💾 Archived View for sdf.org › blippy › usb.gmi captured on 2024-06-16 at 12:34:54. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-03-21)

-=-=-=-=-=-=-

USB system bus

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.

Transfer types

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.

Classes

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.

Glossary

CDC

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

HID

Abbrev: Human Interface Device

A device such as keyboard, mouse and "pointing device" such as controller pads or joystick.

Device Class Definition for HIDs

MSC

Abbrev: Mass Storage Class

TUH

Abbrev: Tinyusb Host

EXITS

Basic USB Concepts, Manuel.

Introduction to USB from a developers perspective