[−][src]Crate epd_waveshare
A simple Driver for the Waveshare E-Ink Displays via SPI
This driver was built using embedded-hal
traits.
Requirements
SPI
- MISO is not connected/available
- SPI_MODE_0 is used (CPHL = 0, CPOL = 0)
- 8 bits per word, MSB first
- Max. Speed tested by myself was 8Mhz but more should be possible (Ben Krasnow used 18Mhz with his implemenation)
Other....
- 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
Examples
ⓘThis example is not tested
use epd_waveshare::{ epd2in9::{EPD2in9, Display2in9}, graphics::{Display, DisplayRotation}, prelude::*, }; use embedded_graphics::Drawing; // Setup EPD let mut epd = EPD2in9::new(&mut spi, cs_pin, busy_in, dc, rst, &mut delay).unwrap(); // Use display graphics let mut display = Display2in9::default(); // 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(), ); // 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");
Modules
color | B/W Color for EPDs |
epd1in54 | A simple Driver for the Waveshare 1.54" E-Ink Display via SPI |
epd2in9 | A simple Driver for the Waveshare 2.9" E-Ink Display via SPI |
epd4in2 | A simple Driver for the Waveshare 4.2" E-Ink Display via SPI |
graphics | Graphics Support for EPDs |
prelude |
Constants
SPI_MODE | SPI mode - For more infos see Requirements: SPI |