34 #define SCSI_TESTUNIT_READY 0x00
35 #define SCSI_REQUESTSENSE 0x03
36 #define SCSI_INQUIRY 0x12
37 #define SCSI_STARTSTOP_UNIT 0x1B
38 #define SCSI_READCAPACITY 0x25
39 #define SCSI_READ10 0x28
40 #define SCSI_WRITE10 0x2A
41 #define SCSI_VERIFY10 0x2F
43 #define SCSI_READ10_LEN 10U
44 #define SCSI_WRITE10_LEN 10U
45 #define SCSI_VERIFY10_LEN 10U
46 #define SCSI_INQUIRYDATA_LEN 36U
47 #define SCSI_STARTSTOPUNIT_LEN 6U
48 #define SCSI_REQUESTSENSE_LEN 6U
49 #define SCSI_REQUESTSENSEDATA_LEN 18U
50 #define SCSI_READCAPACITY_LEN 10U
51 #define SCSI_READCAPACITYDATA_LEN 8U
80 uint8_t PeripheralDeviceType : 5;
81 uint8_t PeripheralQualifier : 3;
85 uint8_t Reserved1 : 7;
86 uint8_t Removable : 1;
91 uint8_t ResponseDataFormat : 4;
94 uint8_t Obsolete1 : 2;
100 uint8_t Reserved2 : 2;
101 uint8_t ThirdPartyCode : 1;
109 uint8_t Obsolete2 : 2;
120 uint8_t Obsolete3 : 1;
124 uint8_t Obsolete4 : 2;
126 uint8_t T10VendorId[ 8 ];
127 uint8_t ProductId[ 16 ];
128 uint8_t ProductRevisionLevel[ 4 ];
142 uint8_t Reserved1 : 7;
159 uint8_t ResponseCode : 7;
165 uint8_t SenseKey : 4;
166 uint8_t Reserved : 1;
169 uint8_t FileMark : 1;
179 uint8_t SenseKeySpecific1 : 7;
196 uint8_t Obsolete : 1;
197 uint8_t Reserved1 : 7;
204 uint8_t Reserved3 : 7;
230 uint8_t Obsolete : 1;
232 uint8_t Reserved1 : 1;
235 uint8_t RdProtect : 3;
240 uint8_t GroupNumber : 5;
241 uint8_t Reserved2 : 3;
257 uint8_t Obsolete : 1;
259 uint8_t Reserved1 : 1;
262 uint8_t WrProtect : 3;
267 uint8_t GroupNumber : 5;
268 uint8_t Reserved2 : 3;
284 uint8_t Obsolete : 1;
286 uint8_t Reserved1 : 2;
288 uint8_t VrProtect : 3;
293 uint8_t GroupNumber : 5;
294 uint8_t Reserved2 : 2;
295 uint8_t Restricted : 1;
312 uint8_t Reserved1 : 7;
317 uint8_t PowerConditionModifier : 4;
318 uint8_t Reserved3 : 4;
324 uint8_t No_Flush : 1;
325 uint8_t Reserved4 : 1;
326 uint8_t PowerCondition : 4;
334 #if defined(USB_HOST)
336 bool MSDSCSI_Init(USBH_Ep_TypeDef *out, USBH_Ep_TypeDef *in);
342 bool MSDSCSI_Write10(uint32_t lba, uint16_t sectors,
const void *data);
bool MSDSCSI_TestUnitReady(void)
Issue a SCSI Test Unit Ready command.
SCSI Inquiry response data typedef.
#define SL_PACK_END()
Macro for handling packed structs. Use this macro after the struct definition. With GCC...
SCSI Request Sense response data typedef.
SCSI Read Capacity Command Descriptor Block (CDB) typedef.
SCSI Read Capacity response data typedef.
SCSI Inquiry Command Descriptor Block (CDB) typedef.
#define SL_PACK_START(x)
Macro for handling packed structs. Use this macro before the struct definition. X denotes the max...
bool MSDSCSI_Write10(uint32_t lba, uint16_t sectors, const void *data)
Perform a SCSI Write(10) command.
uint32_t LogicalBlockAddress
SCSI Verify 10 Command Descriptor Block (CDB) typedef.
uint32_t LogicalBlockLength
SCSI Start Stop Unit Command Descriptor Block (CDB) typedef.
SCSI Read 10 Command Descriptor Block (CDB) typedef.
uint8_t SenseKeySpecific3
bool MSDSCSI_RequestSense(MSDSCSI_RequestSenseData_TypeDef *data)
Issue a SCSI Request Sense command.
SCSI Request Sense Command Descriptor Block (CDB) typedef.
SCSI Write 10 Command Descriptor Block (CDB) typedef.
#define SL_ATTRIBUTE_PACKED
GCC style macro for handling packed structs.
bool MSDSCSI_Init(USBH_Ep_TypeDef *out, USBH_Ep_TypeDef *in)
MSDSCSI module initialization.
uint16_t AllocationLength
uint8_t SenseKeySpecific2
bool MSDSCSI_Read10(uint32_t lba, uint16_t sectors, void *data)
Issue a SCSI Read(10) command.
bool MSDSCSI_ReadCapacity(MSDSCSI_ReadCapacityData_TypeDef *data)
Issue a SCSI Read Capacity command.
bool MSDSCSI_Inquiry(MSDSCSI_InquiryData_TypeDef *data)
Issue a SCSI Inquiry command.