use super::display::{CydFrame, Orientation};
pub trait DisplayBackend {
type Error;
type Frame<'a>: CydFrame<Error = Self::Error>
where
Self: 'a;
fn create_frame_mut(
&mut self,
rectangle: embedded_graphics::primitives::Rectangle,
) -> Self::Frame<'_>;
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RawTouchEvent {
Down {
raw_x: u16,
raw_y: u16,
},
Move {
raw_x: u16,
raw_y: u16,
},
Up,
}
pub use super::touch::calibration::CalibrationConfig;
pub use super::touch::driver::Error;
pub use super::touch::driver::ensure_calibration;
pub trait TouchUncalibrated: Sized {
type Error;
type Calibrated: super::CydTouch<Error = Self::Error>;
fn read_raw_touch_event(&mut self) -> Result<Option<RawTouchEvent>, Self::Error>;
fn calibrate(
self,
calibration_config: CalibrationConfig,
orientation: Orientation,
) -> Self::Calibrated;
}