Function esp_idf_svc::sys::esp_flash_init

source ยท
pub unsafe extern "C" fn esp_flash_init(chip: *mut esp_flash_t) -> i32
Expand description

@brief Initialise SPI flash chip interface.

This function must be called before any other API functions are called for this chip.

@note Only the host and read_mode fields of the chip structure must be initialised before this function is called. Other fields may be auto-detected if left set to zero or NULL.

@note If the chip->drv pointer is NULL, chip chip_drv will be auto-detected based on its manufacturer & product IDs. See esp_flash_registered_flash_drivers pointer for details of this process.

@param chip Pointer to SPI flash chip to use. If NULL, esp_flash_default_chip is substituted. @return ESP_OK on success, or a flash error code if initialisation fails.