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

Daisy FatFS Driver Interface. More...

Detailed Description

Daisy FatFS Driver Interface.

Specifies the desired media (SD Card, USB, etc.) to be mountable with FatFS within a given application. Once initialization is called, the standard FatFS API will be usable with the media mounted in the order they are listed in the Media config struct. For example, when only using an SD Card, it will mount at "0:/", when only using USB, it will mount at "0:/". However, when mounting with SD card and USB, the SD card will mount at "0:/", and the USB will mount at "1:/". The relevant hardware peripheral (SDMMC, or MSD) needs to be initialized separately by the application before using FatFS.

This object has some memory limitations due to the media connected to it. The SDMMC1 peripheral can only communicate with the AXI SRAM, and the DTCMRAM cannot communicate with the DMA. So the FatFSInterface object should always be located in the AXI SRAM. This is the default location for all data/bss memory using the standard build. However, applciations using the electrosmith bootloader will need special consideration when using this object AND an SD Card.

#include <fatfs.h>

Classes

struct  Config
 

Public Types

enum  Result { OK , ERR_TOO_MANY_VOLUMES , ERR_NO_MEDIA_SELECTED , ERR_GENERIC }
 

Public Member Functions

 FatFSInterface ()
 
Result Init (const Config &cfg)
 
Result Init (const uint8_t media)
 
Result DeInit ()
 
bool Initialized () const
 
const ConfigGetConfig () const
 
ConfigGetMutableConfig ()
 
const charGetSDPath () const
 
const charGetUSBPath () const
 
FATFSGetSDFileSystem ()
 
FATFSGetUSBFileSystem ()
 

Member Enumeration Documentation

◆ Result

Return values specifying specific errors for linking Daisy to FatFS

Enumerator
OK 
ERR_TOO_MANY_VOLUMES 
ERR_NO_MEDIA_SELECTED 
ERR_GENERIC 

Constructor & Destructor Documentation

◆ FatFSInterface()

daisy::FatFSInterface::FatFSInterface ( )
inline

Member Function Documentation

◆ DeInit()

Result daisy::FatFSInterface::DeInit ( )

Unlinks FatFS from the configured media

◆ GetConfig()

const Config & daisy::FatFSInterface::GetConfig ( ) const
inline

Return the current configuration

◆ GetMutableConfig()

Config & daisy::FatFSInterface::GetMutableConfig ( )
inline

Return a mutable reference to the Configuration

◆ GetSDFileSystem()

FATFS & daisy::FatFSInterface::GetSDFileSystem ( )
inline

Returns reference to filesystem object for the SD volume.

◆ GetSDPath()

const char * daisy::FatFSInterface::GetSDPath ( ) const
inline

Returns the path to an SD Card volume to use with f_mount

◆ GetUSBFileSystem()

FATFS & daisy::FatFSInterface::GetUSBFileSystem ( )
inline

Returns reference to filesystem object for the USB volume.

◆ GetUSBPath()

const char * daisy::FatFSInterface::GetUSBPath ( ) const
inline

Returns the path to a USB Device volume to use with f_mount

◆ Init() [1/2]

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

Link the desired hardware specified via Config::Media

◆ Init() [2/2]

Result daisy::FatFSInterface::Init ( const uint8_t  media)

Link the desired hardware specified via Config::Media

Alternate, explicit initialization provided for simplified syntax.

◆ Initialized()

bool daisy::FatFSInterface::Initialized ( ) const
inline

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