pub struct PS2Mouse<'c> { /* private fields */ }
Expand description
A reference to the PS/2 Mouse connected to the PS/2 Controller.
Implementations§
source§impl<'c> PS2Mouse<'c>
impl<'c> PS2Mouse<'c>
sourcepub fn new(controller: &'c PS2Controller) -> Self
pub fn new(controller: &'c PS2Controller) -> Self
Create a new reference to the mouse connected to the given PS2 controller.
The default mouse id of PS/2 is zero.
sourcepub fn set_mouse_id(&mut self) -> Result<(), &'static str>
pub fn set_mouse_id(&mut self) -> Result<(), &'static str>
set self.id
to the highest possible MouseId by magic sequence
sourcepub fn read_mouse_packet(&self) -> MousePacket
pub fn read_mouse_packet(&self) -> MousePacket
read the correct MousePacket according to MouseId
sourcepub fn is_output_buffer_full(&self) -> bool
pub fn is_output_buffer_full(&self) -> bool
Returns true
if there is content in the PS/2 Mouse’s output buffer
that can be read from.
This also checks the status register’s output_buffer_full
bit.
Otherwise mouse_id
would read ACK (0xFA) instead of mouse id.
Auto Trait Implementations§
impl<'c> !RefUnwindSafe for PS2Mouse<'c>
impl<'c> Send for PS2Mouse<'c>
impl<'c> Sync for PS2Mouse<'c>
impl<'c> Unpin for PS2Mouse<'c>
impl<'c> !UnwindSafe for PS2Mouse<'c>
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