diff --git a/src/lib.rs b/src/lib.rs index 4cb890e..ef014a2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,10 @@ #![no_std] +//! This library is an embedded-hal based driver implementation for the GDEQ031T10 e-paper display. +//! +//! **Note**: 9-bit SPI mode (where the data/command is designated with an extra bit for each byte) +//! is not supported by this driver. Only the mode with a dedicated data/command line is supported. + use embedded_hal::{ delay::DelayNs, digital::{InputPin, OutputPin}, @@ -10,6 +15,7 @@ const EPD_WIDTH: usize = 240; const EPD_HEIGHT: usize = 320; const EPD_ARRAY: usize = EPD_WIDTH * EPD_HEIGHT / 8; +/// The display driver for the GDEQ031T10 e-paper display. pub struct EPaperDisplay { busy: BusyPin, reset: ResetPin, @@ -18,13 +24,25 @@ pub struct EPaperDisplay { delay: Delay, } +/// An error that may occur during display initialisation. pub enum InitError { + /// This variant is for any error with setting the level of the reset pin. + /// + /// This variant may be uninhabited if the `ResetPin` type parameter for [EPaperDisplay] is one that + /// doesn't produce errors. ResetError(ResetError), + /// This variant is for errors when attempting to communicate with the display controller after reset. WriteError(WriteError), } +/// An error when trying to communicate with the display controller. pub enum WriteError { + /// This variant is for any error with setting the level of the DC (Data/Command) pin. + /// + /// This variant may be uninhabited if the `DcPin` type parameter for [EPaperDisplay] is one that + /// doesn't produce errors. DcError(DcError), + /// This variant is for errors produced by the SPI driver. SpiError(SpiError), }