ff.h File Reference
#include "integer.h"
#include "ffconf.h"
Include dependency graph for ff.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  FATFS
 
struct  FIL
 
struct  DIR
 
struct  FILINFO
 

Macros

#define _FATFS   8051 /* Revision ID */
 
#define LD2PD(vol)   (BYTE)(vol) /* Each logical drive is bound to the same physical drive number */
 
#define LD2PT(vol)   0 /* Find first valid partition or in SFD */
 
#define _T(x)   x
 
#define _TEXT(x)   x
 
#define f_eof(fp)   (((fp)->fptr == (fp)->fsize) ? 1 : 0)
 
#define f_error(fp)   ((fp)->err)
 
#define f_tell(fp)   ((fp)->fptr)
 
#define f_size(fp)   ((fp)->fsize)
 
#define EOF   (-1)
 
#define FA_READ   0x01
 
#define FA_OPEN_EXISTING   0x00
 
#define FA_WRITE   0x02
 
#define FA_CREATE_NEW   0x04
 
#define FA_CREATE_ALWAYS   0x08
 
#define FA_OPEN_ALWAYS   0x10
 
#define FA__WRITTEN   0x20
 
#define FA__DIRTY   0x40
 
#define FS_FAT12   1
 
#define FS_FAT16   2
 
#define FS_FAT32   3
 
#define AM_RDO   0x01 /* Read only */
 
#define AM_HID   0x02 /* Hidden */
 
#define AM_SYS   0x04 /* System */
 
#define AM_VOL   0x08 /* Volume label */
 
#define AM_LFN   0x0F /* LFN entry */
 
#define AM_DIR   0x10 /* Directory */
 
#define AM_ARC   0x20 /* Archive */
 
#define AM_MASK   0x3F /* Mask of defined bits */
 
#define CREATE_LINKMAP   0xFFFFFFFF
 

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_open (FIL *fp, const TCHAR *path, BYTE mode)
 
FRESULT f_close (FIL *fp)
 
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_forward (FIL *fp, UINT(*func)(const BYTE *, UINT), UINT btf, UINT *bf)
 
FRESULT f_lseek (FIL *fp, DWORD ofs)
 
FRESULT f_truncate (FIL *fp)
 
FRESULT f_sync (FIL *fp)
 
FRESULT f_opendir (DIR *dp, const TCHAR *path)
 
FRESULT f_closedir (DIR *dp)
 
FRESULT f_readdir (DIR *dp, FILINFO *fno)
 
FRESULT f_mkdir (const TCHAR *path)
 
FRESULT f_unlink (const TCHAR *path)
 
FRESULT f_rename (const TCHAR *path_old, const TCHAR *path_new)
 
FRESULT f_stat (const TCHAR *path, FILINFO *fno)
 
FRESULT f_chmod (const TCHAR *path, BYTE value, BYTE mask)
 
FRESULT f_utime (const TCHAR *path, const FILINFO *fno)
 
FRESULT f_chdir (const TCHAR *path)
 
FRESULT f_chdrive (const TCHAR *path)
 
FRESULT f_getcwd (TCHAR *buff, UINT len)
 
FRESULT f_getfree (const TCHAR *path, DWORD *nclst, FATFS **fatfs)
 
FRESULT f_getlabel (const TCHAR *path, TCHAR *label, DWORD *vsn)
 
FRESULT f_setlabel (const TCHAR *label)
 
FRESULT f_mount (FATFS *fs, const TCHAR *path, BYTE opt)
 
FRESULT f_mkfs (const TCHAR *path, BYTE sfd, UINT au)
 
FRESULT f_fdisk (BYTE pdrv, const DWORD szt[], void *work)
 
int f_putc (TCHAR c, FIL *fp)
 
int f_puts (const TCHAR *str, FIL *cp)
 
int f_printf (FIL *fp, const TCHAR *str,...)
 
TCHARf_gets (TCHAR *buff, int len, FIL *fp)
 
DWORD get_fattime (void)
 
WCHAR ff_convert (WCHAR chr, UINT dir)
 
WCHAR ff_wtoupper (WCHAR chr)
 
int ff_cre_syncobj (BYTE vol, _SYNC_t *sobj)
 
int ff_req_grant (_SYNC_t sobj)
 
void ff_rel_grant (_SYNC_t sobj)
 
int ff_del_syncobj (_SYNC_t sobj)
 

Macro Definition Documentation

#define _FATFS   8051 /* 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)->err)
#define f_size (   fp)    ((fp)->fsize)
#define f_tell (   fp)    ((fp)->fptr)
#define FA__DIRTY   0x40
#define FA__WRITTEN   0x20
#define FA_CREATE_ALWAYS   0x08
#define FA_CREATE_NEW   0x04
#define FA_OPEN_ALWAYS   0x10
#define FA_OPEN_EXISTING   0x00
#define FA_READ   0x01
#define FA_WRITE   0x02
#define FS_FAT12   1
#define FS_FAT16   2
#define FS_FAT32   3
#define LD2PD (   vol)    (BYTE)(vol) /* Each logical drive is bound to the same physical drive number */
#define LD2PT (   vol)    0 /* Find first valid partition or in SFD */

Typedef Documentation

typedef char TCHAR

Enumeration Type Documentation

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 

Function Documentation

FRESULT f_chdir ( const TCHAR path)
FRESULT f_chdrive ( const TCHAR path)
FRESULT f_chmod ( const TCHAR path,
BYTE  value,
BYTE  mask 
)
FRESULT f_close ( FIL fp)
FRESULT f_closedir ( DIR dp)
FRESULT f_fdisk ( BYTE  pdrv,
const DWORD  szt[],
void *  work 
)
FRESULT f_forward ( FIL fp,
UINT(*)(const BYTE *, UINT func,
UINT  btf,
UINT bf 
)
FRESULT f_getcwd ( TCHAR buff,
UINT  len 
)
FRESULT f_getfree ( const TCHAR path,
DWORD nclst,
FATFS **  fatfs 
)
FRESULT f_getlabel ( const TCHAR path,
TCHAR label,
DWORD vsn 
)
TCHAR* f_gets ( TCHAR buff,
int  len,
FIL fp 
)
FRESULT f_lseek ( FIL fp,
DWORD  ofs 
)
FRESULT f_mkdir ( const TCHAR path)
FRESULT f_mkfs ( const TCHAR path,
BYTE  sfd,
UINT  au 
)
FRESULT f_mount ( FATFS fs,
const TCHAR path,
BYTE  opt 
)
FRESULT f_open ( FIL fp,
const TCHAR path,
BYTE  mode 
)
FRESULT f_opendir ( DIR dp,
const TCHAR path 
)
int f_printf ( FIL fp,
const TCHAR str,
  ... 
)
int f_putc ( TCHAR  c,
FIL fp 
)
int f_puts ( const TCHAR str,
FIL cp 
)
FRESULT f_read ( FIL fp,
void *  buff,
UINT  btr,
UINT br 
)
FRESULT f_readdir ( DIR dp,
FILINFO fno 
)
FRESULT f_rename ( const TCHAR path_old,
const TCHAR path_new 
)
FRESULT f_setlabel ( const TCHAR label)
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 
)
WCHAR ff_convert ( WCHAR  chr,
UINT  dir 
)
int ff_cre_syncobj ( BYTE  vol,
_SYNC_t sobj 
)
int ff_del_syncobj ( _SYNC_t  sobj)
void ff_rel_grant ( _SYNC_t  sobj)
int ff_req_grant ( _SYNC_t  sobj)
WCHAR ff_wtoupper ( WCHAR  chr)
DWORD get_fattime ( void  )

This function is called by FAT FS System to get system time

Returns
DWORD containing the time structure