Expand description
USB bus trait and allocator.
§Architecture
UsbBus— hardware-abstraction trait implemented by the peripheral driver.UsbBusAllocator— wraps a bus during the pre-enable allocation phase, then freezes it (enabling the peripheral) and returns a shared bus reference that bothUsbDeviceand class endpoint handles can borrow from.
§Key improvements over usb-device
- No
portable_atomic/AtomicPtr— endpoint handles borrow&'a Bdirectly. - No
mem::forgethack —UnsafeCell<B>+Cell<bool>give safe interior- mutability without leaking theRefMutborrow-count. UsbClass<B>is not required to be generic overBby the allocator itself; Endpoint handles carry&'a Bwhich is erased to&'a dyn UsbBuswhere needed.
Structs§
- Interface
Number - An opaque handle to an allocated USB interface number.
- String
Index - An opaque handle to an allocated USB string descriptor index.
- UsbBus
Allocator - Wraps a
UsbBusduring the endpoint-allocation phase.
Enums§
- Poll
Result - Events returned by
UsbBus::poll.
Traits§
- UsbBus
- Low-level hardware abstraction trait for a USB peripheral.