diff --git a/README.md b/README.md index 796202b..62ff176 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,20 @@ It uses the [embedded graphics](https://crates.io/crates/embedded-graphics) libr | [4.2 Inch B/W (A)](https://www.waveshare.com/product/4.2inch-e-paper-module.htm) | Black, White | ✕ | Not officially [[1](#42-inch-e-ink-blackwhite)] | ✔ | ✔ | | [1.54 Inch B/W (A)](https://www.waveshare.com/1.54inch-e-Paper-Module.htm) | Black, White | ✕ | ✔ | ✔ | ✔ | | [2.13 Inch B/W (A)](https://www.waveshare.com/product/2.13inch-e-paper-hat.htm) | Black, White | ✕ | ✔ | | | -| [2.9 Inch B/W (A)](https://www.waveshare.com/product/2.9inch-e-paper-module.htm) | Black, White | ✕ | ✔ | ✔ | ✔ | +| [2.9 Inch B/W (A)](https://www.waveshare.com/product/2.9inch-e-paper-module.htm) | Black, White | ✕ | ✔ | ✔ | ✔ [[2](#)] | -### 4.2 Inch E-Ink Black/White +### [1]: 4.2 Inch E-Ink Black/White - Partial Refresh Out of the Box the original driver from Waveshare only supports full updates. -- [1]: Be careful with the quick refresh updates:
+That means: Be careful with the quick refresh updates:
It's possible with this driver but might lead to ghosting / burn-in effects therefore it's hidden behind a feature. +### [2]: 2.9 Inch E-Ink Black/White - Tests + +Since my 2.9 Inch-Display has some blurring issues I am not absolutly sure if everything was working correctly + ### Interface | Interface | Description | diff --git a/src/epd2in9/mod.rs b/src/epd2in9/mod.rs index 9da3e14..dcdf1a7 100644 --- a/src/epd2in9/mod.rs +++ b/src/epd2in9/mod.rs @@ -1,22 +1,38 @@ //! A simple Driver for the Waveshare 2.9" E-Ink Display via SPI //! +//! Untested! //! -//! # Examples from the 4.2" Display. It should work the same for the 2.9" one. -//! +//! # Example for the 2.9 in E-Ink Display +//! //! ```ignore -//! let mut epd4in2 = EPD4in2::new(spi, cs, busy, dc, rst, delay).unwrap(); -//! -//! let mut buffer = [0u8, epd4in2.get_width() / 8 * epd4in2.get_height()]; -//! -//! // draw something into the buffer -//! -//! epd4in2.display_and_transfer_buffer(buffer, None); -//! -//! // wait and look at the image +//! use eink_waveshare_rs::{ +//! epd2in9::{EPD2in9, Buffer2in9}, +//! graphics::{Display, DisplayRotation}, +//! prelude::*, +//! }; +//! +//! // Setup EPD +//! let mut epd = EPD2in9::new(&mut spi, cs_pin, busy_in, dc, rst, &mut delay)?; //! -//! epd4in2.clear_frame(None); +//! // Use display graphics +//! let mut buffer = Buffer2in9::default(); +//! let mut display = Display::new(epd.width(), epd.height(), &mut buffer.buffer); +//! +//! // Write some hello world in the screenbuffer +//! display.draw( +//! Font6x8::render_str("Hello World!") +//! .with_stroke(Some(Color::Black)) +//! .with_fill(Some(Color::White)) +//! .translate(Coord::new(5, 50)) +//! .into_iter(), +//! ); //! -//! epd4in2.sleep(); +//! // Display updated frame +//! epd.update_frame(&mut spi, &display.buffer()).unwrap(); +//! epd.display_frame(&mut spi).expect("display frame new graphics"); +//! +//! // Set the EPD to sleep +//! epd.sleep(&mut spi).expect("sleep"); //! ``` pub const WIDTH: u32 = 128;