SdFat

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 >:
[legend]
Collaboration diagram for SdBase< Vol, Fmt >:
[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)
SdCard * | card ()
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] | csPin | SD card chip select pin.
  [in] | maxSck | Maximum 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] | csPin | SD 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] | sdioConfig | SDIO 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] | spiConfig | SPI 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] | sdioConfig | SDIO 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] | spiConfig | SPI 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] | msg | Message 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] | msg | Message 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] | pr | Print 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] | pr | Print destination.
  [in] | msg | Message 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] | pr | Print destination.
  [in] | msg | Message 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] | msg | Message 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] | msg | Message 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] | pr | Print 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] | pr | Print destination.
  [in] | msg | Message 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] | pr | Print destination.
  [in] | msg | Message to print.

## ◆ format()

template<class Vol , class Fmt >

bool SdBase< Vol, Fmt >::format | ( | print_t * | pr = `NULL` | ) |
| inline

Format SD card

Parameters

  [in] | pr | Print 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] | msg | Message 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] | msg | Message 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] | pr | Print 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] | pr | Print destination.
  [in] | msg | Message 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] | pr | Print destination.
  [in] | msg | Message 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] | pr | Print 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] | pr | Print destination.

## ◆ printSdError()

template<class Vol , class Fmt >

void SdBase< Vol, Fmt >::printSdError | ( | print_t * | pr | ) |
| inline

Print error info and return.

Parameters

  [in] | pr | Print 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] | value | desired 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:

- ArduinoSdFat/libraries/SdFat/src/SdFat.h