USBMSD SD card Hello World for Mbed platforms

Dependencies:   mbed USBMSD_SD USBDevice

Committer:
samux
Date:
Mon Nov 14 12:08:32 2011 +0000
Revision:
7:6494da2a5c60
will try to use ChaNFSSD

Who changed what in which revision?

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