Crate nanohat_oled

Source
Expand description

This is a Rust port of the manufacturer code for the NanoHat OLED, based on the SSD1306 OLED display from Solomon Systech.

It enables basic access to the screen functions, including a facility for displaying text and images.

§Example

use nanohat_oled::{Oled, OledResult};

fn main() -> OledResult {
    let mut oled = Oled::from_path("/dev/i2c-0")?;
    oled.init()?;
    oled.put_string("Hello, world!")?;
    Ok(())
}

Structs§

Oled
Represents the NanoHat OLED device

Enums§

AddressingMode
Different addressing modes available for the display. They affect how pointers are advanced after data is written.
Command
A command that can be sent to the OLED display

Constants§

OLED_ADDRESS
The I2C slave address of the display
OLED_HEIGHT
The height of the display, in pixels
OLED_WIDTH
The width of the display, in pixels

Type Aliases§

Image
For now, images are represented as byte arrays representing 8-bit grayscale bitmaps. Note that images must be exactly the size of the display
OledResult
Returned for commands and data sent to the OLED display.