mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-12 13:27:36 +00:00
fatfs: add vfs support
This commit is contained in:
@@ -44,16 +44,36 @@ DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
|
||||
DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
|
||||
DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
|
||||
|
||||
/**
|
||||
* Structure of pointers to disk IO driver functions.
|
||||
*
|
||||
* See FatFs documentation for details about these functions
|
||||
*/
|
||||
typedef struct {
|
||||
DSTATUS (*init) (BYTE pdrv);
|
||||
DSTATUS (*status) (BYTE pdrv);
|
||||
DRESULT (*read) (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
|
||||
DRESULT (*write) (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
|
||||
DRESULT (*ioctl) (BYTE pdrv, BYTE cmd, void* buff);
|
||||
DSTATUS (*init) (BYTE pdrv); /*!< disk initialization function */
|
||||
DSTATUS (*status) (BYTE pdrv); /*!< disk status check function */
|
||||
DRESULT (*read) (BYTE pdrv, BYTE* buff, DWORD sector, UINT count); /*!< sector read function */
|
||||
DRESULT (*write) (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count); /*!< sector write function */
|
||||
DRESULT (*ioctl) (BYTE pdrv, BYTE cmd, void* buff); /*!< function to get info about disk and do some misc operations */
|
||||
} ff_diskio_impl_t;
|
||||
|
||||
/**
|
||||
* Register diskio driver for given drive number.
|
||||
*
|
||||
* When FATFS library calls one of disk_xxx functions for driver number pdrv,
|
||||
* corresponding function in discio_impl for given pdrv will be called.
|
||||
*
|
||||
* @param pdrv drive number
|
||||
* @param discio_impl pointer to ff_diskio_impl_t structure with diskio functions
|
||||
*/
|
||||
void ff_diskio_register(BYTE pdrv, const ff_diskio_impl_t* discio_impl);
|
||||
|
||||
/**
|
||||
* Register SD/MMC diskio driver
|
||||
*
|
||||
* @param pdrv drive number
|
||||
* @param card pointer to sdmmc_card_t structure describing a card; card should be initialized before calling f_mount.
|
||||
*/
|
||||
void ff_diskio_register_sdmmc(BYTE pdrv, sdmmc_card_t* card);
|
||||
|
||||
/* Disk Status Bits (DSTATUS) */
|
||||
|
Reference in New Issue
Block a user