Crate epd_waveshare[][src]

Expand description

A simple Driver for the Waveshare E-Ink Displays via SPI

Example

use embedded_graphics::{
    pixelcolor::BinaryColor::On as Black, prelude::*, primitives::{Line, PrimitiveStyle},
};
use epd_waveshare::{epd1in54::*, prelude::*};

// Setup EPD
let mut epd = Epd1in54::new(&mut spi, cs_pin, busy_in, dc, rst, &mut delay)?;

// Use display graphics from embedded-graphics
let mut display = Display1in54::default();

// Use embedded graphics for drawing a line

let _ = Line::new(Point::new(0, 120), Point::new(0, 295))
    .into_styled(PrimitiveStyle::with_stroke(Black, 1))
    .draw(&mut display);

    // Display updated frame
epd.update_frame(&mut spi, &display.buffer(), &mut delay)?;
epd.display_frame(&mut spi, &mut delay)?;

// Set the EPD to sleep
epd.sleep(&mut spi, &mut delay)?;

Other information and requirements

  • Buffersize: Wherever a buffer is used it always needs to be of the size: width / 8 * length, where width and length being either the full e-ink size or the partial update window size

SPI

MISO is not connected/available. SPI_MODE_0 is used (CPHL = 0, CPOL = 0) with 8 bits per word, MSB first.

Maximum speed tested by myself was 8Mhz but more should be possible (Ben Krasnow used 18Mhz with his implemenation)

Modules

B/W Color for EPDs

A simple Driver for the Waveshare 1.54“ E-Ink Display via SPI

A simple Driver for the Waveshare 1.54“ (B) E-Ink Display via SPI

A simple Driver for the Waveshare 1.54“ (C) E-Ink Display via SPI

A simple Driver for the Waveshare 2.7“ B Tri-Color E-Ink Display via SPI

A simple Driver for the Waveshare 2.9“ E-Ink Display via SPI

A simple Driver for the Waveshare 2.9“ E-Ink Display V2 via SPI

A simple Driver for the Waveshare 2.9“ (B/C) E-Ink Display via SPI

A Driver for the Waveshare 2.13“ E-Ink Display (V2) via SPI

A simple Driver for the Waveshare 2.13“ (B/C) E-Ink Display via SPI More information on this display can be found at the Waveshare Wiki This driver was build and tested for 212x104, 2.13inch E-Ink display HAT for Raspberry Pi, three-color, SPI interface

A simple Driver for the Waveshare 4.2“ E-Ink Display via SPI

A simple Driver for the Waveshare 6.65 inch (F) E-Ink Display via SPI

A simple Driver for the Waveshare 7.5“ E-Ink Display via SPI

A simple Driver for the Waveshare 7.5“ E-Ink Display (HD) via SPI

A simple Driver for the Waveshare 7.5“ E-Ink Display (V2) via SPI

Graphics Support for EPDs

Includes everything important besides the chosen Display

Constants

SPI mode - For more infos see Requirements: SPI

Functions

Computes the needed buffer length. Takes care of rounding up in case width is not divisible by 8.