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.

eepy-gui: make framebuffer public

+7 -7
+7 -7
eepy-gui/src/draw_target.rs
··· 8 8 use tp370pgh01::{DIM_X, DIM_Y, IMAGE_BYTES}; 9 9 10 10 pub struct EpdDrawTarget { 11 - buf: [u8; IMAGE_BYTES], 11 + pub framebuffer: [u8; IMAGE_BYTES], 12 12 } 13 13 14 14 impl Dimensions for EpdDrawTarget { ··· 35 35 let j = 1 << (bit_index & 0x07); 36 36 37 37 match colour { 38 - BinaryColor::Off => self.buf[i] &= !j, 39 - BinaryColor::On => self.buf[i] |= j, 38 + BinaryColor::Off => self.framebuffer[i] &= !j, 39 + BinaryColor::On => self.framebuffer[i] |= j, 40 40 } 41 41 } 42 42 ··· 45 45 46 46 fn clear(&mut self, colour: Self::Color) -> Result<(), Self::Error> { 47 47 match colour { 48 - BinaryColor::Off => self.buf.copy_from_slice(&[0; IMAGE_BYTES]), 49 - BinaryColor::On => self.buf.copy_from_slice(&[u8::MAX; IMAGE_BYTES]), 48 + BinaryColor::Off => self.framebuffer.copy_from_slice(&[0; IMAGE_BYTES]), 49 + BinaryColor::On => self.framebuffer.copy_from_slice(&[u8::MAX; IMAGE_BYTES]), 50 50 } 51 51 52 52 Ok(()) ··· 56 56 impl EpdDrawTarget { 57 57 pub const fn new() -> Self { 58 58 Self { 59 - buf: [0; IMAGE_BYTES] 59 + framebuffer: [0; IMAGE_BYTES] 60 60 } 61 61 } 62 62 63 63 pub fn refresh(&self, fast_refresh: bool, block_mode: RefreshBlockMode) { 64 - write_image(&self.buf); 64 + write_image(&self.framebuffer); 65 65 refresh(fast_refresh, block_mode); 66 66 } 67 67 }