30#include "common/tusb_common.h"
42 MSC_SUBCLASS_RBC = 1 ,
43 MSC_SUBCLASS_SFF_MMC ,
51 MSC_CBW_SIGNATURE = 0x43425355,
52 MSC_CSW_SIGNATURE = 0x53425355
59 MSC_PROTOCOL_CBI = 0 ,
60 MSC_PROTOCOL_CBI_NO_INTERRUPT = 1 ,
61 MSC_PROTOCOL_BOT = 0x50
67 MSC_REQ_GET_MAX_LUN = 254,
76 MSC_CSW_STATUS_PASSED = 0 ,
77 MSC_CSW_STATUS_FAILED ,
78 MSC_CSW_STATUS_PHASE_ERROR
93TU_VERIFY_STATIC(
sizeof(
msc_cbw_t) == 31,
"size is not correct");
104TU_VERIFY_STATIC(
sizeof(
msc_csw_t) == 13,
"size is not correct");
113 SCSI_CMD_TEST_UNIT_READY = 0x00,
114 SCSI_CMD_INQUIRY = 0x12,
115 SCSI_CMD_MODE_SELECT_6 = 0x15,
116 SCSI_CMD_MODE_SENSE_6 = 0x1A,
117 SCSI_CMD_START_STOP_UNIT = 0x1B,
118 SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E,
119 SCSI_CMD_READ_CAPACITY_10 = 0x25,
120 SCSI_CMD_REQUEST_SENSE = 0x03,
121 SCSI_CMD_READ_FORMAT_CAPACITY = 0x23,
122 SCSI_CMD_READ_10 = 0x28,
123 SCSI_CMD_WRITE_10 = 0x2A,
129 SCSI_SENSE_NONE = 0x00,
130 SCSI_SENSE_RECOVERED_ERROR = 0x01,
131 SCSI_SENSE_NOT_READY = 0x02,
132 SCSI_SENSE_MEDIUM_ERROR = 0x03,
133 SCSI_SENSE_HARDWARE_ERROR = 0x04,
134 SCSI_SENSE_ILLEGAL_REQUEST = 0x05,
135 SCSI_SENSE_UNIT_ATTENTION = 0x06,
136 SCSI_SENSE_DATA_PROTECT = 0x07,
137 SCSI_SENSE_FIRMWARE_ERROR = 0x08,
138 SCSI_SENSE_ABORTED_COMMAND = 0x0b,
139 SCSI_SENSE_EQUAL = 0x0c,
140 SCSI_SENSE_VOLUME_OVERFLOW = 0x0d,
141 SCSI_SENSE_MISCOMPARE = 0x0e
142}scsi_sense_key_type_t;
170TU_VERIFY_STATIC(
sizeof(
scsi_inquiry_t) == 6,
"size is not correct");
175 uint8_t peripheral_device_type : 5;
176 uint8_t peripheral_qualifier : 3;
179 uint8_t is_removable : 1;
183 uint8_t response_data_format : 4;
184 uint8_t hierarchical_support : 1;
185 uint8_t normal_aca : 1;
188 uint8_t additional_length;
192 uint8_t third_party_copy : 1;
193 uint8_t target_port_group_support : 2;
194 uint8_t access_control_coordinator : 1;
195 uint8_t scc_support : 1;
199 uint8_t multi_port : 1;
201 uint8_t enclosure_service : 1;
226 uint8_t sense_key : 4;
229 uint8_t end_of_medium : 1;
230 uint8_t filemark : 1;
232 uint32_t information;
233 uint8_t add_sense_len;
234 uint32_t command_specific_info;
235 uint8_t add_sense_code;
236 uint8_t add_sense_qualifier;
237 uint8_t field_replaceable_unit_code;
250 uint8_t disable_block_descriptor : 1;
253 uint8_t page_code : 6;
254 uint8_t page_control : 2;
256 uint8_t subpage_code;
270 bool write_protected : 1;
272 uint8_t block_descriptor_len;
281 uint8_t prohibit_removal;
296 uint8_t power_condition_mod : 4;
300 uint8_t load_eject : 1;
301 uint8_t no_flush : 1;
303 uint8_t power_condition : 4;
332 uint16_t block_size_u16;
350 uint8_t partial_medium_indicator ;
375TU_VERIFY_STATIC(
sizeof(
scsi_read10_t) == 10,
"size is not correct");
376TU_VERIFY_STATIC(
sizeof(
scsi_write10_t) == 10,
"size is not correct");
AUDIO Channel Cluster Descriptor (4.1)
Definition audio.h:647
uint32_t tag
Tag sent by the host. The device shall echo the contents of this field back to the host in the dCSWTa...
Definition msc.h:85
uint8_t product_rev[4]
4 bytes of ASCII data defined by the vendor.
Definition msc.h:213
uint8_t cmd_code
SCSI OpCode for SCSI_CMD_TEST_UNIT_READY.
Definition msc.h:151
uint8_t status
indicates the success or failure of the command. Values from msc_csw_status_t
Definition msc.h:101
uint8_t alloc_length
specifies the maximum number of bytes that USB host has allocated in the Data-In Buffer....
Definition msc.h:166
uint8_t sense_key_specific[3]
sense key specific valid bit is bit 7 of key[0], aka MSB in Big Endian layout
Definition msc.h:239
uint8_t lun
The device Logical Unit Number (LUN) to which the command block is being sent. For devices that suppo...
Definition msc.h:88
uint8_t cmd_len
The valid length of the CBWCBin bytes. This defines the valid length of the command block....
Definition msc.h:89
uint8_t dir
Bit 7 of this field define transfer direction - 0 : Data-Out from host to the device....
Definition msc.h:87
uint32_t signature
Signature that helps identify this data packet as a CBW. The signature field shall contain the value ...
Definition msc.h:84
uint8_t product_id[16]
16 bytes of ASCII data defined by the vendor.
Definition msc.h:212
uint32_t block_num
must be 8*n, length in bytes of formattable capacity descriptor followed it.
Definition msc.h:328
uint8_t vendor_id[8]
8 bytes of ASCII data identifying the vendor of the product.
Definition msc.h:211
uint8_t ili
Incorrect length indicator.
Definition msc.h:228
uint8_t descriptor_type
Number of Logical Blocks.
Definition msc.h:329
uint32_t data_residue
For Data-Out the device shall report in the dCSWDataResidue the difference between the amount of data...
Definition msc.h:100
uint16_t block_count
Number of Blocks used by this command.
Definition msc.h:371
uint8_t command[16]
The command block to be executed by the device. The device shall interpret the first cmd_len bytes in...
Definition msc.h:90
uint8_t response_code
70h - current errors, Fixed Format 71h - deferred errors, Fixed Format
Definition msc.h:221
uint8_t reserved
Definition hid.h:325
uint32_t total_bytes
The number of bytes of data that the host expects to transfer on the Bulk-In or Bulk-Out endpoint (as...
Definition msc.h:86
uint32_t lba
The first Logical Block Address (LBA) accessed by this command.
Definition msc.h:348
SCSI Read Capacity 10 Response Data.
Definition msc.h:357
uint32_t last_lba
The last Logical Block Address of the device.
Definition msc.h:358
uint32_t block_size
Block size in bytes.
Definition msc.h:359