Crate epd_waveshare

Source
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, busy_in, dc, rst, &mut delay, None)?;

// 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(Color::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)

Re-exports§

pub use epd7in5b_v2 as epd7in5b_v3;

Modules§

color
B/W Color for EPDs
epd1in54
A simple Driver for the Waveshare 1.54“ E-Ink Display via SPI
epd1in54_v2
A simple Driver for the Waveshare 1.54“ E-Ink Display via SPI
epd1in54b
A simple Driver for the Waveshare 1.54“ (B) E-Ink Display via SPI
epd1in54c
A simple Driver for the Waveshare 1.54“ (C) E-Ink Display via SPI
epd2in9
A simple Driver for the Waveshare 2.9“ E-Ink Display via SPI
epd2in7b
A simple Driver for the Waveshare 2.7“ B Tri-Color E-Ink Display via SPI
epd2in9_v2
A simple Driver for the Waveshare 2.9“ E-Ink Display V2 via SPI
epd2in9bc
A simple Driver for the Waveshare 2.9“ (B/C) E-Ink Display via SPI
epd2in9d
A simple Driver for the Waveshare 2.9“ D E-Ink Display via SPI
epd2in13_v2
A Driver for the Waveshare 2.13“ E-Ink Display (V2 and V3) via SPI
epd2in13bc
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
epd2in66b
A driver for the Waveshare three-color E-ink Pi Pico hat ‘Pico-ePaper-2.66-B’ B/W/R.
epd3in7
A simple Driver for the Waveshare 3.7“ E-Ink Display via SPI
epd4in2
A simple Driver for the Waveshare 4.2“ E-Ink Display via SPI
epd5in65f
A simple Driver for the Waveshare 6.65 inch (F) E-Ink Display via SPI
epd5in83_v2
A simple Driver for the Waveshare 5.83“ v2 E-Ink Display via SPI
epd5in83b_v2
A simple Driver for the Waveshare 5.83“ (B) v2 E-Ink Display via SPI
epd7in5
A simple Driver for the Waveshare 7.5“ E-Ink Display via SPI
epd7in3f
A simple Driver for the Waveshare 7.3inch e-Paper HAT (F) Display via SPI
epd7in5_hd
A simple Driver for the Waveshare 7.5“ E-Ink Display (HD) via SPI
epd7in5_v2
A simple Driver for the Waveshare 7.5“ E-Ink Display (V2) via SPI
epd7in5b_v2
A simple Driver for the Waveshare 7.5“ (B) E-Ink Display (V2 and V3) via SPI
graphics
Graphics Support for EPDs
prelude
Includes everything important besides the chosen Display

Constants§

SPI_MODE
SPI mode - For more infos see Requirements: SPI

Functions§

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