Trait WritePixels

Source
pub trait WritePixels {
    // Required method
    async fn write_pixels(
        &mut self,
        data: &[u8],
        bit_depth: BitDepth,
        area: Rectangle,
    );

    // Provided method
    async fn flush<C>(&mut self, fb: &Framebuffer<'_, C>, top_left: Point)
       where C: PixelColor + ToBytes { ... }
}
Expand description

Convenience trait to hide details of the driver type.

Once the display driver is created, only the error type depends on the HAL types used for the implementation. For the use cases where panic on error is acceptable, we can ignore the type parameters.

Required Methods§

Source

async fn write_pixels( &mut self, data: &[u8], bit_depth: BitDepth, area: Rectangle, )

Provided Methods§

Source

async fn flush<C>(&mut self, fb: &Framebuffer<'_, C>, top_left: Point)
where C: PixelColor + ToBytes,

Transfers the contents of the framebuffer to the 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.

Implementors§

Source§

impl<RST, DC, SPI, PinE, SpiE> WritePixels for Ssd1331<RST, DC, SPI>
where RST: OutputPin<Error = PinE>, DC: OutputPin<Error = PinE>, SPI: SpiDevice<Error = SpiE>,