Daisy FatFS Driver Interface. More...
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 Config & | GetConfig () const |
Config & | GetMutableConfig () |
const char * | GetSDPath () const |
const char * | GetUSBPath () const |
FATFS & | GetSDFileSystem () |
FATFS & | GetUSBFileSystem () |
|
inline |
Result daisy::FatFSInterface::DeInit | ( | ) |
Unlinks FatFS from the configured media
|
inline |
Return a mutable reference to the Configuration
|
inline |
Returns reference to filesystem object for the SD volume.
Returns the path to an SD Card volume to use with f_mount
|
inline |
Returns reference to filesystem object for the USB volume.
Returns the path to a USB Device volume to use with f_mount
Link the desired hardware specified via Config::Media
Link the desired hardware specified via Config::Media
Alternate, explicit initialization provided for simplified syntax.
|
inline |