mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
add some documentation
This commit is contained in:
parent
5935406f89
commit
9d850a068f
2 changed files with 7 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ impl Keyboard {
|
||||||
Ok(Keyboard { conn })
|
Ok(Keyboard { conn })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Listeners get passed the full content of the key press on each key hit.
|
||||||
pub fn register_listener(&self, server_name: &str, action_opcode: usize) {
|
pub fn register_listener(&self, server_name: &str, action_opcode: usize) {
|
||||||
let kr =
|
let kr =
|
||||||
KeyboardRegistration { server_name: String::from(server_name), listener_op_id: action_opcode };
|
KeyboardRegistration { server_name: String::from(server_name), listener_op_id: action_opcode };
|
||||||
|
|
@ -24,6 +25,9 @@ impl Keyboard {
|
||||||
.expect("couldn't register listener");
|
.expect("couldn't register listener");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Observers get notified if a key is hit, but the actual keypress is always null.
|
||||||
|
/// This is useful for hardware services that need to do e.g. screen wakeup on key hit
|
||||||
|
/// but has no need to know the user's actually keystroke contents.
|
||||||
pub fn register_observer(&self, server_name: &str, action_opcode: usize) {
|
pub fn register_observer(&self, server_name: &str, action_opcode: usize) {
|
||||||
let kr =
|
let kr =
|
||||||
KeyboardRegistration { server_name: String::from(server_name), listener_op_id: action_opcode };
|
KeyboardRegistration { server_name: String::from(server_name), listener_op_id: action_opcode };
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,8 @@ fn main() {
|
||||||
.expect("couldn't map UDMA global control");
|
.expect("couldn't map UDMA global control");
|
||||||
let udma_global = GlobalConfig::new(udma_global_csr.as_mut_ptr() as *mut u32);
|
let udma_global = GlobalConfig::new(udma_global_csr.as_mut_ptr() as *mut u32);
|
||||||
|
|
||||||
|
// -------------------- begin timer workaround code
|
||||||
|
// This code should go away with NTO as we have a proper, private ticktimer unit.
|
||||||
let mut pio_ss = xous_pio::PioSharedState::new();
|
let mut pio_ss = xous_pio::PioSharedState::new();
|
||||||
// map and enable the interrupt for the PIO system timer
|
// map and enable the interrupt for the PIO system timer
|
||||||
let irq18_page = xous::syscall::map_memory(
|
let irq18_page = xous::syscall::map_memory(
|
||||||
|
|
@ -185,6 +187,7 @@ fn main() {
|
||||||
ptimer.irq_csr.wfo(utra::irqarray18::EV_ENABLE_PIOIRQ0_DUPE, 1);
|
ptimer.irq_csr.wfo(utra::irqarray18::EV_ENABLE_PIOIRQ0_DUPE, 1);
|
||||||
log::info!("Quantum timer setup!");
|
log::info!("Quantum timer setup!");
|
||||||
}
|
}
|
||||||
|
// -------------------- end timer workaround code
|
||||||
|
|
||||||
// start keyboard emulator service
|
// start keyboard emulator service
|
||||||
hw::keyboard::start_keyboard_service();
|
hw::keyboard::start_keyboard_service();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue