1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00
LibrePilot/flight/PiOS/inc/pios_flash_w25x.h
James Cotton 1e8811362e On revolution attach the flash chip to the accel bus now. Also extended the
flash chip driver to take in the slave number during initialization so this is
no longer a hardcoded option.
2012-01-20 07:37:47 -06:00

38 lines
1.6 KiB
C

/**
******************************************************************************
*
* @addtogroup PIOS PIOS Core hardware abstraction layer
* @{
* @addtogroup PIOS_FLASH Flash device handler
* @{
*
* @file pios_flash_w25x.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Driver for talking to W25X flash chip (and most JEDEC chips)
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
int32_t PIOS_Flash_W25X_Init(uint32_t spi_id, uint32_t slave_num);
int32_t PIOS_Flash_W25X_ReadStatus();
int32_t PIOS_Flash_W25X_ReadID();
int32_t PIOS_Flash_W25X_EraseChip();
int32_t PIOS_Flash_W25X_EraseSector(uint32_t add);
int32_t PIOS_Flash_W25X_WriteData(uint32_t addr, uint8_t * data, uint16_t len);
int32_t PIOS_Flash_W25X_ReadData(uint32_t addr, uint8_t * data, uint16_t len);