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