diff --git a/src/color.rs b/src/color.rs index ee446da..c8bd818 100644 --- a/src/color.rs +++ b/src/color.rs @@ -30,7 +30,7 @@ pub enum TriColor { Chromatic, } -/// For the 5in65 8 Color Display +/// For the 5in65 7 Color Display #[derive(Clone, Copy, PartialEq, Debug)] pub enum OctColor { /// Black Color @@ -47,6 +47,8 @@ pub enum OctColor { Yellow = 0x05, /// Orange Color Orange = 0x06, + /// HiZ / Clean Color + HiZ = 0x07, } impl From<()> for OctColor { @@ -80,6 +82,7 @@ impl OctColor { 0x04 => Ok(OctColor::Red), 0x05 => Ok(OctColor::Yellow), 0x06 => Ok(OctColor::Orange), + 0x07 => Ok(OctColor::HiZ), _ => Err(()) } } @@ -99,6 +102,7 @@ impl OctColor { OctColor::Red => (0xff, 0x00, 0x00), OctColor::Yellow => (0xff, 0xff, 0x00), OctColor::Orange => (0xff, 0x80, 0x00), + OctColor::HiZ => (0x80, 0x80, 0x80), /* looks greyish */ } } } diff --git a/src/epd5in65f/mod.rs b/src/epd5in65f/mod.rs index 1ccb4ff..fb80fb7 100644 --- a/src/epd5in65f/mod.rs +++ b/src/epd5in65f/mod.rs @@ -155,7 +155,7 @@ where } fn clear_frame(&mut self, spi: &mut SPI) -> Result<(), SPI::Error> { - let bg = 0x77; /*clear frame */ //OctColor::colors_byte(self.color, self.color); + let bg = OctColor::colors_byte(self.color, self.color); self.wait_busy_high(); self.send_resolution(spi)?; self.command(spi, Command::DATA_START_TRANSMISSION_1)?; diff --git a/src/lib.rs b/src/lib.rs index 4685308..94f275e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -86,13 +86,13 @@ pub(crate) mod type_a; /// Includes everything important besides the chosen Display pub mod prelude { - pub use crate::color::{Color, TriColor}; + pub use crate::color::{Color, TriColor, OctColor}; pub use crate::traits::{RefreshLUT, WaveshareDisplay, WaveshareThreeColorDisplay}; pub use crate::SPI_MODE; #[cfg(feature = "graphics")] - pub use crate::graphics::{Display, DisplayRotation}; + pub use crate::graphics::{OctDisplay, Display, DisplayRotation}; } /// Computes the needed buffer length. Takes care of rounding up in case width