mirror of
https://github.com/Anshorei/epd-waveshare.git
synced 2026-10-03 22:06:43 +00:00
migrate minimum set of drivers to make tests pass
This commit is contained in:
@@ -2,6 +2,7 @@ use crate::epd7in5_v2::{DEFAULT_BACKGROUND_COLOR, HEIGHT, WIDTH};
|
||||
use crate::graphics::{Display, DisplayRotation};
|
||||
use embedded_graphics::pixelcolor::BinaryColor;
|
||||
use embedded_graphics::prelude::*;
|
||||
use embedded_graphics_core::OriginDimension;
|
||||
|
||||
/// Full size buffer for use with the 7in5 EPD
|
||||
///
|
||||
@@ -22,16 +23,17 @@ impl Default for Display7in5 {
|
||||
}
|
||||
}
|
||||
|
||||
impl DrawTarget<BinaryColor> for Display7in5 {
|
||||
impl DrawTarget for Display7in5 {
|
||||
type Color = BinaryColor;
|
||||
type Error = core::convert::Infallible;
|
||||
|
||||
fn draw_pixel(&mut self, pixel: Pixel<BinaryColor>) -> Result<(), Self::Error> {
|
||||
self.draw_helper(WIDTH, HEIGHT, pixel)
|
||||
}
|
||||
|
||||
fn size(&self) -> Size {
|
||||
Size::new(WIDTH, HEIGHT)
|
||||
}
|
||||
// fn size(&self) -> Size {
|
||||
// Size::new(WIDTH, HEIGHT)
|
||||
// }
|
||||
}
|
||||
|
||||
impl Display for Display7in5 {
|
||||
@@ -52,6 +54,12 @@ impl Display for Display7in5 {
|
||||
}
|
||||
}
|
||||
|
||||
impl OriginDimension for Display7in5 {
|
||||
fn size(&self) -> Size {
|
||||
Size::new(WIDTH, HEIGHT)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user