Skip to content

Class daisy::FatFSInterface

ClassList > daisy > FatFSInterface

Daisy FatFS Driver Interface. More...

  • #include <fatfs.h>

Classes

Type Name
struct Config

Public Types

Type Name
enum Result

Public Functions

Type Name
Result DeInit ()
FatFSInterface ()
const Config & GetConfig () const
Config & GetMutableConfig ()
FATFS & GetSDFileSystem ()
const char * GetSDPath () const
FATFS & GetUSBFileSystem ()
const char * GetUSBPath () const
Result Init (const Config & cfg)
Result Init (const uint8_t media)
bool Initialized () const

Detailed Description

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.

Public Types Documentation

enum Result

enum daisy::FatFSInterface::Result {
    OK,
    ERR_TOO_MANY_VOLUMES,
    ERR_NO_MEDIA_SELECTED,
    ERR_GENERIC
};

Return values specifying specific errors for linking Daisy to FatFS


Public Functions Documentation

function DeInit

Result daisy::FatFSInterface::DeInit () 

Unlinks FatFS from the configured media


function FatFSInterface

inline daisy::FatFSInterface::FatFSInterface () 

function GetConfig

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

Return the current configuration


function GetMutableConfig

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

Return a mutable reference to the Configuration


function GetSDFileSystem

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

Returns reference to filesystem object for the SD volume.


function GetSDPath

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

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


function GetUSBFileSystem

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

Returns reference to filesystem object for the USB volume.


function GetUSBPath

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

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


function Init [½]

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

Link the desired hardware specified via Config::Media


function 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.


function Initialized

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


The documentation for this class was generated from the following file external-docs/libDaisy/src/sys/fatfs.h