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 610 B view raw
1use eepy_serial::SerialCommand; 2use crate::{Error, HostApp, Serial}; 3 4pub const IMAGE_BYTES: usize = (240 * 416) / 8; 5 6impl Serial<HostApp> { 7 pub fn refresh(&mut self, fast: bool, image: &[u8; IMAGE_BYTES]) -> Result<(), Error> { 8 let cmd = if fast { SerialCommand::RefreshFast } else { SerialCommand::RefreshNormal }; 9 self.write(cmd, image) 10 } 11 12 pub fn maybe_refresh(&mut self, fast: bool, image: &[u8; IMAGE_BYTES]) -> Result<(), Error> { 13 let cmd = if fast { SerialCommand::MaybeRefreshFast } else { SerialCommand::MaybeRefreshNormal }; 14 self.write(cmd, image) 15 } 16}