pub struct Keyboard<'d, C: HostController> { /* private fields */ }Expand description
A keyboard driven through its boot-protocol interrupt endpoint.
Implementations§
Source§impl<'d, C: HostController> Keyboard<'d, C>
impl<'d, C: HostController> Keyboard<'d, C>
Sourcepub fn open(device: &Device<'d, C>) -> HostResult<Self>
pub fn open(device: &Device<'d, C>) -> HostResult<Self>
Find the boot keyboard interface of device, put it in boot protocol
mode and open its interrupt IN endpoint.
The device has to be configured already
(Device::set_configuration), because the interface is only live
afterwards.
Sourcepub fn read(&self) -> HostResult<Report>
pub fn read(&self) -> HostResult<Report>
Wait for the next report.
The endpoint NAKs until something changed, so this blocks for up to the NAK retry budget of the controller.
Sourcepub fn endpoint(&self) -> EndpointAddress
pub fn endpoint(&self) -> EndpointAddress
The interrupt IN endpoint the keyboard is read from.
Auto Trait Implementations§
impl<'d, C> !Freeze for Keyboard<'d, C>
impl<'d, C> !RefUnwindSafe for Keyboard<'d, C>
impl<'d, C> !Sync for Keyboard<'d, C>
impl<'d, C> Forget for Keyboard<'d, C>
impl<'d, C> Move for Keyboard<'d, C>
impl<'d, C> Send for Keyboard<'d, C>
impl<'d, C> Unpin for Keyboard<'d, C>
impl<'d, C> UnsafeUnpin for Keyboard<'d, C>where
Pipe<'d, C>: UnsafeUnpin,
impl<'d, C> UnwindSafe for Keyboard<'d, C>where
Pipe<'d, C>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more