libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
fatfs.h
Go to the documentation of this file.
1#ifndef __fatfs_H
2#define __fatfs_H
4#include "ff.h"
5
6namespace daisy
7{
28{
29 public:
38
40 struct Config
41 {
55 {
56 MEDIA_SD = 0x01,
57 MEDIA_USB = 0x02,
58 // MEDIA_QSPI = 0x04,
59 };
60
62 };
63
65
68
73 Result Init(const uint8_t media);
74
77
78 bool Initialized() const { return initialized_; }
79
81 const Config& GetConfig() const { return cfg_; }
82
84 Config& GetMutableConfig() { return cfg_; }
85
87 const char* GetSDPath() const { return path_[0]; }
88
90 const char* GetUSBPath() const { return path_[1]; }
91
93 FATFS& GetSDFileSystem() { return fs_[0]; }
94
96 FATFS& GetUSBFileSystem() { return fs_[1]; }
97
98 private:
99 Config cfg_;
100 FATFS fs_[_VOLUMES];
101 char path_[_VOLUMES][4];
102 bool initialized_;
103};
104
105} // namespace daisy
106
110extern "C" DWORD get_fattime(void);
111
112#endif
Daisy FatFS Driver Interface.
Definition fatfs.h:28
Result
Definition fatfs.h:32
@ ERR_GENERIC
Definition fatfs.h:36
@ ERR_TOO_MANY_VOLUMES
Definition fatfs.h:34
@ ERR_NO_MEDIA_SELECTED
Definition fatfs.h:35
@ OK
Definition fatfs.h:33
FatFSInterface()
Definition fatfs.h:64
Config & GetMutableConfig()
Definition fatfs.h:84
const Config & GetConfig() const
Definition fatfs.h:81
const char * GetSDPath() const
Definition fatfs.h:87
const char * GetUSBPath() const
Definition fatfs.h:90
bool Initialized() const
Definition fatfs.h:78
FATFS & GetUSBFileSystem()
Definition fatfs.h:96
FATFS & GetSDFileSystem()
Definition fatfs.h:93
Result Init(const uint8_t media)
Result Init(const Config &cfg)
Definition leddriver.h:33
DWORD get_fattime(void)
#define _VOLUMES
Definition ffconf.h:164
Hardware defines and helpers for daisy field platform.
Definition index.h:2
Definition fatfs.h:41
Media
Definition fatfs.h:55
@ MEDIA_SD
Definition fatfs.h:56
@ MEDIA_USB
Definition fatfs.h:57
uint8_t media
Definition fatfs.h:61