The repo is on GitHub Trending today, riding the maker-hardware wave. USB feels like magic because it always just works; the handshake underneath is a tidy state machine worth knowing.
It all begins with the first question a host asks: who are you?
Enumeration: the introductions
When a device plugs in, the host sends control requests and the device answers with descriptors - structured tables declaring what it is. Vendor ID, product ID, how many configurations, which interfaces, which endpoints. The host reads these, loads the matching driver, and assigns an address. Only then does data flow.
Device classes: pre-agreed roles
| Class | Declares itself as | Driver needed |
|---|---|---|
| HID | Keyboard, mouse, gamepad | Built into every OS |
| Mass storage | Flash drive, card reader | Built into every OS |
| Audio | Speakers, microphones | Built into every OS |
| Vendor-specific | Custom device | Usually supplied by maker |
Classes are USB's cleverest trick: devices that adopt a standard class work everywhere with zero installation. That is why a keyboard from a small maker plugs into anything - it introduces itself as HID, and every operating system already speaks HID.
Why embedded teams choose TinyUSB
- It runs on tiny microcontrollers with strict memory budgets.
- Callbacks organize logic by events rather than blocking loops.
- Broad chip support means one stack across a product family.
- The license and transparency let teams audit exactly what their firmware does.
The event-driven style also matches USB's nature: the stack spends most time idle, then bursts into activity on each transfer.
Its event-driven design also maps well onto low-power budgets: the stack sleeps between transfers, which matters enormously on battery-powered devices that spend most of their lives unplugged from hosts.
Drop in your PDF - it doesn't leave your device.
Every miss becomes a red node on your map.
Free plan: 21 nodes, no card, no countdown.
The lesson in the handshake
USB solves a universal computing problem - strangers introducing themselves - with a protocol of declarations: describe yourself, adopt a known role, then communicate within it. The same shape appears in service discovery, plugin systems and API handshakes everywhere. Every plug that just works is this quiet ceremony succeeding.
Key takeaways
- Enumeration is a descriptor exchange where devices declare identity and capabilities.
- Standard device classes let hardware work everywhere without installation.
- TinyUSB brings the full protocol to tiny microcontrollers with event-driven callbacks.
- Declare-adopt-communicate is a recurring pattern for any stranger-meets-stranger protocol.
Quick answers
What is USB enumeration?
The startup conversation where a host reads a device's descriptors, loads its driver and assigns it an address.
What is a descriptor?
A structured table the device returns, declaring vendor identity, configurations, interfaces and endpoints.
Why do some devices need drivers and others not?
Devices using standard classes match built-in OS drivers; vendor-specific devices ship their own.
What is an endpoint?
A named communication channel on the device - each has a direction and type, like control, bulk or interrupt.
One thing to do tonight
Open your operating system's USB device list and inspect any gadget's descriptors. Reading one device's self-declaration makes the whole protocol concrete.