libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::SdmmcHandler Class Reference

Detailed Description

Configuration for interfacing with SD cards. Currently only supports operation using FatFS filesystem

Only SDMMC1 is supported at this time.

Pins are fixed to the following: PC12 - SDMMC1 CK PD2 - SDMMC1 CMD PC8 - SDMMC1 D0 PC9 - SDMMC1 D1 (optional) PC10 - SDMMC1 D2 (optional) PC11 - SDMMC1 D3 (optional)

#include <sdmmc.h>

Classes

struct  Config
 

Public Types

enum class  Result { OK , ERROR }
 
enum class  BusWidth { BITS_1 , BITS_4 }
 
enum class  Speed {
  SLOW , MEDIUM_SLOW , STANDARD , FAST ,
  VERY_FAST
}
 

Public Member Functions

 SdmmcHandler ()
 
 ~SdmmcHandler ()
 
Result Init (const Config &cfg)
 

Member Enumeration Documentation

◆ BusWidth

Sets whether 4-bit mode or 1-bit mode is used for the SDMMC

Enumerator
BITS_1 

Only 1 bit of data per clock is transferred

BITS_4 

4-bits of parallel data for each clock pulse

◆ Result

Return values for the SdmmcHandler class

Enumerator
OK 
ERROR 

◆ Speed

Sets the desired clock speed of the SD card bus.
Initialization is always done at or below 400kHz, and then the user speed is set.

Enumerator
SLOW 

400kHz, initialization performed at this rate, before moving to user value

MEDIUM_SLOW 

12.5MHz - half of standard rate

STANDARD 

25MHz - DS (Default Speed for SDMMC)

FAST 

50MHz - HS (High Speed signaling)

VERY_FAST 

100MHz - SDR50 Overclocked rate for maximum transfer rates

Constructor & Destructor Documentation

◆ SdmmcHandler()

daisy::SdmmcHandler::SdmmcHandler ( )
inline

◆ ~SdmmcHandler()

daisy::SdmmcHandler::~SdmmcHandler ( )
inline

Member Function Documentation

◆ Init()

Result daisy::SdmmcHandler::Init ( const Config cfg)

Configures the SDMMC Peripheral with the user defined settings. Initialization does not happen immediatly and will be called by the filesystem (i.e. FatFS).


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