Crates.io | sharp-memory-display |
lib.rs | sharp-memory-display |
version | 0.3.0 |
source | src |
created_at | 2022-09-03 11:30:36.715691 |
updated_at | 2022-11-14 14:41:26.743529 |
description | A no-std-compatible embedded-graphics driver for SHARP memory-in-pixel displays |
homepage | |
repository | https://git.sr.ht/~doesnotcompete/sharp-memory-display |
max_upload_size | |
id | 657863 |
size | 51,291 |
sharp-memory-display
sharp-memory-display
provides an embedded-graphics
driver for SHARP memory-in-pixel displays, such as the LS027B7DH01 and similar models. The crate depends on embedded-hal
and is #![no_std]
-compatible.
Just depend on the crate in your Cargo manifest, specifying your display model via features
:
[dependencies]
sharp-memory-display = { version: "0.1", features: ["ls027b7dh01"] }
Now you can bring the crate into scope:
use sharp_memory_display::*
Then simply construct a new MemoryDisplay
from an SPI struct, a chip-select pin, and a display pin similar to this:
let cs = pins.pa14.into_push_pull_output();
let disp = pins.pa16.into_push_pull_output();
let spi = spi::Config::new(&peripherals.MCLK, spi_sercom, pads, freq)
.baud(Hertz(500_000u32))
.spi_mode(sharp_memory_display::MODE)
.enable();
// Create display
let mut disp = MemoryDisplay::new(spi, cs, disp)
disp.enable();
disp.clear();
Please note the maximum supported SPI baud rate for your display. You can find it in the corresponding datasheet.
You can now use the display as a DrawTarget
. To write the changes to the screen, you must invoke the flush_buffer
function. Please see the documentation for notes on usage.
Note: You must specify your display via features
. Supported display models currently are:
ls027b7dh01
(tested)ls013b7dh05
ls012b7dd06
ls010b7dh04
ls011b7dh03
(tested)Support for additional display models can be easily added. Merge requests are welcome :)
Contributions to this project are welcome. You can find the issue tracker and the code repository at sourcehut. You may also submit bug reports or feature requests via email to ~doesnotcompete/sharp-memory-display@todo.sr.ht.