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 user must implement the XHw
traits for their hardware that are needed by their display.
These traits abstract over common hardware functionality that displays need, like SPI
communication, GPIO pins (for Data/Command, Reset, and Busy) and a delay timer. You need to
implement these traits for your chosen peripherals. This trades off some set up code (
implementing these traits), for simple type signatures with fewer generic parameters.
See the crate::hw module for more.
§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 implementembedded-graphics::DrawTarget
. These are designed to be fast and compact.- various
<display>
modules: each display lives in its own module, such asepd2in9
for the 2.9“ e-paper display.
Modules§
- buffer
- epd2in9
- epd2in9_
v2 - hw
- This module provides hardware abstraction traits that can be used by display drivers. You should implement all the traits on a single struct, so that you can pass this one hardware struct to your display driver.
Traits§
- Display
Partial - 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.
- Display
Simple - 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.
- 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.