#ifndefESP_LITTLEFS_H__#defineESP_LITTLEFS_H__#include"esp_err.h"#include"esp_idf_version.h"#include<stdbool.h>#include"esp_partition.h"#ifdefCONFIG_LITTLEFS_SDMMC_SUPPORT#include<sdmmc_cmd.h>#endif#ifdef__cplusplusextern"C"{#endif#defineESP_LITTLEFS_VERSION_NUMBER"1.14.8"#defineESP_LITTLEFS_VERSION_MAJOR1#defineESP_LITTLEFS_VERSION_MINOR14#defineESP_LITTLEFS_VERSION_PATCH8#ifESP_IDF_VERSION>=ESP_IDF_VERSION_VAL(4,4,2)&&CONFIG_VFS_SUPPORT_DIR#defineESP_LITTLEFS_ENABLE_FTRUNCATE#endif// ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 2)/** *Configuration structure for esp_vfs_littlefs_register. *//* ... */typedefstruct{constchar*base_path;/**< Mounting point. */constchar*partition_label;/**< Label of partition to use. */constesp_partition_t*partition;/**< partition to use if partition_label is NULL */#ifdefCONFIG_LITTLEFS_SDMMC_SUPPORTsdmmc_card_t*sdcard;/**< SD card handle to use if both esp_partition handle & partition label is NULL */#endifuint8_tformat_if_mount_failed:1;/**< Format the file system if it fails to mount. */uint8_tread_only:1;/**< Mount the partition as read-only. */uint8_tdont_mount:1;/**< Don't attempt to mount.*/uint8_tgrow_on_mount:1;/**< Grow filesystem to match partition size on mount.*/}{ ... }esp_vfs_littlefs_conf_t;/** * Register and mount (if configured to) littlefs to VFS with given path prefix. * * @param conf Pointer to esp_vfs_littlefs_conf_t configuration structure * * @return * - ESP_OK if success * - ESP_ERR_NO_MEM if objects could not be allocated * - ESP_ERR_INVALID_STATE if already mounted or partition is encrypted * - ESP_ERR_NOT_FOUND if partition for littlefs was not found * - ESP_FAIL if mount or format fails *//* ... */esp_err_tesp_vfs_littlefs_register(constesp_vfs_littlefs_conf_t*conf);/** * Unregister and unmount littlefs from VFS * * @param partition_label Label of the partition to unregister. * * @return * - ESP_OK if successful * - ESP_ERR_INVALID_STATE already unregistered *//* ... */esp_err_tesp_vfs_littlefs_unregister(constchar*partition_label);#ifdefCONFIG_LITTLEFS_SDMMC_SUPPORT/** * Unregister and unmount LittleFS from VFS for SD card * * @param sdcard SD card to unregister. * * @return * - ESP_OK if successful * - ESP_ERR_INVALID_STATE already unregistered *//* ... */esp_err_tesp_vfs_littlefs_unregister_sdmmc(sdmmc_card_t*sdcard);/* ... */#endif/** * Unregister and unmount littlefs from VFS * * @param partition partition to unregister. * * @return * - ESP_OK if successful * - ESP_ERR_INVALID_STATE already unregistered *//* ... */esp_err_tesp_vfs_littlefs_unregister_partition(constesp_partition_t*partition);/** * Check if littlefs is mounted * * @param partition_label Label of the partition to check. * * @return * - true if mounted * - false if not mounted *//* ... */boolesp_littlefs_mounted(constchar*partition_label);/** * Check if littlefs is mounted * * @param partition partition to check. * * @return * - true if mounted * - false if not mounted *//* ... */boolesp_littlefs_partition_mounted(constesp_partition_t*partition);#ifdefCONFIG_LITTLEFS_SDMMC_SUPPORT/** * Check if littlefs is mounted * * @param sdcard SD card to check. * * @return * - true if mounted * - false if not mounted *//* ... */boolesp_littlefs_sdmmc_mounted(sdmmc_card_t*sdcard);/* ... */#endif/** * Format the littlefs partition * * @param partition_label Label of the partition to format. * @return * - ESP_OK if successful * - ESP_FAIL on error *//* ... */esp_err_tesp_littlefs_format(constchar*partition_label);/** * Format the littlefs partition * * @param partition partition to format. * @return * - ESP_OK if successful * - ESP_FAIL on error *//* ... */esp_err_tesp_littlefs_format_partition(constesp_partition_t*partition);#ifdefCONFIG_LITTLEFS_SDMMC_SUPPORT/** * Format the LittleFS on a SD card * * @param sdcard SD card to format * @return * - ESP_OK if successful * - ESP_FAIL on error *//* ... */esp_err_tesp_littlefs_format_sdmmc(sdmmc_card_t*sdcard);/* ... */#endif/** * Get information for littlefs * * @param partition_label Optional, label of the partition to get info for. * @param[out] total_bytes Size of the file system * @param[out] used_bytes Current used bytes in the file system * * @return * - ESP_OK if success * - ESP_ERR_INVALID_STATE if not mounted *//* ... */esp_err_tesp_littlefs_info(constchar*partition_label,size_t*total_bytes,size_t*used_bytes);/** * Get information for littlefs * * @param parition the partition to get info for. * @param[out] total_bytes Size of the file system * @param[out] used_bytes Current used bytes in the file system * * @return * - ESP_OK if success * - ESP_ERR_INVALID_STATE if not mounted *//* ... */esp_err_tesp_littlefs_partition_info(constesp_partition_t*partition,size_t*total_bytes,size_t*used_bytes);#ifdefCONFIG_LITTLEFS_SDMMC_SUPPORT/** * Get information for littlefs on SD card * * @param[in] sdcard the SD card to get info for. * @param[out] total_bytes Size of the file system * @param[out] used_bytes Current used bytes in the file system * * @return * - ESP_OK if success * - ESP_ERR_INVALID_STATE if not mounted *//* ... */esp_err_tesp_littlefs_sdmmc_info(sdmmc_card_t*sdcard,size_t*total_bytes,size_t*used_bytes);/* ... */#endif#ifdef__cplusplus}{...}// extern "C"#endif/* ... */#endif
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.