SdFat
|
Integration class for the SdFat library. More...
#include <SdFat.h>
Public Member Functions | |
Sd2Card * | card () |
bool | chdir () |
bool | chdir (const char *path) |
SdFile * | cwd () |
void | errorHalt (char const *msg) |
void | errorHalt () |
void | errorHalt_P (PGM_P msg) |
void | errorPrint () |
void | errorPrint (char const *msg) |
void | errorPrint_P (PGM_P msg) |
bool | exists (const char *name) |
bool | init (uint8_t sckRateID=SPI_FULL_SPEED, uint8_t chipSelectPin=SD_CHIP_SELECT_PIN) |
void | initErrorHalt () |
void | initErrorPrint () |
void | ls (uint8_t flags=0) |
void | ls (Print *pr, uint8_t flags=0) |
bool | mkdir (const char *path, bool pFlag=true) |
bool | remove (const char *path) |
bool | rename (const char *oldPath, const char *newPath) |
bool | rmdir (const char *path) |
bool | truncate (const char *path, uint32_t length) |
SdVolume * | vol () |
Integration class for the SdFat library.
bool SdFat::chdir | ( | const char * | path | ) |
Change current working directory
Changes the current working directory to the path subdirectory.
Example: Executing chdir("SUB") in the "/DIR" directory will change the current working directory from "/DIR" to "/DIR/SUB".
[in] | path | The name of the subdirectory. |
bool SdFat::chdir | ( | ) |
Change current working directory to root
Changes the current working directory to the SD's root directory.
SdFile* SdFat::cwd | ( | ) | [inline] |
void SdFat::errorHalt | ( | ) |
Print any SD error code and halt.
void SdFat::errorHalt | ( | char const * | msg | ) |
Print msg, any SD error code, and halt.
[in] | msg | Message to print. |
void SdFat::errorHalt_P | ( | PGM_P | msg | ) |
Print msg, any SD error code, and halt.
[in] | msg | Message in program space (flash memory) to print. |
void SdFat::errorPrint | ( | ) |
Print any SD error code.
void SdFat::errorPrint | ( | char const * | msg | ) |
Print msg, any SD error code.
[in] | msg | Message to print. |
void SdFat::errorPrint_P | ( | PGM_P | msg | ) |
Print msg, any SD error code.
[in] | msg | Message in program space (flash memory) to print. |
bool SdFat::exists | ( | const char * | name | ) |
Test for the existence of a file.
[in] | name | Name of the file to be tested for. |
bool SdFat::init | ( | uint8_t | sckRateID = SPI_FULL_SPEED , |
uint8_t | chipSelectPin = SD_CHIP_SELECT_PIN |
||
) |
Initialize an SdFat object.
Initializes the SD card, SD volume, and root directory.
[in] | sckRateID | value for SPI SCK rate. See Sd2Card::init(). |
[in] | chipSelectPin | SD chip select pin. See Sd2Card::init(). |
void SdFat::initErrorHalt | ( | ) |
Print error details and halt after SdFat::init() fails.
void SdFat::initErrorPrint | ( | ) |
Print error details after SdFat::init() fails.
void SdFat::ls | ( | uint8_t | flags = 0 | ) |
List the directory contents of the current working directory to Serial.
[in] | flags | The inclusive OR of |
LS_DATE - Print file modification date
LS_SIZE - Print file size.
LS_R - Recursive list of subdirectories.
void SdFat::ls | ( | Print * | pr, |
uint8_t | flags = 0 |
||
) |
List the directory contents of the current working directory to Serial.
[in] | pr | Print stream for 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 SdFat::mkdir | ( | const char * | path, |
bool | pFlag = true |
||
) |
Make a subdirectory in the current working directory.
[in] | path | A path with a valid 8.3 DOS name for the subdirectory. |
[in] | pFlag | Create missing parent directories if true. |
bool SdFat::remove | ( | const char * | path | ) |
Remove a file from the current working directory.
[in] | path | A path with a valid 8.3 DOS name for the file. |
bool SdFat::rename | ( | const char * | oldPath, |
const char * | newPath | ||
) |
Rename a file or subdirectory.
[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.
bool SdFat::rmdir | ( | const char * | path | ) |
Remove a subdirectory from the current working directory.
[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.
bool SdFat::truncate | ( | const char * | path, |
uint32_t | length | ||
) |
Truncate a file to a specified length. The current file position will be maintained if it is less than or equal to length otherwise it will be set to end of file.
[in] | path | A path with a valid 8.3 DOS name for the file. |
[in] | length | The desired length for the file. |