James Heavey / Mbed 2 deprecated 2665-Breakout-Game

Dependencies:   mbed

Committer:
jamesheavey
Date:
Tue Jan 05 01:14:11 2021 +0000
Revision:
0:92b180c8d407
test

Who changed what in which revision?

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