rustubs::machine::keyctrl

Struct KeyboardController

Source
pub struct KeyboardController {
    keystate: KeyState,
    gather: AtomicU32,
    cport: IOPort,
    dport: IOPort,
}

Fields§

§keystate: KeyState§gather: AtomicU32

gather require synchronization between L2 and L3, therefore we pack the Key into a u32 and use an Atomic type here.

§cport: IOPort§dport: IOPort

Implementations§

Source§

impl KeyboardController

Source

pub const fn new() -> Self

Source

fn toggle_lock(&mut self, lock: Modifiers)

Source

fn update_led(&self)

in some corner cases, e.g. keyboard control I/O may fail, while the CAPSLOCK is set and the uppcase table is used for key decoding. So we never set the leds explicitly, instead we update the leds from the current keyboard state i.e. keystate.modi

Source

fn update_state(&mut self, code: u8)

Source

fn press_event(&mut self) -> bool

Source

fn release_event(&mut self)

Source

fn read_status(&self) -> Option<StatusReg>

Source

fn fetch_key(&mut self)

Source

fn consume_key(&mut self) -> Option<Key>

this is safe to be called from all sync levels

Source

fn decode_key(&mut self)

Source

fn cycle_repeat_rate()

Source

fn cycle_deley()

Source

unsafe fn __block_until_cmd_buffer_empty(&self)

Source

unsafe fn __block_until_data_available(&self)

block until there is something in the data register to read

Source§

impl KeyboardController

Source§

impl KeyboardController

Source

pub unsafe fn reboot(&self)

Auto Trait Implementations§

§

impl !Freeze for KeyboardController

§

impl RefUnwindSafe for KeyboardController

§

impl Send for KeyboardController

§

impl Sync for KeyboardController

§

impl Unpin for KeyboardController

§

impl UnwindSafe for KeyboardController

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.