SSD3306 I2C
A Rust crate for SSD1306 LCD display over I2C
https://github.com/marvinrobot42/ssd1306-i2c.git
Documentation
Examples
This crate is a fork of James Waples's SH1106 crate modifed for SSD1306 use updated to use embedded-hal 1.0.
The SSD1306 LCD contains old fashion 8 bit parallel interface, a SPI and I2C interface. This crate only uses the I2C interface. Also, note that this driver includes support for several display sizes but only 128 x 64 is avialble for the SSD1306 (as far as I know).
Features
- updated to use embedded-hal version 1.0.x
- supports embedded-hal-bus 0.1.0 for I2C bus sharing
- uses embedded-graphics crate for graphics abstraction
- designed for embedded use (ESP32-C3, -C6 and -S3)
- supports both primary and secondary I2C SSD1306 addresses
- no_std embedded compatible
Notes
I wanted to add a LCD display to my home automation environmental sensor IoT creation but I could not find a crate for the SSD1306 that depends on embedded-hal 1.0. It needs to have several devices on one I2C bus and since my sensors are embedded-hal 1.0 based the SSD1306 crate needs to be also. So I did a quick job of migrating James's SH1106 crate from embedded-hal 0.2.x to 1.0, and modified it for the SSD1306 LCD. Why start with SH1106 instead of his SSD1306 create: because the SH1106 seemed more modern and does not depend on other embedded-hal 0.2 crates like display-interface-i2c (which is four years old now). Note that this ssd1306-i2c crate does not support SH1106 display because the display initialization is not compatible.
My Sparkfun SSD1306 LCD (LCD-23453) only supports I2C so I could not work with or test SPI.
Recent version history
- 0.1.2 More documentation
- 0.1.1 Some document typo fixes
- 0.1.0 Initial release
Usage
Add the dependencies to Cargo.toml.
[]
= "0.1"
= "0.8.1"
= "0.43.0" # an embedded-hal for your platform
Simple Example
A more complete example is in the repository examples path. See James's SSH1106 crate repository examples folder for more examples: https://github.com/jamwaffles/sh1106/tree/master/examples.
use ;
use ;
use info;
...
License
You are free to copy, modify, and distribute this application with attribution under the terms of either
- Apache License, Version 2.0 (LICENSE-Apache-2.0 or https://opensource.org/licenses/Apache-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
This project is not affiliated with nor endorsed in any way by Sparkfun.