SD file system class for FAT16, FAT32, and exFAT volumes.
More...
#include <SdFs.h>
|
bool | begin (BlockDevice *blockDev) |
|
bool | begin (uint8_t csPin=SS) |
|
bool | begin (uint8_t csPin, SPISettings spiSettings) |
|
bool | begin (SdSpiConfig spiConfig) |
|
bool | begin (SdioConfig sdioConfig) |
|
SdCard * | card () |
|
bool | cardBegin (SdSpiConfig spiConfig) |
|
bool | cardBegin (SdioConfig sdioConfig) |
|
bool | chdir () |
|
bool | chdir (const char *path) |
|
void | chvol () |
|
uint32_t | clusterCount () |
|
uint32_t | dataStartSector () const |
|
void | end () |
|
void | errorHalt (Print *pr) |
|
void | errorHalt () |
|
void | errorHalt (Print *pr, const char *msg) |
|
void | errorHalt (Print *pr, const __FlashStringHelper *msg) |
|
void | errorHalt (const __FlashStringHelper *msg) |
|
void | errorHalt (const char *msg) |
|
bool | exists (const char *path) |
|
bool | exists (const String &path) |
|
uint32_t | fatStartSector () const |
|
uint8_t | fatType () const |
|
uint32_t | freeClusterCount () |
|
void | initErrorHalt (Print *pr) |
|
void | initErrorHalt () |
|
void | ls (print_t *pr) |
|
void | ls (print_t *pr, uint8_t flags) |
|
void | ls (print_t *pr, const char *path, uint8_t flags) |
|
void | ls () |
|
void | ls (uint8_t flags) |
|
void | ls (const char *path, uint8_t flags=0) |
|
bool | mkdir (const char *path, bool pFlag=true) |
|
bool | mkdir (const String &path, bool pFlag=true) |
|
FsFile | open (const char *path, uint8_t oflag=O_READ) |
|
FsFile | open (const String &path, uint8_t oflag=O_READ) |
|
void | printFatType (Print *pr) |
|
void | printSdError (print_t *pr) |
|
void | printSdErrorCode (Print *pr) |
|
bool | remove (const char *path) |
|
bool | remove (const String &path) |
|
bool | rename (const char *oldPath, const char *newPath) |
|
bool | rmdir (const char *path) |
|
bool | rmdir (const String &path) |
|
uint8_t | sdErrorCode () |
|
uint8_t | sdErrorData () |
|
uint32_t | sectorsPerCluster () const |
|
bool | volumeBegin () |
|
SD file system class for FAT16, FAT32, and exFAT volumes.
Initialize an FatVolume object.
- Parameters
-
[in] | blockDev | Device block driver. |
- Returns
- The value true is returned for success and the value false is returned for failure.
Initialize SD card and file system.
- Parameters
-
[in] | csPin | SD card chip select pin. |
- Returns
- true for success else false.
bool SdBase< FsVolume >::begin |
( |
uint8_t |
csPin, |
|
|
SPISettings |
spiSettings |
|
) |
| |
|
inlineinherited |
Initialize SD card and file system.
- Parameters
-
[in] | csPin | SD card chip select pin. |
[in] | spiSettings | SPI speed, mode, and bit order. |
- Returns
- true for success else false.
Initialize SD card and file system for SPI mode.
- Parameters
-
[in] | spiConfig | SPI configuration. |
- Returns
- true for success else false.
Initialize SD card and file system for SDIO mode.
- Parameters
-
[in] | sdioConfig | SDIO configuration. |
- Returns
- true for success else false.
- Returns
- Pointer to SD card object.
Initialize SD card in SPI mode.
- Parameters
-
[in] | spiConfig | SPI configuration. |
- Returns
- true for success else false.
Initialize SD card in SDIO mode.
- Parameters
-
[in] | sdioConfig | SDIO configuration. |
- Returns
- true for success else false.
Set volume working directory to root.
- Returns
- true for success else false.
bool FsVolume::chdir |
( |
const char * |
path | ) |
|
|
inlineinherited |
Set volume working directory.
- Parameters
-
[in] | path | Path for volume working directory. |
- Returns
- true for success or false for failure.
Change global working volume to this volume.
uint32_t FsVolume::clusterCount |
( |
| ) |
|
|
inlineinherited |
- Returns
- The total number of clusters in the volume.
- Returns
- current working volume.
uint32_t FsVolume::dataStartSector |
( |
| ) |
const |
|
inlineinherited |
- Returns
- The logical sector number for the start of file data.
free dynamic memory and end access to volume
Print error info and halt.
- Parameters
-
Print error info to Serial and halt.
Print error info and halt.
- Parameters
-
[in] | pr | Print destination. |
[in] | msg | Message to print. |
void SdBase< FsVolume >::errorHalt |
( |
Print * |
pr, |
|
|
const __FlashStringHelper * |
msg |
|
) |
| |
|
inlineinherited |
Print msg and halt.
- Parameters
-
[in] | pr | Print destination. |
[in] | msg | Message to print. |
Print msg to Serial and halt.
- Parameters
-
Print error info and halt.
- Parameters
-
bool FsVolume::exists |
( |
const char * |
path | ) |
|
|
inlineinherited |
Test for the existence of a file in a directory
- Parameters
-
[in] | path | Path of the file to be tested for. |
- Returns
- true if the file exists else false.
bool FsVolume::exists |
( |
const String & |
path | ) |
|
|
inlineinherited |
Test for the existence of a file in a directory
- Parameters
-
[in] | path | Path of the file to be tested for. |
- Returns
- true if the file exists else false.
uint32_t FsVolume::fatStartSector |
( |
| ) |
const |
|
inlineinherited |
- Returns
- The logical sector number for the start of the first FAT.
uint8_t FsVolume::fatType |
( |
| ) |
const |
|
inlineinherited |
- Returns
- Partition type, FAT_TYPE_EXFAT, FAT_TYPE_FAT32, FAT_TYPE_FAT16, or zero for error.
uint32_t FsVolume::freeClusterCount |
( |
| ) |
|
|
inlineinherited |
- Returns
- the free cluster count.
Print error info and halt.
- Parameters
-
Print error info and halt.
void FsVolume::ls |
( |
print_t * |
pr | ) |
|
|
inlineinherited |
List directory contents.
- Parameters
-
void FsVolume::ls |
( |
print_t * |
pr, |
|
|
uint8_t |
flags |
|
) |
| |
|
inlineinherited |
List directory contents.
- Parameters
-
[in] | pr | Print object. |
[in] | flags | The inclusive OR of |
LS_DATE - Print file modification date
LS_SIZE - Print file size.
LS_R - Recursive list of subdirectories.
void FsVolume::ls |
( |
print_t * |
pr, |
|
|
const char * |
path, |
|
|
uint8_t |
flags |
|
) |
| |
|
inherited |
List the directory contents of a directory.
- Parameters
-
[in] | pr | Print stream for list. |
[in] | path | directory to list. |
[in] | flags | The inclusive OR of |
LS_DATE - Print file modification date
LS_SIZE - Print file size.
LS_R - Recursive list of subdirectories.
void FsVolume::ls |
( |
uint8_t |
flags | ) |
|
|
inlineinherited |
List directory contents.
- Parameters
-
[in] | flags | The inclusive OR of |
LS_DATE - Print file modification date
LS_SIZE - Print file size.
LS_R - Recursive list of subdirectories.
void FsVolume::ls |
( |
const char * |
path, |
|
|
uint8_t |
flags = 0 |
|
) |
| |
|
inlineinherited |
List the directory contents of a directory to Serial.
- Parameters
-
[in] | path | directory to list. |
[in] | flags | The inclusive OR of |
LS_DATE - Print file modification date
LS_SIZE - Print file size.
LS_R - Recursive list of subdirectories.
bool FsVolume::mkdir |
( |
const char * |
path, |
|
|
bool |
pFlag = true |
|
) |
| |
|
inlineinherited |
Make a subdirectory in the volume root directory.
- Parameters
-
[in] | path | A path with a valid 8.3 DOS name for the subdirectory. |
[in] | pFlag | Create missing parent directories if true. |
- Returns
- The value true is returned for success and the value false is returned for failure.
bool FsVolume::mkdir |
( |
const String & |
path, |
|
|
bool |
pFlag = true |
|
) |
| |
|
inlineinherited |
Make a subdirectory in the volume root directory.
- Parameters
-
[in] | path | A path with a valid 8.3 DOS name for the subdirectory. |
[in] | pFlag | Create missing parent directories if true. |
- Returns
- The value true is returned for success and the value false is returned for failure.
FsFile FsVolume::open |
( |
const char * |
path, |
|
|
uint8_t |
oflag = O_READ |
|
) |
| |
|
inherited |
open a file
- Parameters
-
[in] | path | location of file to be opened. |
[in] | oflag | open mode flags. |
- Returns
- a File object.
FsFile FsVolume::open |
( |
const String & |
path, |
|
|
uint8_t |
oflag = O_READ |
|
) |
| |
|
inherited |
open a file
- Parameters
-
[in] | path | location of file to be opened. |
[in] | oflag | open mode flags. |
- Returns
- a File object.
Print volume FAT/exFAT type.
- Parameters
-
Print error info and return.
- Parameters
-
Print SD errorCode and errorData.
- Parameters
-
bool FsVolume::remove |
( |
const char * |
path | ) |
|
|
inlineinherited |
Remove a file from the volume root directory.
- Parameters
-
[in] | path | A path with a valid 8.3 DOS name for the file. |
- Returns
- The value true is returned for success and the value false is returned for failure.
bool FsVolume::remove |
( |
const String & |
path | ) |
|
|
inlineinherited |
Remove a file from the volume root directory.
- Parameters
-
[in] | path | A path with a valid 8.3 DOS name for the file. |
- Returns
- The value true is returned for success and the value false is returned for failure.
bool FsVolume::rename |
( |
const char * |
oldPath, |
|
|
const char * |
newPath |
|
) |
| |
|
inlineinherited |
Rename a file or subdirectory.
- Parameters
-
[in] | oldPath | Path name to the file or subdirectory to be renamed. |
[in] | newPath | New path name of the file or subdirectory. |
The newPath object must not exist before the rename call.
The file to be renamed must not be open. The directory entry may be moved and file system corruption could occur if the file is accessed by a file object that was opened before the rename() call.
- Returns
- The value true is returned for success and the value false is returned for failure.
bool FsVolume::rmdir |
( |
const char * |
path | ) |
|
|
inlineinherited |
Remove a subdirectory from the volume's root directory.
- Parameters
-
[in] | path | A path with a valid 8.3 DOS name for the subdirectory. |
The subdirectory file will be removed only if it is empty.
- Returns
- The value true is returned for success and the value false is returned for failure.
bool FsVolume::rmdir |
( |
const String & |
path | ) |
|
|
inlineinherited |
Remove a subdirectory from the volume's root directory.
- Parameters
-
[in] | path | A path with a valid 8.3 DOS name for the subdirectory. |
The subdirectory file will be removed only if it is empty.
- Returns
- The value true is returned for success and the value false is returned for failure.
- Returns
- SD card error code.
- Returns
- SD card error data.
uint32_t FsVolume::sectorsPerCluster |
( |
| ) |
const |
|
inlineinherited |
- Returns
- The volume's cluster size in sectors.
Initialize file system after call to cardBegin.
- Returns
- true for success else false.
The documentation for this class was generated from the following file:
- ArduinoSdFs/libraries/SdFs/src/SdFs.h