From 8904066de615aae3e6cea8e3ee07ef302be2117f Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 16 Oct 2018 21:43:27 +0200 Subject: [PATCH] Moved constants of type_a to its own file --- src/epd1in54/mod.rs | 5 ++++- src/epd2in9/mod.rs | 5 ++++- src/type_a/constants.rs | 14 ++++++++++++++ src/type_a/mod.rs | 16 +--------------- 4 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 src/type_a/constants.rs diff --git a/src/epd1in54/mod.rs b/src/epd1in54/mod.rs index 99732d1..a4c625f 100644 --- a/src/epd1in54/mod.rs +++ b/src/epd1in54/mod.rs @@ -29,7 +29,10 @@ use hal::{ digital::*, }; -use type_a::{command::Command, LUT_FULL_UPDATE, LUT_PARTIAL_UPDATE}; +use type_a::{ + command::Command, + constants::{LUT_FULL_UPDATE, LUT_PARTIAL_UPDATE} +}; use color::Color; diff --git a/src/epd2in9/mod.rs b/src/epd2in9/mod.rs index 1110d11..4fd3b2a 100644 --- a/src/epd2in9/mod.rs +++ b/src/epd2in9/mod.rs @@ -28,7 +28,10 @@ use hal::{ digital::*, }; -use type_a::{command::Command, LUT_FULL_UPDATE, LUT_PARTIAL_UPDATE}; +use type_a::{ + command::Command, + constants::{LUT_FULL_UPDATE, LUT_PARTIAL_UPDATE} +}; use color::Color; diff --git a/src/type_a/constants.rs b/src/type_a/constants.rs new file mode 100644 index 0000000..63de296 --- /dev/null +++ b/src/type_a/constants.rs @@ -0,0 +1,14 @@ +// 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 diff --git a/src/type_a/mod.rs b/src/type_a/mod.rs index 987a032..11b59c7 100644 --- a/src/type_a/mod.rs +++ b/src/type_a/mod.rs @@ -1,16 +1,2 @@ pub(crate) mod command; - -// 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 -]; +pub(crate) mod constants; \ No newline at end of file