2018.07.26
Fork of FATFileSystem by
ChaN/ffconf.h@4:3ff2606d5713, 2014-08-28 (annotated)
- Committer:
- mbed_official
- Date:
- Thu Aug 28 13:15:31 2014 +0100
- Revision:
- 4:3ff2606d5713
- Parent:
- 1:46ce1e16c870
- Child:
- 5:b3b3370574cf
Synchronized with git revision fee50a80ffdc8f9d9ee97be545ff36b5a986f041
Full URL: https://github.com/mbedmicro/mbed/commit/fee50a80ffdc8f9d9ee97be545ff36b5a986f041/
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 1:46ce1e16c870 | 1 | /*---------------------------------------------------------------------------/ |
emilmont | 1:46ce1e16c870 | 2 | / FatFs - FAT file system module configuration file R0.09a (C)ChaN, 2012 |
emilmont | 1:46ce1e16c870 | 3 | /----------------------------------------------------------------------------/ |
emilmont | 1:46ce1e16c870 | 4 | / |
emilmont | 1:46ce1e16c870 | 5 | / CAUTION! Do not forget to make clean the project after any changes to |
emilmont | 1:46ce1e16c870 | 6 | / the configuration options. |
emilmont | 1:46ce1e16c870 | 7 | / |
emilmont | 1:46ce1e16c870 | 8 | /----------------------------------------------------------------------------*/ |
emilmont | 1:46ce1e16c870 | 9 | #ifndef _FFCONF |
emilmont | 1:46ce1e16c870 | 10 | #define _FFCONF 4004 /* Revision ID */ |
emilmont | 1:46ce1e16c870 | 11 | |
emilmont | 1:46ce1e16c870 | 12 | #define FFS_DBG 0 |
emilmont | 1:46ce1e16c870 | 13 | |
emilmont | 1:46ce1e16c870 | 14 | /*---------------------------------------------------------------------------/ |
emilmont | 1:46ce1e16c870 | 15 | / Functions and Buffer Configurations |
emilmont | 1:46ce1e16c870 | 16 | /----------------------------------------------------------------------------*/ |
emilmont | 1:46ce1e16c870 | 17 | |
emilmont | 1:46ce1e16c870 | 18 | #define _FS_TINY 0 /* 0:Normal or 1:Tiny */ |
emilmont | 1:46ce1e16c870 | 19 | /* When _FS_TINY is set to 1, FatFs uses the sector buffer in the file system |
emilmont | 1:46ce1e16c870 | 20 | / object instead of the sector buffer in the individual file object for file |
emilmont | 1:46ce1e16c870 | 21 | / data transfer. This reduces memory consumption 512 bytes each file object. */ |
emilmont | 1:46ce1e16c870 | 22 | |
emilmont | 1:46ce1e16c870 | 23 | |
emilmont | 1:46ce1e16c870 | 24 | #define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */ |
emilmont | 1:46ce1e16c870 | 25 | /* Setting _FS_READONLY to 1 defines read only configuration. This removes |
emilmont | 1:46ce1e16c870 | 26 | / writing functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename, |
emilmont | 1:46ce1e16c870 | 27 | / f_truncate and useless f_getfree. */ |
emilmont | 1:46ce1e16c870 | 28 | |
emilmont | 1:46ce1e16c870 | 29 | |
emilmont | 1:46ce1e16c870 | 30 | #define _FS_MINIMIZE 0 /* 0 to 3 */ |
emilmont | 1:46ce1e16c870 | 31 | /* The _FS_MINIMIZE option defines minimization level to remove some functions. |
emilmont | 1:46ce1e16c870 | 32 | / |
emilmont | 1:46ce1e16c870 | 33 | / 0: Full function. |
emilmont | 1:46ce1e16c870 | 34 | / 1: f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_truncate and f_rename |
emilmont | 1:46ce1e16c870 | 35 | / are removed. |
emilmont | 1:46ce1e16c870 | 36 | / 2: f_opendir and f_readdir are removed in addition to 1. |
emilmont | 1:46ce1e16c870 | 37 | / 3: f_lseek is removed in addition to 2. */ |
emilmont | 1:46ce1e16c870 | 38 | |
emilmont | 1:46ce1e16c870 | 39 | |
emilmont | 1:46ce1e16c870 | 40 | #define _USE_STRFUNC 0 /* 0:Disable or 1-2:Enable */ |
emilmont | 1:46ce1e16c870 | 41 | /* To enable string functions, set _USE_STRFUNC to 1 or 2. */ |
emilmont | 1:46ce1e16c870 | 42 | |
emilmont | 1:46ce1e16c870 | 43 | |
emilmont | 1:46ce1e16c870 | 44 | #define _USE_MKFS 1 /* 0:Disable or 1:Enable */ |
emilmont | 1:46ce1e16c870 | 45 | /* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */ |
emilmont | 1:46ce1e16c870 | 46 | |
emilmont | 1:46ce1e16c870 | 47 | |
emilmont | 1:46ce1e16c870 | 48 | #define _USE_FORWARD 0 /* 0:Disable or 1:Enable */ |
emilmont | 1:46ce1e16c870 | 49 | /* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */ |
emilmont | 1:46ce1e16c870 | 50 | |
emilmont | 1:46ce1e16c870 | 51 | |
emilmont | 1:46ce1e16c870 | 52 | #define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */ |
emilmont | 1:46ce1e16c870 | 53 | /* To enable fast seek feature, set _USE_FASTSEEK to 1. */ |
emilmont | 1:46ce1e16c870 | 54 | |
emilmont | 1:46ce1e16c870 | 55 | |
emilmont | 1:46ce1e16c870 | 56 | |
emilmont | 1:46ce1e16c870 | 57 | /*---------------------------------------------------------------------------/ |
emilmont | 1:46ce1e16c870 | 58 | / Locale and Namespace Configurations |
emilmont | 1:46ce1e16c870 | 59 | /----------------------------------------------------------------------------*/ |
emilmont | 1:46ce1e16c870 | 60 | |
emilmont | 1:46ce1e16c870 | 61 | #define _CODE_PAGE 858 |
emilmont | 1:46ce1e16c870 | 62 | /* The _CODE_PAGE specifies the OEM code page to be used on the target system. |
emilmont | 1:46ce1e16c870 | 63 | / Incorrect setting of the code page can cause a file open failure. |
emilmont | 1:46ce1e16c870 | 64 | / |
emilmont | 1:46ce1e16c870 | 65 | / 932 - Japanese Shift-JIS (DBCS, OEM, Windows) |
emilmont | 1:46ce1e16c870 | 66 | / 936 - Simplified Chinese GBK (DBCS, OEM, Windows) |
emilmont | 1:46ce1e16c870 | 67 | / 949 - Korean (DBCS, OEM, Windows) |
emilmont | 1:46ce1e16c870 | 68 | / 950 - Traditional Chinese Big5 (DBCS, OEM, Windows) |
emilmont | 1:46ce1e16c870 | 69 | / 1250 - Central Europe (Windows) |
emilmont | 1:46ce1e16c870 | 70 | / 1251 - Cyrillic (Windows) |
emilmont | 1:46ce1e16c870 | 71 | / 1252 - Latin 1 (Windows) |
emilmont | 1:46ce1e16c870 | 72 | / 1253 - Greek (Windows) |
emilmont | 1:46ce1e16c870 | 73 | / 1254 - Turkish (Windows) |
emilmont | 1:46ce1e16c870 | 74 | / 1255 - Hebrew (Windows) |
emilmont | 1:46ce1e16c870 | 75 | / 1256 - Arabic (Windows) |
emilmont | 1:46ce1e16c870 | 76 | / 1257 - Baltic (Windows) |
emilmont | 1:46ce1e16c870 | 77 | / 1258 - Vietnam (OEM, Windows) |
emilmont | 1:46ce1e16c870 | 78 | / 437 - U.S. (OEM) |
emilmont | 1:46ce1e16c870 | 79 | / 720 - Arabic (OEM) |
emilmont | 1:46ce1e16c870 | 80 | / 737 - Greek (OEM) |
emilmont | 1:46ce1e16c870 | 81 | / 775 - Baltic (OEM) |
emilmont | 1:46ce1e16c870 | 82 | / 850 - Multilingual Latin 1 (OEM) |
emilmont | 1:46ce1e16c870 | 83 | / 858 - Multilingual Latin 1 + Euro (OEM) |
emilmont | 1:46ce1e16c870 | 84 | / 852 - Latin 2 (OEM) |
emilmont | 1:46ce1e16c870 | 85 | / 855 - Cyrillic (OEM) |
emilmont | 1:46ce1e16c870 | 86 | / 866 - Russian (OEM) |
emilmont | 1:46ce1e16c870 | 87 | / 857 - Turkish (OEM) |
emilmont | 1:46ce1e16c870 | 88 | / 862 - Hebrew (OEM) |
emilmont | 1:46ce1e16c870 | 89 | / 874 - Thai (OEM, Windows) |
emilmont | 1:46ce1e16c870 | 90 | / 1 - ASCII only (Valid for non LFN cfg.) |
emilmont | 1:46ce1e16c870 | 91 | */ |
emilmont | 1:46ce1e16c870 | 92 | |
emilmont | 1:46ce1e16c870 | 93 | |
emilmont | 1:46ce1e16c870 | 94 | #define _USE_LFN 1 /* 0 to 3 */ |
emilmont | 1:46ce1e16c870 | 95 | #define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */ |
emilmont | 1:46ce1e16c870 | 96 | /* The _USE_LFN option switches the LFN support. |
emilmont | 1:46ce1e16c870 | 97 | / |
emilmont | 1:46ce1e16c870 | 98 | / 0: Disable LFN feature. _MAX_LFN and _LFN_UNICODE have no effect. |
emilmont | 1:46ce1e16c870 | 99 | / 1: Enable LFN with static working buffer on the BSS. Always NOT reentrant. |
emilmont | 1:46ce1e16c870 | 100 | / 2: Enable LFN with dynamic working buffer on the STACK. |
emilmont | 1:46ce1e16c870 | 101 | / 3: Enable LFN with dynamic working buffer on the HEAP. |
emilmont | 1:46ce1e16c870 | 102 | / |
emilmont | 1:46ce1e16c870 | 103 | / The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. To enable LFN, |
emilmont | 1:46ce1e16c870 | 104 | / Unicode handling functions ff_convert() and ff_wtoupper() must be added |
emilmont | 1:46ce1e16c870 | 105 | / to the project. When enable to use heap, memory control functions |
emilmont | 1:46ce1e16c870 | 106 | / ff_memalloc() and ff_memfree() must be added to the project. */ |
emilmont | 1:46ce1e16c870 | 107 | |
emilmont | 1:46ce1e16c870 | 108 | |
emilmont | 1:46ce1e16c870 | 109 | #define _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */ |
emilmont | 1:46ce1e16c870 | 110 | /* To switch the character code set on FatFs API to Unicode, |
emilmont | 1:46ce1e16c870 | 111 | / enable LFN feature and set _LFN_UNICODE to 1. */ |
emilmont | 1:46ce1e16c870 | 112 | |
emilmont | 1:46ce1e16c870 | 113 | |
emilmont | 1:46ce1e16c870 | 114 | #define _FS_RPATH 0 /* 0 to 2 */ |
emilmont | 1:46ce1e16c870 | 115 | /* The _FS_RPATH option configures relative path feature. |
emilmont | 1:46ce1e16c870 | 116 | / |
emilmont | 1:46ce1e16c870 | 117 | / 0: Disable relative path feature and remove related functions. |
emilmont | 1:46ce1e16c870 | 118 | / 1: Enable relative path. f_chdrive() and f_chdir() are available. |
emilmont | 1:46ce1e16c870 | 119 | / 2: f_getcwd() is available in addition to 1. |
emilmont | 1:46ce1e16c870 | 120 | / |
emilmont | 1:46ce1e16c870 | 121 | / Note that output of the f_readdir fnction is affected by this option. */ |
emilmont | 1:46ce1e16c870 | 122 | |
emilmont | 1:46ce1e16c870 | 123 | |
emilmont | 1:46ce1e16c870 | 124 | |
emilmont | 1:46ce1e16c870 | 125 | /*---------------------------------------------------------------------------/ |
emilmont | 1:46ce1e16c870 | 126 | / Physical Drive Configurations |
emilmont | 1:46ce1e16c870 | 127 | /----------------------------------------------------------------------------*/ |
emilmont | 1:46ce1e16c870 | 128 | |
emilmont | 1:46ce1e16c870 | 129 | #define _VOLUMES 1 |
emilmont | 1:46ce1e16c870 | 130 | /* Number of volumes (logical drives) to be used. */ |
emilmont | 1:46ce1e16c870 | 131 | |
emilmont | 1:46ce1e16c870 | 132 | |
emilmont | 1:46ce1e16c870 | 133 | #define _MAX_SS 512 /* 512, 1024, 2048 or 4096 */ |
emilmont | 1:46ce1e16c870 | 134 | /* Maximum sector size to be handled. |
emilmont | 1:46ce1e16c870 | 135 | / Always set 512 for memory card and hard disk but a larger value may be |
emilmont | 1:46ce1e16c870 | 136 | / required for on-board flash memory, floppy disk and optical disk. |
emilmont | 1:46ce1e16c870 | 137 | / When _MAX_SS is larger than 512, it configures FatFs to variable sector size |
emilmont | 1:46ce1e16c870 | 138 | / and GET_SECTOR_SIZE command must be implememted to the disk_ioctl function. */ |
emilmont | 1:46ce1e16c870 | 139 | |
emilmont | 1:46ce1e16c870 | 140 | |
emilmont | 1:46ce1e16c870 | 141 | #define _MULTI_PARTITION 0 /* 0:Single partition, 1/2:Enable multiple partition */ |
emilmont | 1:46ce1e16c870 | 142 | /* When set to 0, each volume is bound to the same physical drive number and |
emilmont | 1:46ce1e16c870 | 143 | / it can mount only first primaly partition. When it is set to 1, each volume |
emilmont | 1:46ce1e16c870 | 144 | / is tied to the partitions listed in VolToPart[]. */ |
emilmont | 1:46ce1e16c870 | 145 | |
emilmont | 1:46ce1e16c870 | 146 | |
emilmont | 1:46ce1e16c870 | 147 | #define _USE_ERASE 0 /* 0:Disable or 1:Enable */ |
emilmont | 1:46ce1e16c870 | 148 | /* To enable sector erase feature, set _USE_ERASE to 1. CTRL_ERASE_SECTOR command |
emilmont | 1:46ce1e16c870 | 149 | / should be added to the disk_ioctl functio. */ |
emilmont | 1:46ce1e16c870 | 150 | |
emilmont | 1:46ce1e16c870 | 151 | |
emilmont | 1:46ce1e16c870 | 152 | |
emilmont | 1:46ce1e16c870 | 153 | /*---------------------------------------------------------------------------/ |
emilmont | 1:46ce1e16c870 | 154 | / System Configurations |
emilmont | 1:46ce1e16c870 | 155 | /----------------------------------------------------------------------------*/ |
emilmont | 1:46ce1e16c870 | 156 | |
emilmont | 1:46ce1e16c870 | 157 | #define _WORD_ACCESS 0 /* 0 or 1 */ |
emilmont | 1:46ce1e16c870 | 158 | /* Set 0 first and it is always compatible with all platforms. The _WORD_ACCESS |
emilmont | 1:46ce1e16c870 | 159 | / option defines which access method is used to the word data on the FAT volume. |
emilmont | 1:46ce1e16c870 | 160 | / |
emilmont | 1:46ce1e16c870 | 161 | / 0: Byte-by-byte access. |
emilmont | 1:46ce1e16c870 | 162 | / 1: Word access. Do not choose this unless following condition is met. |
emilmont | 1:46ce1e16c870 | 163 | / |
emilmont | 1:46ce1e16c870 | 164 | / When the byte order on the memory is big-endian or address miss-aligned word |
emilmont | 1:46ce1e16c870 | 165 | / access results incorrect behavior, the _WORD_ACCESS must be set to 0. |
emilmont | 1:46ce1e16c870 | 166 | / If it is not the case, the value can also be set to 1 to improve the |
emilmont | 1:46ce1e16c870 | 167 | / performance and code size. |
emilmont | 1:46ce1e16c870 | 168 | */ |
emilmont | 1:46ce1e16c870 | 169 | |
emilmont | 1:46ce1e16c870 | 170 | |
emilmont | 1:46ce1e16c870 | 171 | /* A header file that defines sync object types on the O/S, such as |
emilmont | 1:46ce1e16c870 | 172 | / windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */ |
emilmont | 1:46ce1e16c870 | 173 | |
emilmont | 1:46ce1e16c870 | 174 | #define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */ |
emilmont | 1:46ce1e16c870 | 175 | #define _FS_TIMEOUT 1000 /* Timeout period in unit of time ticks */ |
emilmont | 1:46ce1e16c870 | 176 | #define _SYNC_t HANDLE /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */ |
emilmont | 1:46ce1e16c870 | 177 | |
emilmont | 1:46ce1e16c870 | 178 | /* The _FS_REENTRANT option switches the reentrancy (thread safe) of the FatFs module. |
emilmont | 1:46ce1e16c870 | 179 | / |
emilmont | 1:46ce1e16c870 | 180 | / 0: Disable reentrancy. _SYNC_t and _FS_TIMEOUT have no effect. |
emilmont | 1:46ce1e16c870 | 181 | / 1: Enable reentrancy. Also user provided synchronization handlers, |
emilmont | 1:46ce1e16c870 | 182 | / ff_req_grant, ff_rel_grant, ff_del_syncobj and ff_cre_syncobj |
emilmont | 1:46ce1e16c870 | 183 | / function must be added to the project. */ |
emilmont | 1:46ce1e16c870 | 184 | |
emilmont | 1:46ce1e16c870 | 185 | |
emilmont | 1:46ce1e16c870 | 186 | #define _FS_LOCK 0 /* 0:Disable or >=1:Enable */ |
emilmont | 1:46ce1e16c870 | 187 | /* To enable file lock control feature, set _FS_LOCK to 1 or greater. |
emilmont | 1:46ce1e16c870 | 188 | The value defines how many files can be opened simultaneously. */ |
emilmont | 1:46ce1e16c870 | 189 | |
mbed_official | 4:3ff2606d5713 | 190 | #define FLUSH_ON_NEW_CLUSTER 0 /* Sync the file on every new cluster */ |
mbed_official | 4:3ff2606d5713 | 191 | #define FLUSH_ON_NEW_SECTOR 1 /* Sync the file on every new sector */ |
mbed_official | 4:3ff2606d5713 | 192 | /* Only one of these two defines needs to be set to 1. If both are set to 0 |
mbed_official | 4:3ff2606d5713 | 193 | the file is only sync when closed. |
mbed_official | 4:3ff2606d5713 | 194 | Clusters are group of sectors (eg: 8 sectors). Flushing on new cluster means |
mbed_official | 4:3ff2606d5713 | 195 | it would be less often than flushing on new sector. Sectors are generally |
mbed_official | 4:3ff2606d5713 | 196 | 512 Bytes long. */ |
emilmont | 1:46ce1e16c870 | 197 | |
emilmont | 1:46ce1e16c870 | 198 | #endif /* _FFCONFIG */ |