megan gimple / SDFileSystem

Dependents:   gimple_A4_3_Temp_Light

Committer:
mgimple
Date:
Sat Nov 13 20:10:05 2021 +0000
Revision:
0:07ff9ae5339f
SD

Who changed what in which revision?

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