![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
local fix version of myBlueUSB (http://mbed.org/users/networker/code/myBlueUSB/). - merge deleted files which are required to compile. - enable echo back of received data via RFCOMM.
Dependencies: AvailableMemory FatFileSystem mbed myUSBHost
FATFileSystem/diskio.h@0:003889bc474f, 2013-12-07 (annotated)
- Committer:
- nobukuma
- Date:
- Sat Dec 07 14:19:00 2013 +0000
- Revision:
- 0:003889bc474f
http://mbed.org/users/networker/code/myBlueUSB/ rev13??rev12??????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nobukuma | 0:003889bc474f | 1 | /*----------------------------------------------------------------------- |
nobukuma | 0:003889bc474f | 2 | / Low level disk interface modlue include file R0.06 (C)ChaN, 2007 |
nobukuma | 0:003889bc474f | 3 | /-----------------------------------------------------------------------*/ |
nobukuma | 0:003889bc474f | 4 | |
nobukuma | 0:003889bc474f | 5 | #ifndef _DISKIO |
nobukuma | 0:003889bc474f | 6 | |
nobukuma | 0:003889bc474f | 7 | #define _READONLY 0 /* 1: Read-only mode */ |
nobukuma | 0:003889bc474f | 8 | #define _USE_IOCTL 1 |
nobukuma | 0:003889bc474f | 9 | |
nobukuma | 0:003889bc474f | 10 | #include "integer.h" |
nobukuma | 0:003889bc474f | 11 | |
nobukuma | 0:003889bc474f | 12 | #ifdef __cplusplus |
nobukuma | 0:003889bc474f | 13 | extern "C" { |
nobukuma | 0:003889bc474f | 14 | #endif |
nobukuma | 0:003889bc474f | 15 | |
nobukuma | 0:003889bc474f | 16 | /* Status of Disk Functions */ |
nobukuma | 0:003889bc474f | 17 | typedef BYTE DSTATUS; |
nobukuma | 0:003889bc474f | 18 | |
nobukuma | 0:003889bc474f | 19 | /* Results of Disk Functions */ |
nobukuma | 0:003889bc474f | 20 | typedef enum { |
nobukuma | 0:003889bc474f | 21 | RES_OK = 0, /* 0: Successful */ |
nobukuma | 0:003889bc474f | 22 | RES_ERROR, /* 1: R/W Error */ |
nobukuma | 0:003889bc474f | 23 | RES_WRPRT, /* 2: Write Protected */ |
nobukuma | 0:003889bc474f | 24 | RES_NOTRDY, /* 3: Not Ready */ |
nobukuma | 0:003889bc474f | 25 | RES_PARERR /* 4: Invalid Parameter */ |
nobukuma | 0:003889bc474f | 26 | } DRESULT; |
nobukuma | 0:003889bc474f | 27 | |
nobukuma | 0:003889bc474f | 28 | |
nobukuma | 0:003889bc474f | 29 | /*---------------------------------------*/ |
nobukuma | 0:003889bc474f | 30 | /* Prototypes for disk control functions */ |
nobukuma | 0:003889bc474f | 31 | |
nobukuma | 0:003889bc474f | 32 | DSTATUS disk_initialize (BYTE); |
nobukuma | 0:003889bc474f | 33 | DSTATUS disk_status (BYTE); |
nobukuma | 0:003889bc474f | 34 | DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE); |
nobukuma | 0:003889bc474f | 35 | #if _READONLY == 0 |
nobukuma | 0:003889bc474f | 36 | DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE); |
nobukuma | 0:003889bc474f | 37 | #endif |
nobukuma | 0:003889bc474f | 38 | DRESULT disk_ioctl (BYTE, BYTE, void*); |
nobukuma | 0:003889bc474f | 39 | void disk_timerproc (void); |
nobukuma | 0:003889bc474f | 40 | |
nobukuma | 0:003889bc474f | 41 | #ifdef __cplusplus |
nobukuma | 0:003889bc474f | 42 | }; |
nobukuma | 0:003889bc474f | 43 | #endif |
nobukuma | 0:003889bc474f | 44 | |
nobukuma | 0:003889bc474f | 45 | |
nobukuma | 0:003889bc474f | 46 | /* Disk Status Bits (DSTATUS) */ |
nobukuma | 0:003889bc474f | 47 | |
nobukuma | 0:003889bc474f | 48 | #define STA_NOINIT 0x01 /* Drive not initialized */ |
nobukuma | 0:003889bc474f | 49 | #define STA_NODISK 0x02 /* No medium in the drive */ |
nobukuma | 0:003889bc474f | 50 | #define STA_PROTECT 0x04 /* Write protected */ |
nobukuma | 0:003889bc474f | 51 | |
nobukuma | 0:003889bc474f | 52 | |
nobukuma | 0:003889bc474f | 53 | /* Command code for disk_ioctrl() */ |
nobukuma | 0:003889bc474f | 54 | |
nobukuma | 0:003889bc474f | 55 | /* Generic command */ |
nobukuma | 0:003889bc474f | 56 | #define CTRL_SYNC 0 /* Mandatory for read/write configuration */ |
nobukuma | 0:003889bc474f | 57 | #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */ |
nobukuma | 0:003889bc474f | 58 | #define GET_SECTOR_SIZE 2 |
nobukuma | 0:003889bc474f | 59 | #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */ |
nobukuma | 0:003889bc474f | 60 | #define CTRL_POWER 4 |
nobukuma | 0:003889bc474f | 61 | #define CTRL_LOCK 5 |
nobukuma | 0:003889bc474f | 62 | #define CTRL_EJECT 6 |
nobukuma | 0:003889bc474f | 63 | /* MMC/SDC command */ |
nobukuma | 0:003889bc474f | 64 | #define MMC_GET_TYPE 10 |
nobukuma | 0:003889bc474f | 65 | #define MMC_GET_CSD 11 |
nobukuma | 0:003889bc474f | 66 | #define MMC_GET_CID 12 |
nobukuma | 0:003889bc474f | 67 | #define MMC_GET_OCR 13 |
nobukuma | 0:003889bc474f | 68 | #define MMC_GET_SDSTAT 14 |
nobukuma | 0:003889bc474f | 69 | /* ATA/CF command */ |
nobukuma | 0:003889bc474f | 70 | #define ATA_GET_REV 20 |
nobukuma | 0:003889bc474f | 71 | #define ATA_GET_MODEL 21 |
nobukuma | 0:003889bc474f | 72 | #define ATA_GET_SN 22 |
nobukuma | 0:003889bc474f | 73 | |
nobukuma | 0:003889bc474f | 74 | |
nobukuma | 0:003889bc474f | 75 | #define _DISKIO |
nobukuma | 0:003889bc474f | 76 | #endif |