Trait Displayable

Source
pub trait Displayable<SPI: SpiDevice, ERROR> {
    // Required method
    async fn update_display(&mut self, spi: &mut SPI) -> Result<(), ERROR>;
}
Expand description

Base trait for any display where the display can be updated separate from its framebuffer data.

Required Methods§

Source

async fn update_display(&mut self, spi: &mut SPI) -> Result<(), ERROR>

Updates (refreshes) the display based on what has been written to RAM. Note that this can be stateful, for example displays in DisplayPartial mode often swap two underlying framebuffers on calls to this method, resulting in the following behaviour:

  1. [DisplayPartial::write_diff_framebuffer] is used to turn the RAM all white.
  2. Displayable::update_display is called, which refreshes the display to be all white.
  3. [DisplayPartial::write_diff_framebuffer] is used to turn the RAM all black.
  4. Displayable::update_display is called, which refreshes the display to be all black.
  5. Displayable::update_display is called again, which refreshes the display to be all white again.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<HW: EpdHw> Displayable<<HW as EpdHw>::Spi, <HW as EpdHw>::Error> for Epd2In9<HW, StateReady>

Source§

impl<HW: EpdHw> Displayable<<HW as EpdHw>::Spi, <HW as EpdHw>::Error> for Epd2In9V2<HW, StateReady>