SD Card Interface class. Log raw data bytes to memory addresses of your choice, or format the card and use the FAT file system to write files.

Dependencies:   mbed

Committer:
Blaze513
Date:
Mon Aug 23 07:12:13 2010 +0000
Revision:
3:210eb67b260c
Parent:
1:94c648931f84
Child:
5:d85e20b6b904

        

Who changed what in which revision?

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