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

The Configuration Descriptor (USB_CONFIGURATION_DESCRIPTOR) contains information about the device power requirements and the number of interfaces it can support. A device can have multiple configurations. The host can select the configuration that best matches the requirements of the application software.

Offset Field Type Size Value Description
0 bLength uint8_t 1 Number Size of this descriptor in bytes.
1 bDescriptorType uint8_t 1 Constant Configuration Descriptor Type = 2.
2 wTotalLength uint16_t 2 Number Total length of data returned for this configuration. Includes the combined length of all descriptors (configuration, interface, endpoint, and class or vendor specific) returned for this configuration.
4 bNumInterfaces uint8_t 1 Number Number of interfaces supported by this configuration.
5 bConfigurationValue uint8_t 1 Number Value to select this configuration with SetConfiguration().
6 iConfiguration uint8_t 1 Index Index of string descriptor describing this configuration.
7 bmAttributes uint8_t 1 Bitmap

Configuration characteristics

  • D7: Reserved (must be set to one for historical reasons)
  • D6: Self-powered
  • D5: Remote Wakeup
  • D4...0: Reserved (reset to zero)

A device configuration that uses power from the bus and a local source reports a non-zero value in bMaxPower to indicate the amount of bus power required and sets D6. The actual power source at runtime can be determined using the GetStatus(DEVICE) request. If a device configuration supports remote wakeup, D5 is set to 1.

8 bMaxPower uint8_t 1 mA Maximum power consumption of the USB device from the bus in this specific configuration when the device is fully operational. Expressed in 2mA units (i.e., 50 = 100mA).