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

USB devices report their attributes using descriptors, which are data structures with a defined format. Each descriptor begins with a byte-wide field containing the total number of bytes in the descriptor followed by a byte-wide field identifying the descriptor type.

When an USB device is attached to the USB bus, the host uses a process known as bus enumeration to identify and configure the device. The USB Host sends setup requests as soon as the device has joined the USB network. The device will be instructed to select a configuration and an interface to match the needs of the application running on the USB Host. Once a configuration and an interface have been selected, the device must service the active endpoints to exchange data with the USB Host.

This is not a complete list of all the possible descriptors an USB host can request. The usual number of descriptors are:

String Descriptors describe the above mentioned descriptors in human readable format.

Device Configuration

Alternative information that is needed when the device can operate in different speed modes can be defined in a Device Qualifier Descriptor.

Complex devices have multiple interfaces. Each interface can have a number of endpoints representing a functional unit. For example, a voice-over-IP phone might have:

  • One audio class interface with 2 isochronous endpoints for transferring audio data in each direction.
  • One HID interface with a single IN interrupt endpoint for a built-in keypad.

Provisions have been made in the USB component to give the user the option to override the USB descriptors if necessary. This can be the case when the device class needs to be changed at runtime or other reports need to be created.