No description
- Rust 100%
| src | ||
| .gitignore | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
| README.tpl | ||
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.