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