#include "ff.h"#include "diskio.h"Defines | |
| #define | SS(fs) 512U |
| #define | ENTER_FF(fs) |
| #define | LEAVE_FF(fs, res) return res |
| #define | ABORT(fs, res) { fp->flag |= FA__ERROR; LEAVE_FF(fs, res); } |
| #define | LD_CLUST(dir) (((DWORD)LD_WORD(dir+DIR_FstClusHI)<<16) | LD_WORD(dir+DIR_FstClusLO)) |
| #define | ST_CLUST(dir, cl) {ST_WORD(dir+DIR_FstClusLO, cl); ST_WORD(dir+DIR_FstClusHI, (DWORD)cl>>16);} |
| #define | _DF1S 0 |
| #define | _EXCVT |
| #define | IsUpper(c) (((c)>='A')&&((c)<='Z')) |
| #define | IsLower(c) (((c)>='a')&&((c)<='z')) |
| #define | IsDigit(c) (((c)>='0')&&((c)<='9')) |
| #define | IsDBCS1(c) 0 |
| #define | IsDBCS2(c) 0 |
| #define | NS 11 |
| #define | NS_LOSS 0x01 |
| #define | NS_LFN 0x02 |
| #define | NS_LAST 0x04 |
| #define | NS_BODY 0x08 |
| #define | NS_EXT 0x10 |
| #define | NS_DOT 0x20 |
| #define | MIN_FAT16 4086 |
| #define | MIN_FAT32 65526 |
| #define | BS_jmpBoot 0 |
| #define | BS_OEMName 3 |
| #define | BPB_BytsPerSec 11 |
| #define | BPB_SecPerClus 13 |
| #define | BPB_RsvdSecCnt 14 |
| #define | BPB_NumFATs 16 |
| #define | BPB_RootEntCnt 17 |
| #define | BPB_TotSec16 19 |
| #define | BPB_Media 21 |
| #define | BPB_FATSz16 22 |
| #define | BPB_SecPerTrk 24 |
| #define | BPB_NumHeads 26 |
| #define | BPB_HiddSec 28 |
| #define | BPB_TotSec32 32 |
| #define | BS_DrvNum 36 |
| #define | BS_BootSig 38 |
| #define | BS_VolID 39 |
| #define | BS_VolLab 43 |
| #define | BS_FilSysType 54 |
| #define | BPB_FATSz32 36 |
| #define | BPB_ExtFlags 40 |
| #define | BPB_FSVer 42 |
| #define | BPB_RootClus 44 |
| #define | BPB_FSInfo 48 |
| #define | BPB_BkBootSec 50 |
| #define | BS_DrvNum32 64 |
| #define | BS_BootSig32 66 |
| #define | BS_VolID32 67 |
| #define | BS_VolLab32 71 |
| #define | BS_FilSysType32 82 |
| #define | FSI_LeadSig 0 |
| #define | FSI_StrucSig 484 |
| #define | FSI_Free_Count 488 |
| #define | FSI_Nxt_Free 492 |
| #define | MBR_Table 446 |
| #define | SZ_PTE 16 |
| #define | BS_55AA 510 |
| #define | DIR_Name 0 |
| #define | DIR_Attr 11 |
| #define | DIR_NTres 12 |
| #define | DIR_CrtTime 14 |
| #define | DIR_CrtDate 16 |
| #define | DIR_FstClusHI 20 |
| #define | DIR_WrtTime 22 |
| #define | DIR_WrtDate 24 |
| #define | DIR_FstClusLO 26 |
| #define | DIR_FileSize 28 |
| #define | LDIR_Ord 0 |
| #define | LDIR_Attr 11 |
| #define | LDIR_Type 12 |
| #define | LDIR_Chksum 13 |
| #define | LDIR_FstClusLO 26 |
| #define | SZ_DIR 32 |
| #define | LLE 0x40 |
| #define | DDE 0xE5 |
| #define | NDDE 0x05 |
| #define | DEF_NAMEBUF BYTE sfn[12] |
| #define | INIT_BUF(dobj) (dobj).fn = sfn |
| #define | FREE_BUF() |
Functions | |
| DWORD | clust2sect (FATFS *fs, DWORD clst) |
| DWORD | get_fat (FATFS *fs, DWORD clst) |
| FRESULT | put_fat (FATFS *fs, DWORD clst, DWORD val) |
| FRESULT | f_mount (BYTE vol, FATFS *fs) |
| FRESULT | f_open (FIL *fp, const TCHAR *path, BYTE mode) |
| FRESULT | f_read (FIL *fp, void *buff, UINT btr, UINT *br) |
| FRESULT | f_write (FIL *fp, const void *buff, UINT btw, UINT *bw) |
| FRESULT | f_sync (FIL *fp) |
| FRESULT | f_close (FIL *fp) |
| FRESULT | f_lseek (FIL *fp, DWORD ofs) |
| FRESULT | f_opendir (DIR *dj, const TCHAR *path) |
| FRESULT | f_readdir (DIR *dj, FILINFO *fno) |
| FRESULT | f_stat (const TCHAR *path, FILINFO *fno) |
| FRESULT | f_getfree (const TCHAR *path, DWORD *nclst, FATFS **fatfs) |
| FRESULT | f_truncate (FIL *fp) |
| FRESULT | f_unlink (const TCHAR *path) |
| FRESULT | f_mkdir (const TCHAR *path) |
| FRESULT | f_chmod (const TCHAR *path, BYTE value, BYTE mask) |
| FRESULT | f_utime (const TCHAR *path, const FILINFO *fno) |
| FRESULT | f_rename (const TCHAR *path_old, const TCHAR *path_new) |
| #define _DF1S 0 |
| #define _EXCVT |
{0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0xAd,0x9B,0x8C,0x9D,0xAE,0x9F, \
0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
| #define ABORT | ( | fs, | ||
| res | ||||
| ) | { fp->flag |= FA__ERROR; LEAVE_FF(fs, res); } |
| #define BPB_BkBootSec 50 |
| #define BPB_BytsPerSec 11 |
| #define BPB_ExtFlags 40 |
| #define BPB_FATSz16 22 |
| #define BPB_FATSz32 36 |
| #define BPB_FSInfo 48 |
| #define BPB_FSVer 42 |
| #define BPB_HiddSec 28 |
| #define BPB_Media 21 |
| #define BPB_NumFATs 16 |
| #define BPB_NumHeads 26 |
| #define BPB_RootClus 44 |
| #define BPB_RootEntCnt 17 |
| #define BPB_RsvdSecCnt 14 |
| #define BPB_SecPerClus 13 |
| #define BPB_SecPerTrk 24 |
| #define BPB_TotSec16 19 |
| #define BPB_TotSec32 32 |
| #define BS_55AA 510 |
| #define BS_BootSig 38 |
| #define BS_BootSig32 66 |
| #define BS_DrvNum 36 |
| #define BS_DrvNum32 64 |
| #define BS_FilSysType 54 |
| #define BS_FilSysType32 82 |
| #define BS_jmpBoot 0 |
| #define BS_OEMName 3 |
| #define BS_VolID 39 |
| #define BS_VolID32 67 |
| #define BS_VolLab 43 |
| #define BS_VolLab32 71 |
| #define DDE 0xE5 |
| #define DEF_NAMEBUF BYTE sfn[12] |
| #define DIR_Attr 11 |
| #define DIR_CrtDate 16 |
| #define DIR_CrtTime 14 |
| #define DIR_FileSize 28 |
| #define DIR_FstClusHI 20 |
| #define DIR_FstClusLO 26 |
| #define DIR_Name 0 |
| #define DIR_NTres 12 |
| #define DIR_WrtDate 24 |
| #define DIR_WrtTime 22 |
| #define ENTER_FF | ( | fs | ) |
| #define FREE_BUF | ( | ) |
| #define FSI_Free_Count 488 |
| #define FSI_LeadSig 0 |
| #define FSI_Nxt_Free 492 |
| #define FSI_StrucSig 484 |
| #define INIT_BUF | ( | dobj | ) | (dobj).fn = sfn |
| #define IsDBCS1 | ( | c | ) | 0 |
| #define IsDBCS2 | ( | c | ) | 0 |
| #define IsDigit | ( | c | ) | (((c)>='0')&&((c)<='9')) |
| #define IsLower | ( | c | ) | (((c)>='a')&&((c)<='z')) |
| #define IsUpper | ( | c | ) | (((c)>='A')&&((c)<='Z')) |
| #define LD_CLUST | ( | dir | ) | (((DWORD)LD_WORD(dir+DIR_FstClusHI)<<16) | LD_WORD(dir+DIR_FstClusLO)) |
| #define LDIR_Attr 11 |
| #define LDIR_Chksum 13 |
| #define LDIR_FstClusLO 26 |
| #define LDIR_Ord 0 |
| #define LDIR_Type 12 |
| #define LEAVE_FF | ( | fs, | ||
| res | ||||
| ) | return res |
| #define LLE 0x40 |
| #define MBR_Table 446 |
| #define MIN_FAT16 4086 |
| #define MIN_FAT32 65526 |
| #define NDDE 0x05 |
| #define NS 11 |
| #define NS_BODY 0x08 |
| #define NS_DOT 0x20 |
| #define NS_EXT 0x10 |
| #define NS_LAST 0x04 |
| #define NS_LFN 0x02 |
| #define NS_LOSS 0x01 |
| #define SS | ( | fs | ) | 512U |
| #define ST_CLUST | ( | dir, | ||
| cl | ||||
| ) | {ST_WORD(dir+DIR_FstClusLO, cl); ST_WORD(dir+DIR_FstClusHI, (DWORD)cl>>16);} |
| #define SZ_DIR 32 |
| #define SZ_PTE 16 |
1.7.1