[−][src]Crate epd_waveshare
A simple Driver for the Waveshare E-Ink Displays via SPI
- Built using
embedded-haltraits. - Graphics support is added through
embedded-graphics
Example
use embedded_graphics::{ pixelcolor::BinaryColor::On as Black, prelude::*, primitives::Line, style::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())?; epd.display_frame(&mut spi)?; // Set the EPD to sleep epd.sleep(&mut spi)?;
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
| color | B/W Color for EPDs |
| epd1in54 | 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 |
| epd2in9 | A simple Driver for the Waveshare 2.9" E-Ink Display via SPI |
| epd2in9bc | A simple Driver for the Waveshare 2.9" (B/C) E-Ink Display via SPI |
| epd4in2 | A simple Driver for the Waveshare 4.2" E-Ink Display via SPI |
| epd7in5 | A simple Driver for the Waveshare 7.5" E-Ink Display via SPI |
| epd7in5_v2 | A simple Driver for the Waveshare 7.5" E-Ink Display (V2) 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 |