Crates.io | ssd1362 |
lib.rs | ssd1362 |
version | 0.1.0 |
source | src |
created_at | 2020-08-11 12:10:03.961324 |
updated_at | 2020-08-11 12:10:03.961324 |
description | Driver to interface with SSD1362 based 256x64 OLED displays through SPI |
homepage | |
repository | https://github.com/devboard-io/ssd1362 |
max_upload_size | |
id | 275331 |
size | 825,604 |
SPI Driver crate for SSD1362 OLED displays with resolution of 256x64.
How to build and run:
cargo build --example terminal
cargo run --example terminal
Example usage:
use ssd1362::{self, display::DisplayRotation, terminal};
// ... code omitted
let spi = dp.SPI1.spi(
(sck, miso, mosi),
spi::MODE_0,
10.mhz(),
&mut rcc);
// do power on reset
rst.set_low().unwrap();
delay.delay(1.ms());
rst.set_high().unwrap();
en_16v.set_high().unwrap();
let interface = display_interface_spi::SPIInterface::new(spi, dc, cs);
let display = ssd1362::display::Display::new(interface, DisplayRotation::Rotate180);
let font = terminal::Font6x8 {};
let mut terminal = terminal::TerminalView::new(display, font);
terminal.init().unwrap();
writeln!(terminal, "Write a string to the terminal").unwrap();
terminal.render().unwrap();