Function esp_idf_svc::hal::sys::esp_flash_read
source ยท pub unsafe extern "C" fn esp_flash_read(
chip: *mut esp_flash_t,
buffer: *mut c_void,
address: u32,
length: u32,
) -> i32
Expand description
@brief Read data from the SPI flash chip
@param chip Pointer to identify flash chip. If NULL, esp_flash_default_chip is substituted. Must have been successfully initialised via esp_flash_init() @param buffer Pointer to a buffer where the data will be read. To get better performance, this should be in the DRAM and word aligned. @param address Address on flash to read from. Must be less than chip->size field. @param length Length (in bytes) of data to read.
There are no alignment constraints on buffer, address or length.
@note If on-chip flash encryption is used, this function returns raw (ie encrypted) data. Use the flash cache to transparently decrypt data.
@return - ESP_OK: success - ESP_ERR_NO_MEM: Buffer is in external PSRAM which cannot be concurrently accessed, and a temporary internal buffer could not be allocated. - or a flash error code if operation failed.