Function esp_idf_hal::sys::esp_vfs_fat_spiflash_mount_rw_wl
source · pub unsafe extern "C" fn esp_vfs_fat_spiflash_mount_rw_wl(
base_path: *const i8,
partition_label: *const i8,
mount_config: *const esp_vfs_fat_mount_config_t,
wl_handle: *mut i32,
) -> i32
Expand description
@brief Convenience function to initialize FAT filesystem in SPI flash and register it in VFS
This is an all-in-one function which does the following:
- finds the partition with defined partition_label. Partition label should be configured in the partition table.
- initializes flash wear levelling library on top of the given partition
- mounts FAT partition using FATFS library on top of flash wear levelling library
- registers FATFS library with VFS, with prefix given by base_prefix variable
This function is intended to make example code more compact.
@param base_path path where FATFS partition should be mounted (e.g. “/spiflash”) @param partition_label label of the partition which should be used @param mount_config pointer to structure with extra parameters for mounting FATFS @param[out] wl_handle wear levelling driver handle @return - ESP_OK on success - ESP_ERR_NOT_FOUND if the partition table does not contain FATFS partition with given label - ESP_ERR_INVALID_STATE if esp_vfs_fat_spiflash_mount_rw_wl was already called - ESP_ERR_NO_MEM if memory can not be allocated - ESP_FAIL if partition can not be mounted - other error codes from wear levelling library, SPI flash driver, or FATFS drivers