## FATFS

The `FATFS` structure holds dynamic work area of the logical drive and a file. It is given by application program and registerd/unregisterd to the Petit FatFs module with pf_mount function. There is no member that can be changed by application programs.

    typedef struct {
    	BYTE	fs_type;	/* FAT sub type */
    	BYTE	csize;		/* Number of sectors per cluster */
    	BYTE	flag;		/* File status flags */
    	BYTE	csect;		/* File sector address in the cluster */
    	WORD	n_rootdir;	/* Number of root directory entries (0 on FAT32) */
    	BYTE*	buf;		/* Pointer to the disk access buffer */
    	CLUST	max_clust;	/* Maximum cluster# + 1. Number of clusters is max_clust - 2 */
    	DWORD	fatbase;	/* FAT start sector */
    	DWORD	dirbase;	/* Root directory start sector (Cluster# on FAT32) */
    	DWORD	database;	/* Data start sector */
    	DWORD	fptr;		/* File read/write pointer */
    	DWORD	fsize;		/* File size */
    	CLUST	org_clust;	/* File start cluster */
    	CLUST	curr_clust;	/* File current cluster */
    	DWORD	dsect;		/* File current data sector */
    } FATFS;

Return