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

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.