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§
Sourceasync fn write_framebuffer(
&mut self,
spi: &mut SPI,
buf: &dyn BufferView<BITS, FRAMES>,
) -> Result<(), ERROR>
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.
Sourceasync fn display_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>
A shortcut for calling DisplaySimple::write_framebuffer followed by Displayable::update_display.
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.