No description
Find a file
2026-03-22 13:31:26 +00:00
src use infallible error type 2026-03-22 13:31:26 +00:00
.gitignore initial commit 2026-03-22 12:45:36 +00:00
Cargo.toml use infallible error type 2026-03-22 13:31:26 +00:00
LICENSE initial commit 2026-03-22 12:45:36 +00:00
README.md add no_std compatibility 2026-03-22 13:24:19 +00:00
README.tpl initial commit 2026-03-22 12:45:36 +00:00

sharp-memory-display

An Adafruit 2.7" SHARP Memory Display driver with [embedded_graphics] support.

This is based off Adafruit's libraries and doesnotcompete's Rust driver, but crucially without the bitvec dependency which does not play nice with ESP32.

For usage on other display sizes, you will need to adjust the WIDTH and HEIGHT constants in the file. Alternatively use version 0.1.0 which has the display size passed through as arguments. For simplicity, I just hard-coded them.

Usage

This is an example of usage with esp-idf-svc.

use sharp_memory_display::SharpMemDisplay;
let spi_driver = SpiDriver::new(
    peripherals.spi2,
    pins.gpio36,
    pins.gpio35,
    None,
    &DriverConfig::new()
).expect("failed to create SPI driver");

let spi_config = config::Config::new()
    .baudrate(1u32.MHz().into())
    .bit_order(BitOrder::LsbFirst);

let spi_device = SpiDeviceDriver::new(
    &spi_driver,
    None,
    &spi_config,
).expect("failed to create SPI device");

let cs_pin = PinDriver::output(pins.gpio13).expect("failed to create CS pin");
cs_pin.set_low().ok();

let mut display = SharpMemDisplay::new(spi_device, cs_pin);
display.clear();

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU GPL v3.0