IJFW - IchigoJamのBASICプログラムをメモリカード(MMCまたは互換カード)に保存したり読み出したりできるプログラム。メモリカードにファームウェアのファイルを置くだけで、電源ON時に自動的に書き換える機能も搭載(一応こちらがメイン)。LPC1114FN28専用。

Dependencies:   mbed

参考URL http://www.cyberchabudai.org/index.php/entry?tag=IJFW

Committer:
oks486
Date:
Sun Aug 21 07:51:01 2016 +0000
Revision:
2:daf6c4719496
Parent:
1:11f73f269fdc
Modified I2c2mem for "FILES" command

Who changed what in which revision?

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