Crate nanohat_oled[][src]

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

Represents the NanoHat OLED device

Enums

Different addressing modes available for the display. They affect how pointers are advanced after data is written.

A command that can be sent to the OLED display

Constants

The I2C slave address of the display

The height of the display, in pixels

The width of the display, in pixels

Type Definitions

For now, images are represented as byte arrays representing 8-bit grayscale bitmaps. Note that images must be exactly the size of the display

Returned for commands and data sent to the OLED display.