| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 | FIL
struct | DIR
struct | FILINFO

## Macros
#define | LD2PD(vol) (BYTE)(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 | f_eof(fp) (((fp)->fptr == (fp)->fsize) ? 1 : 0)
#define | f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
#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__ERROR 0x80
#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
#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 }

## Functions
FRESULT | f_mount (BYTE, FATFS *)
FRESULT | f_open (FIL *, const TCHAR *, BYTE)
FRESULT | f_read (FIL *, void *, UINT, UINT *)
FRESULT | f_lseek (FIL *, DWORD)
FRESULT | f_close (FIL *)
FRESULT | f_opendir (DIR *, const TCHAR *)
FRESULT | f_readdir (DIR *, FILINFO *)
FRESULT | f_stat (const TCHAR *, FILINFO *)
FRESULT | f_write (FIL *, const void *, UINT, UINT *)
FRESULT | f_getfree (const TCHAR *, DWORD *, FATFS **)
FRESULT | f_truncate (FIL *)
FRESULT | f_sync (FIL *)
FRESULT | f_unlink (const TCHAR *)
FRESULT | f_mkdir (const TCHAR *)
FRESULT | f_chmod (const TCHAR *, BYTE, BYTE)
FRESULT | f_utime (const TCHAR *, const FILINFO *)
FRESULT | f_rename (const TCHAR *, const TCHAR *)
FRESULT | f_chdrive (BYTE)
FRESULT | f_chdir (const TCHAR *)
FRESULT | f_getcwd (TCHAR *, UINT)
FRESULT | f_forward (FIL *, UINT(*)(const BYTE *, UINT), UINT, UINT *)
FRESULT | f_mkfs (BYTE, BYTE, UINT)
FRESULT | f_fdisk (BYTE, const DWORD[], void *)
int | f_putc (TCHAR, FIL *)
int | f_puts (const TCHAR *, FIL *)
int | f_printf (FIL *, const TCHAR *,...)
TCHAR * | f_gets (TCHAR *, int, FIL *)
DWORD | get_fattime (void)
| User Provided Timer Function for FatFs module.

## Macro Definition Documentation

#define AM_ARC 0x20 /* Archive */

Definition at line 309 of file ff.h.

#define AM_DIR 0x10 /* Directory */

Definition at line 308 of file ff.h.

#define AM_HID 0x02 /* Hidden */

Definition at line 304 of file ff.h.

#define AM_LFN 0x0F /* LFN entry */

Definition at line 307 of file ff.h.

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

Definition at line 310 of file ff.h.

#define AM_RDO 0x01 /* Read only */

Definition at line 303 of file ff.h.

#define AM_SYS 0x04 /* System */

Definition at line 305 of file ff.h.

#define AM_VOL 0x08 /* Volume label */

Definition at line 306 of file ff.h.

#define CREATE_LINKMAP 0xFFFFFFFF

Definition at line 314 of file ff.h.

#define EOF (-1)

Definition at line 239 of file ff.h.

#define f_eof | ( |  | fp | ) | (((fp)->fptr == (fp)->fsize) ? 1 : 0)

Definition at line 233 of file ff.h.

#define f_error | ( |  | fp | ) | (((fp)->flag & FA__ERROR) ? 1 : 0)

Definition at line 234 of file ff.h.

#define f_size | ( |  | fp | ) | ((fp)->fsize)

Definition at line 236 of file ff.h.

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

Definition at line 235 of file ff.h.

#define FA__DIRTY 0x40

Definition at line 290 of file ff.h.

#define FA__ERROR 0x80

Definition at line 282 of file ff.h.

#define FA__WRITTEN 0x20

Definition at line 289 of file ff.h.

#define FA_CREATE_ALWAYS 0x08

Definition at line 287 of file ff.h.

#define FA_CREATE_NEW 0x04

Definition at line 286 of file ff.h.

#define FA_OPEN_ALWAYS 0x10

Definition at line 288 of file ff.h.

#define FA_OPEN_EXISTING 0x00

Definition at line 281 of file ff.h.

#define FA_READ 0x01

Definition at line 280 of file ff.h.

#define FA_WRITE 0x02

Definition at line 285 of file ff.h.

#define FS_FAT12 1

Definition at line 296 of file ff.h.

#define FS_FAT16 2

Definition at line 297 of file ff.h.

#define FS_FAT32 3

Definition at line 298 of file ff.h.

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

Definition at line 45 of file ff.h.

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

Definition at line 46 of file ff.h.

#define LD_DWORD | ( |  | ptr | ) | (DWORD)(((DWORD)*((BYTE*)(ptr)+3)<<24)|((DWORD)*((BYTE*)(ptr)+2)<<16)|((WORD)*((BYTE*)(ptr)+1)<<8)|*(BYTE*)(ptr))

Definition at line 328 of file ff.h.

#define LD_WORD | ( |  | ptr | ) | (WORD)(((WORD)*((BYTE*)(ptr)+1)<<8)|(WORD)*(BYTE*)(ptr))

Definition at line 327 of file ff.h.

#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)

Definition at line 330 of file ff.h.

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

Definition at line 329 of file ff.h.

## Typedef Documentation

typedef char TCHAR

Definition at line 66 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 177 of file ff.h.

## Function Documentation

FRESULT f_chdir | ( | const TCHAR * |  | ) |

FRESULT f_chdrive | ( | BYTE |  | ) |

FRESULT f_chmod | ( | const TCHAR * | ,
|  | BYTE | ,
|  | BYTE |
| ) |  |

Definition at line 3391 of file ff.c.

FRESULT f_close | ( | FIL * |  | ) |

Definition at line 2684 of file ff.c.

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 ** |
| ) |  |

Definition at line 3133 of file ff.c.

TCHAR* f_gets | ( | TCHAR * | ,
|  | int | ,
|  | FIL * |
| ) |  |

FRESULT f_lseek | ( | FIL * | ,
|  | DWORD |
| ) |  |

Definition at line 2853 of file ff.c.

FRESULT f_mkdir | ( | const TCHAR * |  | ) |

Definition at line 3318 of file ff.c.

FRESULT f_mkfs | ( | BYTE | ,
|  | BYTE | ,
|  | UINT |
| ) |  |

FRESULT f_mount | ( | BYTE | ,
|  | FATFS * |
| ) |  |

Definition at line 2244 of file ff.c.

FRESULT f_open | ( | FIL * | ,
|  | const TCHAR * | ,
|  | BYTE |
| ) |  |

Definition at line 2284 of file ff.c.

FRESULT f_opendir | ( | DIR * | ,
|  | const TCHAR * |
| ) |  |

Definition at line 3011 of file ff.c.

int f_printf | ( | FIL * | ,
|  | const TCHAR * | ,
|  |  | ...
| ) |  |

int f_putc | ( | TCHAR | ,
|  | FIL * |
| ) |  |

int f_puts | ( | const TCHAR * | ,
|  | FIL * |
| ) |  |

FRESULT f_read | ( | FIL * | ,
|  | void * | ,
|  | UINT | ,
|  | UINT * |
| ) |  |

Definition at line 2416 of file ff.c.

FRESULT f_readdir | ( | DIR * | ,
|  | FILINFO * |
| ) |  |

Definition at line 3058 of file ff.c.

FRESULT f_rename | ( | const TCHAR * | ,
|  | const TCHAR * |
| ) |  |

Definition at line 3474 of file ff.c.

FRESULT f_stat | ( | const TCHAR * | ,
|  | FILINFO * |
| ) |  |

Definition at line 3100 of file ff.c.

FRESULT f_sync | ( | FIL * |  | ) |

Definition at line 2636 of file ff.c.

FRESULT f_truncate | ( | FIL * |  | ) |

Definition at line 3200 of file ff.c.

FRESULT f_unlink | ( | const TCHAR * |  | ) |

Definition at line 3250 of file ff.c.

FRESULT f_utime | ( | const TCHAR * | ,
|  | const FILINFO * |
| ) |  |

Definition at line 3433 of file ff.c.

FRESULT f_write | ( | FIL * | ,
|  | const void * | ,
|  | UINT | ,
|  | UINT * |
| ) |  |

Definition at line 2517 of file ff.c.

DWORD get_fattime | ( | void |  | ) |

User Provided Timer Function for FatFs module.

Returns
  Nothing

Note
  This is a real time clock service to be called from FatFs module. Any valid time must be returned even if the system does not support a real time clock. This is not required in read-only configuration.

Definition at line 87 of file rtc.c.