About CCS C FAT16 library:
- FAT16 read files.
- If the MMC/SD card has Master Boot Record (MBR), the library will work with the first active partition.
- Only short file name is supported (file name + extension < 13 character).
- Only one file can be opened at a time, if a 2nd file is opened the first file will be automatically closed.
- The user can set buffer size starting from 1 byte. Bigger buffer size --> higher speed.
- Letter case insensitive.
- Library functions read files from the root directory only.
- This library requires MMC/SD card driver to communicate with the media.
This library is small and easy to use, it has 4 functions only:
fat16_init():
Initializes the MMC/SD card and reads the FAT16 boot sector to extract necessary data. Return 0 if OK and 1 if an error occurred (for example problem with MMC/SD initialization).
fat16_open_file(int8* fname):
Opens file stream. fname is file name (short file name). Returns 0 if OK and 1 if error (example: file not found, long file name ....).
fat16_read_byte(int8* data):
Reads a byte from the opened file where data is buffer to store read byte to. Returns 0 if OK, 1 if error or end of file is reached.
fat16_read_data(int32 size, int8* data):
This function reads one byte or more which can be set by size where data is the data buffer. Returns 0 if OK, 1 if error or end of file is reached.
Library Download:
DOWNLOAD
Examples:
Read text file from SD card with FAT16 file system using PIC16F877A
Display BMP images from SD card on ST7735 TFT screen
Read and display text file from FAT16 microSD card using PIC18F4550
Read text files from FAT16 SD card with PIC16F887