|
18 | 18 | #include "task.h" |
19 | 19 | #include "timer.h" |
20 | 20 | #include "block_io_interface.h" |
| 21 | + #if defined(DEVICE_NAME) |
| 22 | + #undef DEVICE_NAME |
| 23 | + #endif |
21 | 24 | #define DEVICE_NAME BLOCKDEV |
| 25 | + #if defined(DEVICE_UID) |
| 26 | + #undef DEVICE_UID |
| 27 | + #endif |
22 | 28 | #define DEVICE_UID 0x1000u |
| 29 | + #if defined(DEVICE_MODE) |
| 30 | + #undef DEVICE_MODE |
| 31 | + #endif |
23 | 32 | #define DEVICE_MODE DeviceModeReadWrite |
| 33 | + #if defined(DEVICE_STATE) |
| 34 | + #undef DEVICE_STATE |
| 35 | + #endif |
24 | 36 | #define DEVICE_STATE DeviceStateRunning |
| 37 | + #if defined(BLOCK_CMD_CONFIG) |
| 38 | + #undef BLOCK_CMD_CONFIG |
| 39 | + #endif |
25 | 40 | #define BLOCK_CMD_CONFIG 0x01u |
| 41 | + #if defined(BLOCK_CMD_SET_ADDRESS) |
| 42 | + #undef BLOCK_CMD_SET_ADDRESS |
| 43 | + #endif |
26 | 44 | #define BLOCK_CMD_SET_ADDRESS 0x02u |
| 45 | + #if defined(BLOCK_CMD_GET_INFO) |
| 46 | + #undef BLOCK_CMD_GET_INFO |
| 47 | + #endif |
27 | 48 | #define BLOCK_CMD_GET_INFO 0x03u |
| 49 | + #if defined(BLOCK_PROTOCOL_SD_CARD) |
| 50 | + #undef BLOCK_PROTOCOL_SD_CARD |
| 51 | + #endif |
28 | 52 | #define BLOCK_PROTOCOL_SD_CARD 0x01u |
| 53 | + #if defined(BLOCK_PROTOCOL_MMC) |
| 54 | + #undef BLOCK_PROTOCOL_MMC |
| 55 | + #endif |
29 | 56 | #define BLOCK_PROTOCOL_MMC 0x02u |
| 57 | + #if defined(BLOCK_PROTOCOL_EMMC) |
| 58 | + #undef BLOCK_PROTOCOL_EMMC |
| 59 | + #endif |
30 | 60 | #define BLOCK_PROTOCOL_EMMC 0x03u |
| 61 | + #if defined(BLOCK_PROTOCOL_RAW) |
| 62 | + #undef BLOCK_PROTOCOL_RAW |
| 63 | + #endif |
31 | 64 | #define BLOCK_PROTOCOL_RAW 0xFFu |
| 65 | + #if defined(BLOCK_CMD_READ_SINGLE) |
| 66 | + #undef BLOCK_CMD_READ_SINGLE |
| 67 | + #endif |
32 | 68 | #define BLOCK_CMD_READ_SINGLE 0x01u |
| 69 | + #if defined(BLOCK_CMD_READ_MULTIPLE) |
| 70 | + #undef BLOCK_CMD_READ_MULTIPLE |
| 71 | + #endif |
33 | 72 | #define BLOCK_CMD_READ_MULTIPLE 0x02u |
| 73 | + #if defined(BLOCK_CMD_WRITE_SINGLE) |
| 74 | + #undef BLOCK_CMD_WRITE_SINGLE |
| 75 | + #endif |
34 | 76 | #define BLOCK_CMD_WRITE_SINGLE 0x03u |
| 77 | + #if defined(BLOCK_CMD_WRITE_MULTIPLE) |
| 78 | + #undef BLOCK_CMD_WRITE_MULTIPLE |
| 79 | + #endif |
35 | 80 | #define BLOCK_CMD_WRITE_MULTIPLE 0x04u |
36 | 81 | typedef struct BlockDeviceState_s { |
37 | 82 | HalfWord_t ioDriverUID; |
|
0 commit comments