►Introduction to Chan’s Library

First of all, if you haven’t downloaded Chan’s source code, you should do this first. You can get from him at this link:

http://elm-chan.org/fsw/ff/00index_e.html

When you unzip this file, use the default directories and you will end up with a directory structure like this:

elm chan FAT16 files


Chan has included examples for a variety of processors. The basic set of routines are found in the src subdirectory. As he notes in his readme file, the files included here are:

FileDescription
ff.hCommon include file for FatFs and application module.
ff.cFatFs Module
tff.hCommon include file for Tiny-FatFs and application module.
tff.cTiny-FatFs module.
diskio.hCommon include file for (Tiny-)FatFs and disk I/O module.
diskio.cSkeleton of low level disk I/O module.
integer.hAlternative type definitions for integer variables.

Chan also states that

the low level disk I/O module is not included in this archive because the FatFs/Tiny-FatFs module is only a generic file system layer and not dependent on any specific storage device. You have to provide a low level disk I/O module that is written to control your storage device.

chan


That is the intent behind this tutorial – to show you how to write the low level disk I/O module so the file system layer can work properly.


Tutorial Index
Interface to Chan’s Library of functions SD Card Initialization
Target development platform Reading and Writing a single sector
Setting up the SPI port during startup.A51 Working with diskio.c
Global type definitions and variables Pulling it all together
Basic SPI function Index Page

Downloads

Comments

ArnoldDiant
Fri Apr 26 2024, 03:53 am
RodneyKnorb
Thu Apr 25 2024, 07:08 pm
Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm
Charlestehed
Wed Apr 24 2024, 05:20 pm