File Allocation Table File System (FATFS) Driver.
The SDFatFS header file should be included in an application as follows:
The SDFatFS driver is designed to hook into FatFs by implementing a set of functions that FatFs needs to call to perform basic block data transfers. This driver makes use of the SD driver for lower level disk IO operations.
The only functions that should be called by the application are the standard driver framework functions (_open, _close, etc...).
The application may use the FatFs APIs or the standard C runtime file I/O calls (fopen, fclose, etc...) given that SDFatFS_open has has been successfully called. After the SDFatFS_close API is called, ensure the application does NOT make any file I/O calls.
The SDFatFS driver interface produces log statements if instrumentation is enabled.
Diagnostics Mask | Log details |
---|---|
Diags_USER1 | basic operations performed |
Diags_USER2 | detailed operations performed |
============================================================================
#include <stdint.h>
#include <ti/drivers/SD.h>
#include <third_party/fatfs/ff.h>
#include <third_party/fatfs/diskio.h>
Go to the source code of this file.
Data Structures | |
struct | SDFatFS_Object |
SDFatFS Object The application must not access any member variables of this structure! More... | |
struct | SDFatFS_Config |
SDFatFS Global configuration. More... | |
Typedefs | |
typedef SDFatFS_Config * | SDFatFS_Handle |
A handle that is returned from a SDFatFS_open() call. More... | |
Functions | |
SDFatFS_Handle | SDFatFS_open (uint_least8_t idx, uint_least8_t drive) |
Function to open a SDFatFS instance on the specified drive. More... | |
void | SDFatFS_close (SDFatFS_Handle handle) |
Function to close a SDFatFS instance specified by the SDFatFS handle. More... | |
void | SDFatFS_init (void) |
typedef SDFatFS_Config* SDFatFS_Handle |
A handle that is returned from a SDFatFS_open() call.
SDFatFS_Handle SDFatFS_open | ( | uint_least8_t | idx, |
uint_least8_t | drive | ||
) |
Function to open a SDFatFS instance on the specified drive.
Function to mount the FatFs filesystem and register the SDFatFS disk I/O functions with the FatFS module.
idx | Logical peripheral number indexed into the HWAttrs table. |
drive | Drive Number |
void SDFatFS_close | ( | SDFatFS_Handle | handle | ) |
Function to close a SDFatFS instance specified by the SDFatFS handle.
This function unmounts the file system mounted by SDFatFS_open() and unregisters the SDFatFS driver from the FatFs module.
handle | A SDFatFS_Handle returned from SDFatFS_open() |
void SDFatFS_init | ( | void | ) |
Function to initialize a SDFatFS instance