Difference between revisions of "USB"

From Stm32World Wiki
Jump to navigation Jump to search
Line 8: Line 8:
  
 
[[File:USB Descriptor Hierarchy.png|1000px]]
 
[[File:USB Descriptor Hierarchy.png|1000px]]
 +
 +
A USB device (or gadget) can only have '''one''' device descriptor.
 +
 +
When a USB host enumerates a USB device, the device and configuration descriptors are analysed and one configuration is enabled.  Only one configuration can be active at any time.
 +
 +
While it _is_ possible for a host to switch configuration on a device offering more than one, it is very rare for devices to offer more than one configuration.
  
 
=== Device Descriptors ===
 
=== Device Descriptors ===
  
 
=== Configuration Descriptors ===
 
=== Configuration Descriptors ===
 +
 +
[[File:Configuration Descriptor.png|800px]]
 +
 
=== Interface Descriptors ===
 
=== Interface Descriptors ===
 
=== Endpoint Descriptors ===
 
=== Endpoint Descriptors ===
 
=== String Descriptors ===
 
=== String Descriptors ===
 
  
 
== Miscellaneous Links ==
 
== Miscellaneous Links ==
  
 
* [https://beyondlogic.org/usbnutshell/usb5.shtml USB In a Nutshell]]
 
* [https://beyondlogic.org/usbnutshell/usb5.shtml USB In a Nutshell]]

Revision as of 07:21, 30 August 2021


Descriptors

One of the most complex things when developing USB is the descriptors. Descriptors are used by a USB Gadgets to inform the USB Host about it's capabilities.

Overall, USB Descriptors is a hierarchy of descriptors organised like this:

USB Descriptor Hierarchy.png

A USB device (or gadget) can only have one device descriptor.

When a USB host enumerates a USB device, the device and configuration descriptors are analysed and one configuration is enabled. Only one configuration can be active at any time.

While it _is_ possible for a host to switch configuration on a device offering more than one, it is very rare for devices to offer more than one configuration.

Device Descriptors

Configuration Descriptors

Configuration Descriptor.png

Interface Descriptors

Endpoint Descriptors

String Descriptors

Miscellaneous Links