12 #ifndef __GD32F1X0_USBD_MSC_SCSI_H
13 #define __GD32F1X0_USBD_MSC_SCSI_H
20 #define SENSE_LIST_DEEPTH 4
23 #define SCSI_FORMAT_UNIT 0x04
24 #define SCSI_INQUIRY 0x12
25 #define SCSI_MODE_SELECT6 0x15
26 #define SCSI_MODE_SELECT10 0x55
27 #define SCSI_MODE_SENSE6 0x1A
28 #define SCSI_MODE_SENSE10 0x5A
29 #define SCSI_ALLOW_MEDIUM_REMOVAL 0x1E
30 #define SCSI_READ6 0x08
31 #define SCSI_READ10 0x28
32 #define SCSI_READ12 0xA8
33 #define SCSI_READ16 0x88
35 #define SCSI_READ_CAPACITY10 0x25
36 #define SCSI_READ_CAPACITY16 0x9E
38 #define SCSI_REQUEST_SENSE 0x03
39 #define SCSI_START_STOP_UNIT 0x1B
40 #define SCSI_TEST_UNIT_READY 0x00
41 #define SCSI_WRITE6 0x0A
42 #define SCSI_WRITE10 0x2A
43 #define SCSI_WRITE12 0xAA
44 #define SCSI_WRITE16 0x8A
46 #define SCSI_VERIFY10 0x2F
47 #define SCSI_VERIFY12 0xAF
48 #define SCSI_VERIFY16 0x8F
50 #define SCSI_SEND_DIAGNOSTIC 0x1D
51 #define SCSI_READ_FORMAT_CAPACITIES 0x23
54 #define RECOVERED_ERROR 1
56 #define MEDIUM_ERROR 3
57 #define HARDWARE_ERROR 4
58 #define ILLEGAL_REQUEST 5
59 #define UNIT_ATTENTION 6
60 #define DATA_PROTECT 7
62 #define VENDOR_SPECIFIC 9
63 #define COPY_ABORTED 10
64 #define ABORTED_COMMAND 11
65 #define VOLUME_OVERFLOW 13
69 #define INVALID_CDB 0x20
70 #define INVALID_FIELED_IN_COMMAND 0x24
71 #define PARAMETER_LIST_LENGTH_ERROR 0x1A
72 #define INVALID_FIELD_IN_PARAMETER_LIST 0x26
73 #define ADDRESS_OUT_OF_RANGE 0x21
74 #define MEDIUM_NOT_PRESENT 0x3A
75 #define MEDIUM_HAVE_CHANGED 0x28
76 #define WRITE_PROTECTED 0x27
77 #define UNRECOVERED_READ_ERROR 0x11
78 #define WRITE_FAULT 0x03
80 #define READ_FORMAT_CAPACITY_DATA_LEN 0x0C
81 #define READ_CAPACITY10_DATA_LEN 0x08
82 #define MODE_SENSE10_DATA_LEN 0x08
83 #define MODE_SENSE6_DATA_LEN 0x04
84 #define REQUEST_SENSE_DATA_LEN 0x12
85 #define STANDARD_INQUIRY_DATA_LEN 0x24
98 extern uint8_t Page00_Inquiry_Data[];
99 extern uint8_t Standard_Inquiry_Data[];
100 extern uint8_t Standard_Inquiry_Data2[];
101 extern uint8_t Mode_Sense6_data[];
102 extern uint8_t Mode_Sense10_data[];
103 extern uint8_t Scsi_Sense_Data[];
104 extern uint8_t ReadCapacity10_Data[];
105 extern uint8_t ReadFormatCapacity_Data[];
108 extern uint8_t SCSI_Sense_Head;
109 extern uint8_t SCSI_Sense_Tail;
int8_t SCSI_ProcessWrite(uint8_t Lun)
Handle write process.
void SCSI_SenseCode(uint8_t Lun, uint8_t SKey, uint8_t ASC)
Load the last error code in the error list.
int8_t SCSI_ProcessRead(uint8_t Lun)
Handle Read Process.
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.
Header file for the usbd_msc_bot.c file.