Struct ssd1309::mode::graphics::GraphicsMode
source · pub struct GraphicsMode<DI>where
DI: WriteOnlyDataCommand,{ /* private fields */ }
Expand description
Graphics mode handler
Implementations§
source§impl<DI> GraphicsMode<DI>where
DI: WriteOnlyDataCommand,
impl<DI> GraphicsMode<DI>where DI: WriteOnlyDataCommand,
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the display buffer. You need to call disp.flush()
for any effect on the screen
sourcepub fn reset<RST, DELAY, PinE>(
&mut self,
rst: &mut RST,
delay: &mut DELAY
) -> Result<(), PinE>where
RST: OutputPin<Error = PinE>,
DELAY: DelayMs<u8>,
pub fn reset<RST, DELAY, PinE>( &mut self, rst: &mut RST, delay: &mut DELAY ) -> Result<(), PinE>where RST: OutputPin<Error = PinE>, DELAY: DelayMs<u8>,
Reset display. This is very important on the SSD1309!
This should be called before init
or any other methods.
sourcepub fn flush(&mut self) -> Result<(), DisplayError>
pub fn flush(&mut self) -> Result<(), DisplayError>
Write out data to display
sourcepub fn set_pixel(&mut self, x: u32, y: u32, value: u8)
pub fn set_pixel(&mut self, x: u32, y: u32, value: u8)
Turn a pixel on or off. A non-zero value
is treated as on, 0
as off. If the X and Y
coordinates are out of the bounds of the display, this method call is a noop.
sourcepub fn init(&mut self) -> Result<(), DisplayError>
pub fn init(&mut self) -> Result<(), DisplayError>
Display is set up in column mode, i.e. a byte walks down a column of 8 pixels from column 0 on the left, to column n on the right
sourcepub fn get_dimensions(&self) -> (u8, u8)
pub fn get_dimensions(&self) -> (u8, u8)
Get display dimensions, taking into account the current rotation of the display
sourcepub fn set_rotation(&mut self, rot: DisplayRotation) -> Result<(), DisplayError>
pub fn set_rotation(&mut self, rot: DisplayRotation) -> Result<(), DisplayError>
Set the display rotation
sourcepub fn display_on(&mut self, on: bool) -> Result<(), DisplayError>
pub fn display_on(&mut self, on: bool) -> Result<(), DisplayError>
Turn the display on or off. The display can be drawn to and retains all of its memory even while off.
sourcepub fn set_contrast(&mut self, contrast: u8) -> Result<(), DisplayError>
pub fn set_contrast(&mut self, contrast: u8) -> Result<(), DisplayError>
Set the display contrast
Trait Implementations§
source§impl<DI> DisplayModeTrait<DI> for GraphicsMode<DI>where
DI: WriteOnlyDataCommand,
impl<DI> DisplayModeTrait<DI> for GraphicsMode<DI>where DI: WriteOnlyDataCommand,
source§fn new(properties: DisplayProperties<DI>) -> Self
fn new(properties: DisplayProperties<DI>) -> Self
Create new GraphicsMode instance
source§fn release(self) -> DisplayProperties<DI>
fn release(self) -> DisplayProperties<DI>
Release all resources used by GraphicsMode