# 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 limited memory even if the RAM size is less than sector size. Also full featured FAT file system module is available here↗.

#### Features

- Very small RAM consumption (44 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 a Volume
- pf_open - Open a File
- pf_read - Read File
- pf_write - Write File
- pf_lseek - Move read/write 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 data from storage device. 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 storage device
- disk_readp - Read a partial sector
- disk_writep - Divided write to a 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↗
- Read first: Petit FatFs module application note June 10, 2014
- Latest Information: http://elm-chan.org/fsw/ff/00index_p.html↗
- 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