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