LCD1289Serial_Ethenet

Dependencies:   EthernetInterface FatFileSystemCpp SDFileSystem mbed-rtos mbed

Committer:
shindo
Date:
Wed Nov 07 06:42:34 2012 +0000
Revision:
0:a5367e4d8591
LCD1289Serial_Ethenet

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shindo 0:a5367e4d8591 1 /*-----------------------------------------------------------------------
shindo 0:a5367e4d8591 2 / Low level disk interface modlue include file
shindo 0:a5367e4d8591 3 /-----------------------------------------------------------------------*/
shindo 0:a5367e4d8591 4
shindo 0:a5367e4d8591 5 #ifndef _DISKIO
shindo 0:a5367e4d8591 6
shindo 0:a5367e4d8591 7 #define _READONLY 0 /* 1: Remove write functions */
shindo 0:a5367e4d8591 8 #define _USE_IOCTL 1 /* 1: Use disk_ioctl fucntion */
shindo 0:a5367e4d8591 9
shindo 0:a5367e4d8591 10 #include "integer.h"
shindo 0:a5367e4d8591 11
shindo 0:a5367e4d8591 12
shindo 0:a5367e4d8591 13 /* Status of Disk Functions */
shindo 0:a5367e4d8591 14 typedef BYTE DSTATUS;
shindo 0:a5367e4d8591 15
shindo 0:a5367e4d8591 16 /* Results of Disk Functions */
shindo 0:a5367e4d8591 17 typedef enum {
shindo 0:a5367e4d8591 18 RES_OK = 0, /* 0: Successful */
shindo 0:a5367e4d8591 19 RES_ERROR, /* 1: R/W Error */
shindo 0:a5367e4d8591 20 RES_WRPRT, /* 2: Write Protected */
shindo 0:a5367e4d8591 21 RES_NOTRDY, /* 3: Not Ready */
shindo 0:a5367e4d8591 22 RES_PARERR /* 4: Invalid Parameter */
shindo 0:a5367e4d8591 23 } DRESULT;
shindo 0:a5367e4d8591 24
shindo 0:a5367e4d8591 25
shindo 0:a5367e4d8591 26 /*---------------------------------------*/
shindo 0:a5367e4d8591 27 /* Prototypes for disk control functions */
shindo 0:a5367e4d8591 28
shindo 0:a5367e4d8591 29 int assign_drives (int, int);
shindo 0:a5367e4d8591 30 DSTATUS disk_initialize (BYTE);
shindo 0:a5367e4d8591 31 DSTATUS disk_status (BYTE);
shindo 0:a5367e4d8591 32 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
shindo 0:a5367e4d8591 33 #if _READONLY == 0
shindo 0:a5367e4d8591 34 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
shindo 0:a5367e4d8591 35 #endif
shindo 0:a5367e4d8591 36 DRESULT disk_ioctl (BYTE, BYTE, void*);
shindo 0:a5367e4d8591 37
shindo 0:a5367e4d8591 38
shindo 0:a5367e4d8591 39
shindo 0:a5367e4d8591 40 /* Disk Status Bits (DSTATUS) */
shindo 0:a5367e4d8591 41
shindo 0:a5367e4d8591 42 #define STA_NOINIT 0x01 /* Drive not initialized */
shindo 0:a5367e4d8591 43 #define STA_NODISK 0x02 /* No medium in the drive */
shindo 0:a5367e4d8591 44 #define STA_PROTECT 0x04 /* Write protected */
shindo 0:a5367e4d8591 45
shindo 0:a5367e4d8591 46
shindo 0:a5367e4d8591 47 /* Command code for disk_ioctrl fucntion */
shindo 0:a5367e4d8591 48
shindo 0:a5367e4d8591 49 /* Generic command (defined for FatFs) */
shindo 0:a5367e4d8591 50 #define CTRL_SYNC 0 /* Flush disk cache (for write functions) */
shindo 0:a5367e4d8591 51 #define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */
shindo 0:a5367e4d8591 52 #define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
shindo 0:a5367e4d8591 53 #define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */
shindo 0:a5367e4d8591 54 #define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */
shindo 0:a5367e4d8591 55
shindo 0:a5367e4d8591 56 /* Generic command */
shindo 0:a5367e4d8591 57 #define CTRL_POWER 5 /* Get/Set power status */
shindo 0:a5367e4d8591 58 #define CTRL_LOCK 6 /* Lock/Unlock media removal */
shindo 0:a5367e4d8591 59 #define CTRL_EJECT 7 /* Eject media */
shindo 0:a5367e4d8591 60
shindo 0:a5367e4d8591 61 /* MMC/SDC specific ioctl command */
shindo 0:a5367e4d8591 62 #define MMC_GET_TYPE 10 /* Get card type */
shindo 0:a5367e4d8591 63 #define MMC_GET_CSD 11 /* Get CSD */
shindo 0:a5367e4d8591 64 #define MMC_GET_CID 12 /* Get CID */
shindo 0:a5367e4d8591 65 #define MMC_GET_OCR 13 /* Get OCR */
shindo 0:a5367e4d8591 66 #define MMC_GET_SDSTAT 14 /* Get SD status */
shindo 0:a5367e4d8591 67
shindo 0:a5367e4d8591 68 /* ATA/CF specific ioctl command */
shindo 0:a5367e4d8591 69 #define ATA_GET_REV 20 /* Get F/W revision */
shindo 0:a5367e4d8591 70 #define ATA_GET_MODEL 21 /* Get model name */
shindo 0:a5367e4d8591 71 #define ATA_GET_SN 22 /* Get serial number */
shindo 0:a5367e4d8591 72
shindo 0:a5367e4d8591 73 /* NAND specific ioctl command */
shindo 0:a5367e4d8591 74 #define NAND_FORMAT 30 /* Create physical format */
shindo 0:a5367e4d8591 75
shindo 0:a5367e4d8591 76
shindo 0:a5367e4d8591 77 #define _DISKIO
shindo 0:a5367e4d8591 78 #endif