Skip to content

daisy::FatFSInterface

Daisy FatFS Driver Interface. More...

#include <fatfs.h>

Public Classes

Name
struct Config

Public Types

Name
enum Result

Public Functions

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

Detailed Description

class daisy::FatFSInterface;

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.

Public Types Documentation

enum Result

Enumerator Value Description
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 FatFSInterface

inline FatFSInterface()

function Init

Result Init(
    const Config & cfg
)

Link the desired hardware specified via Config::Media


function Init

Result Init(
    const uint8_t media
)

Link the desired hardware specified via Config::Media

Alternate, explicit initialization provided for simplified syntax.


function DeInit

Result DeInit()

Unlinks FatFS from the configured media


function Initialized

inline bool Initialized() const

function GetConfig

inline const Config & GetConfig() const

Return the current configuration


function GetMutableConfig

inline Config & GetMutableConfig()

Return a mutable reference to the Configuration


function GetSDPath

inline const char * GetSDPath() const

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


function GetUSBPath

inline const char * GetUSBPath() const

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


function GetSDFileSystem

inline FATFS & GetSDFileSystem()

Returns reference to filesystem object for the SD volume.


function GetUSBFileSystem

inline FATFS & GetUSBFileSystem()

Returns reference to filesystem object for the USB volume.

---

Updated on 2024-01-03 at 19:41:00 +0000