Skip to main content

Module usb

Module usb 

Source
Expand description

A concentrator on a USB card, driven through its bridge.

bridge builds the messages; this sends them down a port and reads what comes back. The port is anything that reads and writes bytes, so a test hands over a script and a gateway hands over the serial device the card enumerates as.

The concentrator driver wants an SPI device and a reset pin. Over USB both are the bridge, so BridgeSpi and BridgePin each hold a share of one Bridge and turn the driver’s transfers and pin writes into messages. The driver does not change: every frame it builds goes out inside a message exactly as it would have gone out on the wire.

One message carries one transfer, which costs a round trip per register. The bridge can carry many at once, and a driver that gathers its writes into a Bulk and sends them through Bridge::bulk saves those trips; the firmware load is where that matters.

Structs§

Bridge
The bridge on a USB card, reached over a port.
BridgePin
One of the card’s pins, driven through the bridge.
BridgeSpi
An SPI device that carries each transfer to the bridge.
Shared
One bridge, held by everything that needs it.

Enums§

UsbError
What went wrong talking to the bridge.