[][src]Struct epd_gde021a1::GDE021A1

pub struct GDE021A1<SPI, RST, CS, DC, BSY> where
    SPI: Write<u8>,
    RST: OutputPin,
    CS: OutputPin,
    DC: OutputPin,
    BSY: InputPin
{ /* fields omitted */ }

The ePaper GDE021A1 Driver data structure

It is composed of

  • GPIO pins to set/read
  • SPI interfacae to write data to
  • a RAM buffer of 3096 byte (172x72 pixel, two bit per pixel)

Draw something to the display as well as clearing the display happens in MCU RAM only. The physical display will only updated by the refresh method, since writing to the chip is resource consuming (communication, energy, etc.)

Drawing must be on the RAM cache of the MCU and not on the RAM cache of the chip because the manipulation of single pixels without affecting neighbor pixels must be supported by the embedded graphics trait and communicating with the chip only allows updates of a set of four pixels.

This driver supports four gray level pixel color

  • embedded_graphics::pixelcolor::Gray2::new(0) maps to black
  • embedded_graphics::pixelcolor::Gray2::new(1) maps to dark gray
  • embedded_graphics::pixelcolor::Gray2::new(2) maps to light gray
  • embedded_graphics::pixelcolor::Gray2::new(3) maps to white

This driver supports binary pixel color:

  • embedded_graphics::pixelcolor::BinaryColor::On maps to black
  • embedded_graphics::pixelcolor::BinaryColor::Off maps to white.

Implementations

impl<SPI, RST, CS, DC, BSY, PinError, SPIError> GDE021A1<SPI, RST, CS, DC, BSY> where
    SPI: Write<u8, Error = SPIError>,
    RST: OutputPin<Error = PinError>,
    CS: OutputPin<Error = PinError>,
    DC: OutputPin<Error = PinError>,
    BSY: InputPin<Error = PinError>, 
[src]

pub fn new(spi: SPI, rst: RST, cs: Option<CS>, dc: DC, bsy: BSY) -> Self[src]

Create a new driver instance that uses SPI connection.

pub fn init(
    &mut self,
    delay: &mut dyn DelayUs<u32>
) -> Result<(), Error<SPIError, PinError>>
[src]

Initialize the display controller according to STM demo app

pub fn clear(&mut self)[src]

Clear just resets the buffer to white

pub fn refresh(
    &mut self,
    delay: &mut dyn DelayUs<u32>
) -> Result<(), Error<SPIError, PinError>>
[src]

Flush buffer to update entire display

The RAM buffer of the display on the MCU is transferred to the ePaper chip and the update command sequence instructs the chip to physically present the new content. The call is blocked until the busy pin signals completion of the operation of the physical display

pub fn busy_wait(&self)[src]

Wait until busy flag is cleared by the chip

pub fn alt_init(
    &mut self,
    delay: &mut dyn DelayUs<u32>
) -> Result<(), Error<SPIError, PinError>>
[src]

Initialize the display controller according to manual suggestion

Trait Implementations

impl<SPI, CS, RST, DC, BSY, PinError, SPIError> DrawTarget<BinaryColor> for GDE021A1<SPI, CS, RST, DC, BSY> where
    SPI: Write<u8, Error = SPIError>,
    RST: OutputPin<Error = PinError>,
    CS: OutputPin<Error = PinError>,
    DC: OutputPin<Error = PinError>,
    BSY: InputPin<Error = PinError>, 
[src]

type Error = Error<SPIError, PinError>

Error type to return when a drawing operation fails. Read more

impl<SPI, CS, RST, DC, BSY, PinError, SPIError> DrawTarget<Gray2> for GDE021A1<SPI, CS, RST, DC, BSY> where
    SPI: Write<u8, Error = SPIError>,
    RST: OutputPin<Error = PinError>,
    CS: OutputPin<Error = PinError>,
    DC: OutputPin<Error = PinError>,
    BSY: InputPin<Error = PinError>, 
[src]

type Error = Error<SPIError, PinError>

Error type to return when a drawing operation fails. Read more

Auto Trait Implementations

impl<SPI, RST, CS, DC, BSY> Send for GDE021A1<SPI, RST, CS, DC, BSY> where
    BSY: Send,
    CS: Send,
    DC: Send,
    RST: Send,
    SPI: Send

impl<SPI, RST, CS, DC, BSY> Sync for GDE021A1<SPI, RST, CS, DC, BSY> where
    BSY: Sync,
    CS: Sync,
    DC: Sync,
    RST: Sync,
    SPI: Sync

impl<SPI, RST, CS, DC, BSY> Unpin for GDE021A1<SPI, RST, CS, DC, BSY> where
    BSY: Unpin,
    CS: Unpin,
    DC: Unpin,
    RST: Unpin,
    SPI: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.