RL-ARM User's Guide

FAT Driver

The FAT Driver implements low-level routines to interface to FAT Media devices.

The FAT driver control block is defined in the file File_Config.h as follows:

typedef struct {
  BOOL (*Init)        (U32 mode);
  BOOL (*UnInit)      (U32 mode);
  BOOL (*ReadSect)    (U32 sect, U8 *buf, U32 cnt);
  BOOL (*WriteSect)   (U32 sect, U8 *buf, U32 cnt);
  BOOL (*ReadInfo)    (Media_INFO *cfg);
  U32  (*DeviceCtrl)  (U32 code, void *p);
} const FAT_DRV;

The following functions can be adapted by the developer:

  • Init()
    This function is called when the RL-FlashFS is initialized by the finit function.
  • UnInit()
    This function is called to uninitialize the USB Flash Drive by the funinit function.
  • ReadSect()
    This function is used to read sectors from the FAT Drive.
  • WriteSect()
    This function is used to write sectors to the FAT Drive.
  • ReadInfo()
    This function is used to read configuration info from the FAT Drive.
  • DeviceCtrl()
    This function is used to send a control code directly to a specified device driver to perform the corresponding operation.