epd_datafuri/lib.rs
1//! epd-datafuri: Adafruit ePaper Display Driver
2//!
3//! Supports [Adafruit ThinkInk 2.9" Mono / 4 Grayscale display](https://www.adafruit.com/product/4777)
4//! and [Adafruit MagTag 2.9"](https://www.adafruit.com/product/4800).
5//!
6//! For a complete example see [the example](https://github.com/ScottCUSA/magtag_esp_hal).
7//!
8//! This driver is loosely modeled after the
9//! [epd-waveshare](https://github.com/caemor/epd-waveshare) drivers.
10//!
11//! ## Architecture
12//!
13//! This driver separates hardware control from graphics rendering:
14//! - **Driver structs** (`ThinkInk2in9Mono`, `MagTag2in9`) handle hardware interface and controller commands
15//! - **Graphics structs** (`Display2in9Mono`, `Display2in9Gray2`) handle frame buffers and embedded-graphics integration
16//!
17//! This allows multiple graphics buffers (e.g., for grayscale planes) to share a single hardware driver.
18//!
19//! ## Usage
20//!
21//! ### Adafruit ThinkInk 2.9" Display (Mono/Grayscale, SSD1680)
22//!
23//! ```rust, ignore
24//! use epd_datafuri::displays::adafruit_thinkink_290_mfgn::{ThinkInk2in9Mono, Display2in9Mono};
25//!
26//! // Create driver and graphics buffer
27//! let mut driver = ThinkInk2in9Mono::new(spi, busy, dc, rst)?;
28//! let mut display = Display2in9Mono::new();
29//!
30//! // Draw and update in one command
31//! driver.update_and_display(display.buffer(), &mut delay)?;
32//! ```
33//!
34//! For advanced use cases, you can also use the individual `update_bw()`, `update_red()`,
35//! `update()`, and `update_display()` methods for more granular control.
36//!
37#![no_std]
38#![deny(missing_docs)]
39#![allow(clippy::pedantic)]
40#![allow(clippy::cast_possible_truncation)]
41#![allow(clippy::cast_sign_loss)]
42#![allow(clippy::must_use_candidate)]
43#![allow(clippy::missing_errors_doc)]
44
45pub mod color;
46#[cfg(feature = "graphics")]
47pub mod displays;
48pub mod driver;
49#[cfg(feature = "graphics")]
50pub mod graphics;
51
52/// Maximum display height this driver supports
53pub const MAX_HEIGHT: u16 = 296;
54
55/// Maximum display width this driver supports
56pub const MAX_WIDTH: u16 = 176;
57
58pub mod interface;
59
60/// Useful exports
61pub mod prelude {
62 pub use crate::color::Color;
63 pub use crate::driver::EpdDriver;
64
65 #[cfg(feature = "graphics")]
66 pub use crate::graphics::{Display, DisplayRotation};
67}