]> cloudbase.mooo.com Git - z180-stamp.git/blame - fatfs/src/ffconf.h
Import fatfs R0.10b
[z180-stamp.git] / fatfs / src / ffconf.h
CommitLineData
53668523
L
1/*---------------------------------------------------------------------------/\r
2/ FatFs - FAT file system module configuration file R0.10b (C)ChaN, 2014\r
3/---------------------------------------------------------------------------*/\r
4\r
5#ifndef _FFCONF\r
6#define _FFCONF 8051 /* Revision ID */\r
7\r
8\r
9/*---------------------------------------------------------------------------/\r
10/ Functions and Buffer Configurations\r
11/---------------------------------------------------------------------------*/\r
12\r
13#define _FS_TINY 0 /* 0:Normal or 1:Tiny */\r
14/* When _FS_TINY is set to 1, it reduces memory consumption _MAX_SS bytes each\r
15/ file object. For file data transfer, FatFs uses the common sector buffer in\r
16/ the file system object (FATFS) instead of private sector buffer eliminated\r
17/ from the file object (FIL). */\r
18\r
19\r
20#define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */\r
21/* Setting _FS_READONLY to 1 defines read only configuration. This removes\r
22/ writing functions, f_write(), f_sync(), f_unlink(), f_mkdir(), f_chmod(),\r
23/ f_rename(), f_truncate() and useless f_getfree(). */\r
24\r
25\r
26#define _FS_MINIMIZE 0 /* 0 to 3 */\r
27/* The _FS_MINIMIZE option defines minimization level to remove API functions.\r
28/\r
29/ 0: All basic functions are enabled.\r
30/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_chmod(), f_utime(),\r
31/ f_truncate() and f_rename() function are removed.\r
32/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.\r
33/ 3: f_lseek() function is removed in addition to 2. */\r
34\r
35\r
36#define _USE_STRFUNC 0 /* 0:Disable or 1-2:Enable */\r
37/* To enable string functions, set _USE_STRFUNC to 1 or 2. */\r
38\r
39\r
40#define _USE_MKFS 0 /* 0:Disable or 1:Enable */\r
41/* To enable f_mkfs() function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */\r
42\r
43\r
44#define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */\r
45/* To enable fast seek feature, set _USE_FASTSEEK to 1. */\r
46\r
47\r
48#define _USE_LABEL 0 /* 0:Disable or 1:Enable */\r
49/* To enable volume label functions, set _USE_LAVEL to 1 */\r
50\r
51\r
52#define _USE_FORWARD 0 /* 0:Disable or 1:Enable */\r
53/* To enable f_forward() function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */\r
54\r
55\r
56/*---------------------------------------------------------------------------/\r
57/ Locale and Namespace Configurations\r
58/---------------------------------------------------------------------------*/\r
59\r
60#define _CODE_PAGE 932\r
61/* The _CODE_PAGE specifies the OEM code page to be used on the target system.\r
62/ Incorrect setting of the code page can cause a file open failure.\r
63/\r
64/ 932 - Japanese Shift_JIS (DBCS, OEM, Windows)\r
65/ 936 - Simplified Chinese GBK (DBCS, OEM, Windows)\r
66/ 949 - Korean (DBCS, OEM, Windows)\r
67/ 950 - Traditional Chinese Big5 (DBCS, OEM, Windows)\r
68/ 1250 - Central Europe (Windows)\r
69/ 1251 - Cyrillic (Windows)\r
70/ 1252 - Latin 1 (Windows)\r
71/ 1253 - Greek (Windows)\r
72/ 1254 - Turkish (Windows)\r
73/ 1255 - Hebrew (Windows)\r
74/ 1256 - Arabic (Windows)\r
75/ 1257 - Baltic (Windows)\r
76/ 1258 - Vietnam (OEM, Windows)\r
77/ 437 - U.S. (OEM)\r
78/ 720 - Arabic (OEM)\r
79/ 737 - Greek (OEM)\r
80/ 775 - Baltic (OEM)\r
81/ 850 - Multilingual Latin 1 (OEM)\r
82/ 858 - Multilingual Latin 1 + Euro (OEM)\r
83/ 852 - Latin 2 (OEM)\r
84/ 855 - Cyrillic (OEM)\r
85/ 866 - Russian (OEM)\r
86/ 857 - Turkish (OEM)\r
87/ 862 - Hebrew (OEM)\r
88/ 874 - Thai (OEM, Windows)\r
89/ 1 - ASCII (Valid for only non-LFN configuration) */\r
90\r
91\r
92#define _USE_LFN 0 /* 0 to 3 */\r
93#define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */\r
94/* The _USE_LFN option switches the LFN feature.\r
95/\r
96/ 0: Disable LFN feature. _MAX_LFN has no effect.\r
97/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.\r
98/ 2: Enable LFN with dynamic working buffer on the STACK.\r
99/ 3: Enable LFN with dynamic working buffer on the HEAP.\r
100/\r
101/ When enable LFN feature, Unicode handling functions ff_convert() and ff_wtoupper()\r
102/ function must be added to the project.\r
103/ The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. When use stack for the\r
104/ working buffer, take care on stack overflow. When use heap memory for the working\r
105/ buffer, memory management functions, ff_memalloc() and ff_memfree(), must be added\r
106/ to the project. */\r
107\r
108\r
109#define _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */\r
110/* To switch the character encoding on the FatFs API (TCHAR) to Unicode, enable LFN\r
111/ feature and set _LFN_UNICODE to 1. This option affects behavior of string I/O\r
112/ functions. This option must be 0 when LFN feature is not enabled. */\r
113\r
114\r
115#define _STRF_ENCODE 3 /* 0:ANSI/OEM, 1:UTF-16LE, 2:UTF-16BE, 3:UTF-8 */\r
116/* When Unicode API is enabled by _LFN_UNICODE option, this option selects the character\r
117/ encoding on the file to be read/written via string I/O functions, f_gets(), f_putc(),\r
118/ f_puts and f_printf(). This option has no effect when _LFN_UNICODE == 0. Note that\r
119/ FatFs supports only BMP. */\r
120\r
121\r
122#define _FS_RPATH 0 /* 0 to 2 */\r
123/* The _FS_RPATH option configures relative path feature.\r
124/\r
125/ 0: Disable relative path feature and remove related functions.\r
126/ 1: Enable relative path. f_chdrive() and f_chdir() function are available.\r
127/ 2: f_getcwd() function is available in addition to 1.\r
128/\r
129/ Note that output of the f_readdir() fnction is affected by this option. */\r
130\r
131\r
132/*---------------------------------------------------------------------------/\r
133/ Drive/Volume Configurations\r
134/---------------------------------------------------------------------------*/\r
135\r
136#define _VOLUMES 1\r
137/* Number of volumes (logical drives) to be used. */\r
138\r
139\r
140#define _STR_VOLUME_ID 0 /* 0:Use only 0-9 for drive ID, 1:Use strings for drive ID */\r
141#define _VOLUME_STRS "RAM","NAND","CF","SD1","SD2","USB1","USB2","USB3"\r
142/* When _STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive\r
143/ number in the path name. _VOLUME_STRS defines the drive ID strings for each logical\r
144/ drives. Number of items must be equal to _VOLUMES. Valid characters for the drive ID\r
145/ strings are: 0-9 and A-Z. */\r
146\r
147\r
148#define _MULTI_PARTITION 0 /* 0:Single partition, 1:Enable multiple partition */\r
149/* By default(0), each logical drive number is bound to the same physical drive number\r
150/ and only a FAT volume found on the physical drive is mounted. When it is set to 1,\r
151/ each logical drive number is bound to arbitrary drive/partition listed in VolToPart[].\r
152*/\r
153\r
154\r
155#define _MIN_SS 512\r
156#define _MAX_SS 512\r
157/* These options configure the range of sector size to be supported. (512, 1024, 2048 or\r
158/ 4096) Always set both 512 for most systems, all memory card and harddisk. But a larger\r
159/ value may be required for on-board flash memory and some type of optical media.\r
160/ When _MAX_SS is larger than _MIN_SS, FatFs is configured to variable sector size and\r
161/ GET_SECTOR_SIZE command must be implemented to the disk_ioctl() function. */\r
162\r
163\r
164#define _USE_ERASE 0 /* 0:Disable or 1:Enable */\r
165/* To enable sector erase feature, set _USE_ERASE to 1. Also CTRL_ERASE_SECTOR command\r
166/ should be added to the disk_ioctl() function. */\r
167\r
168\r
169#define _FS_NOFSINFO 0 /* 0 to 3 */\r
170/* If you need to know correct free space on the FAT32 volume, set bit 0 of this option\r
171/ and f_getfree() function at first time after volume mount will force a full FAT scan.\r
172/ Bit 1 controls the last allocated cluster number as bit 0.\r
173/\r
174/ bit0=0: Use free cluster count in the FSINFO if available.\r
175/ bit0=1: Do not trust free cluster count in the FSINFO.\r
176/ bit1=0: Use last allocated cluster number in the FSINFO if available.\r
177/ bit1=1: Do not trust last allocated cluster number in the FSINFO.\r
178*/\r
179\r
180\r
181\r
182/*---------------------------------------------------------------------------/\r
183/ System Configurations\r
184/---------------------------------------------------------------------------*/\r
185\r
186#define _FS_LOCK 0 /* 0:Disable or >=1:Enable */\r
187/* To enable file lock control feature, set _FS_LOCK to non-zero value.\r
188/ The value defines how many files/sub-directories can be opened simultaneously\r
189/ with file lock control. This feature uses bss _FS_LOCK * 12 bytes. */\r
190\r
191\r
192#define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */\r
193#define _FS_TIMEOUT 1000 /* Timeout period in unit of time tick */\r
194#define _SYNC_t HANDLE /* O/S dependent sync object type. e.g. HANDLE, OS_EVENT*, ID, SemaphoreHandle_t and etc.. */\r
195/* The _FS_REENTRANT option switches the re-entrancy (thread safe) of the FatFs module.\r
196/\r
197/ 0: Disable re-entrancy. _FS_TIMEOUT and _SYNC_t have no effect.\r
198/ 1: Enable re-entrancy. Also user provided synchronization handlers,\r
199/ ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()\r
200/ function must be added to the project.\r
201*/\r
202\r
203\r
204#define _WORD_ACCESS 0 /* 0 or 1 */\r
205/* The _WORD_ACCESS option is an only platform dependent option. It defines\r
206/ which access method is used to the word data on the FAT volume.\r
207/\r
208/ 0: Byte-by-byte access. Always compatible with all platforms.\r
209/ 1: Word access. Do not choose this unless under both the following conditions.\r
210/\r
211/ * Address misaligned memory access is always allowed for ALL instructions.\r
212/ * Byte order on the memory is little-endian.\r
213/\r
214/ If it is the case, _WORD_ACCESS can also be set to 1 to improve performance and\r
215/ reduce code size. Following table shows an example of some processor types.\r
216/\r
217/ ARM7TDMI 0 ColdFire 0 V850E 0\r
218/ Cortex-M3 0 Z80 0/1 V850ES 0/1\r
219/ Cortex-M0 0 RX600(LE) 0/1 TLCS-870 0/1\r
220/ AVR 0/1 RX600(BE) 0 TLCS-900 0/1\r
221/ AVR32 0 RL78 0 R32C 0\r
222/ PIC18 0/1 SH-2 0 M16C 0/1\r
223/ PIC24 0 H8S 0 MSP430 0\r
224/ PIC32 0 H8/300H 0 x86 0/1\r
225*/\r
226\r
227\r
228#endif /* _FFCONF */\r