ff.c File Reference

#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 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 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 DEF_NAMEBUF   BYTE sfn[12]
#define INIT_BUF(dobj)   (dobj).fn = sfn
#define FREE_BUF()
#define N_ROOTDIR   512
#define N_FATS   1

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)
FRESULT f_mkfs (BYTE drv, BYTE sfd, UINT au)

Define Documentation

#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 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 (  )     0

#define IsDBCS2 (  )     0

#define IsDigit (  )     (((c)>='0')&&((c)<='9'))

#define IsLower (  )     (((c)>='a')&&((c)<='z'))

#define IsUpper (  )     (((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 MBR_Table   446

#define MIN_FAT16   4086

#define MIN_FAT32   65526

#define N_FATS   1

#define N_ROOTDIR   512

#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);}


Function Documentation

DWORD clust2sect ( FATFS fs,
DWORD  clst 
)

FRESULT f_chmod ( const TCHAR path,
BYTE  value,
BYTE  mask 
)

FRESULT f_close ( FIL fp  ) 

FRESULT f_getfree ( const TCHAR path,
DWORD nclst,
FATFS **  fatfs 
)

FRESULT f_lseek ( FIL fp,
DWORD  ofs 
)

FRESULT f_mkdir ( const TCHAR path  ) 

FRESULT f_mkfs ( BYTE  drv,
BYTE  sfd,
UINT  au 
)

FRESULT f_mount ( BYTE  vol,
FATFS fs 
)

FRESULT f_open ( FIL fp,
const TCHAR path,
BYTE  mode 
)

FRESULT f_opendir ( DIR dj,
const TCHAR path 
)

FRESULT f_read ( FIL fp,
void *  buff,
UINT  btr,
UINT br 
)

FRESULT f_readdir ( DIR dj,
FILINFO fno 
)

FRESULT f_rename ( const TCHAR path_old,
const TCHAR path_new 
)

FRESULT f_stat ( const TCHAR path,
FILINFO fno 
)

FRESULT f_sync ( FIL fp  ) 

FRESULT f_truncate ( FIL fp  ) 

FRESULT f_unlink ( const TCHAR path  ) 

FRESULT f_utime ( const TCHAR path,
const FILINFO fno 
)

FRESULT f_write ( FIL fp,
const void *  buff,
UINT  btw,
UINT bw 
)

DWORD get_fat ( FATFS fs,
DWORD  clst 
)

FRESULT put_fat ( FATFS fs,
DWORD  clst,
DWORD  val 
)


Generated on Wed Nov 10 11:54:59 2010 by  doxygen 1.5.8