Espressif ESP32-S2 Programming Manual page 794

Table of Contents

Advertisement

Chapter 2. API Reference
struct esp_vfs_fat_mount_config_t
Configuration arguments for esp_vfs_fat_sdmmc_mount and esp_vfs_fat_spiflash_mount functions.
Public Members
bool format_if_mount_failed
If FAT partition can not be mounted, and this parameter is true, create partition table and format the
filesystem.
int max_files
Max number of open files.
size_t allocation_unit_size
If format_if_mount_failed is set, and mount fails, format the card with given allocation unit size. Must
be a power of 2, between sector size and 128 * sector size. For SD cards, sector size is always 512 bytes.
For wear_levelling, sector size is determined by CONFIG_WL_SECTOR_SIZE option.
Using larger allocation unit size will result in higher read/write performance and higher overhead when
storing small files.
Setting this field to 0 will result in allocation unit set to the sector size.
esp_err_t
esp_vfs_fat_spiflash_unmount(const char *base_path,
Unmount FAT filesystem and release resources acquired using esp_vfs_fat_spiflash_mount.
Return
• ESP_OK on success
• ESP_ERR_INVALID_STATE if esp_vfs_fat_spiflash_mount hasn't been called
Parameters
• base_path: path where partition should be registered (e.g. "/spiflash")
• wl_handle: wear levelling driver handle returned by esp_vfs_fat_spiflash_mount
Mid level API Reference
Header File
components/wear_levelling/include/wear_levelling.h
Functions
esp_err_t
wl_mount(const
Mount WL for defined partition.
Return
• ESP_OK, if the allocation was successfully;
• ESP_ERR_INVALID_ARG, if WL allocation was unsuccessful;
• ESP_ERR_NO_MEM, if there was no memory to allocate WL components;
Parameters
• partition: that will be used for access
• out_handle: handle of the WL instance
esp_err_t wl_unmount(wl_handle_t
Unmount WL for defined partition.
Return
• ESP_OK, if the operation completed successfully;
• or one of error codes from lower-level flash driver.
Parameters
• handle: WL partition handle
esp_err_t wl_erase_range(wl_handle_t
Erase part of the WL storage.
Espressif Systems
esp_partition_t
*partition,
wl_handle_t
handle)
handle, size_t start_addr, size_t size)
783
Submit Document Feedback
wl_handle_t
wl_handle)
*out_handle)
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Table of Contents

Save PDF