pub struct Fatfs<T> { /* private fields */ }Expand description
Represents a FAT filesystem.
Implementations§
Source§impl<T> Fatfs<T>
impl<T> Fatfs<T>
Sourcepub fn new_sdcard<H>(drive: u8, sd_card_driver: T) -> Result<Self, EspError>where
T: BorrowMut<SdCardDriver<H>>,
pub fn new_sdcard<H>(drive: u8, sd_card_driver: T) -> Result<Self, EspError>where
T: BorrowMut<SdCardDriver<H>>,
Create a new FAT filesystem instance for a given SD card driver.
§Arguments
- Drive number to assign to the filesystem.
- SD card driver instance.
Sourcepub fn format(
&mut self,
configuration: &FormatConfiguration,
buf: &mut [u8],
) -> Result<(), EspError>
pub fn format( &mut self, configuration: &FormatConfiguration, buf: &mut [u8], ) -> Result<(), EspError>
Format the partition with the given configuration.
§Arguments
- Formatting configuration.
- Buffer to use when formatting.
Sourcepub fn mount(&mut self) -> Result<MountedFatfs<'_, T>, EspError>
pub fn mount(&mut self) -> Result<MountedFatfs<'_, T>, EspError>
Mount the filesystem and return a handle to it.
Source§impl Fatfs<()>
impl Fatfs<()>
Sourcepub unsafe fn new_raw_part(
drive: u8,
partition: *const esp_partition_t,
) -> Result<Self, EspError>
pub unsafe fn new_raw_part( drive: u8, partition: *const esp_partition_t, ) -> Result<Self, EspError>
Create a new - readonly - FAT filesystem instance for a given raw partition in the internal flash.
This API is unsafe because currently esp-idf-hal does not have a safe way to
represent a flash partition - neither a raw one, nor a wear-leveling one.
§Arguments
- Drive number to assign to the filesystem.
- Raw partition pointer.
§Safety
While the filesystem object is alive, the partition should not be modified elsewhere
Sourcepub unsafe fn new_wl_part(
drive: u8,
partition: wl_handle_t,
) -> Result<Self, EspError>
pub unsafe fn new_wl_part( drive: u8, partition: wl_handle_t, ) -> Result<Self, EspError>
Create a new FAT filesystem instance for a given raw partition in the internal flash.
This API is unsafe because currently esp-idf-hal does not have a safe way to
represent a flash partition - neither a raw one, nor a wear-leveling one.
§Arguments
- Drive number to assign to the filesystem.
- A handle to a wear-leveling partition.
§Safety
While the filesystem object is alive, the partition should not be modified elsewhere