# modules/fatfs/src/ff.c File Reference

`#include "ff.h"`
`#include "diskio.h"`

## Defines
#define | FALSE 0
#define | TRUE 1
#define | ENTER_FF(fs)
#define | LEAVE_FF(fs, res) return res
#define | ABORT(fs, res) { fp->flag |= FA__ERROR; LEAVE_FF(fs, res); }
#define | NULL 0
#define | NS 11
#define | NS_LOSS 0x01
#define | NS_LFN 0x02
#define | NS_LAST 0x04
#define | NS_BODY 0x08
#define | NS_EXT 0x10
#define | NS_DOT 0x20
#define | NAMEBUF(sp, lp) BYTE sp[12]
#define | INITBUF(dj, sp, lp) dj.fn = sp
## Functions
DWORD | get_fat (FATFS *fs, DWORD clst)
FRESULT | put_fat (FATFS *fs, DWORD clst, DWORD val)
DWORD | clust2sect (FATFS *fs, DWORD clst)
FRESULT | chk_mounted (const XCHAR **path, FATFS **rfs, BYTE chk_wp)
FRESULT | f_mount (BYTE vol, FATFS *fs)
FRESULT | f_open (FIL *fp, const XCHAR *path, BYTE mode)
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_sync (FIL *fp)
FRESULT | f_close (FIL *fp)
FRESULT | f_lseek (FIL *fp, DWORD ofs)
FRESULT | f_opendir (DIR *dj, const XCHAR *path)
FRESULT | f_readdir (DIR *dj, FILINFO *fno)
FRESULT | f_stat (const XCHAR *path, FILINFO *fno)
FRESULT | f_getfree (const XCHAR *path, DWORD *nclst, FATFS **fatfs)
FRESULT | f_truncate (FIL *fp)
FRESULT | f_unlink (const XCHAR *path)
FRESULT | f_mkdir (const XCHAR *path)
FRESULT | f_chmod (const XCHAR *path, BYTE value, BYTE mask)
FRESULT | f_utime (const XCHAR *path, const FILINFO *fno)
FRESULT | f_rename (const XCHAR *path_old, const XCHAR *path_new)

## Define Documentation

#define ABORT | ( | fs,
|  | res |  | ) | { fp->flag |= FA__ERROR; LEAVE_FF(fs, res); }

#define ENTER_FF | ( | fs |  | ) |

#define FALSE 0

#define INITBUF | ( | dj,
|  | sp,
|  | lp |  | ) | dj.fn = sp

#define LEAVE_FF | ( | fs,
|  | res |  | ) | return res

#define NAMEBUF | ( | sp,
|  | lp |  | ) | BYTE sp[12]

#define NS 11

#define NS_BODY 0x08

#define NS_DOT 0x20

#define NS_EXT 0x10

#define NS_LAST 0x04

#define NS_LFN 0x02

#define NS_LOSS 0x01

#define NULL 0

#define TRUE 1

## Function Documentation

FRESULT chk_mounted | ( | const XCHAR ** | path,
|  | FATFS ** | rfs,
|  | BYTE | chk_wp |
| ) |  |  |

Here is the call graph for this function:

DWORD clust2sect | ( | FATFS * | fs,
|  | DWORD | clst |
| ) |  |  |

FRESULT f_chmod | ( | const XCHAR * | path,
|  | BYTE | value,
|  | BYTE | mask |
| ) |  |  |

Here is the call graph for this function:

FRESULT f_close | ( | FIL * | fp | ) |

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

FRESULT f_mkdir | ( | const XCHAR * | path | ) |

Here is the call graph for this function:

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

FRESULT f_open | ( | FIL * | fp,
|  | const XCHAR * | path,
|  | BYTE | mode |
| ) |  |  |

Here is the call graph for this function:

FRESULT f_opendir | ( | DIR * | dj,
|  | const XCHAR * | path |
| ) |  |  |

Here is the call graph for this function:

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

Here is the call graph for this function:

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

FRESULT f_rename | ( | const XCHAR * | path_old,
|  | const XCHAR * | path_new |
| ) |  |  |

Here is the call graph for this function:

FRESULT f_stat | ( | const XCHAR * | path,
|  | FILINFO * | fno |
| ) |  |  |

Here is the call graph for this function:

FRESULT f_sync | ( | FIL * | fp | ) |

Here is the call graph for this function:

FRESULT f_truncate | ( | FIL * | fp | ) |

Here is the call graph for this function:

FRESULT f_unlink | ( | const XCHAR * | path | ) |

Here is the call graph for this function:

FRESULT f_utime | ( | const XCHAR * | path,
|  | const FILINFO * | fno |
| ) |  |  |

Here is the call graph for this function:

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

Here is the call graph for this function:

DWORD get_fat | ( | FATFS * | fs,
|  | DWORD | clst |
| ) |  |  |

FRESULT put_fat | ( | FATFS * | fs,
|  | DWORD | clst,
|  | DWORD | val |
| ) |  |  |