RKTK API Docs RKTK Home Repo

Trait DisplaySize

Source
pub trait DisplaySize {
    type Buffer: AsMut<[u8]> + NewZeroed;

    const WIDTH: u8;
    const HEIGHT: u8;
    const DRIVER_COLS: u8 = 128u8;
    const DRIVER_ROWS: u8 = 64u8;
    const OFFSETX: u8 = 0u8;
    const OFFSETY: u8 = 0u8;

    // Required method
    fn configure(
        &self,
        iface: &mut impl WriteOnlyDataCommand,
    ) -> Result<(), DisplayError>;
}
Expand description

Display information.

This trait describes information related to a particular display. This includes resolution, offset and framebuffer size.

Required Associated Constants§

Source

const WIDTH: u8

Width in pixels

Source

const HEIGHT: u8

Height in pixels

Provided Associated Constants§

Source

const DRIVER_COLS: u8 = 128u8

Maximum width supported by the display driver

Source

const DRIVER_ROWS: u8 = 64u8

Maximum height supported by the display driver

Source

const OFFSETX: u8 = 0u8

Horizontal offset in pixels

Source

const OFFSETY: u8 = 0u8

Vertical offset in pixels

Required Associated Types§

Source

type Buffer: AsMut<[u8]> + NewZeroed

Size of framebuffer. Because the display is monochrome, this is width * height / 8

Required Methods§

Source

fn configure( &self, iface: &mut impl WriteOnlyDataCommand, ) -> Result<(), DisplayError>

Send resolution and model-dependent configuration to the display

See Command::ComPinConfig and Command::InternalIref for more information

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§