1
2
3
4
5
6
9
10
11
12
15
16
17
21
22
23
24
31
32
33
34
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
53
54
55
56
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
198
199
200
201
207
208
209
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
238
239
240
241
242
243
244
245
246
252
253
254
255
257
258
259
260
262
263
264
265
268
269
270
271
274
275
276
280
281
282
283
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
348
349
350
351
352
353
356
357
358
359
360
361
362
363
368
369
#ifndef _FFCONF_DEFINED
#define _FFCONF_DEFINED
#include "sdkconfig.h"
/* ... */
#define FFCONF_DEF 80286
/* ... */
#define FF_FS_READONLY 0
/* ... */
#define FF_FS_MINIMIZE 0
/* ... */
#define FF_USE_FIND 0
/* ... */
#define FF_USE_MKFS 1
#define FF_USE_FASTSEEK CONFIG_FATFS_USE_FASTSEEK
#define FF_USE_EXPAND 1
#define FF_USE_CHMOD 1
/* ... */
#define FF_USE_LABEL CONFIG_FATFS_USE_LABEL
/* ... */
#define FF_USE_FORWARD 010 defines
#if defined(CONFIG_FATFS_USE_STRFUNC_WITHOUT_CRLF_CONV)
#define FF_USE_STRFUNC 1
#elif defined(CONFIG_FATFS_USE_STRFUNC_WITH_CRLF_CONV)
#define FF_USE_STRFUNC 2
#else
#define FF_USE_STRFUNC 0
#endif
#ifdef CONFIG_FATFS_PRINT_LLI
#define FF_PRINT_LLI 1
#else
#define FF_PRINT_LLI 0
#endif
#ifdef CONFIG_FATFS_PRINT_FLOAT
#define FF_PRINT_FLOAT 1
#else
#define FF_PRINT_FLOAT 0
#endif
#if defined(CONFIG_FATFS_STRF_ENCODE_ANSI)
#define FF_STRF_ENCODE 0
#elif defined(CONFIG_FATFS_STRF_ENCODE_UTF16LE)
#define FF_STRF_ENCODE 1
#elif defined(CONFIG_FATFS_STRF_ENCODE_UTF16BE)
#define FF_STRF_ENCODE 2
#else
#define FF_STRF_ENCODE 3
#endif
/* ... */
/* ... */
#define FF_CODE_PAGE CONFIG_FATFS_CODEPAGE
/* ... */
#if defined(CONFIG_FATFS_LFN_STACK)
#define FF_USE_LFN 2
#elif defined(CONFIG_FATFS_LFN_HEAP)
#define FF_USE_LFN 3
#else
#define FF_USE_LFN 0
#endif
#ifdef CONFIG_FATFS_MAX_LFN
#define FF_MAX_LFN CONFIG_FATFS_MAX_LFN
#endif
/* ... */
#ifdef CONFIG_FATFS_API_ENCODING_UTF_8
#define FF_LFN_UNICODE 2
#else
#define FF_LFN_UNICODE 0
#endif
/* ... */
#define FF_LFN_BUF 255
#define FF_SFN_BUF 12
/* ... */
#define FF_FS_RPATH 0
/* ... */
/* ... */
#define FF_VOLUMES CONFIG_FATFS_VOLUME_COUNT
#define FF_STR_VOLUME_ID 0
#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"
/* ... */
#define FF_MULTI_PARTITION 1
/* ... */
#define FF_SS_SDCARD 512
#define FF_SS_WL CONFIG_WL_SECTOR_SIZE
#define FF_MIN_SS MIN(FF_SS_SDCARD, FF_SS_WL)
#define FF_MAX_SS MAX(FF_SS_SDCARD, FF_SS_WL)
/* ... */
#define FF_LBA64 0
/* ... */
#define FF_MIN_GPT 0x10000000
/* ... */
#define FF_USE_TRIM 1
/* ... */
/* ... */
#define FF_FS_TINY (!CONFIG_FATFS_PER_FILE_CACHE)
/* ... */
#define FF_FS_EXFAT 0
/* ... */
#define FF_FS_NORTC 0
#define FF_NORTC_MON 1
#define FF_NORTC_MDAY 1
#define FF_NORTC_YEAR 2022
/* ... */
#define FF_FS_NOFSINFO 0
/* ... */
#define FF_FS_LOCK CONFIG_FATFS_FS_LOCK
/* ... */
#define FF_FS_REENTRANT 1
#define FF_FS_TIMEOUT (CONFIG_FATFS_TIMEOUT_MS / portTICK_PERIOD_MS)
/* ... */
#define FF_USE_DYN_BUFFER CONFIG_FATFS_USE_DYN_BUFFERS25 defines
/* ... */
#include <sys/param.h>
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
/* ... */
void* ff_memalloc (unsigned msize);
void ff_memfree(void*);
#define disk_initialize ff_disk_initialize
#define disk_status ff_disk_status
#define disk_read ff_disk_read
#define disk_write ff_disk_write
#define disk_ioctl ff_disk_ioctl5 defines
/* ... */
#endif