Merge pull request #4 from Caemor/fast_update_feature_gated

Fast update feature gated
digi-v2-tests
Chris 5 years ago committed by GitHub
commit 20a4b9ef84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,6 +3,12 @@ name = "eink_waveshare_rs"
version = "0.1.0"
authors = ["Christoph Groß <christoph.gross@student.uni-tuebingen.de>"]
[features]
default = []
# Activates the fast LUT for EPD4in2
epd4in2_fast_update = []
[dependencies]

@ -11,7 +11,7 @@ pub(crate) const LUT_VCOM0: [u8; 44] = [
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
];
#[cfg(feature = "epd4in2_fast_update")]
pub(crate) const LUT_VCOM0_QUICK: [u8; 44] = [
0x00, 0x0E, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -33,7 +33,7 @@ pub(crate) const LUT_WW: [u8; 42] =[
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
];
#[cfg(feature = "epd4in2_fast_update")]
pub(crate) const LUT_WW_QUICK: [u8; 42] =[
0xA0, 0x0E, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -55,7 +55,7 @@ pub(crate) const LUT_BW: [u8; 42] =[
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
];
#[cfg(feature = "epd4in2_fast_update")]
pub(crate) const LUT_BW_QUICK: [u8; 42] =[
0xA0, 0x0E, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -77,7 +77,7 @@ pub(crate) const LUT_BB: [u8; 42] =[
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
];
#[cfg(feature = "epd4in2_fast_update")]
pub(crate) const LUT_BB_QUICK: [u8; 42] =[
0x50, 0x0E, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -99,7 +99,7 @@ pub(crate) const LUT_WB: [u8; 42] =[
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
];
#[cfg(feature = "epd4in2_fast_update")]
pub(crate) const LUT_WB_QUICK: [u8; 42] =[
0x50, 0x0E, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

@ -44,8 +44,7 @@
//!
//!
//!
//! BE CAREFUL! The Partial Drawing can "destroy" your display.
//! It needs more testing first.
//! BE CAREFUL! The screen can get ghosting/burn-ins through the Partial Fast Update Drawing.
use hal::{
blocking::{delay::*, spi::Write},
@ -222,7 +221,6 @@ where
self.send_command(Command::VCOM_AND_DATA_INTERVAL_SETTING)?;
//TODO: this was a send_command instead of a send_data. check if it's alright and doing what it should do (setting the default values)
//oldTODO is this really a command here or shouldn't that be data?
//self.send_command_u8(0x97)?; //VBDF 17|D7 VBDW 97 VBDB 57 VBDF F7 VBDW 77 VBDB 37 VBDR B7
self.send_data(0x97)?;
@ -372,9 +370,10 @@ where
}
/// Fill the look-up table for a quick display (partial refresh)
///
/// Is automatically done by [EPD4in2::display_frame_quick()](EPD4in2::display_frame_quick())
///
/// Is automatically done by [EPD4in2::display_frame_quick()](EPD4in2::display_frame_quick())
/// //TODO: make public?
#[cfg(feature = "epd4in2_fast_update")]
fn set_lut_quick(&mut self) -> Result<(), E> {
self.set_lut_helper(
&LUT_VCOM0_QUICK,

Loading…
Cancel
Save