12 #if defined(BOARD_SDCARD_CS_PIN) || defined(BOARD_DATAFLASH_FATFS) 20 #define FILE_WRITE FA_WRITE 21 #define FILE_READ FA_READ 24 static inline uint16_t FAT_YEAR(uint16_t fatDate) {
25 return 1980 + (fatDate >> 9);
28 static inline uint8_t FAT_MONTH(uint16_t fatDate) {
29 return (fatDate >> 5) & 0XF;
32 static inline uint8_t FAT_DAY(uint16_t fatDate) {
33 return fatDate & 0X1F;
37 static inline uint8_t FAT_HOUR(uint16_t fatTime) {
41 static inline uint8_t FAT_MINUTE(uint16_t fatTime) {
42 return(fatTime >> 5) & 0X3F;
45 static inline uint8_t FAT_SECOND(uint16_t fatTime) {
46 return 2*(fatTime & 0X1F);
57 uint8_t fatType(
void);
61 uint8_t blocksPerCluster(
void)
const {
return _SDFatFs.csize ? _SDFatFs.csize : blockSize();}
63 inline uint32_t clusterCount(
void)
const {
return _SDFatFs.n_fatent? _SDFatFs.n_fatent -2:0;}
66 inline uint32_t sectorCount(
void)
const {
return _card->sectorCount(); }
67 inline uint32_t sectorSize(
void)
const {
return _card->sectorSize(); }
68 inline uint32_t blockSize(
void)
const {
return _card->blockSize(); }
70 inline char* getRoot(
void) {
return _SDPath; };
71 FRESULT format(
const char *filepath, Sd2Card *card);
73 static const char *strError(
FRESULT err);
void init()
Generic board initialization function.