pub struct BusController<'d, C: UsbHostController<'d>> { /* private fields */ }Expand description
Bus-level controller for a single root USB controller.
Owns the UsbHostController implementation and exposes the
bus-wide operations that must be serialised against each other
(root-port event waiting, bus reset).
Pipe allocation and device enumeration live on the companion
BusHandle returned alongside a BusController by the bus
constructor.
Implementations§
Source§impl<'d, C: UsbHostController<'d>> BusController<'d, C>
impl<'d, C: UsbHostController<'d>> BusController<'d, C>
Sourcepub fn controller(&self) -> &C
pub fn controller(&self) -> &C
Get a reference to the underlying controller.
Sourcepub fn controller_mut(&mut self) -> &mut C
pub fn controller_mut(&mut self) -> &mut C
Get a mutable reference to the underlying controller.
Sourcepub async fn wait_for_device_event(&mut self) -> DeviceEvent
pub async fn wait_for_device_event(&mut self) -> DeviceEvent
Wait for a root-port attach/detach.
On attach, the implementation drives a bus reset to completion before returning and reports the speed the device settled on.
Sourcepub async fn wait_for_connection(&mut self) -> Speed
pub async fn wait_for_connection(&mut self) -> Speed
Wait for a device to connect on the root port.
Issues a bus reset internally and returns the detected speed. Spurious disconnects, overcurrent events, and other non-attach events are silently absorbed.