![]() |
![]() |
This structure is used to access the Command Block wrapper (CBW) data structure that is used when the communicating with the mass storage class device. More...
#include <usbmsc.h>
Data Fields | |
| uint8_t | bmRequestType |
| Determines the type and direction of the request. | |
| uint8_t | bRequest |
| Identifies the specific request being made. | |
| uint16_t | wValue |
| Word-sized field that varies according to the request. | |
| uint16_t | wIndex |
| uint16_t | wLength |
| uint8_t | bLength |
| uint8_t | bDescriptorType |
| uint16_t | bcdUSB |
| uint8_t | bDeviceClass |
| The device class code. | |
| uint8_t | bDeviceSubClass |
| uint8_t | bDeviceProtocol |
| uint8_t | bMaxPacketSize0 |
| uint16_t | idVendor |
| The device Vendor ID (VID) as assigned by the USB-IF. | |
| uint16_t | idProduct |
| The device Product ID (PID) as assigned by the manufacturer. | |
| uint16_t | bcdDevice |
| The device release number in BCD format. | |
| uint8_t | iManufacturer |
| The index of a string descriptor describing the manufacturer. | |
| uint8_t | iProduct |
| The index of a string descriptor describing the product. | |
| uint8_t | iSerialNumber |
| uint8_t | bNumConfigurations |
| The number of other-speed configurations supported. More... | |
| uint8_t | bReserved |
| Reserved for future use. Must be set to zero. | |
| uint16_t | wTotalLength |
| uint8_t | bNumInterfaces |
| The number of interface supported by this configuration. | |
| uint8_t | bConfigurationValue |
| uint8_t | iConfiguration |
| The index of a string descriptor describing this configuration. | |
| uint8_t | bmAttributes |
| Attributes of this configuration. More... | |
| uint8_t | bMaxPower |
| uint8_t | bInterfaceNumber |
| uint8_t | bAlternateSetting |
| uint8_t | bNumEndpoints |
| uint8_t | bInterfaceClass |
| The interface class code as assigned by the USB-IF. | |
| uint8_t | bInterfaceSubClass |
| The interface subclass code as assigned by the USB-IF. | |
| uint8_t | bInterfaceProtocol |
| The interface protocol code as assigned by the USB-IF. | |
| uint8_t | iInterface |
| The index of a string descriptor describing this interface. | |
| uint8_t | bEndpointAddress |
| uint16_t | wMaxPacketSize |
| uint8_t | bInterval |
| uint16_t | wLANGID [1] |
| uint8_t | bString |
| uint32_t | dCBWSignature |
| uint32_t | dCBWTag |
| uint32_t | dCBWDataTransferLength |
| uint8_t | bmCBWFlags |
| uint8_t | bCBWLUN |
| uint8_t | CBWCB [16] |
| uint32_t | dCSWSignature |
| uint32_t | dCSWTag |
| uint32_t | dCSWDataResidue |
| uint8_t | bCSWStatus |
This structure is used to access the Command Block wrapper (CBW) data structure that is used when the communicating with the mass storage class device.
This structure encapsulates the Command Status Word (CSW) structure that is sent in response to all CBW commands.
The standard USB request header as defined in section 9.3 of the USB 2.0 specification.
This structure describes a generic descriptor header. These fields are to be found at the beginning of all valid USB descriptors.
This structure describes the USB device descriptor as defined in USB 2.0 specification section 9.6.1.
This structure describes the USB device qualifier descriptor as defined in the USB 2.0 specification, section 9.6.2.
This structure describes the USB configuration descriptor as defined in USB 2.0 specification section 9.6.3. This structure also applies to the USB other speed configuration descriptor defined in section 9.6.4.
This structure describes the USB interface descriptor as defined in USB 2.0 specification section 9.6.5.
This structure describes the USB endpoint descriptor as defined in USB 2.0 specification section 9.6.6.
This structure describes the USB string descriptor for index 0 as defined in USB 2.0 specification section 9.6.7. Note that the number of language IDs is variable and can be determined by examining bLength. The number of language IDs present in the descriptor is given by ((bLength - 2) / 2).
This structure describes the USB string descriptor for all string indexes other than 0 as defined in USB 2.0 specification section 9.6.7.
| uint8_t USBLIB_PACKED::bAlternateSetting |
The value used to select this alternate setting for the interface defined in bInterfaceNumber.
| uint8_t USBLIB_PACKED::bCBWLUN |
The device Logical Unit Number (LUN) to which the command block is being sent. For devices that support multiple LUNs, the host shall place into this field the LUN to which this command block is addressed. Otherwise, the host shall set this field to zero.
The valid length of the CBWCB in bytes. This defines the valid length of the command block. The only legal values are 1 through 16. All other values are reserved.
| uint16_t USBLIB_PACKED::bcdUSB |
The USB Specification Release Number in BCD format. For USB 2.0, this will be 0x0200.
| uint8_t USBLIB_PACKED::bConfigurationValue |
The value used as an argument to the SetConfiguration standard request to select this configuration.
| uint8_t USBLIB_PACKED::bCSWStatus |
The bCSWStatus field indicates the success or failure of the command. The device shall set this byte to zero if the command completed successfully. A non-zero value shall indicate a failure during command execution.
| uint8_t USBLIB_PACKED::bDescriptorType |
The type identifier of the descriptor whose information follows. For standard descriptors, this field could contain, for example, USB_DTYPE_DEVICE to identify a device descriptor or USB_DTYPE_ENDPOINT to identify an endpoint descriptor.
The type of the descriptor. For a device descriptor, this will be USB_DTYPE_DEVICE (1).
The type of the descriptor. For a device descriptor, this will be USB_DTYPE_DEVICE_QUAL (6).
The type of the descriptor. For a configuration descriptor, this will be USB_DTYPE_CONFIGURATION (2).
The type of the descriptor. For an interface descriptor, this will be USB_DTYPE_INTERFACE (4).
The type of the descriptor. For an endpoint descriptor, this will be USB_DTYPE_ENDPOINT (5).
The type of the descriptor. For a string descriptor, this will be USB_DTYPE_STRING (3).
| uint8_t USBLIB_PACKED::bDeviceProtocol |
The device protocol code. This value is qualified by the values of bDeviceClass and bDeviceSubClass.
| uint8_t USBLIB_PACKED::bDeviceSubClass |
The device subclass code. This value qualifies the value found in the bDeviceClass field.
| uint8_t USBLIB_PACKED::bEndpointAddress |
The address of the endpoint. This field contains the endpoint number ORed with flag USB_EP_DESC_OUT or USB_EP_DESC_IN to indicate the endpoint direction.
| uint8_t USBLIB_PACKED::bInterfaceNumber |
The number of this interface. This is a zero based index into the array of concurrent interfaces supported by this configuration.
| uint8_t USBLIB_PACKED::bInterval |
The polling interval for data transfers expressed in frames or micro frames depending upon the operating speed.
| uint8_t USBLIB_PACKED::bLength |
The length of this descriptor (including this length byte) expressed in bytes.
The length of this descriptor in bytes. All device descriptors are 18 bytes long.
The length of this descriptor in bytes. All device qualifier descriptors are 10 bytes long.
The length of this descriptor in bytes. All configuration descriptors are 9 bytes long.
The length of this descriptor in bytes. All interface descriptors are 9 bytes long.
The length of this descriptor in bytes. All endpoint descriptors are 7 bytes long.
The length of this descriptor in bytes. This value will vary depending upon the number of language codes provided in the descriptor.
The length of this descriptor in bytes. This value will be 2 greater than the number of bytes comprising the UNICODE string that the descriptor contains.
| uint8_t USBLIB_PACKED::bmAttributes |
Attributes of this configuration.
The endpoint transfer type, USB_EP_ATTR_CONTROL, USB_EP_ATTR_ISOC, USB_EP_ATTR_BULK or USB_EP_ATTR_INT and, if isochronous, additional flags indicating usage type and synchronization method.
| uint8_t USBLIB_PACKED::bMaxPacketSize0 |
The maximum packet size for endpoint zero. Valid values are 8, 16, 32 and 64.
The maximum packet size for endpoint zero when operating at a speed other than high speed.
| uint8_t USBLIB_PACKED::bMaxPower |
The maximum power consumption of the USB device from the bus in this configuration when the device is fully operational. This is expressed in units of 2mA so, for example, 100 represents 200mA.
| uint8_t USBLIB_PACKED::bmCBWFlags |
The device will ignore these bits if the dCBWDataTransferLength value is set to 0.
The bits of this field are defined as follows: Bit 7 Direction 0 = Data-Out from host to the device, 1 = Data-In from the device to the host. Bit 6 Obsolete - The host shall set this bit to zero. Bits 5..0 Reserved - the host shall set these bits to zero.
| uint8_t USBLIB_PACKED::bNumConfigurations |
The number of other-speed configurations supported.
The number of possible configurations offered by the device. This field indicates the number of distinct configuration descriptors that the device offers.
| uint8_t USBLIB_PACKED::bNumEndpoints |
The number of endpoints used by this interface (excluding endpoint zero).
| uint8_t USBLIB_PACKED::bString |
The first byte of the UNICODE string. This string is not NULL terminated. Its length (in bytes) can be computed by subtracting 2 from the value in the bLength field.
| uint8_t USBLIB_PACKED::CBWCB[16] |
This array holds the command block to be executed by the device. The MSC device will interpret the first bCBWCBLength bytes in this field as a command block as defined by the command set identified by bInterfaceSubClass. If the command set supported by the device uses command blocks of fewer than 16 bytes in length, the significant bytes shall be transferred first, beginning with the byte at offset 15. The device will ignore the content of the CBWCB field past the byte at offset (15 + bCBWCBLength - 1).
| uint32_t USBLIB_PACKED::dCBWDataTransferLength |
The number of bytes of data that the host expects to transfer on the Bulk-In or Bulk-Out endpoint (as indicated by the Direction bit) during the execution of this command. If this field is zero, the device and the host will not transfer data between the CBW and the associated CSW, and the device will ignore the value of the Direction bit in bmCBWFlags.
| uint32_t USBLIB_PACKED::dCBWSignature |
Signature that helps identify this data packet as a CBW. The signature field shall contain the value 0x43425355 (little endian), indicating a CBW.
| uint32_t USBLIB_PACKED::dCBWTag |
The Command Block Tag sent by the host controller. The device shall echo the contents of this field back to the host in the dCSWTag field of the associated CSW. The dCSWTag positively associates a CSW with the corresponding CBW.
| uint32_t USBLIB_PACKED::dCSWDataResidue |
For OUT transactions the device will fill the dCSWDataResidue field with the difference between the amount of data expected as stated in the dCBWDataTransferLength, and the actual amount of data processed by the device. For IN transactions the device will fill the dCSWDataResidue field with the difference between the amount of data expected as stated in the dCBWDataTransferLength and the actual amount of relevant data sent by the device. The dCSWDataResidue will not exceed the value sent in the dCBWDataTransferLength.
| uint32_t USBLIB_PACKED::dCSWSignature |
Signature that identifies this data packet as a CSW. The signature field must contain the value 53425355h (little endian) to indicate CSW.
| uint32_t USBLIB_PACKED::dCSWTag |
The device will set this field to the value received in the dCBWTag of the associated CBW.
| uint8_t USBLIB_PACKED::iSerialNumber |
The index of a string descriptor describing the device's serial number.
| uint16_t USBLIB_PACKED::wIndex |
Word-sized field that varies according to the request; typically used to pass an index or offset.
| uint16_t USBLIB_PACKED::wLANGID[1] |
The language code (LANGID) for the first supported language. Note that this descriptor may support multiple languages, in which case, the number of elements in the wLANGID array will increase and bLength will be updated accordingly.
| uint16_t USBLIB_PACKED::wLength |
The number of bytes to transfer if there is a data stage to the request.
| uint16_t USBLIB_PACKED::wMaxPacketSize |
The maximum packet size this endpoint is capable of sending or receiving when this configuration is selected. For high speed isochronous or interrupt endpoints, bits 11 and 12 are used to pass additional information.
| uint16_t USBLIB_PACKED::wTotalLength |
The total length of data returned for this configuration. This includes the combined length of all descriptors (configuration, interface, endpoint and class- or vendor-specific) returned for this configuration.