💾 Archived View for sdf.org › blippy › usb.gmi captured on 2024-07-08 at 23:50:49. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2024-03-21)
-=-=-=-=-=-=-
Created 2022-12-26 Updated 2023-07-27
A USB device may be a single class type, or it may be composed of multiple classes. Classes may be of a standard type (e.g. for HID, Audio, or Telephony), or you may roll-your-own type. Classes whcih are of a standard type should conform to the same interface specification, so that drivers can be shared across different vendor products.
The transfer types are:
The transfer method is determined by the device endpoint. A device must always have at least endpoint 0. Endpoint 0 is a control type, so data can go both in and out.
keyboards can use endpoint 1 for keypresses.
Storage:
CDC class (Virtual COM port) - used as USB-to-serial bridge, usually bulk transfer (isochronous also possible). Transfer is finished when packet smaller than maximum packet size is received
HID - Human interface device - encompassing:
DFU - Device firmware update - for changing the firmware. Bidirectional. A DfuSe extension enables to update parts of the memory
Audio class - used for speakers and microphones. Real-time audio transfer, uses isochronous transfers - close sync might be required. Supports various data formats, sampling frequencies. USB uses unaligned/packed format. This can be an issue for 24-bit formats. STM32 peripherals expect 32-bit aligned data - single 32-bit write to data register via DMA. Additional unpacking required by software.
Composite device - contains multiple interfaces for different USB classes. All classes can operate at the same time. It's possible to use OS system drivers for standard interfaces. An example would be an ST-Link, which contains a debug interface, mass-storage for downloading the firmware, CDC class for communicating with the device through UART.
Abbrev: Communications Device Class.
It is used for computer networking devices akin to a network card, providing an interface for transmitting ethernet of ATM frames into some pyhical media.
USB communications devie class, Widipedia
Abbrev: Human Interface Device
A device such as keyboard, mouse and "pointing device" such as controller pads or joystick.
Device Class Definition for HIDs
Abbrev: Mass Storage Class
Abbrev: Tinyusb Host