Add matrix command

This commit is contained in:
Jeremy Soller
2021-03-01 10:59:32 -07:00
committed by Jeremy Soller
parent c931eb4eef
commit 2ef4cd7bbd
6 changed files with 67 additions and 5 deletions

View File

@ -33,6 +33,7 @@ enum Cmd {
LedSetColor = 14,
LedGetMode = 15,
LedSetMode = 16,
MatrixGet = 17,
}
const CMD_SPI_FLAG_READ: u8 = 1 << 0;
@ -269,6 +270,10 @@ impl<A: Access> Ec<A> {
self.command(Cmd::LedSetMode, &mut data)
}
pub unsafe fn matrix_get(&mut self, matrix: &mut [u8]) -> Result<(), Error> {
self.command(Cmd::MatrixGet, matrix)
}
pub fn into_dyn(self) -> Ec<Box<dyn Access>>
where A: 'static {
Ec {