Trait ssd1306::size::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 Types§

source

type Buffer: AsMut<[u8]> + NewZeroed

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

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 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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl DisplaySize for DisplaySize64x32

source§

const WIDTH: u8 = 64u8

source§

const HEIGHT: u8 = 32u8

source§

const OFFSETX: u8 = 32u8

source§

const OFFSETY: u8 = 0u8

§

type Buffer = [u8; 256]

source§

impl DisplaySize for DisplaySize64x48

source§

const WIDTH: u8 = 64u8

source§

const HEIGHT: u8 = 48u8

source§

const OFFSETX: u8 = 32u8

source§

const OFFSETY: u8 = 0u8

§

type Buffer = [u8; 384]

source§

impl DisplaySize for DisplaySize72x40

source§

const WIDTH: u8 = 72u8

source§

const HEIGHT: u8 = 40u8

source§

const OFFSETX: u8 = 28u8

source§

const OFFSETY: u8 = 0u8

§

type Buffer = [u8; 360]

source§

impl DisplaySize for DisplaySize96x16

source§

const WIDTH: u8 = 96u8

source§

const HEIGHT: u8 = 16u8

§

type Buffer = [u8; 192]

source§

impl DisplaySize for DisplaySize128x32

source§

const WIDTH: u8 = 128u8

source§

const HEIGHT: u8 = 32u8

§

type Buffer = [u8; 512]

source§

impl DisplaySize for DisplaySize128x64

source§

const WIDTH: u8 = 128u8

source§

const HEIGHT: u8 = 64u8

§

type Buffer = [u8; 1024]