First working version of a FATFileSystem compatible Chan FAT v0.8 implementation. This is intended to use with long file names and RTOS support. For now long file names work but RTOS support is still untested.

Dependents:   USB_MSC USB_CDC_MSD_Hello TFTPServerTest DMXStation ... more

Committer:
NeoBelerophon
Date:
Fri Feb 04 21:14:33 2011 +0000
Revision:
2:629e4be333f3
Parent:
0:8ea634413549
getdir() did not work -> remove

Who changed what in which revision?

UserRevisionLine numberNew contents of line
NeoBelerophon 0:8ea634413549 1 /*---------------------------------------------------------------------------/
NeoBelerophon 0:8ea634413549 2 / FatFs - FAT file system module configuration file R0.08b (C)ChaN, 2011
NeoBelerophon 0:8ea634413549 3 /----------------------------------------------------------------------------/
NeoBelerophon 0:8ea634413549 4 /
NeoBelerophon 0:8ea634413549 5 / CAUTION! Do not forget to make clean the project after any changes to
NeoBelerophon 0:8ea634413549 6 / the configuration options.
NeoBelerophon 0:8ea634413549 7 /
NeoBelerophon 0:8ea634413549 8 /----------------------------------------------------------------------------*/
NeoBelerophon 0:8ea634413549 9 #ifndef _FFCONF
NeoBelerophon 0:8ea634413549 10 #define _FFCONF 8237 /* Revision ID */
NeoBelerophon 0:8ea634413549 11
NeoBelerophon 0:8ea634413549 12
NeoBelerophon 0:8ea634413549 13 /*---------------------------------------------------------------------------/
NeoBelerophon 0:8ea634413549 14 / Function and Buffer Configurations
NeoBelerophon 0:8ea634413549 15 /----------------------------------------------------------------------------*/
NeoBelerophon 0:8ea634413549 16
NeoBelerophon 0:8ea634413549 17 #define _FS_TINY 0 /* 0:Normal or 1:Tiny */
NeoBelerophon 0:8ea634413549 18 /* When _FS_TINY is set to 1, FatFs uses the sector buffer in the file system
NeoBelerophon 0:8ea634413549 19 / object instead of the sector buffer in the individual file object for file
NeoBelerophon 0:8ea634413549 20 / data transfer. This reduces memory consumption 512 bytes each file object. */
NeoBelerophon 0:8ea634413549 21
NeoBelerophon 0:8ea634413549 22
NeoBelerophon 0:8ea634413549 23 #define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */
NeoBelerophon 0:8ea634413549 24 /* Setting _FS_READONLY to 1 defines read only configuration. This removes
NeoBelerophon 0:8ea634413549 25 / writing functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename,
NeoBelerophon 0:8ea634413549 26 / f_truncate and useless f_getfree. */
NeoBelerophon 0:8ea634413549 27
NeoBelerophon 0:8ea634413549 28
NeoBelerophon 0:8ea634413549 29 #define _FS_MINIMIZE 0 /* 0 to 3 */
NeoBelerophon 0:8ea634413549 30 /* The _FS_MINIMIZE option defines minimization level to remove some functions.
NeoBelerophon 0:8ea634413549 31 /
NeoBelerophon 0:8ea634413549 32 / 0: Full function.
NeoBelerophon 0:8ea634413549 33 / 1: f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_truncate and f_rename
NeoBelerophon 0:8ea634413549 34 / are removed.
NeoBelerophon 0:8ea634413549 35 / 2: f_opendir and f_readdir are removed in addition to 1.
NeoBelerophon 0:8ea634413549 36 / 3: f_lseek is removed in addition to 2. */
NeoBelerophon 0:8ea634413549 37
NeoBelerophon 0:8ea634413549 38
NeoBelerophon 0:8ea634413549 39 #define _USE_STRFUNC 1 /* 0:Disable or 1/2:Enable */
NeoBelerophon 0:8ea634413549 40 /* To enable string functions, set _USE_STRFUNC to 1 or 2. */
NeoBelerophon 0:8ea634413549 41
NeoBelerophon 0:8ea634413549 42
NeoBelerophon 0:8ea634413549 43 #define _USE_MKFS 1 /* 0:Disable or 1:Enable */
NeoBelerophon 0:8ea634413549 44 /* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */
NeoBelerophon 0:8ea634413549 45
NeoBelerophon 0:8ea634413549 46
NeoBelerophon 0:8ea634413549 47 #define _USE_FORWARD 0 /* 0:Disable or 1:Enable */
NeoBelerophon 0:8ea634413549 48 /* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
NeoBelerophon 0:8ea634413549 49
NeoBelerophon 0:8ea634413549 50
NeoBelerophon 0:8ea634413549 51 #define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */
NeoBelerophon 0:8ea634413549 52 /* To enable fast seek feature, set _USE_FASTSEEK to 1. */
NeoBelerophon 0:8ea634413549 53
NeoBelerophon 0:8ea634413549 54
NeoBelerophon 0:8ea634413549 55
NeoBelerophon 0:8ea634413549 56 /*---------------------------------------------------------------------------/
NeoBelerophon 0:8ea634413549 57 / Locale and Namespace Configurations
NeoBelerophon 0:8ea634413549 58 /----------------------------------------------------------------------------*/
NeoBelerophon 0:8ea634413549 59
NeoBelerophon 0:8ea634413549 60 #define _CODE_PAGE 1252
NeoBelerophon 0:8ea634413549 61 /* The _CODE_PAGE specifies the OEM code page to be used on the target system.
NeoBelerophon 0:8ea634413549 62 / Incorrect setting of the code page can cause a file open failure.
NeoBelerophon 0:8ea634413549 63 /
NeoBelerophon 0:8ea634413549 64 / 932 - Japanese Shift-JIS (DBCS, OEM, Windows)
NeoBelerophon 0:8ea634413549 65 / 936 - Simplified Chinese GBK (DBCS, OEM, Windows)
NeoBelerophon 0:8ea634413549 66 / 949 - Korean (DBCS, OEM, Windows)
NeoBelerophon 0:8ea634413549 67 / 950 - Traditional Chinese Big5 (DBCS, OEM, Windows)
NeoBelerophon 0:8ea634413549 68 / 1250 - Central Europe (Windows)
NeoBelerophon 0:8ea634413549 69 / 1251 - Cyrillic (Windows)
NeoBelerophon 0:8ea634413549 70 / 1252 - Latin 1 (Windows)
NeoBelerophon 0:8ea634413549 71 / 1253 - Greek (Windows)
NeoBelerophon 0:8ea634413549 72 / 1254 - Turkish (Windows)
NeoBelerophon 0:8ea634413549 73 / 1255 - Hebrew (Windows)
NeoBelerophon 0:8ea634413549 74 / 1256 - Arabic (Windows)
NeoBelerophon 0:8ea634413549 75 / 1257 - Baltic (Windows)
NeoBelerophon 0:8ea634413549 76 / 1258 - Vietnam (OEM, Windows)
NeoBelerophon 0:8ea634413549 77 / 437 - U.S. (OEM)
NeoBelerophon 0:8ea634413549 78 / 720 - Arabic (OEM)
NeoBelerophon 0:8ea634413549 79 / 737 - Greek (OEM)
NeoBelerophon 0:8ea634413549 80 / 775 - Baltic (OEM)
NeoBelerophon 0:8ea634413549 81 / 850 - Multilingual Latin 1 (OEM)
NeoBelerophon 0:8ea634413549 82 / 858 - Multilingual Latin 1 + Euro (OEM)
NeoBelerophon 0:8ea634413549 83 / 852 - Latin 2 (OEM)
NeoBelerophon 0:8ea634413549 84 / 855 - Cyrillic (OEM)
NeoBelerophon 0:8ea634413549 85 / 866 - Russian (OEM)
NeoBelerophon 0:8ea634413549 86 / 857 - Turkish (OEM)
NeoBelerophon 0:8ea634413549 87 / 862 - Hebrew (OEM)
NeoBelerophon 0:8ea634413549 88 / 874 - Thai (OEM, Windows)
NeoBelerophon 0:8ea634413549 89 / 1 - ASCII only (Valid for non LFN cfg.)
NeoBelerophon 0:8ea634413549 90 */
NeoBelerophon 0:8ea634413549 91
NeoBelerophon 0:8ea634413549 92
NeoBelerophon 0:8ea634413549 93 #define _USE_LFN 1 /* 0 to 3 */
NeoBelerophon 0:8ea634413549 94 #define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */
NeoBelerophon 0:8ea634413549 95 /* The _USE_LFN option switches the LFN support.
NeoBelerophon 0:8ea634413549 96 /
NeoBelerophon 0:8ea634413549 97 / 0: Disable LFN feature. _MAX_LFN and _LFN_UNICODE have no effect.
NeoBelerophon 0:8ea634413549 98 / 1: Enable LFN with static working buffer on the BSS. Always NOT reentrant.
NeoBelerophon 0:8ea634413549 99 / 2: Enable LFN with dynamic working buffer on the STACK.
NeoBelerophon 0:8ea634413549 100 / 3: Enable LFN with dynamic working buffer on the HEAP.
NeoBelerophon 0:8ea634413549 101 /
NeoBelerophon 0:8ea634413549 102 / The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. To enable LFN,
NeoBelerophon 0:8ea634413549 103 / Unicode handling functions ff_convert() and ff_wtoupper() must be added
NeoBelerophon 0:8ea634413549 104 / to the project. When enable to use heap, memory control functions
NeoBelerophon 0:8ea634413549 105 / ff_memalloc() and ff_memfree() must be added to the project. */
NeoBelerophon 0:8ea634413549 106
NeoBelerophon 0:8ea634413549 107
NeoBelerophon 0:8ea634413549 108 #define _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */
NeoBelerophon 0:8ea634413549 109 /* To switch the character code set on FatFs API to Unicode,
NeoBelerophon 0:8ea634413549 110 / enable LFN feature and set _LFN_UNICODE to 1. */
NeoBelerophon 0:8ea634413549 111
NeoBelerophon 0:8ea634413549 112
NeoBelerophon 0:8ea634413549 113 #define _FS_RPATH 0 /* 0 to 2 */
NeoBelerophon 0:8ea634413549 114 /* The _FS_RPATH option configures relative path feature.
NeoBelerophon 0:8ea634413549 115 /
NeoBelerophon 0:8ea634413549 116 / 0: Disable relative path feature and remove related functions.
NeoBelerophon 0:8ea634413549 117 / 1: Enable relative path. f_chdrive() and f_chdir() are available.
NeoBelerophon 0:8ea634413549 118 / 2: f_getcwd() is available in addition to 1.
NeoBelerophon 0:8ea634413549 119 /
NeoBelerophon 0:8ea634413549 120 / Note that output of the f_readdir fnction is affected by this option. */
NeoBelerophon 0:8ea634413549 121
NeoBelerophon 0:8ea634413549 122
NeoBelerophon 0:8ea634413549 123
NeoBelerophon 0:8ea634413549 124 /*---------------------------------------------------------------------------/
NeoBelerophon 0:8ea634413549 125 / Physical Drive Configurations
NeoBelerophon 0:8ea634413549 126 /----------------------------------------------------------------------------*/
NeoBelerophon 0:8ea634413549 127
NeoBelerophon 0:8ea634413549 128 #define _VOLUMES 1
NeoBelerophon 0:8ea634413549 129 /* Number of volumes (logical drives) to be used. */
NeoBelerophon 0:8ea634413549 130
NeoBelerophon 0:8ea634413549 131
NeoBelerophon 0:8ea634413549 132 #define _MAX_SS 512 /* 512, 1024, 2048 or 4096 */
NeoBelerophon 0:8ea634413549 133 /* Maximum sector size to be handled.
NeoBelerophon 0:8ea634413549 134 / Always set 512 for memory card and hard disk but a larger value may be
NeoBelerophon 0:8ea634413549 135 / required for on-board flash memory, floppy disk and optical disk.
NeoBelerophon 0:8ea634413549 136 / When _MAX_SS is larger than 512, it configures FatFs to variable sector size
NeoBelerophon 0:8ea634413549 137 / and GET_SECTOR_SIZE command must be implememted to the disk_ioctl function. */
NeoBelerophon 0:8ea634413549 138
NeoBelerophon 0:8ea634413549 139
NeoBelerophon 0:8ea634413549 140 #define _MULTI_PARTITION 0 /* 0:Single partition or 1:Multiple partition */
NeoBelerophon 0:8ea634413549 141 /* When set to 0, each volume is bound to the same physical drive number and
NeoBelerophon 0:8ea634413549 142 / it can mount only first primaly partition. When it is set to 1, each volume
NeoBelerophon 0:8ea634413549 143 / is tied to the partitions listed in VolToPart[]. */
NeoBelerophon 0:8ea634413549 144
NeoBelerophon 0:8ea634413549 145
NeoBelerophon 0:8ea634413549 146 #define _USE_ERASE 0 /* 0:Disable or 1:Enable */
NeoBelerophon 0:8ea634413549 147 /* To enable sector erase feature, set _USE_ERASE to 1. CTRL_ERASE_SECTOR command
NeoBelerophon 0:8ea634413549 148 / should be added to the disk_ioctl functio. */
NeoBelerophon 0:8ea634413549 149
NeoBelerophon 0:8ea634413549 150
NeoBelerophon 0:8ea634413549 151
NeoBelerophon 0:8ea634413549 152 /*---------------------------------------------------------------------------/
NeoBelerophon 0:8ea634413549 153 / System Configurations
NeoBelerophon 0:8ea634413549 154 /----------------------------------------------------------------------------*/
NeoBelerophon 0:8ea634413549 155
NeoBelerophon 0:8ea634413549 156 #define _WORD_ACCESS 0 /* 0 or 1 */
NeoBelerophon 0:8ea634413549 157 /* Set 0 first and it is always compatible with all platforms. The _WORD_ACCESS
NeoBelerophon 0:8ea634413549 158 / option defines which access method is used to the word data on the FAT volume.
NeoBelerophon 0:8ea634413549 159 /
NeoBelerophon 0:8ea634413549 160 / 0: Byte-by-byte access.
NeoBelerophon 0:8ea634413549 161 / 1: Word access. Do not choose this unless following condition is met.
NeoBelerophon 0:8ea634413549 162 /
NeoBelerophon 0:8ea634413549 163 / When the byte order on the memory is big-endian or address miss-aligned word
NeoBelerophon 0:8ea634413549 164 / access results incorrect behavior, the _WORD_ACCESS must be set to 0.
NeoBelerophon 0:8ea634413549 165 / If it is not the case, the value can also be set to 1 to improve the
NeoBelerophon 0:8ea634413549 166 / performance and code size. */
NeoBelerophon 0:8ea634413549 167
NeoBelerophon 0:8ea634413549 168
NeoBelerophon 0:8ea634413549 169 /* A header file that defines sync object types on the O/S, such as
NeoBelerophon 0:8ea634413549 170 / windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */
NeoBelerophon 0:8ea634413549 171
NeoBelerophon 0:8ea634413549 172 #define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */
NeoBelerophon 0:8ea634413549 173 #define _FS_TIMEOUT 1000 /* Timeout period in unit of time ticks */
NeoBelerophon 0:8ea634413549 174 #define _SYNC_t HANDLE /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */
NeoBelerophon 0:8ea634413549 175
NeoBelerophon 0:8ea634413549 176 /* The _FS_REENTRANT option switches the reentrancy (thread safe) of the FatFs module.
NeoBelerophon 0:8ea634413549 177 /
NeoBelerophon 0:8ea634413549 178 / 0: Disable reentrancy. _SYNC_t and _FS_TIMEOUT have no effect.
NeoBelerophon 0:8ea634413549 179 / 1: Enable reentrancy. Also user provided synchronization handlers,
NeoBelerophon 0:8ea634413549 180 / ff_req_grant, ff_rel_grant, ff_del_syncobj and ff_cre_syncobj
NeoBelerophon 0:8ea634413549 181 / function must be added to the project. */
NeoBelerophon 0:8ea634413549 182
NeoBelerophon 0:8ea634413549 183
NeoBelerophon 0:8ea634413549 184 #define _FS_SHARE 0 /* 0:Disable or >=1:Enable */
NeoBelerophon 0:8ea634413549 185 /* To enable file shareing feature, set _FS_SHARE to 1 or greater. The value
NeoBelerophon 0:8ea634413549 186 defines how many files can be opened simultaneously. */
NeoBelerophon 0:8ea634413549 187
NeoBelerophon 0:8ea634413549 188
NeoBelerophon 0:8ea634413549 189 #endif /* _FFCONFIG */