1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
33
34
35
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
55
56
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* ... */
#ifndef __FF_GEN_DRV_H
#define __FF_GEN_DRV_H
#ifdef __cplusplus
extern "C" {
#endif
#include "diskio.h"
#include "ff.h"
#include "stdint.h"
Includes
/* ... */
typedef struct
{
DSTATUS (*disk_initialize) (BYTE);
DSTATUS (*disk_status) (BYTE);
DRESULT (*disk_read) (BYTE, BYTE*, DWORD, UINT);
#if _USE_WRITE == 1
DRESULT (*disk_write) (BYTE, const BYTE*, DWORD, UINT);
#endif
#if _USE_IOCTL == 1
DRESULT (*disk_ioctl) (BYTE, BYTE, void*);
#endif
...}Diskio_drvTypeDef;
/* ... */
typedef struct
{
uint8_t is_initialized[_VOLUMES];
const Diskio_drvTypeDef *drv[_VOLUMES];
uint8_t lun[_VOLUMES];
volatile uint8_t nbr;
...}Disk_drvTypeDef;
Exported types
uint8_t FATFS_LinkDriver(const Diskio_drvTypeDef *drv, char *path);
uint8_t FATFS_UnLinkDriver(char *path);
uint8_t FATFS_LinkDriverEx(const Diskio_drvTypeDef *drv, char *path, BYTE lun);
uint8_t FATFS_UnLinkDriverEx(char *path, BYTE lun);
uint8_t FATFS_GetAttachedDriversNbr(void);
#ifdef __cplusplus
}extern "C" { ... }
#endif
/* ... */
#endif