Struct ssd1306::Ssd1306 [−][src]
pub struct Ssd1306<DI, SIZE, MODE> { /* fields omitted */ }
Expand description
SSD1306 driver.
Note that some methods are only available when the display is configured in a certain mode
.
Implementations
impl<DI, SIZE> Ssd1306<DI, SIZE, BufferedGraphicsMode<SIZE>> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
impl<DI, SIZE> Ssd1306<DI, SIZE, BufferedGraphicsMode<SIZE>> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
Clear the display buffer. You need to call disp.flush()
for any effect on the screen
Write out data to a display.
This only updates the parts of the display that have changed since the last flush.
impl<DI, SIZE> Ssd1306<DI, SIZE, TerminalMode> where
DI: WriteOnlyDataCommand,
SIZE: TerminalDisplaySize,
impl<DI, SIZE> Ssd1306<DI, SIZE, TerminalMode> where
DI: WriteOnlyDataCommand,
SIZE: TerminalDisplaySize,
Clear the display and reset the cursor to the top left corner
Print a character to the display
Get the current cursor position, in character coordinates. This is the (column, row) that the next character will be written to.
Set the cursor position, in character coordinates. This is the (column, row) that the next character will be written to. If the position is out of bounds, an Err will be returned.
Clear the display.
Create a basic SSD1306 interface.
Use the into_*_mode
methods to enable more functionality.
impl<DI, SIZE, MODE> Ssd1306<DI, SIZE, MODE> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
impl<DI, SIZE, MODE> Ssd1306<DI, SIZE, MODE> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
Convert the display into a buffered graphics mode, supporting embedded-graphics.
See BufferedGraphicsMode for more information.
Convert the display into a text-only, terminal-like mode.
See TerminalMode for more information.
Initialise the display in one of the available addressing modes.
Change the addressing mode
pub fn bounded_draw(
&mut self,
buffer: &[u8],
disp_width: usize,
upper_left: (u8, u8),
lower_right: (u8, u8)
) -> Result<(), DisplayError>
pub fn bounded_draw(
&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.
Send a raw buffer to the display.
Get display dimensions, taking into account the current rotation of the display
use ssd1306::{mode::TerminalMode, prelude::*, Ssd1306}; let mut display = Ssd1306::new( interface, DisplaySize128x64, DisplayRotation::Rotate0, ).into_terminal_mode(); assert_eq!(display.dimensions(), (128, 64)); let mut rotated_display = Ssd1306::new( interface, DisplaySize128x64, DisplayRotation::Rotate90, ).into_terminal_mode(); assert_eq!(rotated_display.dimensions(), (64, 128));
Get the display rotation.
Set the display rotation.
Change the display brightness.
Turn the display on or off. The display can be drawn to and retains all of its memory even while off.
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.
Set the column address in the framebuffer of the display where any sent data should be drawn.
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.
Trait Implementations
impl<DI, SIZE> DisplayConfig for Ssd1306<DI, SIZE, BufferedGraphicsMode<SIZE>> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
impl<DI, SIZE> DisplayConfig for Ssd1306<DI, SIZE, BufferedGraphicsMode<SIZE>> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
Set the display rotation
This method resets the cursor but does not clear the screen.
Initialise and clear the display in graphics mode.
type Error = DisplayError
type Error = DisplayError
Error.
impl<DI, SIZE> DisplayConfig for Ssd1306<DI, SIZE, TerminalMode> where
DI: WriteOnlyDataCommand,
SIZE: TerminalDisplaySize,
impl<DI, SIZE> DisplayConfig for Ssd1306<DI, SIZE, TerminalMode> where
DI: WriteOnlyDataCommand,
SIZE: TerminalDisplaySize,
Set the display rotation
This method resets the cursor but does not clear the screen.
Initialise the display in page mode (i.e. a byte walks down a column of 8 pixels) with column 0 on the left and column (SIZE::Width::U8 - 1) on the right, but no automatic line wrapping.
type Error = TerminalModeError
type Error = TerminalModeError
Error.
impl<DI, SIZE> DisplayConfig for Ssd1306<DI, SIZE, BasicMode> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
impl<DI, SIZE> DisplayConfig for Ssd1306<DI, SIZE, BasicMode> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
impl<DI, SIZE> DrawTarget for Ssd1306<DI, SIZE, BufferedGraphicsMode<SIZE>> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
impl<DI, SIZE> DrawTarget for Ssd1306<DI, SIZE, BufferedGraphicsMode<SIZE>> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
type Color = BinaryColor
type Color = BinaryColor
The pixel color type the targetted display supports.
type Error = DisplayError
type Error = DisplayError
Error type to return when a drawing operation fails. Read more
Draw individual pixels to the display without a defined order. Read more
fn fill_contiguous<I>(
&mut self,
area: &Rectangle,
colors: I
) -> Result<(), Self::Error> where
I: IntoIterator<Item = Self::Color>,
fn fill_contiguous<I>(
&mut self,
area: &Rectangle,
colors: I
) -> Result<(), Self::Error> where
I: IntoIterator<Item = Self::Color>,
Fill a given area with an iterator providing a contiguous stream of pixel colors. Read more
Fill a given area with a solid color. Read more
impl<DI, SIZE> OriginDimensions for Ssd1306<DI, SIZE, BufferedGraphicsMode<SIZE>> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
impl<DI, SIZE> OriginDimensions for Ssd1306<DI, SIZE, BufferedGraphicsMode<SIZE>> where
DI: WriteOnlyDataCommand,
SIZE: DisplaySize,
impl<DI, SIZE> Write for Ssd1306<DI, SIZE, TerminalMode> where
DI: WriteOnlyDataCommand,
SIZE: TerminalDisplaySize,
impl<DI, SIZE> Write for Ssd1306<DI, SIZE, TerminalMode> where
DI: WriteOnlyDataCommand,
SIZE: TerminalDisplaySize,
Writes a string slice into this writer, returning whether the write succeeded. Read more
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more
Casts the value.
Returns the bounding box.
Casts the value.
Casts the value.
Casts the value.
Casts the value.