ESP8266_RTOS_SDK
v1.4.0
|
SPI Flash APIs. More...
Data Structures | |
struct | SpiFlashChip |
Macros | |
#define | SPI_FLASH_SEC_SIZE 4096 |
Typedefs | |
typedef SpiFlashOpResult(* | user_spi_flash_read) (SpiFlashChip *spi, uint32 src_addr, uint32 *des_addr, uint32 size) |
Registered function for spi_flash_set_read_func. More... | |
Enumerations | |
enum | SpiFlashOpResult { SPI_FLASH_RESULT_OK, SPI_FLASH_RESULT_ERR, SPI_FLASH_RESULT_TIMEOUT } |
Functions | |
uint32 | spi_flash_get_id (void) |
Get ID info of SPI Flash. More... | |
SpiFlashOpResult | spi_flash_read_status (uint32 *status) |
Read state register of SPI Flash. More... | |
SpiFlashOpResult | spi_flash_write_status (uint32 status_value) |
Write state register of SPI Flash. More... | |
SpiFlashOpResult | spi_flash_erase_sector (uint16 sec) |
Erase the Flash sector. More... | |
SpiFlashOpResult | spi_flash_write (uint32 des_addr, uint32 *src_addr, uint32 size) |
Write data to Flash. More... | |
SpiFlashOpResult | spi_flash_read (uint32 src_addr, uint32 *des_addr, uint32 size) |
Read data from Flash. More... | |
void | spi_flash_set_read_func (user_spi_flash_read read) |
Register user-define SPI flash read API. More... | |
SPI Flash APIs.
#define SPI_FLASH_SEC_SIZE 4096 |
SPI Flash sector size
typedef SpiFlashOpResult(* user_spi_flash_read) (SpiFlashChip *spi, uint32 src_addr, uint32 *des_addr, uint32 size) |
Registered function for spi_flash_set_read_func.
SpiFlashChip | *spi : spi flash struct pointer. |
uint32 | src_addr : source address of the data. |
uint32 | *des_addr : destination address in Flash. |
uint32 | size : length of data |
enum SpiFlashOpResult |
SpiFlashOpResult spi_flash_erase_sector | ( | uint16 | sec | ) |
Erase the Flash sector.
uint16 | sec : Sector number, the count starts at sector 0, 4KB per sector. |
uint32 spi_flash_get_id | ( | void | ) |
Get ID info of SPI Flash.
null |
SpiFlashOpResult spi_flash_read | ( | uint32 | src_addr, |
uint32 * | des_addr, | ||
uint32 | size | ||
) |
Read data from Flash.
uint32 | src_addr : source address of the data. |
uint32 | *des_addr : destination address in Flash. |
uint32 | size : length of data |
SpiFlashOpResult spi_flash_read_status | ( | uint32 * | status | ) |
Read state register of SPI Flash.
uint32 | *status : the read value (pointer) of state register. |
void spi_flash_set_read_func | ( | user_spi_flash_read | read | ) |
Register user-define SPI flash read API.
user_spi_flash_read | read : user-define SPI flash read API . |
SpiFlashOpResult spi_flash_write | ( | uint32 | des_addr, |
uint32 * | src_addr, | ||
uint32 | size | ||
) |
Write data to Flash.
uint32 | des_addr : destination address in Flash. |
uint32 | *src_addr : source address of the data. |
uint32 | size : length of data |
SpiFlashOpResult spi_flash_write_status | ( | uint32 | status_value | ) |
Write state register of SPI Flash.
uint32 | status_value : Write state register value. |