pub struct Oled { /* fields omitted */ }
Represents the NanoHat OLED device
Opens the device from its entry in the dev filesystem.
let mut oled = Oled::from_path("/dev/i2c-0");
Initial low-level setup for the display, per SSD1306 and NanoHat OLED datasheets.
Sends a command or command argument to the display's command parser
Sends a data byte to the display RAM.
Display RAM is divided into 8-row pages. When writing bytes to display RAM,
values are set at the current page and column pointer location.
Pixels are set vertically, meaning that for a single byte,
the LSB will be written to the top row of the current page, and the MSB will
be written to the bottom row. Once the byte is written, pointers will advance,
depending on the AddressingMode
.
Sends a set of data all at once into the display RAM.
Data is always written in chunks of 31 bytes (plus a byte to set data mode).
See send_data()
for more details on RAM layout
pub fn set_text_xy(&mut self, column: u8, row: u8) -> OledResult | [src] |
Sets the cursor position for writing text to display RAM.
Completely clears the display of text and images
Writes an image bitmap to the screen.
The bitmap must be the same dimensions as the display.
Anything greater than or equal to the threshold
will
be interpreted as a 1
pixel; anything under will be
interpreted as a 0
.
Writes a single character to the display at the current
X,Y location (as set by set_text_xy()
and incremented by the AddressingMode
).
Note: only printable ASCII is supported. Other characters will output as
an empty square.
Writes a string to the display, starting at the current
X, Y location (as set by set_text_xy
and incremented by
the AddressingMode
).
None: only printable ASCII is supported
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static