Madeline Kistler / SDFileSystem2
Committer:
mkistler
Date:
Tue Nov 17 20:30:08 2020 +0000
Revision:
0:812e8b0b2832
Final draft.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mkistler 0:812e8b0b2832 1 /*---------------------------------------------------------------------------/
mkistler 0:812e8b0b2832 2 / FatFs - FAT file system module configuration file R0.11a (C)ChaN, 2015
mkistler 0:812e8b0b2832 3 /---------------------------------------------------------------------------*/
mkistler 0:812e8b0b2832 4
mkistler 0:812e8b0b2832 5 #define _FFCONF 64180 /* Revision ID */
mkistler 0:812e8b0b2832 6
mkistler 0:812e8b0b2832 7 #define FFS_DBG 0
mkistler 0:812e8b0b2832 8
mkistler 0:812e8b0b2832 9 /*---------------------------------------------------------------------------/
mkistler 0:812e8b0b2832 10 / Function Configurations
mkistler 0:812e8b0b2832 11 /---------------------------------------------------------------------------*/
mkistler 0:812e8b0b2832 12
mkistler 0:812e8b0b2832 13 #define _FS_READONLY 0
mkistler 0:812e8b0b2832 14 /* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
mkistler 0:812e8b0b2832 15 / Read-only configuration removes writing API functions, f_write(), f_sync(),
mkistler 0:812e8b0b2832 16 / f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree()
mkistler 0:812e8b0b2832 17 / and optional writing functions as well. */
mkistler 0:812e8b0b2832 18
mkistler 0:812e8b0b2832 19
mkistler 0:812e8b0b2832 20 #define _FS_MINIMIZE 0
mkistler 0:812e8b0b2832 21 /* This option defines minimization level to remove some basic API functions.
mkistler 0:812e8b0b2832 22 /
mkistler 0:812e8b0b2832 23 / 0: All basic functions are enabled.
mkistler 0:812e8b0b2832 24 / 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_chmod(), f_utime(),
mkistler 0:812e8b0b2832 25 / f_truncate() and f_rename() function are removed.
mkistler 0:812e8b0b2832 26 / 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.
mkistler 0:812e8b0b2832 27 / 3: f_lseek() function is removed in addition to 2. */
mkistler 0:812e8b0b2832 28
mkistler 0:812e8b0b2832 29
mkistler 0:812e8b0b2832 30 #define _USE_STRFUNC 0
mkistler 0:812e8b0b2832 31 /* This option switches string functions, f_gets(), f_putc(), f_puts() and
mkistler 0:812e8b0b2832 32 / f_printf().
mkistler 0:812e8b0b2832 33 /
mkistler 0:812e8b0b2832 34 / 0: Disable string functions.
mkistler 0:812e8b0b2832 35 / 1: Enable without LF-CRLF conversion.
mkistler 0:812e8b0b2832 36 / 2: Enable with LF-CRLF conversion. */
mkistler 0:812e8b0b2832 37
mkistler 0:812e8b0b2832 38
mkistler 0:812e8b0b2832 39 #define _USE_FIND 0
mkistler 0:812e8b0b2832 40 /* This option switches filtered directory read feature and related functions,
mkistler 0:812e8b0b2832 41 / f_findfirst() and f_findnext(). (0:Disable or 1:Enable) */
mkistler 0:812e8b0b2832 42
mkistler 0:812e8b0b2832 43
mkistler 0:812e8b0b2832 44 #define _USE_MKFS 1
mkistler 0:812e8b0b2832 45 /* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
mkistler 0:812e8b0b2832 46
mkistler 0:812e8b0b2832 47
mkistler 0:812e8b0b2832 48 #define _USE_FASTSEEK 0
mkistler 0:812e8b0b2832 49 /* This option switches fast seek feature. (0:Disable or 1:Enable) */
mkistler 0:812e8b0b2832 50
mkistler 0:812e8b0b2832 51
mkistler 0:812e8b0b2832 52 #define _USE_LABEL 0
mkistler 0:812e8b0b2832 53 /* This option switches volume label functions, f_getlabel() and f_setlabel().
mkistler 0:812e8b0b2832 54 / (0:Disable or 1:Enable) */
mkistler 0:812e8b0b2832 55
mkistler 0:812e8b0b2832 56
mkistler 0:812e8b0b2832 57 #define _USE_FORWARD 0
mkistler 0:812e8b0b2832 58 /* This option switches f_forward() function. (0:Disable or 1:Enable)
mkistler 0:812e8b0b2832 59 / To enable it, also _FS_TINY need to be set to 1. */
mkistler 0:812e8b0b2832 60
mkistler 0:812e8b0b2832 61
mkistler 0:812e8b0b2832 62 /*---------------------------------------------------------------------------/
mkistler 0:812e8b0b2832 63 / Locale and Namespace Configurations
mkistler 0:812e8b0b2832 64 /---------------------------------------------------------------------------*/
mkistler 0:812e8b0b2832 65
mkistler 0:812e8b0b2832 66 #define _CODE_PAGE 850
mkistler 0:812e8b0b2832 67 /* This option specifies the OEM code page to be used on the target system.
mkistler 0:812e8b0b2832 68 / Incorrect setting of the code page can cause a file open failure.
mkistler 0:812e8b0b2832 69 /
mkistler 0:812e8b0b2832 70 / 1 - ASCII (No extended character. Non-LFN cfg. only)
mkistler 0:812e8b0b2832 71 / 437 - U.S.
mkistler 0:812e8b0b2832 72 / 720 - Arabic
mkistler 0:812e8b0b2832 73 / 737 - Greek
mkistler 0:812e8b0b2832 74 / 771 - KBL
mkistler 0:812e8b0b2832 75 / 775 - Baltic
mkistler 0:812e8b0b2832 76 / 850 - Latin 1
mkistler 0:812e8b0b2832 77 / 852 - Latin 2
mkistler 0:812e8b0b2832 78 / 855 - Cyrillic
mkistler 0:812e8b0b2832 79 / 857 - Turkish
mkistler 0:812e8b0b2832 80 / 860 - Portuguese
mkistler 0:812e8b0b2832 81 / 861 - Icelandic
mkistler 0:812e8b0b2832 82 / 862 - Hebrew
mkistler 0:812e8b0b2832 83 / 863 - Canadian French
mkistler 0:812e8b0b2832 84 / 864 - Arabic
mkistler 0:812e8b0b2832 85 / 865 - Nordic
mkistler 0:812e8b0b2832 86 / 866 - Russian
mkistler 0:812e8b0b2832 87 / 869 - Greek 2
mkistler 0:812e8b0b2832 88 / 932 - Japanese (DBCS)
mkistler 0:812e8b0b2832 89 / 936 - Simplified Chinese (DBCS)
mkistler 0:812e8b0b2832 90 / 949 - Korean (DBCS)
mkistler 0:812e8b0b2832 91 / 950 - Traditional Chinese (DBCS)
mkistler 0:812e8b0b2832 92 */
mkistler 0:812e8b0b2832 93
mkistler 0:812e8b0b2832 94
mkistler 0:812e8b0b2832 95 #define _USE_LFN 1
mkistler 0:812e8b0b2832 96 #define _MAX_LFN 255
mkistler 0:812e8b0b2832 97 /* The _USE_LFN option switches the LFN feature.
mkistler 0:812e8b0b2832 98 /
mkistler 0:812e8b0b2832 99 / 0: Disable LFN feature. _MAX_LFN has no effect.
mkistler 0:812e8b0b2832 100 / 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
mkistler 0:812e8b0b2832 101 / 2: Enable LFN with dynamic working buffer on the STACK.
mkistler 0:812e8b0b2832 102 / 3: Enable LFN with dynamic working buffer on the HEAP.
mkistler 0:812e8b0b2832 103 /
mkistler 0:812e8b0b2832 104 / When enable the LFN feature, Unicode handling functions (option/unicode.c) must
mkistler 0:812e8b0b2832 105 / be added to the project. The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes.
mkistler 0:812e8b0b2832 106 / When use stack for the working buffer, take care on stack overflow. When use heap
mkistler 0:812e8b0b2832 107 / memory for the working buffer, memory management functions, ff_memalloc() and
mkistler 0:812e8b0b2832 108 / ff_memfree(), must be added to the project. */
mkistler 0:812e8b0b2832 109
mkistler 0:812e8b0b2832 110
mkistler 0:812e8b0b2832 111 #define _LFN_UNICODE 0
mkistler 0:812e8b0b2832 112 /* This option switches character encoding on the API. (0:ANSI/OEM or 1:Unicode)
mkistler 0:812e8b0b2832 113 / To use Unicode string for the path name, enable LFN feature and set _LFN_UNICODE
mkistler 0:812e8b0b2832 114 / to 1. This option also affects behavior of string I/O functions. */
mkistler 0:812e8b0b2832 115
mkistler 0:812e8b0b2832 116
mkistler 0:812e8b0b2832 117 #define _STRF_ENCODE 3
mkistler 0:812e8b0b2832 118 /* When _LFN_UNICODE is 1, this option selects the character encoding on the file to
mkistler 0:812e8b0b2832 119 / be read/written via string I/O functions, f_gets(), f_putc(), f_puts and f_printf().
mkistler 0:812e8b0b2832 120 /
mkistler 0:812e8b0b2832 121 / 0: ANSI/OEM
mkistler 0:812e8b0b2832 122 / 1: UTF-16LE
mkistler 0:812e8b0b2832 123 / 2: UTF-16BE
mkistler 0:812e8b0b2832 124 / 3: UTF-8
mkistler 0:812e8b0b2832 125 /
mkistler 0:812e8b0b2832 126 / When _LFN_UNICODE is 0, this option has no effect. */
mkistler 0:812e8b0b2832 127
mkistler 0:812e8b0b2832 128
mkistler 0:812e8b0b2832 129 #define _FS_RPATH 0
mkistler 0:812e8b0b2832 130 /* This option configures relative path feature.
mkistler 0:812e8b0b2832 131 /
mkistler 0:812e8b0b2832 132 / 0: Disable relative path feature and remove related functions.
mkistler 0:812e8b0b2832 133 / 1: Enable relative path feature. f_chdir() and f_chdrive() are available.
mkistler 0:812e8b0b2832 134 / 2: f_getcwd() function is available in addition to 1.
mkistler 0:812e8b0b2832 135 /
mkistler 0:812e8b0b2832 136 / Note that directory items read via f_readdir() are affected by this option. */
mkistler 0:812e8b0b2832 137
mkistler 0:812e8b0b2832 138
mkistler 0:812e8b0b2832 139 /*---------------------------------------------------------------------------/
mkistler 0:812e8b0b2832 140 / Drive/Volume Configurations
mkistler 0:812e8b0b2832 141 /---------------------------------------------------------------------------*/
mkistler 0:812e8b0b2832 142
mkistler 0:812e8b0b2832 143 #define _VOLUMES 1
mkistler 0:812e8b0b2832 144 /* Number of volumes (logical drives) to be used. */
mkistler 0:812e8b0b2832 145
mkistler 0:812e8b0b2832 146
mkistler 0:812e8b0b2832 147 #define _STR_VOLUME_ID 0
mkistler 0:812e8b0b2832 148 #define _VOLUME_STRS "RAM","NAND","CF","SD1","SD2","USB1","USB2","USB3"
mkistler 0:812e8b0b2832 149 /* _STR_VOLUME_ID option switches string volume ID feature.
mkistler 0:812e8b0b2832 150 / When _STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive
mkistler 0:812e8b0b2832 151 / number in the path name. _VOLUME_STRS defines the drive ID strings for each
mkistler 0:812e8b0b2832 152 / logical drives. Number of items must be equal to _VOLUMES. Valid characters for
mkistler 0:812e8b0b2832 153 / the drive ID strings are: A-Z and 0-9. */
mkistler 0:812e8b0b2832 154
mkistler 0:812e8b0b2832 155
mkistler 0:812e8b0b2832 156 #define _MULTI_PARTITION 0
mkistler 0:812e8b0b2832 157 /* This option switches multi-partition feature. By default (0), each logical drive
mkistler 0:812e8b0b2832 158 / number is bound to the same physical drive number and only an FAT volume found on
mkistler 0:812e8b0b2832 159 / the physical drive will be mounted. When multi-partition feature is enabled (1),
mkistler 0:812e8b0b2832 160 / each logical drive number is bound to arbitrary physical drive and partition
mkistler 0:812e8b0b2832 161 / listed in the VolToPart[]. Also f_fdisk() funciton will be available. */
mkistler 0:812e8b0b2832 162
mkistler 0:812e8b0b2832 163
mkistler 0:812e8b0b2832 164 #define _MIN_SS 512
mkistler 0:812e8b0b2832 165 #define _MAX_SS 512
mkistler 0:812e8b0b2832 166 /* These options configure the range of sector size to be supported. (512, 1024,
mkistler 0:812e8b0b2832 167 / 2048 or 4096) Always set both 512 for most systems, all type of memory cards and
mkistler 0:812e8b0b2832 168 / harddisk. But a larger value may be required for on-board flash memory and some
mkistler 0:812e8b0b2832 169 / type of optical media. When _MAX_SS is larger than _MIN_SS, FatFs is configured
mkistler 0:812e8b0b2832 170 / to variable sector size and GET_SECTOR_SIZE command must be implemented to the
mkistler 0:812e8b0b2832 171 / disk_ioctl() function. */
mkistler 0:812e8b0b2832 172
mkistler 0:812e8b0b2832 173
mkistler 0:812e8b0b2832 174 #define _USE_TRIM 0
mkistler 0:812e8b0b2832 175 /* This option switches ATA-TRIM feature. (0:Disable or 1:Enable)
mkistler 0:812e8b0b2832 176 / To enable Trim feature, also CTRL_TRIM command should be implemented to the
mkistler 0:812e8b0b2832 177 / disk_ioctl() function. */
mkistler 0:812e8b0b2832 178
mkistler 0:812e8b0b2832 179
mkistler 0:812e8b0b2832 180 #define _FS_NOFSINFO 0
mkistler 0:812e8b0b2832 181 /* If you need to know correct free space on the FAT32 volume, set bit 0 of this
mkistler 0:812e8b0b2832 182 / option, and f_getfree() function at first time after volume mount will force
mkistler 0:812e8b0b2832 183 / a full FAT scan. Bit 1 controls the use of last allocated cluster number.
mkistler 0:812e8b0b2832 184 /
mkistler 0:812e8b0b2832 185 / bit0=0: Use free cluster count in the FSINFO if available.
mkistler 0:812e8b0b2832 186 / bit0=1: Do not trust free cluster count in the FSINFO.
mkistler 0:812e8b0b2832 187 / bit1=0: Use last allocated cluster number in the FSINFO if available.
mkistler 0:812e8b0b2832 188 / bit1=1: Do not trust last allocated cluster number in the FSINFO.
mkistler 0:812e8b0b2832 189 */
mkistler 0:812e8b0b2832 190
mkistler 0:812e8b0b2832 191
mkistler 0:812e8b0b2832 192
mkistler 0:812e8b0b2832 193 /*---------------------------------------------------------------------------/
mkistler 0:812e8b0b2832 194 / System Configurations
mkistler 0:812e8b0b2832 195 /---------------------------------------------------------------------------*/
mkistler 0:812e8b0b2832 196
mkistler 0:812e8b0b2832 197 #define _FS_TINY 0
mkistler 0:812e8b0b2832 198 /* This option switches tiny buffer configuration. (0:Normal or 1:Tiny)
mkistler 0:812e8b0b2832 199 / At the tiny configuration, size of the file object (FIL) is reduced _MAX_SS
mkistler 0:812e8b0b2832 200 / bytes. Instead of private sector buffer eliminated from the file object,
mkistler 0:812e8b0b2832 201 / common sector buffer in the file system object (FATFS) is used for the file
mkistler 0:812e8b0b2832 202 / data transfer. */
mkistler 0:812e8b0b2832 203
mkistler 0:812e8b0b2832 204
mkistler 0:812e8b0b2832 205 #define _FS_NORTC 0
mkistler 0:812e8b0b2832 206 #define _NORTC_MON 1
mkistler 0:812e8b0b2832 207 #define _NORTC_MDAY 1
mkistler 0:812e8b0b2832 208 #define _NORTC_YEAR 2015
mkistler 0:812e8b0b2832 209 /* The _FS_NORTC option switches timestamp feature. If the system does not have
mkistler 0:812e8b0b2832 210 / an RTC function or valid timestamp is not needed, set _FS_NORTC to 1 to disable
mkistler 0:812e8b0b2832 211 / the timestamp feature. All objects modified by FatFs will have a fixed timestamp
mkistler 0:812e8b0b2832 212 / defined by _NORTC_MON, _NORTC_MDAY and _NORTC_YEAR.
mkistler 0:812e8b0b2832 213 / When timestamp feature is enabled (_FS_NORTC == 0), get_fattime() function need
mkistler 0:812e8b0b2832 214 / to be added to the project to read current time form RTC. _NORTC_MON,
mkistler 0:812e8b0b2832 215 / _NORTC_MDAY and _NORTC_YEAR have no effect.
mkistler 0:812e8b0b2832 216 / These options have no effect at read-only configuration (_FS_READONLY == 1). */
mkistler 0:812e8b0b2832 217
mkistler 0:812e8b0b2832 218
mkistler 0:812e8b0b2832 219 #define _FS_LOCK 0
mkistler 0:812e8b0b2832 220 /* The _FS_LOCK option switches file lock feature to control duplicated file open
mkistler 0:812e8b0b2832 221 / and illegal operation to open objects. This option must be 0 when _FS_READONLY
mkistler 0:812e8b0b2832 222 / is 1.
mkistler 0:812e8b0b2832 223 /
mkistler 0:812e8b0b2832 224 / 0: Disable file lock feature. To avoid volume corruption, application program
mkistler 0:812e8b0b2832 225 / should avoid illegal open, remove and rename to the open objects.
mkistler 0:812e8b0b2832 226 / >0: Enable file lock feature. The value defines how many files/sub-directories
mkistler 0:812e8b0b2832 227 / can be opened simultaneously under file lock control. Note that the file
mkistler 0:812e8b0b2832 228 / lock feature is independent of re-entrancy. */
mkistler 0:812e8b0b2832 229
mkistler 0:812e8b0b2832 230
mkistler 0:812e8b0b2832 231 #define _FS_REENTRANT 0
mkistler 0:812e8b0b2832 232 #define _FS_TIMEOUT 1000
mkistler 0:812e8b0b2832 233 #define _SYNC_t HANDLE
mkistler 0:812e8b0b2832 234 /* The _FS_REENTRANT option switches the re-entrancy (thread safe) of the FatFs
mkistler 0:812e8b0b2832 235 / module itself. Note that regardless of this option, file access to different
mkistler 0:812e8b0b2832 236 / volume is always re-entrant and volume control functions, f_mount(), f_mkfs()
mkistler 0:812e8b0b2832 237 / and f_fdisk() function, are always not re-entrant. Only file/directory access
mkistler 0:812e8b0b2832 238 / to the same volume is under control of this feature.
mkistler 0:812e8b0b2832 239 /
mkistler 0:812e8b0b2832 240 / 0: Disable re-entrancy. _FS_TIMEOUT and _SYNC_t have no effect.
mkistler 0:812e8b0b2832 241 / 1: Enable re-entrancy. Also user provided synchronization handlers,
mkistler 0:812e8b0b2832 242 / ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()
mkistler 0:812e8b0b2832 243 / function, must be added to the project. Samples are available in
mkistler 0:812e8b0b2832 244 / option/syscall.c.
mkistler 0:812e8b0b2832 245 /
mkistler 0:812e8b0b2832 246 / The _FS_TIMEOUT defines timeout period in unit of time tick.
mkistler 0:812e8b0b2832 247 / The _SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*,
mkistler 0:812e8b0b2832 248 / SemaphoreHandle_t and etc.. A header file for O/S definitions needs to be
mkistler 0:812e8b0b2832 249 / included somewhere in the scope of ff.c. */
mkistler 0:812e8b0b2832 250
mkistler 0:812e8b0b2832 251
mkistler 0:812e8b0b2832 252 #define _WORD_ACCESS 0
mkistler 0:812e8b0b2832 253 /* The _WORD_ACCESS option is an only platform dependent option. It defines
mkistler 0:812e8b0b2832 254 / which access method is used to the word data on the FAT volume.
mkistler 0:812e8b0b2832 255 /
mkistler 0:812e8b0b2832 256 / 0: Byte-by-byte access. Always compatible with all platforms.
mkistler 0:812e8b0b2832 257 / 1: Word access. Do not choose this unless under both the following conditions.
mkistler 0:812e8b0b2832 258 /
mkistler 0:812e8b0b2832 259 / * Address misaligned memory access is always allowed to ALL instructions.
mkistler 0:812e8b0b2832 260 / * Byte order on the memory is little-endian.
mkistler 0:812e8b0b2832 261 /
mkistler 0:812e8b0b2832 262 / If it is the case, _WORD_ACCESS can also be set to 1 to reduce code size.
mkistler 0:812e8b0b2832 263 / Following table shows allowable settings of some type of processors.
mkistler 0:812e8b0b2832 264 /
mkistler 0:812e8b0b2832 265 / ARM7TDMI 0 *2 ColdFire 0 *1 V850E 0 *2
mkistler 0:812e8b0b2832 266 / Cortex-M3 0 *3 Z80 0/1 V850ES 0/1
mkistler 0:812e8b0b2832 267 / Cortex-M0 0 *2 x86 0/1 TLCS-870 0/1
mkistler 0:812e8b0b2832 268 / AVR 0/1 RX600(LE) 0/1 TLCS-900 0/1
mkistler 0:812e8b0b2832 269 / AVR32 0 *1 RL78 0 *2 R32C 0 *2
mkistler 0:812e8b0b2832 270 / PIC18 0/1 SH-2 0 *1 M16C 0/1
mkistler 0:812e8b0b2832 271 / PIC24 0 *2 H8S 0 *1 MSP430 0 *2
mkistler 0:812e8b0b2832 272 / PIC32 0 *1 H8/300H 0 *1 8051 0/1
mkistler 0:812e8b0b2832 273 /
mkistler 0:812e8b0b2832 274 / *1:Big-endian.
mkistler 0:812e8b0b2832 275 / *2:Unaligned memory access is not supported.
mkistler 0:812e8b0b2832 276 / *3:Some compilers generate LDM/STM for mem_cpy function.
mkistler 0:812e8b0b2832 277 */
mkistler 0:812e8b0b2832 278
mkistler 0:812e8b0b2832 279 #define FLUSH_ON_NEW_CLUSTER 0 /* Sync the file on every new cluster */
mkistler 0:812e8b0b2832 280 #define FLUSH_ON_NEW_SECTOR 1 /* Sync the file on every new sector */
mkistler 0:812e8b0b2832 281 /* Only one of these two defines needs to be set to 1. If both are set to 0
mkistler 0:812e8b0b2832 282 the file is only sync when closed.
mkistler 0:812e8b0b2832 283 Clusters are group of sectors (eg: 8 sectors). Flushing on new cluster means
mkistler 0:812e8b0b2832 284 it would be less often than flushing on new sector. Sectors are generally
mkistler 0:812e8b0b2832 285 512 Bytes long. */