CARME-M4 BSP  V1.5
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
 File system object structure. More...
 
struct  FIL
 File object structure. More...
 
struct  DIR
 Directory object structure. More...
 
struct  FILINFO
 File status structure. More...
 

Macros

#define _FATFS   80960 /* Revision ID */
 
#define LD2PD(vol)   (BYTE)(vol)
 
#define LD2PT(vol)   0
 
#define _T(x)   x
 
#define _TEXT(x)   x
 
#define f_eof(fp)   (((fp)->fptr == (fp)->fsize) ? 1 : 0)
 Filepointer at the end of file?
 
#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
 
#define AM_HID   0x02
 
#define AM_SYS   0x04
 
#define AM_VOL   0x08
 
#define AM_LFN   0x0F
 
#define AM_DIR   0x10
 
#define AM_ARC   0x20
 
#define AM_MASK   0x3F
 
#define CREATE_LINKMAP   0xFFFFFFFF
 
#define LD_WORD(ptr)   (WORD)(((WORD)*((BYTE*)(ptr)+1)<<8)|(WORD)*(BYTE*)(ptr))
 
#define LD_DWORD(ptr)   (DWORD)(((DWORD)*((BYTE*)(ptr)+3)<<24)|((DWORD)*((BYTE*)(ptr)+2)<<16)|((WORD)*((BYTE*)(ptr)+1)<<8)|*(BYTE*)(ptr))
 
#define ST_WORD(ptr, val)   *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8)
 
#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)
 

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
}
 File function return code. More...
 

Functions

FRESULT f_open (FIL *fp, const TCHAR *path, BYTE mode)
 Open or Create a File. More...
 
FRESULT f_close (FIL *fp)
 Close File. More...
 
FRESULT f_read (FIL *fp, void *buff, UINT btr, UINT *br)
 Read File. More...
 
FRESULT f_write (FIL *fp, const void *buff, UINT btw, UINT *bw)
 Write File. More...
 
FRESULT f_lseek (FIL *fp, DWORD ofs)
 Seek File R/W Pointer. More...
 
FRESULT f_truncate (FIL *fp)
 Truncate File. More...
 
FRESULT f_sync (FIL *fp)
 Synchronize the File. More...
 
FRESULT f_opendir (DIR *dp, const TCHAR *path)
 Create a Directory Object. More...
 
FRESULT f_closedir (DIR *dp)
 Close Directory. More...
 
FRESULT f_readdir (DIR *dp, FILINFO *fno)
 Read Directory Entries in Sequence. More...
 
FRESULT f_mkdir (const TCHAR *path)
 Create a Directory. More...
 
FRESULT f_unlink (const TCHAR *path)
 Delete a File or Directory. More...
 
FRESULT f_rename (const TCHAR *path_old, const TCHAR *path_new)
 Rename File/Directory. More...
 
FRESULT f_stat (const TCHAR *path, FILINFO *fno)
 Get File Status. More...
 
FRESULT f_chmod (const TCHAR *path, BYTE value, BYTE mask)
 Change Attribute. More...
 
FRESULT f_utime (const TCHAR *path, const FILINFO *fno)
 Change Timestamp. More...
 
FRESULT f_getfree (const TCHAR *path, DWORD *nclst, FATFS **fatfs)
 Get Number of Free Clusters. More...
 
FRESULT f_mount (FATFS *fs, const TCHAR *path, BYTE opt)
 Mount/Unmount a Logical Drive. More...
 
FRESULT f_mkfs (const TCHAR *path, BYTE sfd, UINT au)
 
int f_putc (TCHAR c, FIL *fp)
 
int f_puts (const TCHAR *str, FIL *cp)
 
int f_printf (FIL *fp, const TCHAR *str,...)
 
TCHAR * f_gets (TCHAR *buff, int len, FIL *fp)
 
DWORD get_fattime (void)
 Get the time from the RTC.
This function is used from the FatFs and the function prototype is given by the FatFs module. More...
 
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)
 

Detailed Description

Version
R0.10
Date
2013-10-02
Author
ChaN

Copyright © 2013, ChaN, all right reserved.

FatFs module is a generic FAT file system module for small embedded systems. This is a free software that opened for education, research and commercial developments under license policy of following terms.

  • The FatFs module is a free software and there is NO WARRANTY.
  • No restriction on use. You can use, modify and redistribute it for personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.
  • Redistributions of source code must retain the above copyright notice.

Definition in file ff.h.