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:
0:43cce7b453d0
Modified I2c2mem for "FILES" command

Who changed what in which revision?

UserRevisionLine numberNew contents of line
oks486 0:43cce7b453d0 1 /*-----------------------------------------------------------------------/
oks486 0:43cce7b453d0 2 / Low level disk interface modlue include file (C)ChaN, 2014 /
oks486 0:43cce7b453d0 3 /-----------------------------------------------------------------------*/
oks486 0:43cce7b453d0 4
oks486 0:43cce7b453d0 5 #ifndef _DISKIO_DEFINED
oks486 0:43cce7b453d0 6 #define _DISKIO_DEFINED
oks486 0:43cce7b453d0 7
oks486 0:43cce7b453d0 8 #ifdef __cplusplus
oks486 0:43cce7b453d0 9 extern "C" {
oks486 0:43cce7b453d0 10 #endif
oks486 0:43cce7b453d0 11
oks486 0:43cce7b453d0 12 #define _USE_WRITE 1 /* 1: Enable disk_write function */
oks486 0:43cce7b453d0 13 #define _USE_IOCTL 1 /* 1: Enable disk_ioctl fucntion */
oks486 0:43cce7b453d0 14
oks486 0:43cce7b453d0 15 #include "integer.h"
oks486 0:43cce7b453d0 16
oks486 0:43cce7b453d0 17
oks486 0:43cce7b453d0 18 /* Status of Disk Functions */
oks486 0:43cce7b453d0 19 typedef BYTE DSTATUS;
oks486 0:43cce7b453d0 20
oks486 0:43cce7b453d0 21 /* Results of Disk Functions */
oks486 0:43cce7b453d0 22 typedef enum {
oks486 0:43cce7b453d0 23 RES_OK = 0, /* 0: Successful */
oks486 0:43cce7b453d0 24 RES_ERROR, /* 1: R/W Error */
oks486 0:43cce7b453d0 25 RES_WRPRT, /* 2: Write Protected */
oks486 0:43cce7b453d0 26 RES_NOTRDY, /* 3: Not Ready */
oks486 0:43cce7b453d0 27 RES_PARERR /* 4: Invalid Parameter */
oks486 0:43cce7b453d0 28 } DRESULT;
oks486 0:43cce7b453d0 29
oks486 0:43cce7b453d0 30
oks486 0:43cce7b453d0 31 /*---------------------------------------*/
oks486 0:43cce7b453d0 32 /* Prototypes for disk control functions */
oks486 0:43cce7b453d0 33
oks486 0:43cce7b453d0 34
oks486 0:43cce7b453d0 35 DSTATUS disk_initialize (BYTE pdrv);
oks486 0:43cce7b453d0 36 DSTATUS disk_status (BYTE pdrv);
oks486 0:43cce7b453d0 37 DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
oks486 0:43cce7b453d0 38 DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
oks486 0:43cce7b453d0 39 DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
oks486 0:43cce7b453d0 40
oks486 0:43cce7b453d0 41
oks486 0:43cce7b453d0 42 /* Disk Status Bits (DSTATUS) */
oks486 0:43cce7b453d0 43
oks486 0:43cce7b453d0 44 #define STA_NOINIT 0x01 /* Drive not initialized */
oks486 0:43cce7b453d0 45 #define STA_NODISK 0x02 /* No medium in the drive */
oks486 0:43cce7b453d0 46 #define STA_PROTECT 0x04 /* Write protected */
oks486 0:43cce7b453d0 47
oks486 0:43cce7b453d0 48
oks486 0:43cce7b453d0 49 /* Command code for disk_ioctrl fucntion */
oks486 0:43cce7b453d0 50
oks486 0:43cce7b453d0 51 /* Generic command (Used by FatFs) */
oks486 0:43cce7b453d0 52 #define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */
oks486 0:43cce7b453d0 53 #define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */
oks486 0:43cce7b453d0 54 #define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */
oks486 0:43cce7b453d0 55 #define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */
oks486 0:43cce7b453d0 56 #define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
oks486 0:43cce7b453d0 57
oks486 0:43cce7b453d0 58 /* Generic command (Not used by FatFs) */
oks486 0:43cce7b453d0 59 #define CTRL_POWER 5 /* Get/Set power status */
oks486 0:43cce7b453d0 60 #define CTRL_LOCK 6 /* Lock/Unlock media removal */
oks486 0:43cce7b453d0 61 #define CTRL_EJECT 7 /* Eject media */
oks486 0:43cce7b453d0 62 #define CTRL_FORMAT 8 /* Create physical format on the media */
oks486 0:43cce7b453d0 63
oks486 0:43cce7b453d0 64 /* MMC/SDC specific ioctl command */
oks486 0:43cce7b453d0 65 #define MMC_GET_TYPE 10 /* Get card type */
oks486 0:43cce7b453d0 66 #define MMC_GET_CSD 11 /* Get CSD */
oks486 0:43cce7b453d0 67 #define MMC_GET_CID 12 /* Get CID */
oks486 0:43cce7b453d0 68 #define MMC_GET_OCR 13 /* Get OCR */
oks486 0:43cce7b453d0 69 #define MMC_GET_SDSTAT 14 /* Get SD status */
oks486 0:43cce7b453d0 70
oks486 0:43cce7b453d0 71 /* ATA/CF specific ioctl command */
oks486 0:43cce7b453d0 72 #define ATA_GET_REV 20 /* Get F/W revision */
oks486 0:43cce7b453d0 73 #define ATA_GET_MODEL 21 /* Get model name */
oks486 0:43cce7b453d0 74 #define ATA_GET_SN 22 /* Get serial number */
oks486 0:43cce7b453d0 75
oks486 0:43cce7b453d0 76 #ifdef __cplusplus
oks486 0:43cce7b453d0 77 }
oks486 0:43cce7b453d0 78 #endif
oks486 0:43cce7b453d0 79
oks486 0:43cce7b453d0 80 #endif