FATFS

From uGFX Wiki
Revision as of 19:46, 1 July 2014 by Tectu (Talk | contribs) (Created page with "The GFILE module uses the well known [http://www.elm-chan.org/fsw/ff/00index_e.html elm-chan FatFS library] to provide built-in support to access FatFS file systems. == Disk...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The GFILE module uses the well known elm-chan FatFS library to provide built-in support to access FatFS file systems.

Disk interface

Unless you are using ChibiOS/RT, you have to provide a file called diskio.c which is pretty much like the board files of the GDISP module. It's purpose is to abstract the I/O interface to your disk. You can use the existing ChibiOS/RT file as a template. It can be found under /src/gfile/fatfs/fatfs_chibios_diskio.c.

Configuration

FatFS comes with its own configuration file. We do provide a default configuration, however, in most cases the users wants to overwrite it with his own parameters. You can copy the existing config (/src/gfile/fatfs/src/ffconf.h). Modify it and place it in your project directory.

Mounting

Before a FatFS volume can be accessed, it needs to be mounted. By default, GFILE does automatically mount the default volume. If you want to do this yourself or mount a different volume, set GFILE_NEED_NOAUTOMOUNT to TRUE in your gfxconf.h and manually use gfileMount().

Multiple volumes

It is currently not possible to have more than one volume mounted at a time. This restriction will be removed in the future.

Licensing

The FatFS library is 3rd party software and does therefore not stand under the uGFX license. However, the FatFS license allows a restriction free use.

/*----------------------------------------------------------------------------/
/  FatFs - FAT file system module  R0.10b                    (C)ChaN, 2014
/-----------------------------------------------------------------------------/
/ FatFs module is a generic FAT file system module for small embedded systems.
/ This is a free software that opened for education, research and commercial
/ developments under license policy of following trems.
/
/  Copyright (C) 2014, ChaN, all right reserved.
/
/ * The FatFs module is a free software and there is NO WARRANTY.
/ * No restriction on use. You can use, modify and redistribute it for
/   personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.
/ * Redistributions of source code must retain the above copyright notice.
/
/-----------------------------------------------------------------------------/