migrate minimum set of drivers to make tests pass

This commit is contained in:
Reinier Balt
2021-06-16 13:49:33 +02:00
parent 253cc101fd
commit 78ffda673e
26 changed files with 411 additions and 201 deletions
+12 -4
View File
@@ -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::*;