publication inutile mais obligée

Committer:
adrevong
Date:
Tue Jan 28 11:14:21 2020 +0000
Revision:
0:8b2a15992487

        

Who changed what in which revision?

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