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 a3ff1f4e4e2aaec4a4c1ec5def91c21d36dc12f7 31 lines 1.1 kB view raw
1pub mod button; 2pub mod slider; 3 4use embedded_graphics::mono_font::ascii::FONT_10X20; 5use embedded_graphics::mono_font::MonoTextStyle; 6use embedded_graphics::pixelcolor::BinaryColor; 7use embedded_graphics::prelude::*; 8use embedded_graphics::primitives::{PrimitiveStyle, PrimitiveStyleBuilder, Rectangle}; 9use eepy_sys::input_common::Event; 10use tp370pgh01::{DIM_X, DIM_Y}; 11use crate::draw_target::EpdDrawTarget; 12 13pub const DEFAULT_PRIMITIVE_STYLE: PrimitiveStyle<BinaryColor> = PrimitiveStyleBuilder::new() 14 .stroke_width(2) 15 .stroke_color(BinaryColor::On) 16 .fill_color(BinaryColor::Off) 17 .build(); 18pub const DEFAULT_TEXT_STYLE: MonoTextStyle<BinaryColor> = MonoTextStyle::new(&FONT_10X20, BinaryColor::On); 19 20pub trait Gui { 21 type Output; 22 23 fn draw_init(&self, target: &mut EpdDrawTarget); 24 25 fn tick(&mut self, target: &mut EpdDrawTarget, ev: Event) -> Self::Output; 26 27 // By default, assume element fills the display 28 fn bounding_box(&self) -> Rectangle { 29 Rectangle::new(Point::zero(), Size::new(DIM_X as u32, DIM_Y as u32)) 30 } 31}