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

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.

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.

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.

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

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.

Reset the display.

Reset the display.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Set the display rotation

This method resets the cursor but does not clear the screen.

Initialise and clear the display in graphics mode.

Error.

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.

Error.

Set the display rotation.

Initialise in horizontal addressing mode.

Error.

The pixel color type the targetted display supports.

Error type to return when a drawing operation fails. Read more

Draw individual pixels to the display without a defined order. Read more

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

Fill the entire display with a solid color. Read more

Returns the size of the bounding box.

Writes a string slice into this writer, returning whether the write succeeded. Read more

Writes a char into this writer, returning whether the write succeeded. Read more

Glue for usage of the write! macro with implementors of this trait. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Returns the bounding box.

Performs the conversion.

Performs the conversion.

Casts the value.

Casts the value.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

Casts the value.