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);
}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§
Sourcetype Allocator: UsbHostAllocator<'d>
type Allocator: UsbHostAllocator<'d>
Pipe allocator associated with this controller.
Required Methods§
Sourcefn 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.
Sourceasync 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.