wire / wire-format / usb-protocol
USB (Universal Serial Bus) is a host-controlled serial bus. Enumeration: device connects → host detects (via pull-up on D+/D-) → host sends reset → host reads device descriptor → host assigns address → host reads configuration descriptor → host loads driver → device ready. Transfer types: Control (setup + data + status, for enumeration/config), Bulk (large data, error-checked, no timing guarantee), Interrupt (small data, periodic, guaranteed latency), Isochronous (streaming, guaranteed bandwidth, no retry).
aka: USB protocol (enumeration and transfers)
spec: USB 2.0/3.0 specification
USB (Universal Serial Bus) is a host-controlled serial bus. Enumeration: device connects → host detects (via pull-up on D+/D-) → host sends reset → host reads device descriptor → host assigns address → host reads configuration descriptor → host loads driver → device ready. Transfer types: Control (setup + data + status, for enumeration/config), Bulk (large data, error-checked, no timing guarantee), Interrupt (small data, periodic, guaranteed latency), Isochronous (streaming, guaranteed bandwidth, no retry).
| field | size | meaning |
|---|---|---|
| Enumeration | process | 1. Device connects (pull-up on D+/D-). 2. Host detects, sends reset. 3. Host reads device descriptor (address 0). 4. Host assigns address (SET_ADDRESS). 5. Host reads config descriptor. 6. Host sets configuration (SET_CONFIGURATION). 7. Device ready. |
| Control transfer | 3 stages | Setup (8 bytes: bmRequestType, bRequest, wValue, wIndex, wLength) + Data (optional, wLength bytes) + Status (zero-length packet, opposite direction). |
| Bulk transfer | variable | Large data, error-checked (CRC16), retried on error. No timing guarantee. Used for storage, printers. |
| Interrupt transfer | small, periodic | Small data, periodic (polling interval), guaranteed latency. Used for keyboards, mice. |
| Isochronous transfer | streaming | Guaranteed bandwidth, no retry (errors not corrected). Used for audio, video. |
| Endpoints | 0-15 per direction | Endpoint 0 = control. Endpoints 1-15 = data (IN/OUT). Each endpoint has a type and max packet size. |
| Speeds | config | Low (1.5 Mbps), Full (12 Mbps), High (480 Mbps), Super (5 Gbps), Super+ (10 Gbps), Super++ (20 Gbps). |
example:
00 00
USB protocol (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/usb-protocol
or /wire-format/usb-protocol.json