esp-open-rtos/include/espressif/spi_flash.h

24 lines
648 B
C

/*
* copyright (c) Espressif System 2010
*
*/
#ifndef __SPI_FLASH_H__
#define __SPI_FLASH_H__
typedef enum {
SPI_FLASH_RESULT_OK,
SPI_FLASH_RESULT_ERR,
SPI_FLASH_RESULT_TIMEOUT
} SpiFlashOpResult;
#define SPI_FLASH_SEC_SIZE 4096
uint32_t spi_flash_get_id(void);
SpiFlashOpResult spi_flash_read_status(uint32_t *status);
SpiFlashOpResult spi_flash_write_status(uint32_t status_value);
SpiFlashOpResult spi_flash_erase_sector(uint16_t sec);
SpiFlashOpResult spi_flash_write(uint32_t des_addr, uint32_t *src_addr, uint32_t size);
SpiFlashOpResult spi_flash_read(uint32_t src_addr, uint32_t *des_addr, uint32_t size);
#endif