Fork of FATFileSystem by
ChaN/ffconf.h@5:5746af5f56e3, 2015-03-12 (annotated)
- Committer:
- sbts
- Date:
- Thu Mar 12 02:24:40 2015 +0000
- Revision:
- 5:5746af5f56e3
- Parent:
- 4:3ff2606d5713
Added local_ffconf.h #include and fragment to ffconf.h
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 | /----------------------------------------------------------------------------*/ |
sbts | 5:5746af5f56e3 | 9 | |
sbts | 5:5746af5f56e3 | 10 | /** Fat Filesystem Local Configuration File |
sbts | 5:5746af5f56e3 | 11 | / * DO NOT MAKE per Project changes to ffconf.h |
sbts | 5:5746af5f56e3 | 12 | / * Insetad, copy this fragment into a new project file |
sbts | 5:5746af5f56e3 | 13 | / * (anyware in the Directory Tree) called local_ffconf.h |
sbts | 5:5746af5f56e3 | 14 | / * |
sbts | 5:5746af5f56e3 | 15 | / * |
sbts | 5:5746af5f56e3 | 16 | / * Start of file local_ffconf.h |
sbts | 5:5746af5f56e3 | 17 | //---------------------------------------------------------------------------- |
sbts | 5:5746af5f56e3 | 18 | // FatFs - FAT file system module configuration file R0.09a (C)ChaN, 2012 |
sbts | 5:5746af5f56e3 | 19 | //---------------------------------------------------------------------------- |
sbts | 5:5746af5f56e3 | 20 | // |
sbts | 5:5746af5f56e3 | 21 | // CAUTION! Do not forget to make clean the project after any changes to |
sbts | 5:5746af5f56e3 | 22 | // the configuration options. |
sbts | 5:5746af5f56e3 | 23 | // |
sbts | 5:5746af5f56e3 | 24 | //---------------------------------------------------------------------------- |
sbts | 5:5746af5f56e3 | 25 | #ifndef LOCAL_FFCONF_H |
sbts | 5:5746af5f56e3 | 26 | #define LOCAL_FFCONF_H 1000 // Revision ID |
sbts | 5:5746af5f56e3 | 27 | // |
sbts | 5:5746af5f56e3 | 28 | //--------------------------------------------------------------------------- |
sbts | 5:5746af5f56e3 | 29 | // This file can be used to override and validate settings in |
sbts | 5:5746af5f56e3 | 30 | // FATFileSystem/ChaN/ffconf.h |
sbts | 5:5746af5f56e3 | 31 | // It should contain all settings from that file including the defaults. |
sbts | 5:5746af5f56e3 | 32 | // for settings that need to be "Different" from the defaults don't forget to |
sbts | 5:5746af5f56e3 | 33 | // #undef xyz |
sbts | 5:5746af5f56e3 | 34 | // #define xyz new_value |
sbts | 5:5746af5f56e3 | 35 | // You should only #undef settings that need to change. |
sbts | 5:5746af5f56e3 | 36 | // This helps protect you against unexpected changes to the library config |
sbts | 5:5746af5f56e3 | 37 | // after an update. |
sbts | 5:5746af5f56e3 | 38 | //---------------------------------------------------------------------------- |
sbts | 5:5746af5f56e3 | 39 | |
sbts | 5:5746af5f56e3 | 40 | //--------------------------------------------------------------------------- |
sbts | 5:5746af5f56e3 | 41 | // Insert your config below this comment. |
sbts | 5:5746af5f56e3 | 42 | // It is recommended that you put all config options in here, |
sbts | 5:5746af5f56e3 | 43 | // but only #undef the ones that are different from defaults |
sbts | 5:5746af5f56e3 | 44 | // that way you will get a warning if the defaults change in the future |
sbts | 5:5746af5f56e3 | 45 | //---------------------------------------------------------------------------- |
sbts | 5:5746af5f56e3 | 46 | // example overriding a default |
sbts | 5:5746af5f56e3 | 47 | // #undef _FS_TINY |
sbts | 5:5746af5f56e3 | 48 | // #define _FS_TINY 1 // 0:Normal or 1:Tiny |
sbts | 5:5746af5f56e3 | 49 | |
sbts | 5:5746af5f56e3 | 50 | // example confirming a default |
sbts | 5:5746af5f56e3 | 51 | // #define _FS_READONLY 0 // 0:Read/Write or 1:Read only |
sbts | 5:5746af5f56e3 | 52 | #endif // LOCAL_FFCONF_H |
sbts | 5:5746af5f56e3 | 53 | / * end of file local_ffconf.h |
sbts | 5:5746af5f56e3 | 54 | */ |
sbts | 5:5746af5f56e3 | 55 | |
sbts | 5:5746af5f56e3 | 56 | |
sbts | 5:5746af5f56e3 | 57 | |
sbts | 5:5746af5f56e3 | 58 | |
emilmont | 1:46ce1e16c870 | 59 | #ifndef _FFCONF |
emilmont | 1:46ce1e16c870 | 60 | #define _FFCONF 4004 /* Revision ID */ |
emilmont | 1:46ce1e16c870 | 61 | |
emilmont | 1:46ce1e16c870 | 62 | #define FFS_DBG 0 |
emilmont | 1:46ce1e16c870 | 63 | |
emilmont | 1:46ce1e16c870 | 64 | /*---------------------------------------------------------------------------/ |
emilmont | 1:46ce1e16c870 | 65 | / Functions and Buffer Configurations |
emilmont | 1:46ce1e16c870 | 66 | /----------------------------------------------------------------------------*/ |
emilmont | 1:46ce1e16c870 | 67 | |
emilmont | 1:46ce1e16c870 | 68 | #define _FS_TINY 0 /* 0:Normal or 1:Tiny */ |
emilmont | 1:46ce1e16c870 | 69 | /* When _FS_TINY is set to 1, FatFs uses the sector buffer in the file system |
emilmont | 1:46ce1e16c870 | 70 | / object instead of the sector buffer in the individual file object for file |
emilmont | 1:46ce1e16c870 | 71 | / data transfer. This reduces memory consumption 512 bytes each file object. */ |
emilmont | 1:46ce1e16c870 | 72 | |
emilmont | 1:46ce1e16c870 | 73 | |
emilmont | 1:46ce1e16c870 | 74 | #define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */ |
emilmont | 1:46ce1e16c870 | 75 | /* Setting _FS_READONLY to 1 defines read only configuration. This removes |
emilmont | 1:46ce1e16c870 | 76 | / writing functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename, |
emilmont | 1:46ce1e16c870 | 77 | / f_truncate and useless f_getfree. */ |
emilmont | 1:46ce1e16c870 | 78 | |
emilmont | 1:46ce1e16c870 | 79 | |
emilmont | 1:46ce1e16c870 | 80 | #define _FS_MINIMIZE 0 /* 0 to 3 */ |
emilmont | 1:46ce1e16c870 | 81 | /* The _FS_MINIMIZE option defines minimization level to remove some functions. |
emilmont | 1:46ce1e16c870 | 82 | / |
emilmont | 1:46ce1e16c870 | 83 | / 0: Full function. |
emilmont | 1:46ce1e16c870 | 84 | / 1: f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_truncate and f_rename |
emilmont | 1:46ce1e16c870 | 85 | / are removed. |
emilmont | 1:46ce1e16c870 | 86 | / 2: f_opendir and f_readdir are removed in addition to 1. |
emilmont | 1:46ce1e16c870 | 87 | / 3: f_lseek is removed in addition to 2. */ |
emilmont | 1:46ce1e16c870 | 88 | |
emilmont | 1:46ce1e16c870 | 89 | |
emilmont | 1:46ce1e16c870 | 90 | #define _USE_STRFUNC 0 /* 0:Disable or 1-2:Enable */ |
emilmont | 1:46ce1e16c870 | 91 | /* To enable string functions, set _USE_STRFUNC to 1 or 2. */ |
emilmont | 1:46ce1e16c870 | 92 | |
emilmont | 1:46ce1e16c870 | 93 | |
emilmont | 1:46ce1e16c870 | 94 | #define _USE_MKFS 1 /* 0:Disable or 1:Enable */ |
emilmont | 1:46ce1e16c870 | 95 | /* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */ |
emilmont | 1:46ce1e16c870 | 96 | |
emilmont | 1:46ce1e16c870 | 97 | |
emilmont | 1:46ce1e16c870 | 98 | #define _USE_FORWARD 0 /* 0:Disable or 1:Enable */ |
emilmont | 1:46ce1e16c870 | 99 | /* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */ |
emilmont | 1:46ce1e16c870 | 100 | |
emilmont | 1:46ce1e16c870 | 101 | |
emilmont | 1:46ce1e16c870 | 102 | #define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */ |
emilmont | 1:46ce1e16c870 | 103 | /* To enable fast seek feature, set _USE_FASTSEEK to 1. */ |
emilmont | 1:46ce1e16c870 | 104 | |
emilmont | 1:46ce1e16c870 | 105 | |
emilmont | 1:46ce1e16c870 | 106 | |
emilmont | 1:46ce1e16c870 | 107 | /*---------------------------------------------------------------------------/ |
emilmont | 1:46ce1e16c870 | 108 | / Locale and Namespace Configurations |
emilmont | 1:46ce1e16c870 | 109 | /----------------------------------------------------------------------------*/ |
emilmont | 1:46ce1e16c870 | 110 | |
emilmont | 1:46ce1e16c870 | 111 | #define _CODE_PAGE 858 |
emilmont | 1:46ce1e16c870 | 112 | /* The _CODE_PAGE specifies the OEM code page to be used on the target system. |
emilmont | 1:46ce1e16c870 | 113 | / Incorrect setting of the code page can cause a file open failure. |
emilmont | 1:46ce1e16c870 | 114 | / |
emilmont | 1:46ce1e16c870 | 115 | / 932 - Japanese Shift-JIS (DBCS, OEM, Windows) |
emilmont | 1:46ce1e16c870 | 116 | / 936 - Simplified Chinese GBK (DBCS, OEM, Windows) |
emilmont | 1:46ce1e16c870 | 117 | / 949 - Korean (DBCS, OEM, Windows) |
emilmont | 1:46ce1e16c870 | 118 | / 950 - Traditional Chinese Big5 (DBCS, OEM, Windows) |
emilmont | 1:46ce1e16c870 | 119 | / 1250 - Central Europe (Windows) |
emilmont | 1:46ce1e16c870 | 120 | / 1251 - Cyrillic (Windows) |
emilmont | 1:46ce1e16c870 | 121 | / 1252 - Latin 1 (Windows) |
emilmont | 1:46ce1e16c870 | 122 | / 1253 - Greek (Windows) |
emilmont | 1:46ce1e16c870 | 123 | / 1254 - Turkish (Windows) |
emilmont | 1:46ce1e16c870 | 124 | / 1255 - Hebrew (Windows) |
emilmont | 1:46ce1e16c870 | 125 | / 1256 - Arabic (Windows) |
emilmont | 1:46ce1e16c870 | 126 | / 1257 - Baltic (Windows) |
emilmont | 1:46ce1e16c870 | 127 | / 1258 - Vietnam (OEM, Windows) |
emilmont | 1:46ce1e16c870 | 128 | / 437 - U.S. (OEM) |
emilmont | 1:46ce1e16c870 | 129 | / 720 - Arabic (OEM) |
emilmont | 1:46ce1e16c870 | 130 | / 737 - Greek (OEM) |
emilmont | 1:46ce1e16c870 | 131 | / 775 - Baltic (OEM) |
emilmont | 1:46ce1e16c870 | 132 | / 850 - Multilingual Latin 1 (OEM) |
emilmont | 1:46ce1e16c870 | 133 | / 858 - Multilingual Latin 1 + Euro (OEM) |
emilmont | 1:46ce1e16c870 | 134 | / 852 - Latin 2 (OEM) |
emilmont | 1:46ce1e16c870 | 135 | / 855 - Cyrillic (OEM) |
emilmont | 1:46ce1e16c870 | 136 | / 866 - Russian (OEM) |
emilmont | 1:46ce1e16c870 | 137 | / 857 - Turkish (OEM) |
emilmont | 1:46ce1e16c870 | 138 | / 862 - Hebrew (OEM) |
emilmont | 1:46ce1e16c870 | 139 | / 874 - Thai (OEM, Windows) |
emilmont | 1:46ce1e16c870 | 140 | / 1 - ASCII only (Valid for non LFN cfg.) |
emilmont | 1:46ce1e16c870 | 141 | */ |
emilmont | 1:46ce1e16c870 | 142 | |
emilmont | 1:46ce1e16c870 | 143 | |
emilmont | 1:46ce1e16c870 | 144 | #define _USE_LFN 1 /* 0 to 3 */ |
emilmont | 1:46ce1e16c870 | 145 | #define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */ |
emilmont | 1:46ce1e16c870 | 146 | /* The _USE_LFN option switches the LFN support. |
emilmont | 1:46ce1e16c870 | 147 | / |
emilmont | 1:46ce1e16c870 | 148 | / 0: Disable LFN feature. _MAX_LFN and _LFN_UNICODE have no effect. |
emilmont | 1:46ce1e16c870 | 149 | / 1: Enable LFN with static working buffer on the BSS. Always NOT reentrant. |
emilmont | 1:46ce1e16c870 | 150 | / 2: Enable LFN with dynamic working buffer on the STACK. |
emilmont | 1:46ce1e16c870 | 151 | / 3: Enable LFN with dynamic working buffer on the HEAP. |
emilmont | 1:46ce1e16c870 | 152 | / |
emilmont | 1:46ce1e16c870 | 153 | / The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. To enable LFN, |
emilmont | 1:46ce1e16c870 | 154 | / Unicode handling functions ff_convert() and ff_wtoupper() must be added |
emilmont | 1:46ce1e16c870 | 155 | / to the project. When enable to use heap, memory control functions |
emilmont | 1:46ce1e16c870 | 156 | / ff_memalloc() and ff_memfree() must be added to the project. */ |
emilmont | 1:46ce1e16c870 | 157 | |
emilmont | 1:46ce1e16c870 | 158 | |
emilmont | 1:46ce1e16c870 | 159 | #define _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */ |
emilmont | 1:46ce1e16c870 | 160 | /* To switch the character code set on FatFs API to Unicode, |
emilmont | 1:46ce1e16c870 | 161 | / enable LFN feature and set _LFN_UNICODE to 1. */ |
emilmont | 1:46ce1e16c870 | 162 | |
emilmont | 1:46ce1e16c870 | 163 | |
emilmont | 1:46ce1e16c870 | 164 | #define _FS_RPATH 0 /* 0 to 2 */ |
emilmont | 1:46ce1e16c870 | 165 | /* The _FS_RPATH option configures relative path feature. |
emilmont | 1:46ce1e16c870 | 166 | / |
emilmont | 1:46ce1e16c870 | 167 | / 0: Disable relative path feature and remove related functions. |
emilmont | 1:46ce1e16c870 | 168 | / 1: Enable relative path. f_chdrive() and f_chdir() are available. |
emilmont | 1:46ce1e16c870 | 169 | / 2: f_getcwd() is available in addition to 1. |
emilmont | 1:46ce1e16c870 | 170 | / |
emilmont | 1:46ce1e16c870 | 171 | / Note that output of the f_readdir fnction is affected by this option. */ |
emilmont | 1:46ce1e16c870 | 172 | |
emilmont | 1:46ce1e16c870 | 173 | |
emilmont | 1:46ce1e16c870 | 174 | |
emilmont | 1:46ce1e16c870 | 175 | /*---------------------------------------------------------------------------/ |
emilmont | 1:46ce1e16c870 | 176 | / Physical Drive Configurations |
emilmont | 1:46ce1e16c870 | 177 | /----------------------------------------------------------------------------*/ |
emilmont | 1:46ce1e16c870 | 178 | |
emilmont | 1:46ce1e16c870 | 179 | #define _VOLUMES 1 |
emilmont | 1:46ce1e16c870 | 180 | /* Number of volumes (logical drives) to be used. */ |
emilmont | 1:46ce1e16c870 | 181 | |
emilmont | 1:46ce1e16c870 | 182 | |
emilmont | 1:46ce1e16c870 | 183 | #define _MAX_SS 512 /* 512, 1024, 2048 or 4096 */ |
emilmont | 1:46ce1e16c870 | 184 | /* Maximum sector size to be handled. |
emilmont | 1:46ce1e16c870 | 185 | / Always set 512 for memory card and hard disk but a larger value may be |
emilmont | 1:46ce1e16c870 | 186 | / required for on-board flash memory, floppy disk and optical disk. |
emilmont | 1:46ce1e16c870 | 187 | / When _MAX_SS is larger than 512, it configures FatFs to variable sector size |
emilmont | 1:46ce1e16c870 | 188 | / and GET_SECTOR_SIZE command must be implememted to the disk_ioctl function. */ |
emilmont | 1:46ce1e16c870 | 189 | |
emilmont | 1:46ce1e16c870 | 190 | |
emilmont | 1:46ce1e16c870 | 191 | #define _MULTI_PARTITION 0 /* 0:Single partition, 1/2:Enable multiple partition */ |
emilmont | 1:46ce1e16c870 | 192 | /* When set to 0, each volume is bound to the same physical drive number and |
emilmont | 1:46ce1e16c870 | 193 | / it can mount only first primaly partition. When it is set to 1, each volume |
emilmont | 1:46ce1e16c870 | 194 | / is tied to the partitions listed in VolToPart[]. */ |
emilmont | 1:46ce1e16c870 | 195 | |
emilmont | 1:46ce1e16c870 | 196 | |
emilmont | 1:46ce1e16c870 | 197 | #define _USE_ERASE 0 /* 0:Disable or 1:Enable */ |
emilmont | 1:46ce1e16c870 | 198 | /* To enable sector erase feature, set _USE_ERASE to 1. CTRL_ERASE_SECTOR command |
emilmont | 1:46ce1e16c870 | 199 | / should be added to the disk_ioctl functio. */ |
emilmont | 1:46ce1e16c870 | 200 | |
emilmont | 1:46ce1e16c870 | 201 | |
emilmont | 1:46ce1e16c870 | 202 | |
emilmont | 1:46ce1e16c870 | 203 | /*---------------------------------------------------------------------------/ |
emilmont | 1:46ce1e16c870 | 204 | / System Configurations |
emilmont | 1:46ce1e16c870 | 205 | /----------------------------------------------------------------------------*/ |
emilmont | 1:46ce1e16c870 | 206 | |
emilmont | 1:46ce1e16c870 | 207 | #define _WORD_ACCESS 0 /* 0 or 1 */ |
emilmont | 1:46ce1e16c870 | 208 | /* Set 0 first and it is always compatible with all platforms. The _WORD_ACCESS |
emilmont | 1:46ce1e16c870 | 209 | / option defines which access method is used to the word data on the FAT volume. |
emilmont | 1:46ce1e16c870 | 210 | / |
emilmont | 1:46ce1e16c870 | 211 | / 0: Byte-by-byte access. |
emilmont | 1:46ce1e16c870 | 212 | / 1: Word access. Do not choose this unless following condition is met. |
emilmont | 1:46ce1e16c870 | 213 | / |
emilmont | 1:46ce1e16c870 | 214 | / When the byte order on the memory is big-endian or address miss-aligned word |
emilmont | 1:46ce1e16c870 | 215 | / access results incorrect behavior, the _WORD_ACCESS must be set to 0. |
emilmont | 1:46ce1e16c870 | 216 | / If it is not the case, the value can also be set to 1 to improve the |
emilmont | 1:46ce1e16c870 | 217 | / performance and code size. |
emilmont | 1:46ce1e16c870 | 218 | */ |
emilmont | 1:46ce1e16c870 | 219 | |
emilmont | 1:46ce1e16c870 | 220 | |
emilmont | 1:46ce1e16c870 | 221 | /* A header file that defines sync object types on the O/S, such as |
emilmont | 1:46ce1e16c870 | 222 | / windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */ |
emilmont | 1:46ce1e16c870 | 223 | |
emilmont | 1:46ce1e16c870 | 224 | #define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */ |
emilmont | 1:46ce1e16c870 | 225 | #define _FS_TIMEOUT 1000 /* Timeout period in unit of time ticks */ |
emilmont | 1:46ce1e16c870 | 226 | #define _SYNC_t HANDLE /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */ |
emilmont | 1:46ce1e16c870 | 227 | |
emilmont | 1:46ce1e16c870 | 228 | /* The _FS_REENTRANT option switches the reentrancy (thread safe) of the FatFs module. |
emilmont | 1:46ce1e16c870 | 229 | / |
emilmont | 1:46ce1e16c870 | 230 | / 0: Disable reentrancy. _SYNC_t and _FS_TIMEOUT have no effect. |
emilmont | 1:46ce1e16c870 | 231 | / 1: Enable reentrancy. Also user provided synchronization handlers, |
emilmont | 1:46ce1e16c870 | 232 | / ff_req_grant, ff_rel_grant, ff_del_syncobj and ff_cre_syncobj |
emilmont | 1:46ce1e16c870 | 233 | / function must be added to the project. */ |
emilmont | 1:46ce1e16c870 | 234 | |
emilmont | 1:46ce1e16c870 | 235 | |
emilmont | 1:46ce1e16c870 | 236 | #define _FS_LOCK 0 /* 0:Disable or >=1:Enable */ |
emilmont | 1:46ce1e16c870 | 237 | /* To enable file lock control feature, set _FS_LOCK to 1 or greater. |
emilmont | 1:46ce1e16c870 | 238 | The value defines how many files can be opened simultaneously. */ |
emilmont | 1:46ce1e16c870 | 239 | |
mbed_official | 4:3ff2606d5713 | 240 | #define FLUSH_ON_NEW_CLUSTER 0 /* Sync the file on every new cluster */ |
mbed_official | 4:3ff2606d5713 | 241 | #define FLUSH_ON_NEW_SECTOR 1 /* Sync the file on every new sector */ |
mbed_official | 4:3ff2606d5713 | 242 | /* Only one of these two defines needs to be set to 1. If both are set to 0 |
mbed_official | 4:3ff2606d5713 | 243 | the file is only sync when closed. |
mbed_official | 4:3ff2606d5713 | 244 | Clusters are group of sectors (eg: 8 sectors). Flushing on new cluster means |
mbed_official | 4:3ff2606d5713 | 245 | it would be less often than flushing on new sector. Sectors are generally |
mbed_official | 4:3ff2606d5713 | 246 | 512 Bytes long. */ |
sbts | 5:5746af5f56e3 | 247 | |
sbts | 5:5746af5f56e3 | 248 | #include local_ffconf.h |
emilmont | 1:46ce1e16c870 | 249 | |
emilmont | 1:46ce1e16c870 | 250 | #endif /* _FFCONFIG */ |