Module epd_waveshare::epd2in13bc [−][src]
Expand description
A simple Driver for the Waveshare 2.13“ (B/C) E-Ink Display via SPI More information on this display can be found at the Waveshare Wiki This driver was build and tested for 212x104, 2.13inch E-Ink display HAT for Raspberry Pi, three-color, SPI interface
Example for the 2.13“ E-Ink Display
use embedded_graphics::{prelude::*, primitives::{Line, PrimitiveStyle, PrimitiveStyleBuilder}};
use epd_waveshare::{epd2in13bc::*, prelude::*};
// Setup EPD
let mut epd = Epd2in13bc::new(&mut spi, cs_pin, busy_in, dc, rst, &mut delay)?;
// Use display graphics from embedded-graphics
// This display is for the black/white/chromatic pixels
let mut tricolor_display = Display2in13bc::default();
// Use embedded graphics for drawing a black line
let _ = Line::new(Point::new(0, 120), Point::new(0, 200))
.into_styled(PrimitiveStyle::with_stroke(TriColor::Black, 1))
.draw(&mut tricolor_display);
// We use `chromatic` but it will be shown as red/yellow
let _ = Line::new(Point::new(15, 120), Point::new(15, 200))
.into_styled(PrimitiveStyle::with_stroke(TriColor::Chromatic, 1))
.draw(&mut tricolor_display);
// Display updated frame
epd.update_color_frame(
&mut spi,
&tricolor_display.bw_buffer(),
&tricolor_display.chromatic_buffer()
)?;
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 2.13“ b/c EPD
Epd2in13bc driver
Constants
Default background color (white) of epd2in13bc display
Height of epd2in13bc in pixels
Width of epd2in13bc in pixels