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
28
29
30
31
36
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
67
68
69
70
71
72
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
typedef unsigned int UINT;
typedef unsigned char BYTE;
typedef uint32_t DWORD;
#define FF_DRV_NOT_USED 0xFF
#include "diskio.h"
#include "esp_err.h"
/* ... */
typedef struct {
DSTATUS (*init) (unsigned char pdrv);
DSTATUS (*status) (unsigned char pdrv);
DRESULT (*read) (unsigned char pdrv, unsigned char* buff, uint32_t sector, unsigned count);
DRESULT (*write) (unsigned char pdrv, const unsigned char* buff, uint32_t sector, unsigned count);
DRESULT (*ioctl) (unsigned char pdrv, unsigned char cmd, void* buff);
}{ ... } ff_diskio_impl_t;
/* ... */
void ff_diskio_register(BYTE pdrv, const ff_diskio_impl_t* discio_impl);
#define ff_diskio_unregister(pdrv_) ff_diskio_register(pdrv_, NULL)
/* ... */
esp_err_t ff_diskio_get_drive(BYTE* out_pdrv);
#ifdef __cplusplus
}{...}
#endif