Arduino FatFS
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
fatfs::SDClass Class Reference
Main » sd

SDClass: starting driver, access to files. More...

#include <fatfs.h>

Collaboration diagram for fatfs::SDClass:
Collaboration graph
[legend]

Public Member Functions

 SDClass (IO &driver)
 
bool begin (IO &driver)
 Initialization of SD card: Use before other methods.
 
bool begin ()
 Initialization of SD card. We use the SPI SD driver if nothing has been defined in the constructor.
 
void end ()
 
File open (const char *filename, uint8_t mode=FILE_READ)
 
File open (const String &filename, uint8_t mode=FILE_READ)
 
bool exists (const char *filepath)
 Methods to determine if the requested file path exists.
 
bool exists (const String &filepath)
 
bool mkdir (const char *filepath)
 
bool mkdir (const String &filepath)
 
bool remove (const char *filepath)
 Delete the file.
 
bool remove (const String &filepath)
 
bool rmdir (const char *filepath)
 
bool rmdir (const String &filepath)
 
bool chdir (const char *filepath)
 Change directoy: extended functionality not available in Arduino SD API.
 
bool chdir (String filepath)
 Change directoy: extended functionality not available in Arduino SD API.
 
bool getcwd (char *buff, size_t len)
 
bool mkfs (int workBufferSize=FF_MAX_SS)
 format drive
 
FatFsgetFatFs ()
 Access to low level FatFS api to use functionality not exposed by this API.
 
void setDriver (IO &driver)
 Set the driver.
 
IOgetDriver ()
 Access lo low level driver.
 

Protected Member Functions

bool handleError (FRESULT rc)
 

Protected Attributes

FatFs fat_fs
 
uint8_t * work_buffer = nullptr
 

Detailed Description

SDClass: starting driver, access to files.

Member Function Documentation

◆ end()

void fatfs::SDClass::end ( )
inline

call this when a card is removed. It will allow you to insert and initialise a new card.

◆ getcwd()

bool fatfs::SDClass::getcwd ( char *  buff,
size_t  len 
)
inline

Get current directoy: extended functionality not available in Arduino SD API

◆ mkdir()

bool fatfs::SDClass::mkdir ( const char *  filepath)
inline

Create the requested directory heirarchy–if intermediate directories do not exist they will be created.

◆ open()

File fatfs::SDClass::open ( const char *  filename,
uint8_t  mode = FILE_READ 
)
inline

Open the specified file/directory with the supplied mode (e.g. read or write, etc). Returns a File object for interacting with the file. Note that currently only one file can be open at a time.


The documentation for this class was generated from the following file: