Virtual base class for SdFat library.
More...
#include <SdFat.h>
|
bool | begin (SdSpiCard::m_spi_t *spi, uint8_t csPin=SS, uint8_t divisor=2) |
|
SdSpiCard * | card () |
|
bool | chdir (bool set_cwd=false) |
|
bool | chdir (const char *path, bool set_cwd=false) |
|
void | chvol () |
|
void | errorHalt () |
|
void | errorHalt (Print *pr) |
|
void | errorHalt (char const *msg) |
|
void | errorHalt (Print *pr, char const *msg) |
|
void | errorHalt (const __FlashStringHelper *msg) |
|
void | errorHalt (Print *pr, const __FlashStringHelper *msg) |
|
void | errorPrint () |
|
void | errorPrint (Print *pr) |
|
void | errorPrint (const char *msg) |
|
void | errorPrint (Print *pr, char const *msg) |
|
void | errorPrint (const __FlashStringHelper *msg) |
|
void | errorPrint (Print *pr, const __FlashStringHelper *msg) |
|
bool | exists (const char *path) |
|
bool | fsBegin () |
|
void | initErrorHalt () |
|
void | initErrorHalt (Print *pr) |
|
void | initErrorHalt (char const *msg) |
|
void | initErrorHalt (Print *pr, char const *msg) |
|
void | initErrorHalt (const __FlashStringHelper *msg) |
|
void | initErrorHalt (Print *pr, const __FlashStringHelper *msg) |
|
void | initErrorPrint () |
|
void | initErrorPrint (Print *pr) |
|
void | initErrorPrint (char const *msg) |
|
void | initErrorPrint (Print *pr, char const *msg) |
|
void | initErrorPrint (const __FlashStringHelper *msg) |
|
void | initErrorPrint (Print *pr, const __FlashStringHelper *msg) |
|
void | ls (print_t *pr, uint8_t flags) |
|
void | ls (print_t *pr, const char *path, uint8_t flags) |
|
void | ls (uint8_t flags=0) |
|
void | ls (const char *path, uint8_t flags=0) |
|
bool | mkdir (const char *path, bool pFlag=true) |
|
File | open (const char *path, uint8_t mode=FILE_READ) |
|
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) |
|
FatVolume * | vol () |
|
SdBaseFile * | vwd () |
|
Virtual base class for SdFat library.
bool SdFatBase::begin |
( |
SdSpiCard::m_spi_t * |
spi, |
|
|
uint8_t |
csPin = SS , |
|
|
uint8_t |
divisor = 2 |
|
) |
| |
|
inline |
Initialize SD card and file system.
- Parameters
-
[in] | spi | SPI object for the card. |
[in] | csPin | SD card chip select pin. |
[in] | divisor | SPI divisor. |
- Returns
- true for success else false.
- Returns
- Pointer to SD card object
bool FatFileSystem::chdir |
( |
bool |
set_cwd = false | ) |
|
|
inlineinherited |
Change a volume's working directory to root
Changes the volume's working directory to the SD's root directory. Optionally set the current working directory to the volume's working directory.
- Parameters
-
[in] | set_cwd | Set the current working directory to this volume's working directory if true. |
- Returns
- The value one, true, is returned for success and the value zero, false, is returned for failure.
bool FatFileSystem::chdir |
( |
const char * |
path, |
|
|
bool |
set_cwd = false |
|
) |
| |
|
inlineinherited |
Change a volume's working directory
Changes the volume working directory to the path subdirectory. Optionally set the current working directory to the volume's working directory.
Example: If the volume's working directory is "/DIR", chdir("SUB") will change the volume's working directory from "/DIR" to "/DIR/SUB".
If path is "/", the volume's working directory will be changed to the root directory
- Parameters
-
[in] | path | The name of the subdirectory. |
[in] | set_cwd | Set the current working directory to this volume's working directory if true. |
- Returns
- The value one, true, is returned for success and the value zero, false, is returned for failure.
void FatFileSystem::chvol |
( |
| ) |
|
|
inlineinherited |
Set the current working directory to a volume's working directory.
This is useful with multiple SD cards.
The current working directory is changed to this volume's working directory.
This is like the Windows/DOS <drive letter>: command.
void SdFatBase::errorHalt |
( |
| ) |
|
|
inline |
Print any SD error code to Serial and halt.
void SdFatBase::errorHalt |
( |
Print * |
pr | ) |
|
Print any SD error code and halt.
- Parameters
-
void SdFatBase::errorHalt |
( |
char const * |
msg | ) |
|
|
inline |
Print msg, any SD error code and halt.
- Parameters
-
void SdFatBase::errorHalt |
( |
Print * |
pr, |
|
|
char const * |
msg |
|
) |
| |
Print msg, any SD error code, and halt.
- Parameters
-
[in] | pr | Print destination. |
[in] | msg | Message to print. |
void SdFatBase::errorHalt |
( |
const __FlashStringHelper * |
msg | ) |
|
|
inline |
Print msg, any SD error code, and halt.
- Parameters
-
void SdFatBase::errorHalt |
( |
Print * |
pr, |
|
|
const __FlashStringHelper * |
msg |
|
) |
| |
Print msg, any SD error code, and halt.
- Parameters
-
[in] | pr | Print destination. |
[in] | msg | Message to print. |
void SdFatBase::errorPrint |
( |
| ) |
|
|
inline |
Print any SD error code to Serial
void SdFatBase::errorPrint |
( |
Print * |
pr | ) |
|
Print any SD error code.
- Parameters
-
void SdFatBase::errorPrint |
( |
const char * |
msg | ) |
|
|
inline |
Print msg, any SD error code.
- Parameters
-
void SdFatBase::errorPrint |
( |
Print * |
pr, |
|
|
char const * |
msg |
|
) |
| |
Print msg, any SD error code.
- Parameters
-
[in] | pr | Print destination. |
[in] | msg | Message to print. |
void SdFatBase::errorPrint |
( |
const __FlashStringHelper * |
msg | ) |
|
|
inline |
Print msg, any SD error code.
- Parameters
-
void SdFatBase::errorPrint |
( |
Print * |
pr, |
|
|
const __FlashStringHelper * |
msg |
|
) |
| |
Print msg, any SD error code.
- Parameters
-
[in] | pr | Print destination. |
[in] | msg | Message to print. |
bool FatFileSystem::exists |
( |
const char * |
path | ) |
|
|
inlineinherited |
Test for the existence of a file.
- Parameters
-
[in] | path | Path of the file to be tested for. |
- Returns
- true if the file exists else false.
bool SdFatBase::fsBegin |
( |
| ) |
|
|
inline |
Diagnostic call to initialize FatFileSystem.
- Returns
- true for success else false.
void SdFatBase::initErrorHalt |
( |
| ) |
|
|
inline |
Print any SD error code and halt.
void SdFatBase::initErrorHalt |
( |
Print * |
pr | ) |
|
Print error details and halt after begin fails.
- Parameters
-
void SdFatBase::initErrorHalt |
( |
char const * |
msg | ) |
|
|
inline |
Print message, error details, and halt after SdFat::init() fails.
- Parameters
-
void SdFatBase::initErrorHalt |
( |
Print * |
pr, |
|
|
char const * |
msg |
|
) |
| |
Print message, error details, and halt after SdFatBase::init() fails.
- Parameters
-
[in] | pr | Print device. |
[in] | msg | Message to print. |
void SdFatBase::initErrorHalt |
( |
const __FlashStringHelper * |
msg | ) |
|
|
inline |
Print message, error details, and halt after SdFat::init() fails.
- Parameters
-
void SdFatBase::initErrorHalt |
( |
Print * |
pr, |
|
|
const __FlashStringHelper * |
msg |
|
) |
| |
Print message, error details, and halt after SdFatBase::init() fails.
- Parameters
-
[in] | pr | Print device for message. |
[in] | msg | Message to print. |
void SdFatBase::initErrorPrint |
( |
| ) |
|
|
inline |
void SdFatBase::initErrorPrint |
( |
Print * |
pr | ) |
|
void SdFatBase::initErrorPrint |
( |
char const * |
msg | ) |
|
|
inline |
Print message and error details and halt after SdFat::init() fails.
- Parameters
-
void SdFatBase::initErrorPrint |
( |
Print * |
pr, |
|
|
char const * |
msg |
|
) |
| |
Print message and error details and halt after SdFatBase::init() fails.
- Parameters
-
[in] | pr | Print destination. |
[in] | msg | Message to print. |
void SdFatBase::initErrorPrint |
( |
const __FlashStringHelper * |
msg | ) |
|
|
inline |
Print message and error details and halt after SdFat::init() fails.
- Parameters
-
void SdFatBase::initErrorPrint |
( |
Print * |
pr, |
|
|
const __FlashStringHelper * |
msg |
|
) |
| |
Print message and error details and halt after SdFatBase::init() fails.
- Parameters
-
[in] | pr | Print destination. |
[in] | msg | Message to print. |
void FatFileSystem::ls |
( |
print_t * |
pr, |
|
|
uint8_t |
flags |
|
) |
| |
|
inlineinherited |
List the directory contents of the volume working directory.
- Parameters
-
[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.
void FatFileSystem::ls |
( |
print_t * |
pr, |
|
|
const char * |
path, |
|
|
uint8_t |
flags |
|
) |
| |
|
inlineinherited |
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 SdFatBase::ls |
( |
uint8_t |
flags = 0 | ) |
|
|
inline |
List the directory contents of the volume working directory to Serial.
- 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 SdFatBase::ls |
( |
const char * |
path, |
|
|
uint8_t |
flags = 0 |
|
) |
| |
|
inline |
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 FatFileSystem::mkdir |
( |
const char * |
path, |
|
|
bool |
pFlag = true |
|
) |
| |
|
inlineinherited |
Make a subdirectory in the volume working 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 one, true, is returned for success and the value zero, false, is returned for failure.
File SdFatBase::open |
( |
const char * |
path, |
|
|
uint8_t |
mode = FILE_READ |
|
) |
| |
open a file
- Parameters
-
[in] | path | location of file to be opened. |
[in] | mode | open mode flags. |
- Returns
- a File object.
bool FatFileSystem::remove |
( |
const char * |
path | ) |
|
|
inlineinherited |
Remove a file from the volume working directory.
- Parameters
-
[in] | path | A path with a valid 8.3 DOS name for the file. |
- Returns
- The value one, true, is returned for success and the value zero, false, is returned for failure.
bool FatFileSystem::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 one, true, is returned for success and the value zero, false, is returned for failure.
bool FatFileSystem::rmdir |
( |
const char * |
path | ) |
|
|
inlineinherited |
Remove a subdirectory from the volume's working 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 one, true, is returned for success and the value zero, false, is returned for failure.
bool FatFileSystem::truncate |
( |
const char * |
path, |
|
|
uint32_t |
length |
|
) |
| |
|
inlineinherited |
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.
- Parameters
-
[in] | path | A path with a valid 8.3 DOS name for the file. |
[in] | length | The desired length for the file. |
- Returns
- The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include file is read only, file is a directory, length is greater than the current file size or an I/O error occurs.
- Returns
- a pointer to the volume working directory.
The documentation for this class was generated from the following files:
- Arduino/libraries/SdFat/SdFat.h
- Arduino/libraries/SdFat/SdFatBase.cpp