]>
Commit | Line | Data |
---|---|---|
1 | /*---------------------------------------------------------------------------/\r | |
2 | / Configurations of FatFs Module\r | |
3 | /---------------------------------------------------------------------------*/\r | |
4 | \r | |
5 | #define FFCONF_DEF 80286 /* Revision ID */\r | |
6 | \r | |
7 | /*---------------------------------------------------------------------------/\r | |
8 | / Function Configurations\r | |
9 | /---------------------------------------------------------------------------*/\r | |
10 | \r | |
11 | #define FF_FS_READONLY 0\r | |
12 | /* This option switches read-only configuration. (0:Read/Write or 1:Read-only)\r | |
13 | / Read-only configuration removes writing API functions, f_write(), f_sync(),\r | |
14 | / f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree()\r | |
15 | / and optional writing functions as well. */\r | |
16 | \r | |
17 | \r | |
18 | #define FF_FS_MINIMIZE 0\r | |
19 | /* This option defines minimization level to remove some basic API functions.\r | |
20 | /\r | |
21 | / 0: Basic functions are fully enabled.\r | |
22 | / 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename()\r | |
23 | / are removed.\r | |
24 | / 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.\r | |
25 | / 3: f_lseek() function is removed in addition to 2. */\r | |
26 | \r | |
27 | \r | |
28 | #define FF_USE_FIND 0\r | |
29 | /* This option switches filtered directory read functions, f_findfirst() and\r | |
30 | / f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */\r | |
31 | \r | |
32 | \r | |
33 | #define FF_USE_MKFS 0\r | |
34 | /* This option switches f_mkfs() function. (0:Disable or 1:Enable) */\r | |
35 | \r | |
36 | \r | |
37 | #define FF_USE_FASTSEEK 0\r | |
38 | /* This option switches fast seek function. (0:Disable or 1:Enable) */\r | |
39 | \r | |
40 | \r | |
41 | #define FF_USE_EXPAND 0\r | |
42 | /* This option switches f_expand function. (0:Disable or 1:Enable) */\r | |
43 | \r | |
44 | \r | |
45 | #define FF_USE_CHMOD 0\r | |
46 | /* This option switches attribute manipulation functions, f_chmod() and f_utime().\r | |
47 | / (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */\r | |
48 | \r | |
49 | \r | |
50 | #define FF_USE_LABEL 0\r | |
51 | /* This option switches volume label functions, f_getlabel() and f_setlabel().\r | |
52 | / (0:Disable or 1:Enable) */\r | |
53 | \r | |
54 | \r | |
55 | #define FF_USE_FORWARD 0\r | |
56 | /* This option switches f_forward() function. (0:Disable or 1:Enable) */\r | |
57 | \r | |
58 | \r | |
59 | #define FF_USE_STRFUNC 0\r | |
60 | #define FF_PRINT_LLI 1\r | |
61 | #define FF_PRINT_FLOAT 1\r | |
62 | #define FF_STRF_ENCODE 3\r | |
63 | /* FF_USE_STRFUNC switches string functions, f_gets(), f_putc(), f_puts() and\r | |
64 | / f_printf().\r | |
65 | /\r | |
66 | / 0: Disable. FF_PRINT_LLI, FF_PRINT_FLOAT and FF_STRF_ENCODE have no effect.\r | |
67 | / 1: Enable without LF-CRLF conversion.\r | |
68 | / 2: Enable with LF-CRLF conversion.\r | |
69 | /\r | |
70 | / FF_PRINT_LLI = 1 makes f_printf() support long long argument and FF_PRINT_FLOAT = 1/2\r | |
71 | / makes f_printf() support floating point argument. These features want C99 or later.\r | |
72 | / When FF_LFN_UNICODE >= 1 with LFN enabled, string functions convert the character\r | |
73 | / encoding in it. FF_STRF_ENCODE selects assumption of character encoding ON THE FILE\r | |
74 | / to be read/written via those functions.\r | |
75 | /\r | |
76 | / 0: ANSI/OEM in current CP\r | |
77 | / 1: Unicode in UTF-16LE\r | |
78 | / 2: Unicode in UTF-16BE\r | |
79 | / 3: Unicode in UTF-8\r | |
80 | */\r | |
81 | \r | |
82 | \r | |
83 | /*---------------------------------------------------------------------------/\r | |
84 | / Locale and Namespace Configurations\r | |
85 | /---------------------------------------------------------------------------*/\r | |
86 | \r | |
87 | #define FF_CODE_PAGE 932\r | |
88 | /* This option specifies the OEM code page to be used on the target system.\r | |
89 | / Incorrect code page setting can cause a file open failure.\r | |
90 | /\r | |
91 | / 437 - U.S.\r | |
92 | / 720 - Arabic\r | |
93 | / 737 - Greek\r | |
94 | / 771 - KBL\r | |
95 | / 775 - Baltic\r | |
96 | / 850 - Latin 1\r | |
97 | / 852 - Latin 2\r | |
98 | / 855 - Cyrillic\r | |
99 | / 857 - Turkish\r | |
100 | / 860 - Portuguese\r | |
101 | / 861 - Icelandic\r | |
102 | / 862 - Hebrew\r | |
103 | / 863 - Canadian French\r | |
104 | / 864 - Arabic\r | |
105 | / 865 - Nordic\r | |
106 | / 866 - Russian\r | |
107 | / 869 - Greek 2\r | |
108 | / 932 - Japanese (DBCS)\r | |
109 | / 936 - Simplified Chinese (DBCS)\r | |
110 | / 949 - Korean (DBCS)\r | |
111 | / 950 - Traditional Chinese (DBCS)\r | |
112 | / 0 - Include all code pages above and configured by f_setcp()\r | |
113 | */\r | |
114 | \r | |
115 | \r | |
116 | #define FF_USE_LFN 0\r | |
117 | #define FF_MAX_LFN 255\r | |
118 | /* The FF_USE_LFN switches the support for LFN (long file name).\r | |
119 | /\r | |
120 | / 0: Disable LFN. FF_MAX_LFN has no effect.\r | |
121 | / 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.\r | |
122 | / 2: Enable LFN with dynamic working buffer on the STACK.\r | |
123 | / 3: Enable LFN with dynamic working buffer on the HEAP.\r | |
124 | /\r | |
125 | / To enable the LFN, ffunicode.c needs to be added to the project. The LFN function\r | |
126 | / requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and\r | |
127 | / additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled.\r | |
128 | / The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can\r | |
129 | / be in range of 12 to 255. It is recommended to be set it 255 to fully support LFN\r | |
130 | / specification.\r | |
131 | / When use stack for the working buffer, take care on stack overflow. When use heap\r | |
132 | / memory for the working buffer, memory management functions, ff_memalloc() and\r | |
133 | / ff_memfree() exemplified in ffsystem.c, need to be added to the project. */\r | |
134 | \r | |
135 | \r | |
136 | #define FF_LFN_UNICODE 0\r | |
137 | /* This option switches the character encoding on the API when LFN is enabled.\r | |
138 | /\r | |
139 | / 0: ANSI/OEM in current CP (TCHAR = char)\r | |
140 | / 1: Unicode in UTF-16 (TCHAR = WCHAR)\r | |
141 | / 2: Unicode in UTF-8 (TCHAR = char)\r | |
142 | / 3: Unicode in UTF-32 (TCHAR = DWORD)\r | |
143 | /\r | |
144 | / Also behavior of string I/O functions will be affected by this option.\r | |
145 | / When LFN is not enabled, this option has no effect. */\r | |
146 | \r | |
147 | \r | |
148 | #define FF_LFN_BUF 255\r | |
149 | #define FF_SFN_BUF 12\r | |
150 | /* This set of options defines size of file name members in the FILINFO structure\r | |
151 | / which is used to read out directory items. These values should be suffcient for\r | |
152 | / the file names to read. The maximum possible length of the read file name depends\r | |
153 | / on character encoding. When LFN is not enabled, these options have no effect. */\r | |
154 | \r | |
155 | \r | |
156 | #define FF_FS_RPATH 0\r | |
157 | /* This option configures support for relative path.\r | |
158 | /\r | |
159 | / 0: Disable relative path and remove related functions.\r | |
160 | / 1: Enable relative path. f_chdir() and f_chdrive() are available.\r | |
161 | / 2: f_getcwd() function is available in addition to 1.\r | |
162 | */\r | |
163 | \r | |
164 | \r | |
165 | /*---------------------------------------------------------------------------/\r | |
166 | / Drive/Volume Configurations\r | |
167 | /---------------------------------------------------------------------------*/\r | |
168 | \r | |
169 | #define FF_VOLUMES 1\r | |
170 | /* Number of volumes (logical drives) to be used. (1-10) */\r | |
171 | \r | |
172 | \r | |
173 | #define FF_STR_VOLUME_ID 0\r | |
174 | #define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"\r | |
175 | /* FF_STR_VOLUME_ID switches support for volume ID in arbitrary strings.\r | |
176 | / When FF_STR_VOLUME_ID is set to 1 or 2, arbitrary strings can be used as drive\r | |
177 | / number in the path name. FF_VOLUME_STRS defines the volume ID strings for each\r | |
178 | / logical drives. Number of items must not be less than FF_VOLUMES. Valid\r | |
179 | / characters for the volume ID strings are A-Z, a-z and 0-9, however, they are\r | |
180 | / compared in case-insensitive. If FF_STR_VOLUME_ID >= 1 and FF_VOLUME_STRS is\r | |
181 | / not defined, a user defined volume string table is needed as:\r | |
182 | /\r | |
183 | / const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb",...\r | |
184 | */\r | |
185 | \r | |
186 | \r | |
187 | #define FF_MULTI_PARTITION 0\r | |
188 | /* This option switches support for multiple volumes on the physical drive.\r | |
189 | / By default (0), each logical drive number is bound to the same physical drive\r | |
190 | / number and only an FAT volume found on the physical drive will be mounted.\r | |
191 | / When this function is enabled (1), each logical drive number can be bound to\r | |
192 | / arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk()\r | |
193 | / function will be available. */\r | |
194 | \r | |
195 | \r | |
196 | #define FF_MIN_SS 512\r | |
197 | #define FF_MAX_SS 512\r | |
198 | /* This set of options configures the range of sector size to be supported. (512,\r | |
199 | / 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and\r | |
200 | / harddisk, but a larger value may be required for on-board flash memory and some\r | |
201 | / type of optical media. When FF_MAX_SS is larger than FF_MIN_SS, FatFs is configured\r | |
202 | / for variable sector size mode and disk_ioctl() function needs to implement\r | |
203 | / GET_SECTOR_SIZE command. */\r | |
204 | \r | |
205 | \r | |
206 | #define FF_LBA64 0\r | |
207 | /* This option switches support for 64-bit LBA. (0:Disable or 1:Enable)\r | |
208 | / To enable the 64-bit LBA, also exFAT needs to be enabled. (FF_FS_EXFAT == 1) */\r | |
209 | \r | |
210 | \r | |
211 | #define FF_MIN_GPT 0x10000000\r | |
212 | /* Minimum number of sectors to switch GPT as partitioning format in f_mkfs and\r | |
213 | / f_fdisk function. 0x100000000 max. This option has no effect when FF_LBA64 == 0. */\r | |
214 | \r | |
215 | \r | |
216 | #define FF_USE_TRIM 0\r | |
217 | /* This option switches support for ATA-TRIM. (0:Disable or 1:Enable)\r | |
218 | / To enable Trim function, also CTRL_TRIM command should be implemented to the\r | |
219 | / disk_ioctl() function. */\r | |
220 | \r | |
221 | \r | |
222 | \r | |
223 | /*---------------------------------------------------------------------------/\r | |
224 | / System Configurations\r | |
225 | /---------------------------------------------------------------------------*/\r | |
226 | \r | |
227 | #define FF_FS_TINY 0\r | |
228 | /* This option switches tiny buffer configuration. (0:Normal or 1:Tiny)\r | |
229 | / At the tiny configuration, size of file object (FIL) is shrinked FF_MAX_SS bytes.\r | |
230 | / Instead of private sector buffer eliminated from the file object, common sector\r | |
231 | / buffer in the filesystem object (FATFS) is used for the file data transfer. */\r | |
232 | \r | |
233 | \r | |
234 | #define FF_FS_EXFAT 0\r | |
235 | /* This option switches support for exFAT filesystem. (0:Disable or 1:Enable)\r | |
236 | / To enable exFAT, also LFN needs to be enabled. (FF_USE_LFN >= 1)\r | |
237 | / Note that enabling exFAT discards ANSI C (C89) compatibility. */\r | |
238 | \r | |
239 | \r | |
240 | #define FF_FS_NORTC 0\r | |
241 | #define FF_NORTC_MON 1\r | |
242 | #define FF_NORTC_MDAY 1\r | |
243 | #define FF_NORTC_YEAR 2022\r | |
244 | /* The option FF_FS_NORTC switches timestamp feature. If the system does not have\r | |
245 | / an RTC or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable the\r | |
246 | / timestamp feature. Every object modified by FatFs will have a fixed timestamp\r | |
247 | / defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time.\r | |
248 | / To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be\r | |
249 | / added to the project to read current time form real-time clock. FF_NORTC_MON,\r | |
250 | / FF_NORTC_MDAY and FF_NORTC_YEAR have no effect.\r | |
251 | / These options have no effect in read-only configuration (FF_FS_READONLY = 1). */\r | |
252 | \r | |
253 | \r | |
254 | #define FF_FS_NOFSINFO 0\r | |
255 | /* If you need to know correct free space on the FAT32 volume, set bit 0 of this\r | |
256 | / option, and f_getfree() function at the first time after volume mount will force\r | |
257 | / a full FAT scan. Bit 1 controls the use of last allocated cluster number.\r | |
258 | /\r | |
259 | / bit0=0: Use free cluster count in the FSINFO if available.\r | |
260 | / bit0=1: Do not trust free cluster count in the FSINFO.\r | |
261 | / bit1=0: Use last allocated cluster number in the FSINFO if available.\r | |
262 | / bit1=1: Do not trust last allocated cluster number in the FSINFO.\r | |
263 | */\r | |
264 | \r | |
265 | \r | |
266 | #define FF_FS_LOCK 0\r | |
267 | /* The option FF_FS_LOCK switches file lock function to control duplicated file open\r | |
268 | / and illegal operation to open objects. This option must be 0 when FF_FS_READONLY\r | |
269 | / is 1.\r | |
270 | /\r | |
271 | / 0: Disable file lock function. To avoid volume corruption, application program\r | |
272 | / should avoid illegal open, remove and rename to the open objects.\r | |
273 | / >0: Enable file lock function. The value defines how many files/sub-directories\r | |
274 | / can be opened simultaneously under file lock control. Note that the file\r | |
275 | / lock control is independent of re-entrancy. */\r | |
276 | \r | |
277 | \r | |
278 | #define FF_FS_REENTRANT 0\r | |
279 | #define FF_FS_TIMEOUT 1000\r | |
280 | /* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs\r | |
281 | / module itself. Note that regardless of this option, file access to different\r | |
282 | / volume is always re-entrant and volume control functions, f_mount(), f_mkfs()\r | |
283 | / and f_fdisk() function, are always not re-entrant. Only file/directory access\r | |
284 | / to the same volume is under control of this featuer.\r | |
285 | /\r | |
286 | / 0: Disable re-entrancy. FF_FS_TIMEOUT have no effect.\r | |
287 | / 1: Enable re-entrancy. Also user provided synchronization handlers,\r | |
288 | / ff_mutex_create(), ff_mutex_delete(), ff_mutex_take() and ff_mutex_give()\r | |
289 | / function, must be added to the project. Samples are available in ffsystem.c.\r | |
290 | /\r | |
291 | / The FF_FS_TIMEOUT defines timeout period in unit of O/S time tick.\r | |
292 | */\r | |
293 | \r | |
294 | \r | |
295 | \r | |
296 | /*--- End of configuration options ---*/\r |