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
impl KeyboardController
pub const fn new() -> Self
fn toggle_lock(&mut self, lock: Modifiers)
Sourcefn update_led(&self)
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
fn update_state(&mut self, code: u8)
fn press_event(&mut self) -> bool
fn release_event(&mut self)
fn read_status(&self) -> Option<StatusReg>
fn fetch_key(&mut self)
Sourcefn consume_key(&mut self) -> Option<Key>
fn consume_key(&mut self) -> Option<Key>
this is safe to be called from all sync levels
fn decode_key(&mut self)
fn cycle_repeat_rate()
fn cycle_deley()
unsafe fn __block_until_cmd_buffer_empty(&self)
Sourceunsafe fn __block_until_data_available(&self)
unsafe fn __block_until_data_available(&self)
block until there is something in the data register to read