ESP32_RTOS_SDK V1.1.0

- Main Page
- Modules
- Data Structures
- Files

Macros | Enumerations | Functions
SPI Driver APIs
Driver APIs

SPI Flash APIs. More...

## Macros

#define | SPI_FLASH_SEC_SIZE 4096

## Enumerations

enum | SpiFlashOpResult { SPI_FLASH_RESULT_OK, SPI_FLASH_RESULT_ERR, SPI_FLASH_RESULT_TIMEOUT }

## Functions

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...

## Detailed Description

SPI Flash APIs.

## Macro Definition Documentation

#define SPI_FLASH_SEC_SIZE 4096

SPI Flash sector size

## Enumeration Type Documentation

enum SpiFlashOpResult

Enumerator
SPI_FLASH_RESULT_OK | SPI Flash operating OK
SPI_FLASH_RESULT_ERR | SPI Flash operating fail
SPI_FLASH_RESULT_TIMEOUT | SPI Flash operating time out

## Function Documentation

SpiFlashOpResult spi_flash_erase_sector | ( | uint16 | sec | ) |

Erase the Flash sector.

Parameters

  uint16 | sec : Sector number, the count starts at sector 0, 4KB per sector.

Returns
  SpiFlashOpResult

SpiFlashOpResult spi_flash_read | ( | uint32 | src_addr,
|  | uint32 * | des_addr,
|  | uint32 | size
| ) |  |

Read data from Flash.

Parameters

  uint32 | src_addr : source address of the data.
  uint32 | *des_addr : destination address in Flash.
  uint32 | size : length of data

Returns
  SpiFlashOpResult

SpiFlashOpResult spi_flash_write | ( | uint32 | des_addr,
|  | uint32 * | src_addr,
|  | uint32 | size
| ) |  |

Write data to Flash.

Parameters

  uint32 | des_addr : destination address in Flash.
  uint32 | *src_addr : source address of the data.
  uint32 | size : length of data

Returns
  SpiFlashOpResult