Struct ssd1306::mode::graphics::GraphicsMode
source · pub struct GraphicsMode<DI>where
DI: DisplayInterface,{ /* private fields */ }
Expand description
Graphics mode handler
Implementations§
source§impl<DI> GraphicsMode<DI>where
DI: DisplayInterface,
impl<DI> GraphicsMode<DI>where
DI: DisplayInterface,
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>(&mut self, rst: &mut RST, delay: &mut DELAY)where
RST: OutputPin,
DELAY: DelayMs<u8>,
pub fn reset<RST, DELAY>(&mut self, rst: &mut RST, delay: &mut DELAY)where
RST: OutputPin,
DELAY: DelayMs<u8>,
Reset 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<(), ()>
pub fn init(&mut self) -> Result<(), ()>
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<(), ()>
pub fn set_rotation(&mut self, rot: DisplayRotation) -> Result<(), ()>
Set the display rotation
Trait Implementations§
source§impl<DI> DisplayModeTrait<DI> for GraphicsMode<DI>where
DI: DisplayInterface,
impl<DI> DisplayModeTrait<DI> for GraphicsMode<DI>where
DI: DisplayInterface,
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