EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #794 background imageLoading...
Page #794 background image
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, wl_handle_t wl_handle)
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 hasnt 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 esp_partition_t *partition, wl_handle_t *out_handle)
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 handle)
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 handle, size_t start_addr, size_t size)
Erase part of the WL storage.
Espressif Systems 783
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish