SdFat
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SdBase< Vol, Fmt > Class Template Reference

base SD file system template class. More...

#include <SdFat.h>

Inheritance diagram for SdBase< Vol, Fmt >:
Inheritance graph
[legend]
Collaboration diagram for SdBase< Vol, Fmt >:
Collaboration graph
[legend]

Public Member Functions

bool begin (SdCsPin_t csPin, uint32_t maxSck)
 
bool begin (SdCsPin_t csPin=SS)
 
bool begin (SdioConfig sdioConfig)
 
bool begin (SdSpiConfig spiConfig)
 
SdCardcard ()
 
bool cardBegin (SdioConfig sdioConfig)
 
bool cardBegin (SdSpiConfig spiConfig)
 
void end ()
 
void errorHalt ()
 
void errorHalt (const __FlashStringHelper *msg)
 
void errorHalt (const char *msg)
 
void errorHalt (print_t *pr)
 
void errorHalt (print_t *pr, const __FlashStringHelper *msg)
 
void errorHalt (print_t *pr, const char *msg)
 
void errorPrint (const __FlashStringHelper *msg)
 
void errorPrint (const char *msg)
 
void errorPrint (print_t *pr)
 
void errorPrint (print_t *pr, char const *msg)
 
void errorPrint (print_t *pr, const __FlashStringHelper *msg)
 
bool format (print_t *pr=NULL)
 
uint32_t freeClusterCount ()
 
bool hasDedicatedSpi ()
 
void initErrorHalt ()
 
void initErrorHalt (const __FlashStringHelper *msg)
 
void initErrorHalt (const char *msg)
 
void initErrorHalt (print_t *pr)
 
void initErrorHalt (print_t *pr, const __FlashStringHelper *msg)
 
void initErrorHalt (print_t *pr, const char *msg)
 
void initErrorPrint ()
 
void initErrorPrint (print_t *pr)
 
bool isDedicatedSpi ()
 
void printFatType (print_t *pr)
 
void printSdError (print_t *pr)
 
uint8_t sdErrorCode ()
 
uint8_t sdErrorData ()
 
bool setDedicatedSpi (bool value)
 
Vol * vol ()
 
bool volumeBegin ()
 

Detailed Description

template<class Vol, class Fmt>
class SdBase< Vol, Fmt >

base SD file system template class.

Member Function Documentation

◆ begin() [1/4]

template<class Vol , class Fmt >
bool SdBase< Vol, Fmt >::begin ( SdCsPin_t  csPin,
uint32_t  maxSck 
)
inline

Initialize SD card and file system.

Parameters
[in]csPinSD card chip select pin.
[in]maxSckMaximum SCK frequency.
Returns
true for success or false for failure.

◆ begin() [2/4]

template<class Vol , class Fmt >
bool SdBase< Vol, Fmt >::begin ( SdCsPin_t  csPin = SS)
inline

Initialize SD card and file system.

Parameters
[in]csPinSD card chip select pin.
Returns
true for success or false for failure.

◆ begin() [3/4]

template<class Vol , class Fmt >
bool SdBase< Vol, Fmt >::begin ( SdioConfig  sdioConfig)
inline

Initialize SD card and file system for SDIO mode.

Parameters
[in]sdioConfigSDIO configuration.
Returns
true for success or false for failure.

◆ begin() [4/4]

template<class Vol , class Fmt >
bool SdBase< Vol, Fmt >::begin ( SdSpiConfig  spiConfig)
inline

Initialize SD card and file system for SPI mode.

Parameters
[in]spiConfigSPI configuration.
Returns
true for success or false for failure.

◆ card()

template<class Vol , class Fmt >
SdCard * SdBase< Vol, Fmt >::card ( )
inline
Returns
Pointer to SD card object.

◆ cardBegin() [1/2]

template<class Vol , class Fmt >
bool SdBase< Vol, Fmt >::cardBegin ( SdioConfig  sdioConfig)
inline

Initialize SD card in SDIO mode.

Parameters
[in]sdioConfigSDIO configuration.
Returns
true for success or false for failure.

◆ cardBegin() [2/2]

template<class Vol , class Fmt >
bool SdBase< Vol, Fmt >::cardBegin ( SdSpiConfig  spiConfig)
inline

Initialize SD card in SPI mode.

Parameters
[in]spiConfigSPI configuration.
Returns
true for success or false for failure.

◆ end()

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::end ( )
inline

End use of card.

◆ errorHalt() [1/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::errorHalt ( )
inline

Print error info to Serial and halt.

◆ errorHalt() [2/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::errorHalt ( const __FlashStringHelper *  msg)
inline

Print msg to Serial and halt.

Parameters
[in]msgMessage to print.

◆ errorHalt() [3/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::errorHalt ( const char *  msg)
inline

Print error info and halt.

Parameters
[in]msgMessage to print.

◆ errorHalt() [4/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::errorHalt ( print_t pr)
inline

Print error info and halt.

Parameters
[in]prPrint destination.

◆ errorHalt() [5/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::errorHalt ( print_t pr,
const __FlashStringHelper *  msg 
)
inline

Print msg and halt.

Parameters
[in]prPrint destination.
[in]msgMessage to print.

◆ errorHalt() [6/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::errorHalt ( print_t pr,
const char *  msg 
)
inline

Print error info and halt.

Parameters
[in]prPrint destination.
[in]msgMessage to print.

◆ errorPrint() [1/5]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::errorPrint ( const __FlashStringHelper *  msg)
inline

Print msg, any SD error code.

Parameters
[in]msgMessage to print.

◆ errorPrint() [2/5]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::errorPrint ( const char *  msg)
inline

Print msg, any SD error code.

Parameters
[in]msgMessage to print.

◆ errorPrint() [3/5]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::errorPrint ( print_t pr)
inline

Print SD errorCode and errorData.

Parameters
[in]prPrint destination.

◆ errorPrint() [4/5]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::errorPrint ( print_t pr,
char const *  msg 
)
inline

Print msg, any SD error code.

Parameters
[in]prPrint destination.
[in]msgMessage to print.

◆ errorPrint() [5/5]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::errorPrint ( print_t pr,
const __FlashStringHelper *  msg 
)
inline

Print msg, any SD error code.

Parameters
[in]prPrint destination.
[in]msgMessage to print.

◆ format()

template<class Vol , class Fmt >
bool SdBase< Vol, Fmt >::format ( print_t pr = NULL)
inline

Format SD card

Parameters
[in]prPrint destination.
Returns
true for success else false.

◆ freeClusterCount()

template<class Vol , class Fmt >
uint32_t SdBase< Vol, Fmt >::freeClusterCount ( )
inline
Returns
the free cluster count.

◆ hasDedicatedSpi()

template<class Vol , class Fmt >
bool SdBase< Vol, Fmt >::hasDedicatedSpi ( )
inline
Returns
true if can be in dedicated SPI state

◆ initErrorHalt() [1/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::initErrorHalt ( )
inline

Print error info and halt.

◆ initErrorHalt() [2/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::initErrorHalt ( const __FlashStringHelper *  msg)
inline

Print error info and halt.

Parameters
[in]msgMessage to print.

◆ initErrorHalt() [3/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::initErrorHalt ( const char *  msg)
inline

Print error info and halt.

Parameters
[in]msgMessage to print.

◆ initErrorHalt() [4/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::initErrorHalt ( print_t pr)
inline

Print error info and halt.

Parameters
[in]prPrint destination.

◆ initErrorHalt() [5/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::initErrorHalt ( print_t pr,
const __FlashStringHelper *  msg 
)
inline

Print error info and halt.

Parameters
[in]prPrint destination.
[in]msgMessage to print.

◆ initErrorHalt() [6/6]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::initErrorHalt ( print_t pr,
const char *  msg 
)
inline

Print error info and halt.

Parameters
[in]prPrint destination.
[in]msgMessage to print.

◆ initErrorPrint() [1/2]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::initErrorPrint ( )
inline

Print error details after begin() fails.

◆ initErrorPrint() [2/2]

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::initErrorPrint ( print_t pr)
inline

Print error details after begin() fails.

Parameters
[in]prPrint destination.

◆ isDedicatedSpi()

template<class Vol , class Fmt >
bool SdBase< Vol, Fmt >::isDedicatedSpi ( )
inline
Returns
true if in dedicated SPI state.

◆ printFatType()

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::printFatType ( print_t pr)
inline

Print volume FAT/exFAT type.

Parameters
[in]prPrint destination.

◆ printSdError()

template<class Vol , class Fmt >
void SdBase< Vol, Fmt >::printSdError ( print_t pr)
inline

Print error info and return.

Parameters
[in]prPrint destination.

◆ sdErrorCode()

template<class Vol , class Fmt >
uint8_t SdBase< Vol, Fmt >::sdErrorCode ( )
inline
Returns
SD card error code.

◆ sdErrorData()

template<class Vol , class Fmt >
uint8_t SdBase< Vol, Fmt >::sdErrorData ( )
inline
Returns
SD card error data.

◆ setDedicatedSpi()

template<class Vol , class Fmt >
bool SdBase< Vol, Fmt >::setDedicatedSpi ( bool  value)
inline

Set SPI sharing state

Parameters
[in]valuedesired state.
Returns
true for success else false;

◆ vol()

template<class Vol , class Fmt >
Vol * SdBase< Vol, Fmt >::vol ( )
inline
Returns
pointer to base volume

◆ volumeBegin()

template<class Vol , class Fmt >
bool SdBase< Vol, Fmt >::volumeBegin ( )
inline

Initialize file system after call to cardBegin.

Returns
true for success or false for failure.

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