[][src]Struct ssd1306::properties::DisplayProperties

pub struct DisplayProperties<DI> { /* fields omitted */ }

Display properties struct

Methods

impl<DI> DisplayProperties<DI> where
    DI: DisplayInterface
[src]

pub fn new(
    iface: DI,
    display_size: DisplaySize,
    display_rotation: DisplayRotation
) -> DisplayProperties<DI>
[src]

Create new DisplayProperties instance

pub fn init_column_mode(&mut self) -> Result<(), ()>[src]

Initialise the display in column mode (i.e. a byte walks down a column of 8 pixels) with column 0 on the left and column (display_width - 1) on the right.

pub fn set_draw_area(
    &mut self,
    start: (u8, u8),
    end: (u8, u8)
) -> Result<(), ()>
[src]

Set the position in the framebuffer of the display where any sent data should be drawn. This method can be used for changing the affected area on the screen as well as (re-)setting the start point of the next draw call.

pub fn draw(&mut self, buffer: &[u8]) -> Result<(), ()>[src]

Send the data to the display for drawing at the current position in the framebuffer and advance the position accordingly. Cf. set_draw_area to modify the affected area by this method.

pub fn get_size(&self) -> DisplaySize[src]

Get the configured display size

pub fn get_dimensions(&self) -> (u8, u8)[src]

Get display dimensions, taking into account the current rotation of the display

let disp = DisplayProperties::new(
    interface,
    DisplaySize::Display128x64,
    DisplayRotation::Rotate0
);
assert_eq!(disp.get_dimensions(), (128, 64));

let rotated_disp = DisplayProperties::new(
    interface,
    DisplaySize::Display128x64,
    DisplayRotation::Rotate90
);
assert_eq!(rotated_disp.get_dimensions(), (64, 128));

pub fn get_rotation(&self) -> DisplayRotation[src]

Get the display rotation

pub fn set_rotation(
    &mut self,
    display_rotation: DisplayRotation
) -> Result<(), ()>
[src]

Set the display rotation

Auto Trait Implementations

impl<DI> Send for DisplayProperties<DI> where
    DI: Send

impl<DI> Sync for DisplayProperties<DI> where
    DI: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]