firmware for my Touchscreen E-Paper Input Module for Framework Laptop 16
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

at f6676c82689a4e7314b93c8eb98ddd08152fe708 16 lines 566 B view raw
1use eepy_serial::{Event, SerialCommand}; 2use crate::{Error, HostApp, Serial}; 3 4impl Serial<HostApp> { 5 pub fn set_touch_enabled(&mut self, enabled: bool) -> Result<(), Error> { 6 let cmd = if enabled { SerialCommand::EnableTouch } else { SerialCommand::DisableTouch }; 7 self.write(cmd, &[]) 8 } 9 10 pub fn next_event(&mut self) -> Result<Option<Event>, Error> { 11 self.write(SerialCommand::NextEvent, &[])?; 12 let mut event_buf = [0u8; 32]; 13 self.port.read(&mut event_buf)?; 14 Ok(postcard::from_bytes(&event_buf)?) 15 } 16}