APM:Libraries
Classes | Macros | Typedefs | Enumerations | Functions
ff.h File Reference
#include "integer.h"
#include "ffconf.h"
#include <util.h>
#include <string.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.

Classes

struct  FATFS
 
struct  FFOBJID
 
struct  FIL
 
struct  DIR
 
struct  FILINFO
 

Macros

#define FF_DEFINED   63463 /* Revision ID */
 
#define _INC_TCHAR
 
#define _T(x)   x
 
#define _TEXT(x)   x
 
#define f_eof(fp)   ((int)((fp)->fptr == (fp)->obj.objsize))
 
#define f_error(fp)   ((fp)->err)
 
#define f_tell(fp)   ((fp)->fptr)
 
#define f_size(fp)   ((fp)->obj.objsize)
 
#define f_rewind(fp)   f_lseek((fp), 0)
 
#define f_rewinddir(dp)   f_readdir((dp), 0)
 
#define f_rmdir(path)   f_unlink(path)
 
#define f_unmount(path)   f_mount(0, path, 0)
 
#define EOF   (-1)
 
#define FA_READ   0x01
 
#define FA_WRITE   0x02
 
#define FA_OPEN_EXISTING   0x00
 
#define FA_CREATE_NEW   0x04
 
#define FA_CREATE_ALWAYS   0x08
 
#define FA_OPEN_ALWAYS   0x10
 
#define FA_OPEN_APPEND   0x30
 
#define CREATE_LINKMAP   ((FSIZE_t)0 - 1)
 
#define FM_FAT   0x01
 
#define FM_FAT32   0x02
 
#define FM_EXFAT   0x04
 
#define FM_ANY   0x07
 
#define FM_SFD   0x08
 
#define FS_FAT12   1
 
#define FS_FAT16   2
 
#define FS_FAT32   3
 
#define FS_EXFAT   4
 
#define AM_RDO   0x01 /* Read only */
 
#define AM_HID   0x02 /* Hidden */
 
#define AM_SYS   0x04 /* System */
 
#define AM_DIR   0x10 /* Directory */
 
#define AM_ARC   0x20 /* Archive */
 

Typedefs

typedef char TCHAR
 
typedef DWORD FSIZE_t
 

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,
  FR_IS_DIR
}
 

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_lseek (FIL *fp, FSIZE_t 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_findfirst (DIR *dp, FILINFO *fno, const TCHAR *path, const TCHAR *pattern)
 
FRESULT f_findnext (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 attr, 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_forward (FIL *fp, UINT(*func)(const BYTE *, UINT), UINT btf, UINT *bf)
 
FRESULT f_expand (FIL *fp, FSIZE_t szf, BYTE opt)
 
FRESULT f_mount (FATFS *fs, const TCHAR *path, BYTE opt)
 
FRESULT f_mkfs (const TCHAR *path, BYTE opt, DWORD au, void *work, UINT len)
 
FRESULT f_fdisk (BYTE pdrv, const DWORD *szt, void *work)
 
FRESULT f_setcp (WORD cp)
 
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)
 
FRESULT find_volume (const TCHAR **path, FATFS **rfs, BYTE mode)
 
DWORD get_fattime (void)
 

Macro Definition Documentation

◆ _INC_TCHAR

#define _INC_TCHAR

Definition at line 61 of file ff.h.

◆ _T

#define _T (   x)    x

Definition at line 79 of file ff.h.

◆ _TEXT

#define _TEXT (   x)    x

Definition at line 80 of file ff.h.

◆ AM_ARC

#define AM_ARC   0x20 /* Archive */

Definition at line 388 of file ff.h.

Referenced by dir_read(), f_open(), f_rename(), and f_sync().

◆ AM_DIR

#define AM_DIR   0x10 /* Directory */

Definition at line 387 of file ff.h.

Referenced by f_close(), f_mkdir(), f_open(), f_opendir(), f_rename(), f_unlink(), follow_path(), st_clust(), and stat().

◆ AM_HID

#define AM_HID   0x02 /* Hidden */

Definition at line 385 of file ff.h.

Referenced by f_rename().

◆ AM_RDO

#define AM_RDO   0x01 /* Read only */

Definition at line 384 of file ff.h.

Referenced by chmod(), f_open(), f_rename(), f_unlink(), and stat().

◆ AM_SYS

#define AM_SYS   0x04 /* System */

Definition at line 386 of file ff.h.

Referenced by f_rename(), and stat().

◆ CREATE_LINKMAP

#define CREATE_LINKMAP   ((FSIZE_t)0 - 1)

Definition at line 368 of file ff.h.

Referenced by f_lseek().

◆ EOF

#define EOF   (-1)

◆ f_eof

#define f_eof (   fp)    ((int)((fp)->fptr == (fp)->obj.objsize))

Definition at line 308 of file ff.h.

◆ f_error

#define f_error (   fp)    ((fp)->err)

Definition at line 309 of file ff.h.

◆ f_rewind

#define f_rewind (   fp)    f_lseek((fp), 0)

Definition at line 312 of file ff.h.

◆ f_rewinddir

#define f_rewinddir (   dp)    f_readdir((dp), 0)

Definition at line 313 of file ff.h.

◆ f_rmdir

#define f_rmdir (   path)    f_unlink(path)

Definition at line 314 of file ff.h.

◆ f_size

#define f_size (   fp)    ((fp)->obj.objsize)

Definition at line 311 of file ff.h.

Referenced by lseek(), and open().

◆ f_tell

#define f_tell (   fp)    ((fp)->fptr)

Definition at line 310 of file ff.h.

Referenced by fatfs_getc().

◆ f_unmount

#define f_unmount (   path)    f_mount(0, path, 0)

Definition at line 315 of file ff.h.

◆ FA_CREATE_ALWAYS

#define FA_CREATE_ALWAYS   0x08

Definition at line 363 of file ff.h.

Referenced by f_open(), and open().

◆ FA_CREATE_NEW

#define FA_CREATE_NEW   0x04

Definition at line 362 of file ff.h.

Referenced by f_open().

◆ FA_OPEN_ALWAYS

#define FA_OPEN_ALWAYS   0x10

Definition at line 364 of file ff.h.

Referenced by f_open(), and open().

◆ FA_OPEN_APPEND

#define FA_OPEN_APPEND   0x30

Definition at line 365 of file ff.h.

Referenced by f_open().

◆ FA_OPEN_EXISTING

#define FA_OPEN_EXISTING   0x00

Definition at line 361 of file ff.h.

Referenced by truncate().

◆ FA_READ

#define FA_READ   0x01

Definition at line 359 of file ff.h.

Referenced by f_open(), f_read(), f_rename(), find_volume(), open(), and truncate().

◆ FA_WRITE

#define FA_WRITE   0x02

Definition at line 360 of file ff.h.

Referenced by f_lseek(), f_mkdir(), f_open(), f_rename(), f_truncate(), f_unlink(), f_write(), open(), and truncate().

◆ FF_DEFINED

#define FF_DEFINED   63463 /* Revision ID */

Definition at line 23 of file ff.h.

◆ FM_ANY

#define FM_ANY   0x07

Definition at line 374 of file ff.h.

Referenced by f_mkfs().

◆ FM_EXFAT

#define FM_EXFAT   0x04

Definition at line 373 of file ff.h.

Referenced by f_mkfs().

◆ FM_FAT

#define FM_FAT   0x01

Definition at line 371 of file ff.h.

Referenced by f_mkfs().

◆ FM_FAT32

#define FM_FAT32   0x02

Definition at line 372 of file ff.h.

Referenced by f_mkfs().

◆ FM_SFD

#define FM_SFD   0x08

Definition at line 375 of file ff.h.

Referenced by f_mkfs().

◆ FS_EXFAT

#define FS_EXFAT   4

◆ FS_FAT12

#define FS_FAT12   1

Definition at line 378 of file ff.h.

Referenced by f_getfree(), f_mkfs(), find_volume(), get_fat(), and put_fat().

◆ FS_FAT16

#define FS_FAT16   2

Definition at line 379 of file ff.h.

Referenced by f_getfree(), f_mkfs(), find_volume(), get_fat(), and put_fat().

◆ FS_FAT32

#define FS_FAT32   3

Definition at line 380 of file ff.h.

Referenced by dir_sdi(), f_mkfs(), f_rename(), find_volume(), get_fat(), ld_clust(), put_fat(), st_clust(), and sync_fs().

Typedef Documentation

◆ FSIZE_t

typedef DWORD FSIZE_t

Definition at line 92 of file ff.h.

◆ TCHAR

typedef char TCHAR

Definition at line 78 of file ff.h.

Enumeration Type Documentation

◆ FRESULT

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 
FR_IS_DIR 

Definition at line 243 of file ff.h.

Function Documentation

◆ f_chdir()

FRESULT f_chdir ( const TCHAR path)

Referenced by chdir(), and f_close().

Here is the caller graph for this function:

◆ f_chdrive()

FRESULT f_chdrive ( const TCHAR path)

Referenced by f_close().

Here is the caller graph for this function:

◆ f_chmod()

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

Referenced by chmod(), and f_rename().

Here is the caller graph for this function:

◆ f_close()

FRESULT f_close ( FIL fp)

Definition at line 4026 of file ff.c.

Referenced by close(), and open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_closedir()

FRESULT f_closedir ( DIR dp)

Definition at line 4467 of file ff.c.

Referenced by closedir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_expand()

FRESULT f_expand ( FIL fp,
FSIZE_t  szf,
BYTE  opt 
)

Referenced by f_rename().

Here is the caller graph for this function:

◆ f_fdisk()

FRESULT f_fdisk ( BYTE  pdrv,
const DWORD szt,
void *  work 
)

Referenced by f_mkfs().

Here is the caller graph for this function:

◆ f_findfirst()

FRESULT f_findfirst ( DIR dp,
FILINFO fno,
const TCHAR path,
const TCHAR pattern 
)

Definition at line 4558 of file ff.c.

Here is the call graph for this function:

◆ f_findnext()

FRESULT f_findnext ( DIR dp,
FILINFO fno 
)

Definition at line 4533 of file ff.c.

Referenced by f_findfirst().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_forward()

FRESULT f_forward ( FIL fp,
UINT(*)(const BYTE *, UINT func,
UINT  btf,
UINT bf 
)

Referenced by f_rename().

Here is the caller graph for this function:

◆ f_getcwd()

FRESULT f_getcwd ( TCHAR buff,
UINT  len 
)

Referenced by f_close(), and getcwd().

Here is the caller graph for this function:

◆ f_getfree()

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

Definition at line 4620 of file ff.c.

Referenced by fs_getfree(), and fs_gettotal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_getlabel()

FRESULT f_getlabel ( const TCHAR path,
TCHAR label,
DWORD vsn 
)

Referenced by f_rename().

Here is the caller graph for this function:

◆ f_gets()

TCHAR* f_gets ( TCHAR buff,
int  len,
FIL fp 
)

Definition at line 6069 of file ff.c.

Here is the call graph for this function:

◆ f_lseek()

FRESULT f_lseek ( FIL fp,
FSIZE_t  ofs 
)

Definition at line 4240 of file ff.c.

Referenced by fatfs_getc(), ftruncate(), lseek(), open(), and truncate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_mkdir()

FRESULT f_mkdir ( const TCHAR path)

Definition at line 4853 of file ff.c.

Referenced by mkdir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_mkfs()

FRESULT f_mkfs ( const TCHAR path,
BYTE  opt,
DWORD  au,
void *  work,
UINT  len 
)

Definition at line 5521 of file ff.c.

Here is the call graph for this function:

◆ f_mount()

FRESULT f_mount ( FATFS fs,
const TCHAR path,
BYTE  opt 
)

Definition at line 3482 of file ff.c.

Referenced by sdcard_init(), and sdcard_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_open()

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

Definition at line 3530 of file ff.c.

Referenced by open(), and truncate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_opendir()

FRESULT f_opendir ( DIR dp,
const TCHAR path 
)

Definition at line 4401 of file ff.c.

Referenced by f_findfirst(), and opendir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_printf()

int f_printf ( FIL fp,
const TCHAR str,
  ... 
)

Definition at line 6408 of file ff.c.

Here is the call graph for this function:

◆ f_putc()

int f_putc ( TCHAR  c,
FIL fp 
)

Definition at line 6368 of file ff.c.

Here is the call graph for this function:

◆ f_puts()

int f_puts ( const TCHAR str,
FIL cp 
)

Definition at line 6388 of file ff.c.

Here is the call graph for this function:

◆ f_read()

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

Definition at line 3721 of file ff.c.

Referenced by f_gets(), fatfs_getc(), and read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_readdir()

FRESULT f_readdir ( DIR dp,
FILINFO fno 
)

Definition at line 4497 of file ff.c.

Referenced by f_findnext(), and readdir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_rename()

FRESULT f_rename ( const TCHAR path_old,
const TCHAR path_new 
)

Definition at line 4941 of file ff.c.

Referenced by rename().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_setcp()

FRESULT f_setcp ( WORD  cp)

Referenced by f_printf().

Here is the caller graph for this function:

◆ f_setlabel()

FRESULT f_setlabel ( const TCHAR label)

Referenced by f_rename().

Here is the caller graph for this function:

◆ f_stat()

FRESULT f_stat ( const TCHAR path,
FILINFO fno 
)

Definition at line 4585 of file ff.c.

Referenced by stat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_sync()

FRESULT f_sync ( FIL fp)

Definition at line 3945 of file ff.c.

Referenced by f_close(), fsync(), and syncfs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_truncate()

FRESULT f_truncate ( FIL fp)

Definition at line 4709 of file ff.c.

Referenced by ftruncate(), and truncate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_unlink()

FRESULT f_unlink ( const TCHAR path)

Definition at line 4759 of file ff.c.

Referenced by remove(), rmdir(), and unlink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_utime()

FRESULT f_utime ( const TCHAR path,
const FILINFO fno 
)

Referenced by f_rename(), and utime().

Here is the caller graph for this function:

◆ f_write()

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

Definition at line 3821 of file ff.c.

Referenced by fatfs_putc(), putc_bfd(), putc_flush(), and write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_volume()

FRESULT find_volume ( const TCHAR **  path,
FATFS **  rfs,
BYTE  mode 
)

Definition at line 3213 of file ff.c.

Referenced by f_close(), f_getfree(), f_mkdir(), f_mount(), f_open(), f_opendir(), f_rename(), f_stat(), and f_unlink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_fattime()

DWORD get_fattime ( void  )