Microchip® Advanced Software Framework

ff.h File Reference
#include "integer.h"
#include "ffconf.h"

Data Structures

struct  DIR
 
struct  FATFS
 
struct  FIL
 
struct  FILINFO
 

Macros

#define _FATFS   6502 /* Revision ID */
 
#define _T(x)   x
 
#define _TEXT(x)   x
 
#define AM_ARC   0x20 /* Archive */
 
#define AM_DIR   0x10 /* Directory */
 
#define AM_HID   0x02 /* Hidden */
 
#define AM_LFN   0x0F /* LFN entry */
 
#define AM_MASK   0x3F /* Mask of defined bits */
 
#define AM_RDO   0x01 /* Read only */
 
#define AM_SYS   0x04 /* System */
 
#define AM_VOL   0x08 /* Volume label */
 
#define CREATE_LINKMAP   0xFFFFFFFF
 
#define EOF   (-1)
 
#define f_eof(fp)   (((fp)->fptr == (fp)->fsize) ? 1 : 0)
 
#define f_error(fp)   (((fp)->flag & FA__ERROR) ? 1 : 0)
 
#define f_size(fp)   ((fp)->fsize)
 
#define f_tell(fp)   ((fp)->fptr)
 
#define FA__ERROR   0x80
 
#define FA_OPEN_EXISTING   0x00
 
#define FA_READ   0x01
 
#define FS_FAT12   1
 
#define FS_FAT16   2
 
#define FS_FAT32   3
 
#define LD2PD(vol)   (vol) /* Each logical drive is bound to the same physical drive number */
 
#define LD2PT(vol)   0 /* Always mounts the 1st partition or in SFD */
 
#define LD_DWORD(ptr)   (DWORD)(((DWORD)*((BYTE*)(ptr)+3)<<24)|((DWORD)*((BYTE*)(ptr)+2)<<16)|((WORD)*((BYTE*)(ptr)+1)<<8)|*(BYTE*)(ptr))
 
#define LD_WORD(ptr)   (WORD)(((WORD)*((BYTE*)(ptr)+1)<<8)|(WORD)*(BYTE*)(ptr))
 
#define ST_DWORD(ptr, val)   *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8); *((BYTE*)(ptr)+2)=(BYTE)((DWORD)(val)>>16); *((BYTE*)(ptr)+3)=(BYTE)((DWORD)(val)>>24)
 
#define ST_WORD(ptr, val)   *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8)
 

Typedefs

typedef char TCHAR
 

Enumerations

enum  FRESULT {
  FR_OK = 0,
  FR_DISK_ERR,
  FR_INT_ERR,
  FR_NOT_READY,
  FR_NO_FILE,
  FR_NO_PATH,
  FR_INVALID_NAME,
  FR_DENIED,
  FR_EXIST,
  FR_INVALID_OBJECT,
  FR_WRITE_PROTECTED,
  FR_INVALID_DRIVE,
  FR_NOT_ENABLED,
  FR_NO_FILESYSTEM,
  FR_MKFS_ABORTED,
  FR_TIMEOUT,
  FR_LOCKED,
  FR_NOT_ENOUGH_CORE,
  FR_TOO_MANY_OPEN_FILES,
  FR_INVALID_PARAMETER
}
 

Functions

FRESULT f_chdir (const TCHAR *)
 
FRESULT f_chdrive (BYTE)
 
FRESULT f_chmod (const TCHAR *, BYTE, BYTE)
 
FRESULT f_close (FIL *)
 
FRESULT f_fdisk (BYTE, const DWORD[], void *)
 
FRESULT f_forward (FIL *, UINT(*)(const BYTE *, UINT), UINT, UINT *)
 
FRESULT f_getcwd (TCHAR *, UINT)
 
FRESULT f_getfree (const TCHAR *, DWORD *, FATFS **)
 
TCHARf_gets (TCHAR *, int, FIL *)
 
FRESULT f_lseek (FIL *, DWORD)
 
FRESULT f_mkdir (const TCHAR *)
 
FRESULT f_mkfs (BYTE, BYTE, UINT)
 
FRESULT f_mount (BYTE, FATFS *)
 
FRESULT f_open (FIL *, const TCHAR *, BYTE)
 
FRESULT f_opendir (DIR *, const TCHAR *)
 
int f_printf (FIL *, const TCHAR *,...)
 
int f_putc (TCHAR, FIL *)
 
int f_puts (const TCHAR *, FIL *)
 
FRESULT f_read (FIL *, void *, UINT, UINT *)
 
FRESULT f_readdir (DIR *, FILINFO *)
 
FRESULT f_rename (const TCHAR *, const TCHAR *)
 
FRESULT f_stat (const TCHAR *, FILINFO *)
 
FRESULT f_sync (FIL *)
 
FRESULT f_truncate (FIL *)
 
FRESULT f_unlink (const TCHAR *)
 
FRESULT f_utime (const TCHAR *, const FILINFO *)
 
FRESULT f_write (FIL *, const void *, UINT, UINT *)
 
WCHAR ff_convert (WCHAR, UINT)
 
WCHAR ff_wtoupper (WCHAR)
 

#define _FATFS   6502 /* Revision ID */
#define _T (   x)    x
#define _TEXT (   x)    x
#define AM_ARC   0x20 /* Archive */
#define AM_DIR   0x10 /* Directory */

Referenced by f_open(), f_opendir(), and follow_path().

#define AM_HID   0x02 /* Hidden */
#define AM_LFN   0x0F /* LFN entry */

Referenced by dir_find(), and dir_read().

#define AM_MASK   0x3F /* Mask of defined bits */

Referenced by dir_find(), and dir_read().

#define AM_RDO   0x01 /* Read only */

Referenced by f_open().

#define AM_SYS   0x04 /* System */
#define AM_VOL   0x08 /* Volume label */

Referenced by dir_find(), and dir_read().

#define CREATE_LINKMAP   0xFFFFFFFF

Referenced by f_lseek().

#define EOF   (-1)
#define f_eof (   fp)    (((fp)->fptr == (fp)->fsize) ? 1 : 0)
#define f_error (   fp)    (((fp)->flag & FA__ERROR) ? 1 : 0)
#define f_size (   fp)    ((fp)->fsize)
#define f_tell (   fp)    ((fp)->fptr)
#define FA__ERROR   0x80

Referenced by f_lseek(), and f_read().

#define FA_OPEN_EXISTING   0x00
#define FA_READ   0x01
#define FS_FAT12   1

Referenced by chk_mounted(), and get_fat().

#define FS_FAT16   2

Referenced by chk_mounted(), and get_fat().

#define FS_FAT32   3

Referenced by chk_mounted(), dir_sdi(), and get_fat().

#define LD2PD (   vol)    (vol) /* Each logical drive is bound to the same physical drive number */

Referenced by chk_mounted().

#define LD2PT (   vol)    0 /* Always mounts the 1st partition or in SFD */

Referenced by chk_mounted().

#define LD_DWORD (   ptr)    (DWORD)(((DWORD)*((BYTE*)(ptr)+3)<<24)|((DWORD)*((BYTE*)(ptr)+2)<<16)|((WORD)*((BYTE*)(ptr)+1)<<8)|*(BYTE*)(ptr))
#define LD_WORD (   ptr)    (WORD)(((WORD)*((BYTE*)(ptr)+1)<<8)|(WORD)*(BYTE*)(ptr))
#define ST_DWORD (   ptr,
  val 
)    *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8); *((BYTE*)(ptr)+2)=(BYTE)((DWORD)(val)>>16); *((BYTE*)(ptr)+3)=(BYTE)((DWORD)(val)>>24)

Referenced by f_open().

#define ST_WORD (   ptr,
  val 
)    *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8)

typedef char TCHAR

enum FRESULT
Enumerator
FR_OK 
FR_DISK_ERR 
FR_INT_ERR 
FR_NOT_READY 
FR_NO_FILE 
FR_NO_PATH 
FR_INVALID_NAME 
FR_DENIED 
FR_EXIST 
FR_INVALID_OBJECT 
FR_WRITE_PROTECTED 
FR_INVALID_DRIVE 
FR_NOT_ENABLED 
FR_NO_FILESYSTEM 
FR_MKFS_ABORTED 
FR_TIMEOUT 
FR_LOCKED 
FR_NOT_ENOUGH_CORE 
FR_TOO_MANY_OPEN_FILES 
FR_INVALID_PARAMETER 

FRESULT f_chdir ( const TCHAR )
FRESULT f_chdrive ( BYTE  )
FRESULT f_chmod ( const TCHAR ,
BYTE  ,
BYTE   
)
FRESULT f_fdisk ( BYTE  ,
const DWORD  [],
void *   
)
FRESULT f_forward ( FIL ,
UINT(*)(const BYTE *, UINT ,
UINT  ,
UINT  
)
FRESULT f_getcwd ( TCHAR ,
UINT   
)
FRESULT f_getfree ( const TCHAR ,
DWORD ,
FATFS **   
)
FRESULT f_mkdir ( const TCHAR )
FRESULT f_mkfs ( BYTE  ,
BYTE  ,
UINT   
)
int f_printf ( FIL ,
const TCHAR ,
  ... 
)
int f_putc ( TCHAR  ,
FIL  
)
int f_puts ( const TCHAR ,
FIL  
)
FRESULT f_rename ( const TCHAR ,
const TCHAR  
)
FRESULT f_stat ( const TCHAR ,
FILINFO  
)
FRESULT f_sync ( FIL )

Referenced by f_close().

FRESULT f_truncate ( FIL )
FRESULT f_unlink ( const TCHAR )
FRESULT f_utime ( const TCHAR ,
const FILINFO  
)
FRESULT f_write ( FIL ,
const void *  ,
UINT  ,
UINT  
)
WCHAR ff_convert ( WCHAR  ,
UINT   
)

References Tbl.

Referenced by create_name(), and get_fileinfo().

WCHAR ff_wtoupper ( WCHAR  )

Referenced by cmp_lfn(), and create_name().