12 #ifndef __GD32F10X_USBD_MSC_SCSI_H
13 #define __GD32F10X_USBD_MSC_SCSI_H
38 #define SENSE_LIST_DEEPTH 4
41 #define SCSI_FORMAT_UNIT 0x04
42 #define SCSI_INQUIRY 0x12
43 #define SCSI_MODE_SELECT6 0x15
44 #define SCSI_MODE_SELECT10 0x55
45 #define SCSI_MODE_SENSE6 0x1A
46 #define SCSI_MODE_SENSE10 0x5A
47 #define SCSI_ALLOW_MEDIUM_REMOVAL 0x1E
48 #define SCSI_READ6 0x08
49 #define SCSI_READ10 0x28
50 #define SCSI_READ12 0xA8
51 #define SCSI_READ16 0x88
53 #define SCSI_READ_CAPACITY10 0x25
54 #define SCSI_READ_CAPACITY16 0x9E
56 #define SCSI_REQUEST_SENSE 0x03
57 #define SCSI_START_STOP_UNIT 0x1B
58 #define SCSI_TEST_UNIT_READY 0x00
59 #define SCSI_WRITE6 0x0A
60 #define SCSI_WRITE10 0x2A
61 #define SCSI_WRITE12 0xAA
62 #define SCSI_WRITE16 0x8A
64 #define SCSI_VERIFY10 0x2F
65 #define SCSI_VERIFY12 0xAF
66 #define SCSI_VERIFY16 0x8F
68 #define SCSI_SEND_DIAGNOSTIC 0x1D
69 #define SCSI_READ_FORMAT_CAPACITIES 0x23
72 #define RECOVERED_ERROR 1
74 #define MEDIUM_ERROR 3
75 #define HARDWARE_ERROR 4
76 #define ILLEGAL_REQUEST 5
77 #define UNIT_ATTENTION 6
78 #define DATA_PROTECT 7
80 #define VENDOR_SPECIFIC 9
81 #define COPY_ABORTED 10
82 #define ABORTED_COMMAND 11
83 #define VOLUME_OVERFLOW 13
87 #define INVALID_CDB 0x20
88 #define INVALID_FIELED_IN_COMMAND 0x24
89 #define PARAMETER_LIST_LENGTH_ERROR 0x1A
90 #define INVALID_FIELD_IN_PARAMETER_LIST 0x26
91 #define ADDRESS_OUT_OF_RANGE 0x21
92 #define MEDIUM_NOT_PRESENT 0x3A
93 #define MEDIUM_HAVE_CHANGED 0x28
94 #define WRITE_PROTECTED 0x27
95 #define UNRECOVERED_READ_ERROR 0x11
96 #define WRITE_FAULT 0x03
98 #define READ_FORMAT_CAPACITY_DATA_LEN 0x0C
99 #define READ_CAPACITY10_DATA_LEN 0x08
100 #define MODE_SENSE10_DATA_LEN 0x08
101 #define MODE_SENSE6_DATA_LEN 0x04
102 #define REQUEST_SENSE_DATA_LEN 0x12
103 #define STANDARD_INQUIRY_DATA_LEN 0x24
116 uint32_t Information;
128 extern uint8_t Page00_Inquiry_Data[];
129 extern uint8_t Standard_Inquiry_Data[];
130 extern uint8_t Standard_Inquiry_Data2[];
131 extern uint8_t Mode_Sense6_data[];
132 extern uint8_t Mode_Sense10_data[];
133 extern uint8_t Scsi_Sense_Data[];
134 extern uint8_t ReadCapacity10_Data[];
135 extern uint8_t ReadFormatCapacity_Data[];
138 extern uint8_t SCSI_Sense_Head;
139 extern uint8_t SCSI_Sense_Tail;
void SCSI_SenseCode(uint8_t Lun, uint8_t SKey, uint8_t ASC)
Load the last error code in the error list.
Header file for the usbd_msc_data.c file.
int8_t SCSI_ProcessCmd(USB_DEVICE_HANDLE *pudev, uint8_t Lun, uint8_t *cmd)
Process SCSI commands.
int8_t SCSI_ProcessRead(uint8_t Lun)
Handle Read Process.
int8_t SCSI_ProcessWrite(uint8_t Lun)
Handle write process.
Header file for the usbd_msc_bot.c file.