Provide access to the FAT file system on SPI flash. The FATFS_VFS file system needs a partition definition. This is a map of flash memory that specified an array into which the files should be saved and loaded. A partition is a named entity and the name we choose in the partition definition should be named in the constructor. More...
#include <FATFS_VFS.h>
Public Member Functions | |
FATFS_VFS (std::string mountPath, std::string partitionName) | |
Constructor. More... | |
void | mount () |
Mount the FAT file system into VFS. The FAT file system found in the partition is mounted into the VFS. More... | |
void | setMaxFiles (int maxFiles) |
Set the allowable number of concurrently open files. More... | |
void | unmount () |
Unmount a previously mounted file system. More... | |
Provide access to the FAT file system on SPI flash. The FATFS_VFS file system needs a partition definition. This is a map of flash memory that specified an array into which the files should be saved and loaded. A partition is a named entity and the name we choose in the partition definition should be named in the constructor.
A partition configuration file can be described in the make menuconfig
settings. For example:
The recommended file name for the partition description is partitions.csv
A typical example would be:
FATFS_VFS::FATFS_VFS | ( | std::string | mountPath, |
std::string | partitionName | ||
) |
Constructor.
In ESP32, every file system has a mount point. If a file access is attempted south of that mount point, then the corresponding file system will be used. The mountPath
parameter defines the mount point for this instance of the FATFS file system. In order to save the files for subsequent retrieval, the file data has to be written to flash memory. A partition table provides a map or layout of the flash memory by defining named partitions. The partitionName
parameter defines the name of the partition used to provide the underlying storage for this instance of the FATFS file system.
[in] | mountPath | The path in the VFS where the FAT file system should be mounted. |
[in] | partitionName | The name of the partition used to store the FAT file system. |
void FATFS_VFS::mount | ( | ) |
Mount the FAT file system into VFS. The FAT file system found in the partition is mounted into the VFS.
void FATFS_VFS::setMaxFiles | ( | int | maxFiles | ) |
Set the allowable number of concurrently open files.
[in] | maxFiles | Number of concurrently open files. |
void FATFS_VFS::unmount | ( | ) |
Unmount a previously mounted file system.