Browse Source

Hide the Fast Update which possible might lead to Ghosting/Burn-in effects behind a feature gate

embedded-hal-1.0
Christoph Groß 8 years ago
parent
commit
66f70b3244
  1. 5
      Cargo.toml
  2. 5
      src/epd4in2/lut.rs
  3. 8
      src/epd4in2/mod.rs

5
Cargo.toml

@ -3,6 +3,11 @@ name = "eink_waveshare_rs"
version = "0.1.0"
authors = ["Christoph Groß <christoph.gross@student.uni-tuebingen.de>"]
[features]
default = []
epd4in2_fast_update = []
[dependencies]

5
src/epd4in2/lut.rs

@ -8,6 +8,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,
@ -28,6 +29,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,
@ -49,6 +51,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,
@ -70,6 +73,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,
@ -91,6 +95,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,

8
src/epd4in2/mod.rs

@ -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::{
@ -268,7 +267,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)?;
@ -324,6 +322,7 @@ where
/// the necessary stuff
/// TODO: check delay!!!
/// Displays the frame data from SRAM
#[cfg(feature = "epd4in2_fast_update")]
pub fn display_frame_quick(&mut self) -> Result<(), E> {
self.set_lut_quick()?;
self.send_command(Command::DISPLAY_REFRESH)?;
@ -423,7 +422,8 @@ where
/// Fill the look-up table for a quick display (partial refresh)
///
/// Is automatically done by [EPD4in2::display_frame_quick()](EPD4in2::display_frame_quick())
/// //TODO: make public?
/// //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