| Crates.io | hx1230 |
| lib.rs | hx1230 |
| version | 0.3.2 |
| created_at | 2022-11-08 19:05:10.826286+00 |
| updated_at | 2022-11-12 16:43:20.540918+00 |
| description | Driver for the HX1230 display |
| homepage | |
| repository | https://github.com/viktorchvatal/hx1230 |
| max_upload_size | |
| id | 708228 |
| size | 42,176 |
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
// 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
let text_style = MonoTextStyle::new(&FONT_6X13, BinaryColor::On);
Text::new("example", Point::new(0, 12), text_style)
.draw(&mut frame_buffer)
.unwrap();
Send data to display
// Send display buffer data to display
display.send_buffer(&frame_buffer).unwrap();
Full example code: examples/graphics.rs
Note:
memory.x file.gdbinit file present in the root crate directoryTo 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