ssd1315-driver

Crates.iossd1315-driver
lib.rsssd1315-driver
version0.4.1
created_at2025-08-31 13:17:28.056481+00
updated_at2025-09-02 13:46:40.009957+00
descriptionSSD1315 OLED driver.
homepage
repositoryhttps://github.com/LinkWanna/ssd1315-driver
max_upload_size
id1818544
size744,776
LinkWanna (LinkWanna)

documentation

https://docs.rs/ssd1315-driver

README

This repository is based on ssd1315 which have not been updated for a long time.

SSD1315 driver

Crates.io Docs.rs

I2C and SPI (4 wire) driver for the the SSD1315 OLED driver.

SSD1315 is a smaller SSD1306 display driver, but this repo is much easier to use than the SSD1306 driver. Generally speaking, you can use the SSD1306 driver to drive the SSD1315 display.

SSD1315 is a display driver IC from Solomon Systech designed for small-size, monochrome OLED or PLED panels with a resolution of up to 128×64 pixels. More information about the SSD1315 can be found in the documentation: SSD1315.

Example

Here is a full example (the MCU model is STM32F411CEU6):

#![deny(unsafe_code)]
#![no_std]
#![no_main]

use cortex_m::asm::nop;
use cortex_m_rt::entry;
use embedded_graphics::{
    pixelcolor::BinaryColor,
    prelude::*,
    primitives::{Circle, PrimitiveStyle},
};
use panic_halt as _;
use ssd1315::*;
use stm32f4xx_hal::{
    i2c::{DutyCycle, Mode},
    pac,
    prelude::*,
};

#[entry]
fn main() -> ! {
    let dp = pac::Peripherals::take().unwrap();

    let rcc = dp.RCC.constrain();
    let clocks = rcc.cfgr.freeze();

    let gpiob = dp.GPIOB.split();
    let (scl, sda) = (
        gpiob.pb8.into_alternate_open_drain(),
        gpiob.pb9.into_alternate_open_drain(),
    );

    let i2c = dp.I2C1.i2c(
        (scl, sda),
        Mode::fast(400000.Hz(), DutyCycle::Ratio2to1),
        &clocks,
    );

    let interface = interface::I2cDisplayInterface::new(i2c);
    let config = config::Ssd1315Config::preset_config();

    let mut display = Ssd1315::new(interface);

    Circle::new(Point::new(0, 0), 40)
        .into_styled(PrimitiveStyle::with_fill(BinaryColor::On))
        .draw(&mut display)
        .unwrap();

    display.init(config).unwrap();
    display.flush().unwrap();

    loop {
        nop()
    }
}

License

This software is distributed under GPL-3.0 license.

Contributing

Thank you for your interest in contributing to this project! If you find any bugs or have suggestions to improve this project, please open an issue or submit a pull request! :)

Commit count: 24

cargo fmt