[−][src]Struct ssd1306::properties::DisplayProperties
Display properties struct
Methods
impl<DI> DisplayProperties<DI> where
DI: DisplayInterface,
[src]
DI: DisplayInterface,
pub fn new(
iface: DI,
display_size: DisplaySize,
display_rotation: DisplayRotation
) -> DisplayProperties<DI>
[src]
iface: DI,
display_size: DisplaySize,
display_rotation: DisplayRotation
) -> DisplayProperties<DI>
Create new DisplayProperties instance
pub fn init_column_mode(&mut self) -> Result<(), DI::Error>
[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<(), DI::Error>
[src]
&mut self,
start: (u8, u8),
end: (u8, u8)
) -> Result<(), DI::Error>
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<(), DI::Error>
[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<(), DI::Error>
[src]
&mut self,
display_rotation: DisplayRotation
) -> Result<(), DI::Error>
Set the display rotation
Auto Trait Implementations
impl<DI> Send for DisplayProperties<DI> where
DI: Send,
DI: Send,
impl<DI> Sync for DisplayProperties<DI> where
DI: Sync,
DI: Sync,
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,