]> cloudbase.mooo.com Git - z180-stamp.git/blame - fatfs/src/ffconf.h
Import fatfs R0.12b
[z180-stamp.git] / fatfs / src / ffconf.h
CommitLineData
53668523 1/*---------------------------------------------------------------------------/\r
70702af1 2/ FatFs - FAT file system module configuration file\r
53668523
L
3/---------------------------------------------------------------------------*/\r
4\r
70702af1 5#define _FFCONF 68020 /* Revision ID */\r
53668523
L
6\r
7/*---------------------------------------------------------------------------/\r
70702af1 8/ Function Configurations\r
53668523
L
9/---------------------------------------------------------------------------*/\r
10\r
7b78a5a2
L
11#define _FS_READONLY 0\r
12/* This option switches read-only configuration. (0:Read/Write or 1:Read-only)\r
70702af1
L
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
53668523
L
16\r
17\r
7b78a5a2 18#define _FS_MINIMIZE 0\r
70702af1 19/* This option defines minimization level to remove some basic API functions.\r
53668523
L
20/\r
21/ 0: All basic functions are enabled.\r
70702af1
L
22/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename()\r
23/ are removed.\r
53668523
L
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
7b78a5a2
L
28#define _USE_STRFUNC 0\r
29/* This option switches string functions, f_gets(), f_putc(), f_puts() and\r
30/ f_printf().\r
31/\r
32/ 0: Disable string functions.\r
33/ 1: Enable without LF-CRLF conversion.\r
34/ 2: Enable with LF-CRLF conversion. */\r
53668523
L
35\r
36\r
70702af1
L
37#define _USE_FIND 0\r
38/* This option switches filtered directory read functions, f_findfirst() and\r
39/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */\r
40\r
41\r
7b78a5a2 42#define _USE_MKFS 0\r
70702af1 43/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */\r
53668523
L
44\r
45\r
7b78a5a2 46#define _USE_FASTSEEK 0\r
70702af1
L
47/* This option switches fast seek function. (0:Disable or 1:Enable) */\r
48\r
49\r
50#define _USE_EXPAND 0\r
51/* This option switches f_expand function. (0:Disable or 1:Enable) */\r
52\r
53\r
54#define _USE_CHMOD 0\r
55/* This option switches attribute manipulation functions, f_chmod() and f_utime().\r
56/ (0:Disable or 1:Enable) Also _FS_READONLY needs to be 0 to enable this option. */\r
53668523
L
57\r
58\r
7b78a5a2
L
59#define _USE_LABEL 0\r
60/* This option switches volume label functions, f_getlabel() and f_setlabel().\r
61/ (0:Disable or 1:Enable) */\r
53668523
L
62\r
63\r
7b78a5a2
L
64#define _USE_FORWARD 0\r
65/* This option switches f_forward() function. (0:Disable or 1:Enable) */\r
53668523
L
66\r
67\r
68/*---------------------------------------------------------------------------/\r
69/ Locale and Namespace Configurations\r
70/---------------------------------------------------------------------------*/\r
71\r
72#define _CODE_PAGE 932\r
7b78a5a2 73/* This option specifies the OEM code page to be used on the target system.\r
53668523
L
74/ Incorrect setting of the code page can cause a file open failure.\r
75/\r
70702af1
L
76/ 1 - ASCII (No extended character. Non-LFN cfg. only)\r
77/ 437 - U.S.\r
78/ 720 - Arabic\r
79/ 737 - Greek\r
80/ 771 - KBL\r
81/ 775 - Baltic\r
82/ 850 - Latin 1\r
83/ 852 - Latin 2\r
84/ 855 - Cyrillic\r
85/ 857 - Turkish\r
86/ 860 - Portuguese\r
87/ 861 - Icelandic\r
88/ 862 - Hebrew\r
89/ 863 - Canadian French\r
90/ 864 - Arabic\r
91/ 865 - Nordic\r
92/ 866 - Russian\r
93/ 869 - Greek 2\r
94/ 932 - Japanese (DBCS)\r
95/ 936 - Simplified Chinese (DBCS)\r
96/ 949 - Korean (DBCS)\r
97/ 950 - Traditional Chinese (DBCS)\r
98*/\r
53668523
L
99\r
100\r
7b78a5a2
L
101#define _USE_LFN 0\r
102#define _MAX_LFN 255\r
70702af1 103/* The _USE_LFN switches the support of long file name (LFN).\r
53668523 104/\r
70702af1 105/ 0: Disable support of LFN. _MAX_LFN has no effect.\r
53668523
L
106/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.\r
107/ 2: Enable LFN with dynamic working buffer on the STACK.\r
108/ 3: Enable LFN with dynamic working buffer on the HEAP.\r
109/\r
70702af1
L
110/ To enable the LFN, Unicode handling functions (option/unicode.c) must be added\r
111/ to the project. The working buffer occupies (_MAX_LFN + 1) * 2 bytes and\r
112/ additional 608 bytes at exFAT enabled. _MAX_LFN can be in range from 12 to 255.\r
113/ It should be set 255 to support full featured LFN operations.\r
7b78a5a2
L
114/ When use stack for the working buffer, take care on stack overflow. When use heap\r
115/ memory for the working buffer, memory management functions, ff_memalloc() and\r
116/ ff_memfree(), must be added to the project. */\r
53668523
L
117\r
118\r
7b78a5a2 119#define _LFN_UNICODE 0\r
70702af1
L
120/* This option switches character encoding on the API. (0:ANSI/OEM or 1:UTF-16)\r
121/ To use Unicode string for the path name, enable LFN and set _LFN_UNICODE = 1.\r
122/ This option also affects behavior of string I/O functions. */\r
53668523
L
123\r
124\r
7b78a5a2 125#define _STRF_ENCODE 3\r
70702af1 126/* When _LFN_UNICODE == 1, this option selects the character encoding ON THE FILE to\r
7b78a5a2
L
127/ be read/written via string I/O functions, f_gets(), f_putc(), f_puts and f_printf().\r
128/\r
129/ 0: ANSI/OEM\r
130/ 1: UTF-16LE\r
131/ 2: UTF-16BE\r
132/ 3: UTF-8\r
133/\r
70702af1 134/ This option has no effect when _LFN_UNICODE == 0. */\r
53668523
L
135\r
136\r
7b78a5a2 137#define _FS_RPATH 0\r
70702af1 138/* This option configures support of relative path.\r
53668523 139/\r
70702af1
L
140/ 0: Disable relative path and remove related functions.\r
141/ 1: Enable relative path. f_chdir() and f_chdrive() are available.\r
53668523 142/ 2: f_getcwd() function is available in addition to 1.\r
70702af1 143*/\r
53668523
L
144\r
145\r
146/*---------------------------------------------------------------------------/\r
147/ Drive/Volume Configurations\r
148/---------------------------------------------------------------------------*/\r
149\r
150#define _VOLUMES 1\r
151/* Number of volumes (logical drives) to be used. */\r
152\r
153\r
7b78a5a2 154#define _STR_VOLUME_ID 0\r
70702af1
L
155#define _VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"\r
156/* _STR_VOLUME_ID switches string support of volume ID.\r
7b78a5a2
L
157/ When _STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive\r
158/ number in the path name. _VOLUME_STRS defines the drive ID strings for each\r
159/ logical drives. Number of items must be equal to _VOLUMES. Valid characters for\r
160/ the drive ID strings are: A-Z and 0-9. */\r
53668523
L
161\r
162\r
7b78a5a2 163#define _MULTI_PARTITION 0\r
70702af1
L
164/* This option switches support of multi-partition on a physical drive.\r
165/ By default (0), each logical drive number is bound to the same physical drive\r
166/ number and only an FAT volume found on the physical drive will be mounted.\r
167/ When multi-partition is enabled (1), each logical drive number can be bound to\r
168/ arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk()\r
169/ funciton will be available. */\r
53668523
L
170\r
171\r
172#define _MIN_SS 512\r
173#define _MAX_SS 512\r
7b78a5a2
L
174/* These options configure the range of sector size to be supported. (512, 1024,\r
175/ 2048 or 4096) Always set both 512 for most systems, all type of memory cards and\r
176/ harddisk. But a larger value may be required for on-board flash memory and some\r
177/ type of optical media. When _MAX_SS is larger than _MIN_SS, FatFs is configured\r
178/ to variable sector size and GET_SECTOR_SIZE command must be implemented to the\r
179/ disk_ioctl() function. */\r
53668523
L
180\r
181\r
7b78a5a2 182#define _USE_TRIM 0\r
70702af1
L
183/* This option switches support of ATA-TRIM. (0:Disable or 1:Enable)\r
184/ To enable Trim function, also CTRL_TRIM command should be implemented to the\r
7b78a5a2 185/ disk_ioctl() function. */\r
53668523
L
186\r
187\r
7b78a5a2
L
188#define _FS_NOFSINFO 0\r
189/* If you need to know correct free space on the FAT32 volume, set bit 0 of this\r
190/ option, and f_getfree() function at first time after volume mount will force\r
191/ a full FAT scan. Bit 1 controls the use of last allocated cluster number.\r
53668523
L
192/\r
193/ bit0=0: Use free cluster count in the FSINFO if available.\r
194/ bit0=1: Do not trust free cluster count in the FSINFO.\r
195/ bit1=0: Use last allocated cluster number in the FSINFO if available.\r
196/ bit1=1: Do not trust last allocated cluster number in the FSINFO.\r
197*/\r
198\r
199\r
200\r
201/*---------------------------------------------------------------------------/\r
202/ System Configurations\r
203/---------------------------------------------------------------------------*/\r
204\r
70702af1
L
205#define _FS_TINY 0\r
206/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny)\r
207/ At the tiny configuration, size of file object (FIL) is reduced _MAX_SS bytes.\r
208/ Instead of private sector buffer eliminated from the file object, common sector\r
209/ buffer in the file system object (FATFS) is used for the file data transfer. */\r
210\r
211\r
212#define _FS_EXFAT 0\r
213/* This option switches support of exFAT file system. (0:Disable or 1:Enable)\r
214/ When enable exFAT, also LFN needs to be enabled. (_USE_LFN >= 1)\r
215/ Note that enabling exFAT discards C89 compatibility. */\r
216\r
217\r
7b78a5a2 218#define _FS_NORTC 0\r
70702af1
L
219#define _NORTC_MON 1\r
220#define _NORTC_MDAY 1\r
221#define _NORTC_YEAR 2016\r
222/* The option _FS_NORTC switches timestamp functiton. If the system does not have\r
223/ any RTC function or valid timestamp is not needed, set _FS_NORTC = 1 to disable\r
224/ the timestamp function. All objects modified by FatFs will have a fixed timestamp\r
225/ defined by _NORTC_MON, _NORTC_MDAY and _NORTC_YEAR in local time.\r
226/ To enable timestamp function (_FS_NORTC = 0), get_fattime() function need to be\r
227/ added to the project to get current time form real-time clock. _NORTC_MON,\r
7b78a5a2 228/ _NORTC_MDAY and _NORTC_YEAR have no effect. \r
70702af1 229/ These options have no effect at read-only configuration (_FS_READONLY = 1). */\r
7b78a5a2
L
230\r
231\r
232#define _FS_LOCK 0\r
70702af1 233/* The option _FS_LOCK switches file lock function to control duplicated file open\r
7b78a5a2
L
234/ and illegal operation to open objects. This option must be 0 when _FS_READONLY\r
235/ is 1.\r
236/\r
70702af1 237/ 0: Disable file lock function. To avoid volume corruption, application program\r
7b78a5a2 238/ should avoid illegal open, remove and rename to the open objects.\r
70702af1 239/ >0: Enable file lock function. The value defines how many files/sub-directories\r
7b78a5a2 240/ can be opened simultaneously under file lock control. Note that the file\r
70702af1 241/ lock control is independent of re-entrancy. */\r
7b78a5a2
L
242\r
243\r
244#define _FS_REENTRANT 0\r
245#define _FS_TIMEOUT 1000\r
246#define _SYNC_t HANDLE\r
70702af1 247/* The option _FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs\r
7b78a5a2
L
248/ module itself. Note that regardless of this option, file access to different\r
249/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs()\r
250/ and f_fdisk() function, are always not re-entrant. Only file/directory access\r
70702af1 251/ to the same volume is under control of this function.\r
53668523
L
252/\r
253/ 0: Disable re-entrancy. _FS_TIMEOUT and _SYNC_t have no effect.\r
254/ 1: Enable re-entrancy. Also user provided synchronization handlers,\r
255/ ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()\r
7b78a5a2
L
256/ function, must be added to the project. Samples are available in\r
257/ option/syscall.c.\r
258/\r
259/ The _FS_TIMEOUT defines timeout period in unit of time tick.\r
260/ The _SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*,\r
70702af1
L
261/ SemaphoreHandle_t and etc.. A header file for O/S definitions needs to be\r
262/ included somewhere in the scope of ff.h. */\r
53668523 263\r
70702af1 264/* #include <windows.h> // O/S definitions */\r
53668523 265\r
53668523 266\r
70702af1 267/*--- End of configuration options ---*/\r