Skip to main content

Module bus

Module bus 

Source
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 both UsbDevice and class endpoint handles can borrow from.

§Key improvements over usb-device

  • No portable_atomic / AtomicPtr — endpoint handles borrow &'a B directly.
  • No mem::forget hack — UnsafeCell<B> + Cell<bool> give safe interior- mutability without leaking the RefMut borrow-count.
  • UsbClass<B> is not required to be generic over B by the allocator itself; Endpoint handles carry &'a B which is erased to &'a dyn UsbBus where needed.

Structs§

InterfaceNumber
An opaque handle to an allocated USB interface number.
StringIndex
An opaque handle to an allocated USB string descriptor index.
UsbBusAllocator
Wraps a UsbBus during the endpoint-allocation phase.

Enums§

PollResult
Events returned by UsbBus::poll.

Traits§

UsbBus
Low-level hardware abstraction trait for a USB peripheral.