Module epd_waveshare::epd2in9 [−][src]
Expand description
A simple Driver for the Waveshare 2.9“ E-Ink Display via SPI
Example for the 2.9 in E-Ink Display
use embedded_graphics::{
pixelcolor::BinaryColor::On as Black, prelude::*, primitives::{Line, PrimitiveStyle},
};
use epd_waveshare::{epd2in9::*, prelude::*};
// Setup EPD
let mut epd = Epd2in9::new(&mut spi, cs_pin, busy_in, dc, rst, &mut delay)?;
// Use display graphics from embedded-graphics
let mut display = Display2in9::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)?;
Structs
Display with Fullsize buffer for use with the 2in9 EPD
Epd2in9 driver
Constants
Default Background Color (white)
Height of epd2in9 in pixels
Width of epd2in9 in pixels