1 /*---------------------------------------------------------------------------/ 2 / FatFs - Configuration file 3 /---------------------------------------------------------------------------*/ 4 #include "k_api.h" 5 6 #define FFCONF_DEF 87030 /* Revision ID */ 7 8 /*---------------------------------------------------------------------------/ 9 / Function Configurations 10 /---------------------------------------------------------------------------*/ 11 12 #define FF_FS_READONLY 0 13 /* This option switches read-only configuration. (0:Read/Write or 1:Read-only) 14 / Read-only configuration removes writing API functions, f_write(), f_sync(), 15 / f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree() 16 / and optional writing functions as well. */ 17 18 19 #define FF_FS_MINIMIZE 0 20 /* This option defines minimization level to remove some basic API functions. 21 / 22 / 0: All basic functions are enabled. 23 / 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename() 24 / are removed. 25 / 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1. 26 / 3: f_lseek() function is removed in addition to 2. */ 27 28 29 #define FF_USE_STRFUNC 0 30 /* This option switches string functions, f_gets(), f_putc(), f_puts() and f_printf(). 31 / 32 / 0: Disable string functions. 33 / 1: Enable without LF-CRLF conversion. 34 / 2: Enable with LF-CRLF conversion. */ 35 36 37 #define FF_USE_FIND 0 38 /* This option switches filtered directory read functions, f_findfirst() and 39 / f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */ 40 41 42 #define FF_USE_MKFS 1 43 /* This option switches f_mkfs() function. (0:Disable or 1:Enable) */ 44 45 46 #define FF_USE_FASTSEEK 0 47 /* This option switches fast seek function. (0:Disable or 1:Enable) */ 48 49 50 #define FF_USE_EXPAND 0 51 /* This option switches f_expand function. (0:Disable or 1:Enable) */ 52 53 54 #define FF_USE_CHMOD 0 55 /* This option switches attribute manipulation functions, f_chmod() and f_utime(). 56 / (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */ 57 58 59 #define FF_USE_LABEL 0 60 /* This option switches volume label functions, f_getlabel() and f_setlabel(). 61 / (0:Disable or 1:Enable) */ 62 63 64 #define FF_USE_FORWARD 0 65 /* This option switches f_forward() function. (0:Disable or 1:Enable) */ 66 67 68 /*---------------------------------------------------------------------------/ 69 / Locale and Namespace Configurations 70 /---------------------------------------------------------------------------*/ 71 72 #define FF_CODE_PAGE 437 73 /* This option specifies the OEM code page to be used on the target system. 74 / Incorrect code page setting can cause a file open failure. 75 / 76 / 437 - U.S. 77 / 936 - Simplified Chinese (DBCS) 78 */ 79 80 81 #define FF_USE_LFN 1 82 #define FF_MAX_LFN 255 83 /* The FF_USE_LFN switches the support for LFN (long file name). 84 / 85 / 0: Disable LFN. FF_MAX_LFN has no effect. 86 / 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe. 87 / 2: Enable LFN with dynamic working buffer on the STACK. 88 / 3: Enable LFN with dynamic working buffer on the HEAP. 89 / 90 / To enable the LFN, Unicode handling functions (option/unicode.c) must be added 91 / to the project. The working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and 92 / additional 608 bytes at exFAT enabled. FF_MAX_LFN can be in range from 12 to 255. 93 / It should be set 255 to support full featured LFN operations. 94 / When use stack for the working buffer, take care on stack overflow. When use heap 95 / memory for the working buffer, memory management functions, ff_memalloc() and 96 / ff_memfree(), must be added to the project. */ 97 98 99 #define FF_LFN_UNICODE 0 100 /* This option switches character encoding on the API, 0:ANSI/OEM or 1:UTF-16, 101 / when LFN is enabled. Also behavior of string I/O functions will be affected by 102 / this option. When LFN is not enabled, this option has no effect. 103 */ 104 105 106 #define FF_STRF_ENCODE 3 107 /* When FF_LFN_UNICODE = 1 with LFN enabled, string I/O functions, f_gets(), 108 / f_putc(), f_puts and f_printf() convert the character encoding in it. 109 / This option selects assumption of character encoding ON THE FILE to be 110 / read/written via those functions. 111 / 112 / 0: ANSI/OEM 113 / 1: UTF-16LE 114 / 2: UTF-16BE 115 / 3: UTF-8 116 */ 117 118 119 #define FF_FS_RPATH 0 120 /* This option configures support for relative path. 121 / 122 / 0: Disable relative path and remove related functions. 123 / 1: Enable relative path. f_chdir() and f_chdrive() are available. 124 / 2: f_getcwd() function is available in addition to 1. 125 */ 126 127 128 /*---------------------------------------------------------------------------/ 129 / Drive/Volume Configurations 130 /---------------------------------------------------------------------------*/ 131 132 #define FF_VOLUMES 3 133 /* Number of volumes (logical drives) to be used. (1-10) */ 134 135 136 #define FF_STR_VOLUME_ID 0 137 #define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3" 138 /* FF_STR_VOLUME_ID switches string support for volume ID. 139 / When FF_STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive 140 / number in the path name. FF_VOLUME_STRS defines the drive ID strings for each 141 / logical drives. Number of items must be equal to FF_VOLUMES. Valid characters for 142 / the drive ID strings are: A-Z and 0-9. */ 143 144 145 #define FF_MULTI_PARTITION 0 146 /* This option switches support for multiple volumes on the physical drive. 147 / By default (0), each logical drive number is bound to the same physical drive 148 / number and only an FAT volume found on the physical drive will be mounted. 149 / When this function is enabled (1), each logical drive number can be bound to 150 / arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk() 151 / funciton will be available. */ 152 153 154 #define FF_MIN_SS 512 155 #define FF_MAX_SS 512 156 /* This set of options configures the range of sector size to be supported. (512, 157 / 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and 158 / harddisk. But a larger value may be required for on-board flash memory and some 159 / type of optical media. When FF_MAX_SS is larger than FF_MIN_SS, FatFs is configured 160 / for variable sector size mode and disk_ioctl() function needs to implement 161 / GET_SECTOR_SIZE command. */ 162 163 164 #define FF_USE_TRIM 0 165 /* This option switches support for ATA-TRIM. (0:Disable or 1:Enable) 166 / To enable Trim function, also CTRL_TRIM command should be implemented to the 167 / disk_ioctl() function. */ 168 169 170 #define FF_FS_NOFSINFO 0 171 /* If you need to know correct free space on the FAT32 volume, set bit 0 of this 172 / option, and f_getfree() function at first time after volume mount will force 173 / a full FAT scan. Bit 1 controls the use of last allocated cluster number. 174 / 175 / bit0=0: Use free cluster count in the FSINFO if available. 176 / bit0=1: Do not trust free cluster count in the FSINFO. 177 / bit1=0: Use last allocated cluster number in the FSINFO if available. 178 / bit1=1: Do not trust last allocated cluster number in the FSINFO. 179 */ 180 181 182 183 /*---------------------------------------------------------------------------/ 184 / System Configurations 185 /---------------------------------------------------------------------------*/ 186 187 #define FF_FS_TINY 0 188 /* This option switches tiny buffer configuration. (0:Normal or 1:Tiny) 189 / At the tiny configuration, size of file object (FIL) is shrinked FF_MAX_SS bytes. 190 / Instead of private sector buffer eliminated from the file object, common sector 191 / buffer in the filesystem object (FATFS) is used for the file data transfer. */ 192 193 194 #define FF_FS_EXFAT 0 195 /* This option switches support for exFAT filesystem. (0:Disable or 1:Enable) 196 / When enable exFAT, also LFN needs to be enabled. 197 / Note that enabling exFAT discards ANSI C (C89) compatibility. */ 198 199 200 #define FF_FS_NORTC 1 201 #define FF_NORTC_MON 5 202 #define FF_NORTC_MDAY 1 203 #define FF_NORTC_YEAR 2017 204 /* The option FF_FS_NORTC switches timestamp functiton. If the system does not have 205 / any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable 206 / the timestamp function. All objects modified by FatFs will have a fixed timestamp 207 / defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. 208 / To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be 209 / added to the project to read current time form real-time clock. FF_NORTC_MON, 210 / FF_NORTC_MDAY and FF_NORTC_YEAR have no effect. 211 / These options have no effect at read-only configuration (FF_FS_READONLY = 1). */ 212 213 214 #define FF_FS_LOCK 0 215 /* The option FF_FS_LOCK switches file lock function to control duplicated file open 216 / and illegal operation to open objects. This option must be 0 when FF_FS_READONLY 217 / is 1. 218 / 219 / 0: Disable file lock function. To avoid volume corruption, application program 220 / should avoid illegal open, remove and rename to the open objects. 221 / >0: Enable file lock function. The value defines how many files/sub-directories 222 / can be opened simultaneously under file lock control. Note that the file 223 / lock control is independent of re-entrancy. */ 224 225 226 #define FF_FS_REENTRANT 0 227 #define FF_FS_TIMEOUT 1000 228 #define FF_SYNC_t kmutex_t 229 /* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs 230 / module itself. Note that regardless of this option, file access to different 231 / volume is always re-entrant and volume control functions, f_mount(), f_mkfs() 232 / and f_fdisk() function, are always not re-entrant. Only file/directory access 233 / to the same volume is under control of this function. 234 / 235 / 0: Disable re-entrancy. FF_FS_TIMEOUT and FF_SYNC_t have no effect. 236 / 1: Enable re-entrancy. Also user provided synchronization handlers, 237 / ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj() 238 / function, must be added to the project. Samples are available in 239 / option/syscall.c. 240 / 241 / The FF_FS_TIMEOUT defines timeout period in unit of time tick. 242 / The FF_SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*, 243 / SemaphoreHandle_t and etc. A header file for O/S definitions needs to be 244 / included somewhere in the scope of ff.h. */ 245 246 247 /*--- End of configuration options ---*/ 248