ESP-IDF
spi_flash_host_driver_s
is only used within ESP-IDF.
Symbol previews are coming soon...
Symbols
loading...
Files
loading (1/5)...
Summary
Syntax
Examples
References
Call Tree
Data Use
Class Tree
Override Tree
Implementations
Instances
Lifecycle
SourceVu
ESP-IDF Framework and Examples
ESP-IDF
spi_flash_host_driver_s
spi_flash_host_driver_s struct
Host driver configuration and context structure.
Syntax
Show:
Summary
Declaration
Definition
from
spi_flash_types.h:124
struct
spi_flash_host_driver_s
;
Implemented in
spi_flash_types.h:135
Fields
Field
Declared as
Description
spi_flash_host_driver_s::flush_cache
esp_err_t
(
*
)
(
spi_flash_host_inst_t
*
host
,
uint32_t
addr
,
uint32_t
size
)
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.
spi_flash_host_driver_s::check_suspend
void
(
*
)
(
spi_flash_host_inst_t
*
host
)
Suspend check erase/program operation, reserved for ESP32-C3 and ESP32-S3 spi flash ROM IMPL.
spi_flash_host_driver_s::resume
void
(
*
)
(
spi_flash_host_inst_t
*
host
)
Resume flash from suspend manually.
spi_flash_host_driver_s::suspend
void
(
*
)
(
spi_flash_host_inst_t
*
host
)
Set flash in suspend status manually.
spi_flash_host_driver_s::sus_setup
esp_err_t
(
*
)
(
spi_flash_host_inst_t
*
host
,
const
spi_flash_sus_cmd_conf
*
sus_conf
)
Suspend feature setup for setting cmd and status register mask.
spi_flash_host_driver_s::dev_config
esp_err_t
(
*
)
(
spi_flash_host_inst_t
*
host
)
Configure the device-related register before transactions. This saves some time to re-configure those registers when we send continuously.
spi_flash_host_driver_s::common_command
esp_err_t
(
*
)
(
spi_flash_host_inst_t
*
host
,
spi_flash_trans_t
*
t
)
Send an user-defined spi transaction to the device.
spi_flash_host_driver_s::read_id
esp_err_t
(
*
)
(
spi_flash_host_inst_t
*
host
,
uint32_t
*
id
)
Read flash ID.
spi_flash_host_driver_s::erase_chip
void
(
*
)
(
spi_flash_host_inst_t
*
host
)
Erase whole flash chip.
spi_flash_host_driver_s::erase_sector
void
(
*
)
(
spi_flash_host_inst_t
*
host
,
uint32_t
start_address
)
Erase a specific sector by its start address.
spi_flash_host_driver_s::erase_block
void
(
*
)
(
spi_flash_host_inst_t
*
host
,
uint32_t
start_address
)
Erase a specific block by its start address.
spi_flash_host_driver_s::read_status
esp_err_t
(
*
)
(
spi_flash_host_inst_t
*
host
,
uint8_t
*
out_sr
)
Read the status of the flash chip.
spi_flash_host_driver_s::set_write_protect
esp_err_t
(
*
)
(
spi_flash_host_inst_t
*
host
,
bool
wp
)
Disable write protection.
spi_flash_host_driver_s::program_page
void
(
*
)
(
spi_flash_host_inst_t
*
host
,
const
void
*
buffer
,
uint32_t
address
,
uint32_t
length
)
Program a page of the flash. Check ``max_write_bytes`` for the maximum allowed writing length.
spi_flash_host_driver_s::supports_direct_write
bool
(
*
)
(
spi_flash_host_inst_t
*
host
,
const
void
*
p
)
Check whether the SPI host supports direct write When cache is disabled, SPI1 doesn't support directly write when buffer isn't internal.
spi_flash_host_driver_s::write_data_slicer
int
(
*
)
(
spi_flash_host_inst_t
*
host
,
uint32_t
address
,
uint32_t
len
,
uint32_t
*
align_addr
,
uint32_t
page_size
)
Slicer for write data. The `program_page` should be called iteratively with the return value of this function.
spi_flash_host_driver_s::read
esp_err_t
(
*
)
(
spi_flash_host_inst_t
*
host
,
void
*
buffer
,
uint32_t
address
,
uint32_t
read_len
)
Read data from the flash. Check ``max_read_bytes`` for the maximum allowed reading length.
spi_flash_host_driver_s::supports_direct_read
bool
(
*
)
(
spi_flash_host_inst_t
*
host
,
const
void
*
p
)
Check whether the SPI host supports direct read When cache is disabled, SPI1 doesn't support directly read when the given buffer isn't internal.
spi_flash_host_driver_s::read_data_slicer
int
(
*
)
(
spi_flash_host_inst_t
*
host
,
uint32_t
address
,
uint32_t
len
,
uint32_t
*
align_addr
,
uint32_t
page_size
)
Slicer for read data. The `read` should be called iteratively with the return value of this function.
spi_flash_host_driver_s::host_status
uint32_t
(
*
)
(
spi_flash_host_inst_t
*
host
)
Check the host status, 0:busy, 1:idle, 2:suspended.
spi_flash_host_driver_s::configure_host_io_mode
esp_err_t
(
*
)
(
spi_flash_host_inst_t
*
host
,
uint32_t
command
,
uint32_t
addr_bitlen
,
int
dummy_bitlen_base
,
esp_flash_io_mode_t
io_mode
)
Configure the host to work at different read mode. Responsible to compensate the timing and set IO mode.
spi_flash_host_driver_s::poll_cmd_done
void
(
*
)
(
spi_flash_host_inst_t
*
host
)
Internal use, poll the HW until the last operation is done.
Examples
References
from
examples
Code
Location
Scope
Referrer
typedef
struct
spi_flash_host_driver_s
spi_flash_host_driver_t
;
spi_flash_types.h:125
struct
spi_flash_host_driver_s
{
spi_flash_types.h:135
struct
spi_flash_host_driver_s
;
spi_flash_types.h:124
DRAM_ATTR
static
const
spi_flash_host_driver_t
esp_flash_default_host
=
ESP_FLASH_DEFAULT_HOST_DRIVER
(
)
;
memspi_host_driver.c:20
typedef
struct
spi_flash_host_driver_s
spi_flash_host_driver_t
;
spi_flash_types.h:125
spi_flash_host_driver_t
const
struct
spi_flash_host_driver_s
*
driver
;
///< Pointer to the implementation function table
spi_flash_types.h:129
spi_flash_host_inst_t
spi_flash_host_inst_t::driver
Call Tree
from
examples
All items filtered out
All items filtered out
Data Use
from
examples
All items filtered out
All items filtered out
Class Tree
from
examples
All items filtered out
All items filtered out
Override Tree
from
examples
All items filtered out
All items filtered out
Implementations
from
examples
All items filtered out
All items filtered out
Instances
from
examples
Instance
Scope
Location
Project
spi_flash_host_inst_t::driver
spi_flash_host_inst_t
spi_flash_types.h:129
esp_flash_default_host
memspi_host_driver.c:20
Lifecycle
from
examples
All items filtered out
All items filtered out