Chapter 2. API Reference
• address: Beginning flash address to read
• len: Length request to read
• align_addr: Output of the aligned address to read
• page_size: Physical page size of the flash chip
uint32_t
(*host_status)(spi_flash_host_inst_t
Check the host status, 0:busy, 1:idle, 2:suspended.
esp_err_t (*configure_host_io_mode)(spi_flash_host_inst_t
Configure the host to work at different read mode. Responsible to compensate the timing and set IO
mode.
void
(*poll_cmd_done)(spi_flash_host_inst_t
Internal use, poll the HW until the last operation is done.
esp_err_t (*flush_cache)(spi_flash_host_inst_t
For some host (SPI1), they are shared with a cache. When the data is modified, the cache needs to be
flushed. Left NULL if not supported.
void
(*check_suspend)(spi_flash_host_inst_t
Suspend check erase/program operation, reserved for ESP32-C3 and ESP32-S3 spi flash ROM IMPL.
void
(*resume)(spi_flash_host_inst_t
Resume flash from suspend manually
void
(*suspend)(spi_flash_host_inst_t
Set flash in suspend status manually
esp_err_t (*sus_setup)(spi_flash_host_inst_t
Suspend feature setup for setting cmd and status register mask.
Macros
SPI_FLASH_TRANS_FLAG_CMD16
Send command of 16 bits.
SPI_FLASH_TRANS_FLAG_IGNORE_BASEIO
Not applying the basic io mode configuration for this transaction.
SPI_FLASH_TRANS_FLAG_BYTE_SWAP
Used for DTR mode, to swap the bytes of a pair of rising/falling edge.
ESP_FLASH_SPEED_MIN
Lowest speed supported by the driver, currently 5 MHz.
SPI_FLASH_CONFIG_CONF_BITS
OR the io_mode with this mask, to enable the dummy output feature or replace the first several dummy bits
into address to meet the requirements of conf bits. (Used in DIO/QIO/OIO mode)
SPI_FLASH_OPI_FLAG
A flag for flash work in opi mode, the io mode below are opi, above are SPI/QSPI mode. DO NOT use this
value in any API.
SPI_FLASH_READ_MODE_MIN
Slowest io mode supported by ESP32, currently SlowRd.
Type Definitions
typedef struct
spi_flash_host_driver_s
Enumerations
enum esp_flash_speed_t
SPI flash clock speed values, always refer to them by the enum rather than the actual value (more speed may
be appended into the list).
Espressif Systems
*host)
uint32_t
addr_bitlen,
esp_flash_io_mode_t
*host)
*host, uint32_t addr, uint32_t size)
*host)
*host)
*host)
*host, const
spi_flash_host_driver_t
755
Submit Document Feedback
*host,
uint32_t
int
dummy_bitlen_base,
io_mode)
spi_flash_sus_cmd_conf
*sus_conf)
command,
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?
Questions and answers