1 unstable release
0.0.1 | Sep 28, 2024 |
---|
#76 in #embedded-graphics
203 downloads per month
13KB
139 lines
edrv-ssd1327
Rust driver for SSD1327.
Overview
SSD1327, 128 x 128, 16 Gray Scale Dot Matrix OLED/PLED Segment/Common Driver with Controller, by Solomon Systech.
Maintenance
This project is maintained by the embedded-drivers team. Our organization's goal is to provide consistent driver access interfaces for embedded Rust and to maintain these drivers collectively to avoid orphaned crates.
Features
- Driver for 128x128 OLED display, Gray4 mode, SPI 4-wire interface
Usage
[Provide basic usage examples]
Documentation
Contributing & License
Please refer to embedded-drivers
lib.rs
:
Driver for SSD1327.
Examples
use embedded_graphics::framebuffer::Framebuffer;
let dc = Output::new(r.dc, Level::Low, Default::default());
let cs = Output::new(r.cs, Level::High, Default::default());
let mut config = hal::spi::Config::default();
config.frequency = Hertz::mhz(20);
let spi = hal::spi::Spi::new_txonly(r.spi1, r.sclk, r.mosi, r.dma_ch0, config);
let spi_bus = embassy_sync::mutex::Mutex::<NoopRawMutex, _>::new(spi);
let spi_dev = embassy_embedded_hal::shared_bus::asynch::spi::SpiDevice::new(&spi_bus, cs);
let mut ssd1327 = edrv_ssd1327::SSD1327::new(spi_dev, dc);
ssd1327.init().await.unwrap();
let mut fb = Framebuffer::<Gray4, _, LittleEndian, 128, 128, { 128 * 128 / 2 }>::new();
// Draw something on the framebuffer
ssd1327.write_framebuffer(fb.data()).await.unwrap();
Dependencies
~78KB