From 5dbf873631e0cfb2244312d6569845aaac1f8263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gro=C3=9F?= Date: Mon, 6 Aug 2018 13:54:23 +0200 Subject: [PATCH] Moved type_a LUTs to type_a mod.rs , updated dependencies accordingly --- src/epd1in54/mod.rs | 18 ++++++++++-------- src/epd2in9/mod.rs | 7 +++++-- src/type_a/luts.rs | 14 -------------- 3 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 src/type_a/luts.rs diff --git a/src/epd1in54/mod.rs b/src/epd1in54/mod.rs index a9aab64..5a0f47f 100644 --- a/src/epd1in54/mod.rs +++ b/src/epd1in54/mod.rs @@ -35,9 +35,11 @@ use hal::{ digital::* }; - -use type_a::luts::*; -pub use type_a::command::Command; +use type_a::{ + LUT_FULL_UPDATE, + LUT_PARTIAL_UPDATE, + command::Command +}; use drawing::color::Color; @@ -53,7 +55,7 @@ use interface::connection_interface::ConnectionInterface; /// EPD2in9 driver /// -pub struct EPD2in9 { +pub struct EPD1in54 { /// SPI interface: ConnectionInterface, /// EPD (width, height) @@ -62,7 +64,7 @@ pub struct EPD2in9 { background_color: Color, } -impl EPD2in9 +impl EPD1in54 where SPI: Write, CS: OutputPin, @@ -76,7 +78,7 @@ where impl WaveshareInterface - for EPD2in9 + for EPD1in54 where SPI: Write, CS: OutputPin, @@ -101,7 +103,7 @@ where let epd = EPD::new(WIDTH, HEIGHT); let background_color = Color::White; - let mut epd = EPD2in9 {interface, /*epd,*/ background_color}; + let mut epd = EPD1in54 {interface, /*epd,*/ background_color}; epd.init()?; @@ -231,7 +233,7 @@ where } -impl EPD2in9 +impl EPD1in54 where SPI: Write, CS: OutputPin, diff --git a/src/epd2in9/mod.rs b/src/epd2in9/mod.rs index ff927f0..60a7b88 100644 --- a/src/epd2in9/mod.rs +++ b/src/epd2in9/mod.rs @@ -34,8 +34,11 @@ use hal::{ }; -use type_a::luts::*; -pub use type_a::command::Command; +use type_a::{ + LUT_FULL_UPDATE, + LUT_PARTIAL_UPDATE, + command::Command +}; use drawing::color::Color; diff --git a/src/type_a/luts.rs b/src/type_a/luts.rs deleted file mode 100644 index 63de296..0000000 --- a/src/type_a/luts.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Original Waveforms from Waveshare -pub(crate) const LUT_FULL_UPDATE: [u8; 30] =[ - 0x02, 0x02, 0x01, 0x11, 0x12, 0x12, 0x22, 0x22, - 0x66, 0x69, 0x69, 0x59, 0x58, 0x99, 0x99, 0x88, - 0x00, 0x00, 0x00, 0x00, 0xF8, 0xB4, 0x13, 0x51, - 0x35, 0x51, 0x51, 0x19, 0x01, 0x00 -]; - -pub(crate) const LUT_PARTIAL_UPDATE: [u8; 30] =[ - 0x10, 0x18, 0x18, 0x08, 0x18, 0x18, 0x08, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -]; \ No newline at end of file