ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts  1.0
ESP8266ILI9341DisplayProject
Data Structures | Macros | Typedefs | Enumerations | Functions
ff.h File Reference
#include "integer.h"
#include "ffconf.h"

Go to the source code of this file.

Data Structures

struct  FATFS
 
struct  _FDID
 
struct  FIL
 
struct  DIR
 
struct  FILINFO
 

Macros

#define _FATFS   68020 /* 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)   ((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 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
}
 

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)
 
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)
 Read time and convert to FAT32 time. More...
 
WCHAR ff_convert (WCHAR chr, UINT dir)
 
WCHAR ff_wtoupper (WCHAR chr)
 
void * ff_memalloc (UINT msize)
 
void ff_memfree (void *mblock)
 

Macro Definition Documentation

#define _FATFS   68020 /* Revision ID */

Definition at line 22 of file ff.h.

#define _T (   x)    x

Definition at line 70 of file ff.h.

#define _TEXT (   x)    x

Definition at line 71 of file ff.h.

#define AM_ARC   0x20 /* Archive */

Definition at line 359 of file ff.h.

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

#define AM_DIR   0x10 /* Directory */
#define AM_HID   0x02 /* Hidden */

Definition at line 356 of file ff.h.

Referenced by f_chmod(), and fatfs_filinfo_list().

#define AM_RDO   0x01 /* Read only */

Definition at line 355 of file ff.h.

Referenced by chmod(), f_chmod(), f_open(), f_unlink(), fatfs_filinfo_list(), and stat().

#define AM_SYS   0x04 /* System */

Definition at line 357 of file ff.h.

Referenced by f_chmod(), fatfs_filinfo_list(), and stat().

#define CREATE_LINKMAP   ((FSIZE_t)0 - 1)

Definition at line 339 of file ff.h.

Referenced by f_lseek().

#define EOF   (-1)

Definition at line 290 of file ff.h.

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

Definition at line 282 of file ff.h.

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

Definition at line 283 of file ff.h.

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

Definition at line 286 of file ff.h.

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

Definition at line 287 of file ff.h.

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

Definition at line 285 of file ff.h.

Referenced by lseek(), and open().

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

Definition at line 284 of file ff.h.

Referenced by fatfs_getc(), and lseek().

#define FA_CREATE_ALWAYS   0x08

Definition at line 334 of file ff.h.

Referenced by f_open(), fatfs_ls(), and open().

#define FA_CREATE_NEW   0x04

Definition at line 333 of file ff.h.

Referenced by f_open().

#define FA_OPEN_ALWAYS   0x10

Definition at line 335 of file ff.h.

Referenced by f_open(), and open().

#define FA_OPEN_APPEND   0x30

Definition at line 336 of file ff.h.

Referenced by f_open().

#define FA_OPEN_EXISTING   0x00

Definition at line 332 of file ff.h.

Referenced by fatfs_ls(), and truncate().

#define FA_READ   0x01

Definition at line 330 of file ff.h.

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

#define FA_WRITE   0x02
#define FM_ANY   0x07

Definition at line 345 of file ff.h.

Referenced by f_mkfs().

#define FM_EXFAT   0x04

Definition at line 344 of file ff.h.

Referenced by f_mkfs().

#define FM_FAT   0x01

Definition at line 342 of file ff.h.

Referenced by f_mkfs().

#define FM_FAT32   0x02

Definition at line 343 of file ff.h.

Referenced by f_mkfs(), fatfs_tests(), and mkfs().

#define FM_SFD   0x08

Definition at line 346 of file ff.h.

Referenced by f_mkfs().

#define FS_EXFAT   4
#define FS_FAT12   1

Definition at line 349 of file ff.h.

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

#define FS_FAT16   2

Definition at line 350 of file ff.h.

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

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

Definition at line 49 of file ff.h.

Referenced by f_mkfs(), and find_volume().

#define LD2PT (   vol)    0 /* Find first valid partition or in SFD */

Definition at line 50 of file ff.h.

Referenced by f_mkfs(), and find_volume().

Typedef Documentation

typedef DWORD FSIZE_t

Definition at line 85 of file ff.h.

typedef char TCHAR

Definition at line 69 of file ff.h.

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 

Definition at line 220 of file ff.h.

Function Documentation

FRESULT f_chdir ( const TCHAR path)

Definition at line 3866 of file ff.c.

Referenced by chdir(), and fatfs_ls().

FRESULT f_chdrive ( const TCHAR path)

Referenced by f_close().

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

Definition at line 4823 of file ff.c.

Referenced by chmod(), and fatfs_tests().

FRESULT f_close ( FIL fp)

Definition at line 3808 of file ff.c.

Referenced by close(), fatfs_ls(), and open().

FRESULT f_closedir ( DIR dp)

Definition at line 4226 of file ff.c.

Referenced by closedir().

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

Definition at line 5133 of file ff.c.

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

Referenced by f_mkfs().

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

Definition at line 4323 of file ff.c.

FRESULT f_findnext ( DIR dp,
FILINFO fno 
)

Definition at line 4297 of file ff.c.

Referenced by f_findfirst().

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

Referenced by f_expand().

FRESULT f_getcwd ( TCHAR buff,
UINT  len 
)

Definition at line 3919 of file ff.c.

Referenced by fatfs_ls(), and getcwd().

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

Definition at line 4387 of file ff.c.

Referenced by fatfs_ls(), and fatfs_status().

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

Definition at line 4915 of file ff.c.

Referenced by fatfs_status().

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

Definition at line 5826 of file ff.c.

FRESULT f_lseek ( FIL fp,
FSIZE_t  ofs 
)

Definition at line 4000 of file ff.c.

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

FRESULT f_mkdir ( const TCHAR path)

Definition at line 4622 of file ff.c.

Referenced by fatfs_ls(), and mkdir().

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

Definition at line 5296 of file ff.c.

Referenced by fatfs_tests(), and mkfs().

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

Definition at line 3255 of file ff.c.

Referenced by fatfs_tests(), mkfs(), and mmc_init().

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

Definition at line 3304 of file ff.c.

Referenced by fatfs_ls(), open(), and truncate().

FRESULT f_opendir ( DIR dp,
const TCHAR path 
)

Definition at line 4155 of file ff.c.

Referenced by f_findfirst(), fatfs_ls(), fatfs_scan_files(), and opendir().

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

Definition at line 6040 of file ff.c.

int f_putc ( TCHAR  c,
FIL fp 
)

Definition at line 5998 of file ff.c.

int f_puts ( const TCHAR str,
FIL cp 
)

Definition at line 6019 of file ff.c.

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

Definition at line 3506 of file ff.c.

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

FRESULT f_readdir ( DIR dp,
FILINFO fno 
)

Definition at line 4260 of file ff.c.

Referenced by f_findnext(), fatfs_ls(), fatfs_scan_files(), and readdir().

FRESULT f_rename ( const TCHAR path_old,
const TCHAR path_new 
)

Definition at line 4716 of file ff.c.

Referenced by fatfs_ls(), and rename().

FRESULT f_setlabel ( const TCHAR label)

Definition at line 5005 of file ff.c.

FRESULT f_stat ( const TCHAR path,
FILINFO fno 
)

Definition at line 4351 of file ff.c.

Referenced by fatfs_ls(), and stat().

FRESULT f_sync ( FIL fp)

Definition at line 3729 of file ff.c.

Referenced by f_close(), and syncfs().

FRESULT f_truncate ( FIL fp)

Definition at line 4475 of file ff.c.

Referenced by ftruncate(), and truncate().

FRESULT f_unlink ( const TCHAR path)

Definition at line 4526 of file ff.c.

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

FRESULT f_utime ( const TCHAR path,
const FILINFO fno 
)

Definition at line 4869 of file ff.c.

Referenced by utime().

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

Definition at line 3607 of file ff.c.

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

WCHAR ff_convert ( WCHAR  chr,
UINT  dir 
)

Definition at line 275 of file ccsbcs.c.

Referenced by create_name(), f_getlabel(), f_gets(), f_setlabel(), get_fileinfo(), putc_bfd(), and sum_sfn().

void* ff_memalloc ( UINT  msize)
void ff_memfree ( void *  mblock)
WCHAR ff_wtoupper ( WCHAR  chr)

Definition at line 303 of file ccsbcs.c.

Referenced by cmp_lfn(), create_name(), dir_find(), f_mkfs(), f_setlabel(), get_achar(), and sum_sfn().

DWORD get_fattime ( void  )

Read time and convert to FAT32 time.

Returns
FAT32 time.
See also
tm_to_fat().

Definition at line 130 of file fatfs_sup.c.

Referenced by rtc_read().