Skip to main content

epd_datafuri/driver/
mod.rs

1//! Driver trait and chip-specific implementations
2pub use display_interface::DisplayError;
3
4pub(crate) mod il0373;
5pub(crate) mod ssd1680;
6
7use embedded_hal::delay::DelayNs;
8
9/// Trait defining the driver interface for EPD displays
10pub trait EpdDriver {
11    /// Reset and initialize the display
12    fn init(&mut self, delay: &mut impl DelayNs) -> Result<(), DisplayError>;
13
14    /// Power down the controller
15    fn sleep(&mut self, delay: &mut impl DelayNs) -> Result<(), DisplayError>;
16
17    /// Send black/white buffer to display
18    fn update_bw(&mut self, buffer: &[u8], delay: &mut impl DelayNs) -> Result<(), DisplayError>;
19
20    /// Send red buffer
21    fn update_red(&mut self, buffer: &[u8], delay: &mut impl DelayNs) -> Result<(), DisplayError>;
22
23    /// Send both low (bw) and high (red) buffers to display
24    fn update(
25        &mut self,
26        low_buffer: &[u8],
27        high_buffer: &[u8],
28        delay: &mut impl DelayNs,
29    ) -> Result<(), DisplayError>;
30
31    /// Clear the BW RAM
32    fn clear_bw_ram(&mut self) -> Result<(), DisplayError>;
33
34    /// Clear the red RAM
35    fn clear_red_ram(&mut self) -> Result<(), DisplayError>;
36
37    /// Begin operation - reset and put into low power state
38    fn begin(&mut self, delay: &mut impl DelayNs) -> Result<(), DisplayError>;
39}