Early version of HX1230 display driver running on embedded-hal
optionally
integrated with embedded_graphics
library
The library is at an early state of development, but usable
embedded_graphics
libraryembedded_graphics
integration is only basic with no further optimizations for faster renderingLibrary has been tested with STM32F103C8T6 microcontroller
To run example on such MCU, run
cargo run --example graphics --release
Initialize the display
```rust // Create display driver using the provided SPI interface and chip select pin let mut display = SpiDriver::new(&mut spi, &mut display_cs);
// Send the initialization sequence display.initialize(&mut delay).unwrap();
// Create frame buffer for HX1230 display let mut frame_buffer: ArrayDisplayBuffer = ArrayDisplayBuffer::new(); ```
Do some drawing using embedded_graphics
into buffer
```rust let textstyle = MonoTextStyle::new(&FONT6X13, BinaryColor::On);
Text::new("example", Point::new(0, 12), textstyle) .draw(&mut framebuffer) .unwrap(); ```
Send data to display
rust
// Send display buffer data to display
display.send_buffer(&frame_buffer).unwrap();
Full example code: examples/graphics.rs
Note:
- openocd must be running to successfully run the example
- MCU memory layout must match the one specified in the memory.x
file
- GDB must successfully apply .gdbinit
file present in the root crate directory
To run unit tests on the local machine (change the target in case of different platform)
test --lib --target x86_64-unknown-linux-gnu
Licensed under either of
at your option.
Python implementation of HX1230 display driver, including useful wiring information and even product datasheets: https://github.com/mcauser/micropython-hx1230