SdFat: SdBase< Vol > Class Template Reference

SdFat

Public Member Functions | List of all members
SdBase< Vol > Class Template Reference

base SD file system template class. More...

`#include <SdFat.h>`

Inheritance diagram for SdBase< Vol >:
[legend]
Collaboration diagram for SdBase< Vol >:
[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 | errorHalt (print_t *pr)
void | errorHalt (print_t *pr, const __FlashStringHelper *msg)
void | errorHalt (print_t *pr, const char *msg)
void | errorPrint (Print *pr, const __FlashStringHelper *msg)
void | errorPrint (print_t *pr)
void | errorPrint (print_t *pr, char const *msg)
void | initErrorHalt (Print *pr, const __FlashStringHelper *msg)
void | initErrorHalt (print_t *pr)
void | initErrorHalt (print_t *pr, const char *msg)
void | initErrorPrint (Print *pr)
void | printFatType (print_t *pr)
void | printSdError (print_t *pr)
uint8_t | sdErrorCode ()
uint8_t | sdErrorData ()
Vol * | vol ()
bool | volumeBegin ()

## Detailed Description

### template<class Vol>
class SdBase< Vol >

base SD file system template class.

## Member Function Documentation

## ◆ begin() [1/4]

template<class Vol >

bool SdBase< Vol >::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 >

bool SdBase< Vol >::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 >

bool SdBase< Vol >::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 >

bool SdBase< Vol >::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 >

SdCard* SdBase< Vol >::card | ( |  | ) |
| inline

Returns
  Pointer to SD card object.

## ◆ cardBegin() [1/2]

template<class Vol >

bool SdBase< Vol >::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 >

bool SdBase< Vol >::cardBegin | ( | SdSpiConfig | spiConfig | ) |
| inline

Initialize SD card in SPI mode.

Parameters

  [in] | spiConfig | SPI configuration.

Returns
  true for success or false for failure.

## ◆ errorHalt() [1/3]

template<class Vol >

void SdBase< Vol >::errorHalt | ( | print_t * | pr | ) |
| inline

Print error info and halt.

Parameters

  [in] | pr | Print destination.

## ◆ errorHalt() [2/3]

template<class Vol >

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

Print msg and halt.

Parameters

  [in] | pr | Print destination.
  [in] | msg | Message to print.

## ◆ errorHalt() [3/3]

template<class Vol >

void SdBase< Vol >::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/3]

template<class Vol >

void SdBase< Vol >::errorPrint | ( | Print * | pr,
|  | const __FlashStringHelper * | msg
| ) |  |
| inline

Print msg, any SD error code.

Parameters

  [in] | pr | Print destination.
  [in] | msg | Message to print.

## ◆ errorPrint() [2/3]

template<class Vol >

void SdBase< Vol >::errorPrint | ( | print_t * | pr | ) |
| inline

Print SD errorCode and errorData.

Parameters

  [in] | pr | Print destination.

## ◆ errorPrint() [3/3]

template<class Vol >

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

Print msg, any SD error code.

Parameters

  [in] | pr | Print destination.
  [in] | msg | Message to print.

## ◆ initErrorHalt() [1/3]

template<class Vol >

void SdBase< Vol >::initErrorHalt | ( | Print * | pr,
|  | const __FlashStringHelper * | msg
| ) |  |
| inline

Print error info and halt.

Parameters

  [in] | pr | Print destination.
  [in] | msg | Message to print.

## ◆ initErrorHalt() [2/3]

template<class Vol >

void SdBase< Vol >::initErrorHalt | ( | print_t * | pr | ) |
| inline

Print error info and halt.

Parameters

  [in] | pr | Print destination.

## ◆ initErrorHalt() [3/3]

template<class Vol >

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

Print error info and halt.

Parameters

  [in] | pr | Print destination.
  [in] | msg | Message to print.

## ◆ initErrorPrint()

template<class Vol >

void SdBase< Vol >::initErrorPrint | ( | Print * | pr | ) |
| inline

Print error details after begin() fails.

Parameters

  [in] | pr | Print destination.

## ◆ printFatType()

template<class Vol >

void SdBase< Vol >::printFatType | ( | print_t * | pr | ) |
| inline

Print volume FAT/exFAT type.

Parameters

  [in] | pr | Print destination.

## ◆ printSdError()

template<class Vol >

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

Print error info and return.

Parameters

  [in] | pr | Print destination.

## ◆ sdErrorCode()

template<class Vol >

uint8_t SdBase< Vol >::sdErrorCode | ( |  | ) |
| inline

Returns
  SD card error code.

## ◆ sdErrorData()

template<class Vol >

uint8_t SdBase< Vol >::sdErrorData | ( |  | ) |
| inline

Returns
  SD card error data.

## ◆ vol()

template<class Vol >

Vol* SdBase< Vol >::vol | ( |  | ) |
| inline

Returns
  pointer to base volume

## ◆ volumeBegin()

template<class Vol >

bool SdBase< Vol >::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