1 unstable release

0.0.2 Mar 30, 2024
0.0.1 Mar 13, 2024
0.0.0 Mar 12, 2024

#21 in #oled

Download history 261/week @ 2024-03-11 7/week @ 2024-03-18 143/week @ 2024-03-25 66/week @ 2024-04-01

223 downloads per month

GPL-3.0 license

17KB
172 lines

SSD1315 (WIP)

The SSD1315 OLED driver.

Compatibility

This driver is developed for SSD1315, but it is also theoretically compatible with SSD1306. Please note that SSD1315 doesn't support parallel ports like 6800 and 8080, which means you cannot use parallel ports when using this crate.

As developed from scratch, this driver supports new features provided in embedded-hal 1.0.0, but that also means this driver doesn't compatible with older hal libraries (e.g. stm32f1xx-hal, which hasn't adopted embedded-hal 1.0.0 yet).

License

This software is distributed under GPL-3.0 license.

Contribution

Contributions to this project are welcome! If you find anywhere contains bugs, please open an issue or commit a pull request.


lib.rs:

SSD1315 (WIP)

SSD1315 driver.

Usage

We assume you have already created an I2C or SPI instance.

Create an I2C interface:

let interface = interface::I2cDisplayInterface::new(i2c);

or the SPI version (you must additionally create a GPIO instance in advanced):

let interface = interface::SpiDisplayInterface::new(spi, dc);

Before creating an SSD1315 instance, we must create a DisplayConfig instance:

let config = config::DisplayConfig::new();

Now we can create an SSD1315 instance:

let mut display = Ssd1315::new(interface, config).into_non_buffered_mode();

We created an SSD1315 instance! But the OLED screen cannot work now. That's because we need to initialize OLED screen first before using it:

display.init();

To let OLED screen displays anything on it, we can call a function and pass something to it:

Because we chose non-buffered mode, when we compile our project, program it in our MCU and power on the MCU, we'll see the contents would be displayed on the OLED screen.

Dependencies

~3.5MB
~37K SLoC