Module epd_waveshare::epd4in2
source · Expand description
A simple Driver for the Waveshare 4.2“ E-Ink Display via SPI
The other Waveshare E-Ink Displays should be added later on
Build with the help of documentation/code from Waveshare,
Ben Krasnows partial Refresh tips and
the driver documents in the pdfs
-folder as orientation.
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 was 8Mhz but more should be possible
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
ⓘ
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
epd4in2.clear_frame(None);
epd4in2.sleep();
BE CAREFUL! The screen can get ghosting/burn-ins through the Partial Fast Update Drawing.
Structs
Full size buffer for use with the 4in2 EPD
EPD4in2 driver