Module epd_waveshare::epd1in54 [−][src]
Expand description
A simple Driver for the Waveshare 1.54“ E-Ink Display via SPI
Example for the 1.54 in E-Ink Display
use embedded_graphics::{
pixelcolor::BinaryColor::On as Black, prelude::*, primitives::{Line, PrimitiveStyleBuilder},
};
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 style = PrimitiveStyleBuilder::new()
.stroke_color(Black)
.stroke_width(1)
.build();
let _ = Line::new(Point::new(0, 120), Point::new(0, 295))
.into_styled(style)
.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
Full size buffer for use with the 1in54 EPD
Epd1in54 driver
Constants
Default Background Color
Height of the display
Width of the display