[−][src]Struct ssd1306::properties::DisplayProperties
Display properties struct
Implementations
impl<DI, DSIZE> DisplayProperties<DI, DSIZE> where
DSIZE: DisplaySize,
[src]
DSIZE: DisplaySize,
pub fn new(
iface: DI,
size: DSIZE,
display_rotation: DisplayRotation
) -> DisplayProperties<DI, DSIZE>
[src]
iface: DI,
size: DSIZE,
display_rotation: DisplayRotation
) -> DisplayProperties<DI, DSIZE>
Create new DisplayProperties instance
impl<DI, DSIZE> DisplayProperties<DI, DSIZE>
[src]
impl<DI, DSIZE> DisplayProperties<DI, DSIZE> where
DI: WriteOnlyDataCommand,
DSIZE: DisplaySize,
[src]
DI: WriteOnlyDataCommand,
DSIZE: DisplaySize,
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 init_with_mode(&mut self, mode: AddrMode) -> Result<(), DisplayError>
[src]
Initialise the display in one of the available addressing modes
pub fn change_mode(&mut self, mode: AddrMode) -> Result<(), DisplayError>
[src]
Change the addressing mode
pub fn set_draw_area(
&mut self,
start: (u8, u8),
end: (u8, u8)
) -> Result<(), DisplayError>
[src]
&mut self,
start: (u8, u8),
end: (u8, u8)
) -> Result<(), DisplayError>
Set the position in the framebuffer of the display limiting 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.
Only works in Horizontal or Vertical addressing mode
pub fn set_column(&mut self, column: u8) -> Result<(), DisplayError>
[src]
Set the column address in the framebuffer of the display where any sent data should be drawn. Only works in Page addressing mode.
pub fn set_row(&mut self, row: u8) -> Result<(), DisplayError>
[src]
Set the page address (row 8px high) in the framebuffer of the display where any sent data should be drawn. Note that the parameter is in pixels, but the page will be set to the start of the 8px row which contains the passed-in row. Only works in Page addressing mode.
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 area affected by
this method in horizontal / vertical mode.
pub fn bounded_draw(
&mut self,
buffer: &[u8],
disp_width: usize,
upper_left: (u8, u8),
lower_right: (u8, u8)
) -> Result<(), DisplayError>
[src]
&mut self,
buffer: &[u8],
disp_width: usize,
upper_left: (u8, u8),
lower_right: (u8, u8)
) -> Result<(), DisplayError>
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.
This method takes advantage of a bounding box for faster writes.
pub fn get_dimensions(&self) -> (u8, u8)
[src]
Get display dimensions, taking into account the current rotation of the display
use ssd1306::prelude::*; let disp = DisplayProperties::new( interface, DisplaySize128x64, DisplayRotation::Rotate0, ); assert_eq!(disp.get_dimensions(), (128, 64)); let rotated_disp = DisplayProperties::new( interface, DisplaySize128x64, 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]
&mut self,
display_rotation: DisplayRotation
) -> Result<(), DisplayError>
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_brightness(
&mut self,
brightness: Brightness
) -> Result<(), DisplayError>
[src]
&mut self,
brightness: Brightness
) -> Result<(), DisplayError>
Change the display brightness.
pub fn into<NMODE: DisplayModeTrait<DI, DSIZE>>(self) -> NMODE where
DI: WriteOnlyDataCommand,
[src]
DI: WriteOnlyDataCommand,
Change into any mode implementing DisplayModeTrait
use ssd1306::{mode::GraphicsMode, prelude::*, Builder, I2CDIBuilder}; let interface = I2CDIBuilder::new().init(i2c); let di: GraphicsMode<_, _> = Builder::new() .size(DisplaySize128x32) .connect(interface) .into();
Auto Trait Implementations
impl<DI, DSIZE> Send for DisplayProperties<DI, DSIZE> where
DI: Send,
DSIZE: Send,
[src]
DI: Send,
DSIZE: Send,
impl<DI, DSIZE> Sync for DisplayProperties<DI, DSIZE> where
DI: Sync,
DSIZE: Sync,
[src]
DI: Sync,
DSIZE: Sync,
impl<DI, DSIZE> Unpin for DisplayProperties<DI, DSIZE> where
DI: Unpin,
DSIZE: Unpin,
[src]
DI: Unpin,
DSIZE: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,