Started writing documentation
This commit is contained in:
parent
fa4cc5d3f2
commit
185f700741
1 changed files with 18 additions and 0 deletions
18
src/lib.rs
18
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<BusyPin, ResetPin, DcPin, SpiDevice, Delay> {
|
||||
busy: BusyPin,
|
||||
reset: ResetPin,
|
||||
|
|
@ -18,13 +24,25 @@ pub struct EPaperDisplay<BusyPin, ResetPin, DcPin, SpiDevice, Delay> {
|
|||
delay: Delay,
|
||||
}
|
||||
|
||||
/// An error that may occur during display initialisation.
|
||||
pub enum InitError<ResetError, DcError, SpiError> {
|
||||
/// 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<DcError, SpiError>),
|
||||
}
|
||||
|
||||
/// An error when trying to communicate with the display controller.
|
||||
pub enum WriteError<DcError, SpiError> {
|
||||
/// 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),
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue