[][src]Module epd_waveshare::epd1in54

A simple Driver for the Waveshare 1.54" E-Ink Display via SPI

Example for the 1.54 in E-Ink Display

This example is not tested
use epd_waveshare::{
    epd1in54::{EPD1in54, Display1in54},
    graphics::{Display, DisplayRotation},
    prelude::*,
};
use embedded_graphics::Drawing;

// Setup EPD
let mut epd = EPD1in54::new(&mut spi, cs_pin, busy_in, dc, rst, &mut delay).unwrap();

// Use display graphics
let mut display = Display1in54::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");

Structs

Display1in54

Full size buffer for use with the 1in54 EPD

EPD1in54

EPD1in54 driver

Constants

DEFAULT_BACKGROUND_COLOR
HEIGHT
WIDTH