# Petit FAT File System Module

Petit FatFs is a sub-set of FatFs module for tiny 8-bit microcontrollers. It is written in compliance with ANSI C and completely separated from the disk I/O layer. It can be incorporated into the tiny microcontrollers with a small memory even if the RAM size is less than sector size. Full featured FAT file system module is here.

#### Features

- Very small RAM consumption (46 bytes work area + certain stack).
- Very small code size (2K-4K bytes).
- FAT12, FAT16 and FAT32.
- Single volume and Single file.
- File write function with some restrictions.

### Application Interface

Petit FatFs module provides following functions.

- pf_mount - Mount/Unmount a Volume
- pf_open - Open a File
- pf_read - Read File
- pf_write - Write File
- pf_lseek - Move R/W Pointer
- pf_opendir - Open a Directory
- pf_readdir - Read a Directory Item

### Disk I/O Interface

Since the Petit FatFs module is completely separated from disk I/O layer, it requires following functions to lower layer to read the physical disk. The low level disk I/O module is not a part of Petit FatFs module and it must be provided by user. The sample drivers are also available in the resources.

- disk_initialize - Initialize disk drive
- disk_readp - Read partial sector
- disk_writep - Write partial sector

### Resources

The Petit FatFs module is a free software and is opened for education, research and development. You can use, modify and/or redistribute it for personal, non-profit or commercial use without any restriction under your responsibility. For further information, refer to the application note.

- FatFs User Forum
- Petit FatFs module application note Dec 14, 2009
- FAT32 Specification by Microsoft (The reference document on FAT file system)
- How to Use MMC/SDC
- Benchmark 3 (ATtiny85/8MHz with MMC via USI)

Return