Chapter 2. API Reference
uint32_t size
Size of the region.
struct esp_flash_os_functions_t
OS-level integration hooks for accessing flash chips inside a running OS.
It's in the public header because some instances should be allocated statically in the startup code. May be
updated according to hardware version and new flash chip feature requirements, shouldn' t be treated as public
API.
For advanced developers, you may replace some of them with your implementations at your own risk.
Public Members
esp_err_t
(*start)(void *arg)
Called before commencing any flash operation. Does not need to be recursive (ie is called at most once
for each call to 'end').
esp_err_t
(*end)(void *arg)
Called after completing any flash operation.
esp_err_t
(*region_protected)(void *arg, size_t start_addr, size_t size)
Called before any erase/write operations to check whether the region is limited by the OS
esp_err_t
(*delay_us)(void *arg, uint32_t us)
Delay for at least 'us'microseconds. Called in between 'start'and 'end'.
void *(*get_temp_buffer)(void *arg, size_t reqest_size, size_t *out_size)
Called for get temp buffer when buffer from application cannot be directly read into/write from.
void (*release_temp_buffer)(void *arg, void *temp_buf)
Called for release temp buffer.
esp_err_t
(*check_yield)(void *arg, uint32_t chip_status, uint32_t *out_request)
Yield to other tasks. Called during erase operations.
Return ESP_OK means yield needs to be called (got an event to handle), while ESP_ERR_TIMEOUT
means skip yield.
esp_err_t
(*yield)(void *arg, uint32_t *out_status)
Yield to other tasks. Called during erase operations.
int64_t (*get_system_time)(void *arg)
Called for get system time.
struct esp_flash_t
Structure to describe a SPI flash chip connected to the system.
Structure must be initialized before use (passed to esp_flash_init()). It's in the public header because some
instances should be allocated statically in the startup code. May be updated according to hardware version and
new flash chip feature requirements, shouldn't be treated as public API.
For advanced developers, you may replace some of them with your implementations at your own risk.
Public Members
spi_flash_host_inst_t
Pointer to hardware-specific "host_driver"structure. Must be initialized before used.
const
spi_flash_chip_t
Pointer to chip-model-specific "adapter"structure. If NULL, will be detected during initialisation.
const
esp_flash_os_functions_t
Pointer to os-specific hook structure. Call esp_flash_init_os_functions() to setup this field,
after the host is properly initialized.
Espressif Systems
*host
*chip_drv
*os_func
Submit Document Feedback
751
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?