DisplaySimple

Trait DisplaySimple 

Source
pub trait DisplaySimple<const BITS: usize, const FRAMES: usize, SPI: SpiDevice, ERROR>: Displayable<SPI, ERROR> {
    // Required methods
    async fn write_framebuffer(
        &mut self,
        spi: &mut SPI,
        buf: &dyn BufferView<BITS, FRAMES>,
    ) -> Result<(), ERROR>;
    async fn display_framebuffer(
        &mut self,
        spi: &mut SPI,
        buf: &dyn BufferView<BITS, FRAMES>,
    ) -> Result<(), ERROR>;
}
Expand description

Simple displays that support writing and displaying framebuffers of a certain bit configuration.

BITS indicates the colour depth of each frame, and FRAMES indicates the total number of frames that represent a complete image. For example, some 4-colour greyscale display might accept data as two separate 1-bit frames instead of one frame of 2-bit pixels. This distinction is exposed so that framebuffers can be written directly to displays without temp copies or transformations.

Required Methods§

Source

async fn write_framebuffer( &mut self, spi: &mut SPI, buf: &dyn BufferView<BITS, FRAMES>, ) -> Result<(), ERROR>

Writes the given buffer’s data into the main framebuffer to be displayed on the next call to Displayable::update_display.

Source

async fn display_framebuffer( &mut self, spi: &mut SPI, buf: &dyn BufferView<BITS, FRAMES>, ) -> Result<(), ERROR>

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> DisplaySimple<1, 1, <HW as SpiHw>::Spi, <HW as ErrorHw>::Error> for Epd2In9<HW, StateReady>
where HW: DcHw + BusyHw + DelayHw + ErrorHw + SpiHw, HW::Error: From<<HW::Dc as ErrorType>::Error> + From<<HW::Busy as ErrorType>::Error> + From<<HW::Spi as ErrorType>::Error>,

Source§

impl<HW> DisplaySimple<1, 1, <HW as SpiHw>::Spi, <HW as ErrorHw>::Error> for Epd2In9V2<HW, StateReady>
where HW: BusyHw + DcHw + SpiHw + ErrorHw, HW::Error: From<<HW::Busy as ErrorType>::Error> + From<<HW::Dc as ErrorType>::Error> + From<<HW::Spi as ErrorType>::Error>,

Source§

impl<HW> DisplaySimple<1, 2, <HW as SpiHw>::Spi, <HW as ErrorHw>::Error> for Epd2In9V2<HW, StateReady>
where HW: BusyHw + DcHw + SpiHw + ErrorHw, HW::Error: From<<HW::Busy as ErrorType>::Error> + From<<HW::Dc as ErrorType>::Error> + From<<HW::Spi as ErrorType>::Error>,