Trait UsbHostController
pub trait UsbHostController<'d>: Sized {
type Allocator: UsbHostAllocator<'d>;
// Required methods
fn allocator(&self) -> Self::Allocator;
async fn wait_for_device_event(&mut self) -> DeviceEvent;
async fn bus_reset(&mut self);
}usb only.Expand description
Main USB host controller trait.
Covers the bus-level operations that must be serialised on a single
controller instance (root-port event waiting, bus reset). Pipe allocation
lives on the companion UsbHostAllocator trait.
Implemented by the HAL.
Required Associated Types§
type Allocator: UsbHostAllocator<'d>
type Allocator: UsbHostAllocator<'d>
Pipe allocator associated with this controller.
Required Methods§
fn allocator(&self) -> Self::Allocator
fn allocator(&self) -> Self::Allocator
Return an allocator handle.
Callers may keep the handle and use it to allocate pipes concurrently
with wait_for_device_event
or bus_reset.
async fn wait_for_device_event(&mut self) -> DeviceEvent
async fn wait_for_device_event(&mut self) -> DeviceEvent
Wait for a root-port attach/detach.
On attach, the implementation must drive a bus reset to completion before returning and must report the speed that the device settled on after reset.
async fn bus_reset(&mut self)
async fn bus_reset(&mut self)
Force a bus reset on the root port.
Invalidates every pipe currently allocated against addresses other than 0. Used to recover from a misbehaving device or to force re-enumeration without unplug.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".