[][src]Struct ssd1309::properties::DisplayProperties

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

Display properties struct

Implementations

impl<DI> DisplayProperties<DI> where
    DI: WriteOnlyDataCommand
[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<(), DisplayError>[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<(), DisplayError>
[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<(), DisplayError>[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<(), DisplayError>
[src]

Set the display rotation

pub fn display_on(&mut self, on: bool) -> Result<(), DisplayError>[src]

Turn the display on or off. The display can be drawn to and retains all of its memory even while off.

pub fn set_contrast(&mut self, contrast: u8) -> Result<(), DisplayError>[src]

Set the display contrast

Auto Trait Implementations

impl<DI> Send for DisplayProperties<DI> where
    DI: Send
[src]

impl<DI> Sync for DisplayProperties<DI> where
    DI: Sync
[src]

impl<DI> Unpin for DisplayProperties<DI> where
    DI: Unpin
[src]

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.