temp

Dependencies:   mbed SDFileSystem MS5607 ADXL345_I2C FATFileSystem

Committer:
IKobayashi
Date:
Mon Mar 16 23:37:42 2020 +0900
Revision:
0:c88c3b616c00
copy

Who changed what in which revision?

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