2018-11-14 02:13:04 +00:00
|
|
|
#![no_std]
|
|
|
|
|
2018-12-26 01:54:30 +00:00
|
|
|
//! SSD1675 ePaper Display Driver
|
|
|
|
//!
|
|
|
|
//! For a complete example see
|
|
|
|
//! [the Raspberry Pi Inky pHAT example](https://github.com/wezm/ssd1675/blob/master/examples/raspberry_pi_inky_phat.rs).
|
|
|
|
//!
|
|
|
|
//! ### Usage
|
|
|
|
//!
|
|
|
|
//! To control a display you will need:
|
|
|
|
//!
|
|
|
|
//! * An [Interface] to the controller
|
|
|
|
//! * A [display configuration][Config]
|
|
|
|
//! * A [Display]
|
|
|
|
//!
|
2018-12-26 03:03:02 +00:00
|
|
|
//! The [Interface] captures the details of the hardware connection to the SSD1675 controller. This
|
2018-12-26 01:54:30 +00:00
|
|
|
//! includes an SPI device and some GPIO pins. The SSD1675 can control many different displays that
|
|
|
|
//! vary in dimensions, rotation, and driving characteristics. The [Config] captures these details.
|
2018-12-26 03:03:02 +00:00
|
|
|
//! To aid in constructing the [Config] there is a [Builder] interface. Finally when you have an
|
|
|
|
//! interface and a [Config] a [Display] instance can be created.
|
|
|
|
//!
|
|
|
|
//! Optionally the [Display] can be promoted to a [GraphicDisplay], which allows it to use the
|
|
|
|
//! functionality from the [embedded-graphics crate][embedded-graphics]. The plain display only
|
|
|
|
//! provides the ability to update the display by passing black/white and red buffers.
|
2018-12-26 01:54:30 +00:00
|
|
|
//!
|
|
|
|
//! To update the display you will typically follow this flow:
|
|
|
|
//!
|
2018-12-26 03:03:02 +00:00
|
|
|
//! 1. [reset](display/struct.Display.html#method.reset)
|
|
|
|
//! 1. [clear](graphics/struct.GraphicDisplay.html#method.clear)
|
|
|
|
//! 1. [update](graphics/struct.GraphicDisplay.html#method.update)
|
|
|
|
//! 1. [sleep](display/struct.Display.html#method.deep_sleep)
|
|
|
|
//!
|
|
|
|
//! [Interface]: interface/struct.Interface.html
|
|
|
|
//! [Display]: display/struct.Display.html
|
|
|
|
//! [GraphicDisplay]: display/struct.GraphicDisplay.html
|
|
|
|
//! [Config]: config/struct.Config.html
|
|
|
|
//! [Builder]: config/struct.Builder.html
|
|
|
|
//! [embedded-graphics]: https://crates.io/crates/embedded-graphics
|
2018-12-26 01:54:30 +00:00
|
|
|
|
2018-11-13 07:13:52 +00:00
|
|
|
extern crate embedded_hal as hal;
|
|
|
|
|
2018-11-16 10:58:57 +00:00
|
|
|
#[cfg(test)]
|
|
|
|
#[macro_use]
|
|
|
|
extern crate std;
|
|
|
|
|
2018-11-27 21:10:16 +00:00
|
|
|
mod color;
|
2018-12-26 03:03:02 +00:00
|
|
|
pub mod command;
|
|
|
|
pub mod config;
|
|
|
|
pub mod display;
|
|
|
|
pub mod graphics;
|
|
|
|
pub mod interface;
|
2018-11-14 02:13:04 +00:00
|
|
|
|
2018-11-14 07:02:33 +00:00
|
|
|
pub use color::Color;
|
2018-11-27 21:10:16 +00:00
|
|
|
pub use config::Builder;
|
2018-12-25 21:43:04 +00:00
|
|
|
pub use display::{Dimensions, Display, Rotation};
|
|
|
|
pub use graphics::GraphicDisplay;
|
|
|
|
pub use interface::DisplayInterface;
|
|
|
|
pub use interface::Interface;
|