pub struct UsbDevice<'d, D: Driver<'d>> { /* private fields */ }
Expand description
Main struct for the USB device stack.
Implementations§
Source§impl<'d, D: Driver<'d>> UsbDevice<'d, D>
impl<'d, D: Driver<'d>> UsbDevice<'d, D>
Sourcepub fn buffer_usage(&self) -> UsbBufferReport
pub fn buffer_usage(&self) -> UsbBufferReport
Returns a report of the consumed buffers
Useful for tuning buffer sizes for actual usage
Sourcepub async fn run(&mut self) -> !
pub async fn run(&mut self) -> !
Runs the UsbDevice
forever.
This future may leave the bus in an invalid state if it is dropped.
After dropping the future, UsbDevice::disable()
should be called
before calling any other UsbDevice
methods to fully reset the
peripheral.
Sourcepub async fn run_until_suspend(&mut self)
pub async fn run_until_suspend(&mut self)
Runs the UsbDevice
until the bus is suspended.
This future may leave the bus in an invalid state if it is dropped.
After dropping the future, UsbDevice::disable()
should be called
before calling any other UsbDevice
methods to fully reset the
peripheral.
Sourcepub async fn wait_resume(&mut self)
pub async fn wait_resume(&mut self)
Waits for a resume condition on the USB bus.
This future is cancel-safe.
Sourcepub async fn remote_wakeup(&mut self) -> Result<(), RemoteWakeupError>
pub async fn remote_wakeup(&mut self) -> Result<(), RemoteWakeupError>
Initiates a device remote wakeup on the USB bus.
If the bus is not suspended or remote wakeup is not enabled, an error will be returned.
This future may leave the bus in an inconsistent state if dropped.
After dropping the future, UsbDevice::disable()
should be called
before calling any other UsbDevice
methods to fully reset the peripheral.