USB Component  Version 6.14.0
MDK Middleware for USB Device and Host Communication
 All Data Structures Functions Variables Enumerations Enumerator Groups Pages
Device Descriptor

The Device Descriptor (USB_DEVICE_DESCRIPTOR) is the root of the descriptor tree and contains basic device information. The unique numbers, idVendor and idProduct, identify the connected device. The Windows operating system uses these numbers to determine which device driver must be loaded.

idVendor is the number assigned to each company producing USB-based devices. The USB Implementers Forum is responsible for administering the assignment of Vendor IDs.

The idProduct is another 16-bit field containing a number assigned by the manufacturer to identify a specific product.

Offset Field Type Size Value Description
0 bLength uint8_t 1 Number Size of this descriptor in bytes.
1 bDescriptorType uint8_t 1 Constant Device Descriptor Type = 1.
2 bcdUSB uint16_t 2 BCD

USB Specification Release Number in Binary-Coded Decimal (i.e., 2.10 is 210h).

This field identifies the release of the USB Specification with which the device and its descriptors are compliant.

4 bDeviceClass uint8_t 1 Class

Class code (assigned by the USB-IF).

If this field is

  • reset to zero, each interface within a configuration specifies its own class information and the various interfaces operate independently.
  • set to a value between 1 and FEh, the device supports different class specifications on different interfaces and the interfaces may not operate independently. This value identifies the class definition used for the aggregate interfaces.
  • set to FFh, the device class is vendor specific.
5 bDeviceSubClass uint8_t 1 SubClass

Subclass code (assigned by the USB-IF).

These codes are qualified by the value of the bDeviceClass field.

If bDeviceClass is

  • reset to zero, this field must also be reset to zero.
  • not set to FFh, all values are reserved for assignment by the USB-IF.
6 bDeviceProtocol uint8_t 1 Protocol

Protocol code (assigned by the USB-IF).

These codes are qualified by the value of the bDeviceClass and bDeviceSubClass fields. If a device supports class-specific protocols on a device basis as opposed to an interface basis, this code identifies the protocols that the device uses as defined by the specification of the device class.

If this field is

  • reset to zero, the device does not use class specific protocols on a device basis. However, it may use class specific protocols on an interface basis.
  • set to FFh, the device uses a vendor specific protocol on a device basis.
7 bMaxPacketSize0 uint8_t 1 Number Maximum packet size for Endpoint zero (only 8, 16, 32, or 64 are valid).
8 idVendor uint16_t 2 ID Vendor ID (assigned by the USB-IF).
10 idProduct uint16_t 2 ID Product ID (assigned by the manufacturer).
12 bcdDevice uint16_t 2 BCD Device release number in binary-coded decimal.
14 iManufacturer uint8_t 1 Index Index of string descriptor describing manufacturer.
15 iProduct uint8_t 1 Index Index of string descriptor describing product.
16 iSerialNumber uint8_t 1 Index Index of string descriptor describing the device's serial number.
17 bNumConfigurations uint8_t 1 Number Number of possible configurations.