tool: Add a system76_ec command to disable input events

For testing Launch keyboards.

Could easily support in EC firmware as well if we had a use for that,
but not adding that for now.
This commit is contained in:
Ian Douglas Scott
2021-11-18 13:08:05 -08:00
parent d9ce247a15
commit 85595a8d4c
3 changed files with 23 additions and 0 deletions

View File

@ -35,6 +35,7 @@ enum Cmd {
LedSetMode = 16,
MatrixGet = 17,
LedSave = 18,
SetNoInput = 19,
}
const CMD_SPI_FLAG_READ: u8 = 1 << 0;
@ -279,6 +280,10 @@ impl<A: Access> Ec<A> {
self.command(Cmd::MatrixGet, matrix)
}
pub unsafe fn set_no_input(&mut self, no_input: bool) -> Result<(), Error> {
self.command(Cmd::SetNoInput, &mut [no_input as u8])
}
pub fn into_dyn(self) -> Ec<Box<dyn Access>>
where A: 'static {
Ec {