Crate epd_waveshare_async

Source
Expand description

This crate provides an async/await interface for controlling Waveshare E-Paper displays.

It is built on top of embedded-hal-async and embedded-graphics, making it compatible with a wide range of embedded platforms.

§Core traits

§Hardware

The use must implement the EpdHw trait for their hardware. This trait abstracts over the underlying hardware components required to control an E-Paper display, including SPI communication, GPIO pins (for Data/Command, Reset, and Busy and a delay timer. You need to implement this trait for your chosen peripherals. This trades off some set up code (implementing this trait), for simple type signatures with fewer generic parameters.

§Functionality

Functionality is split into composable traits, to enable granular support per display, and stateful functionality that can be checked at compilation time.

  • Reset: basic hardware reset support
  • Sleep: displays that can be put to sleep
  • Wake: displays that can be woken from sleep
  • DisplaySimple: basic support for writing and displaying a single framebuffer
  • DisplayPartial: support for partial refresh using a diff

Additionally, the crate provides:

  • buffer module: Contains utilities for creating and managing efficient display buffers that implement embedded-graphics::DrawTarget. These are designed to be fast and compact.
  • various <display> modules: each display lives in its own module, such as epd2in9 for the 2.9“ e-paper display.

Modules§

buffer
epd2in9
epd2in9_v2

Enums§

Error
Indicates usage errors due to incorrect states.

Traits§

DisplayPartial
Displays that support a partial update, where a “diff” framebuffer is diffed against a base framebuffer, and only the changed pixels from the diff are actually updated.
DisplaySimple
Simple displays that support writing and displaying framebuffers of a certain bit configuration.
Displayable
Base trait for any display where the display can be updated separate from its framebuffer data.
EpdHw
Provides access to the hardware needed to control an EPD.
Reset
Displays that have a hardware reset.
Sleep
Displays that can sleep to save power.
Wake
Displays that can be woken from a sleep state.