| Crates.io | super_simple_st7789driver |
| lib.rs | super_simple_st7789driver |
| version | 0.1.3 |
| created_at | 2025-06-28 07:39:00.413642+00 |
| updated_at | 2025-06-29 08:39:14.283949+00 |
| description | an async Rust driver library for controlling the ST7789 display |
| homepage | |
| repository | https://github.com/bigoldcat123/st7789driver |
| max_upload_size | |
| id | 1729609 |
| size | 18,248 |
π This README is in English. ηΉε»θΏιζ₯ηδΈζζζ‘£ (README_ZH.md)
st7789driver is an async Rust driver library for controlling the ST7789 display, designed for embedded no_std environments. It is based on the embedded-hal and embedded-hal-async traits, supporting SPI communication and async delays.
Add the following to your Cargo.toml:
[dependencies]
st7789driver = { path = "your_path/st7789driver" }
embedded-hal = "1"
embedded-hal-async = "1"
defmt = "0.3"
use st7789driver::{St7789, Timer_};
use embedded_hal::digital::OutputPin;
use embedded_hal_async::spi::SpiBus;
struct MyTimer;
impl Timer_ for MyTimer {
fn delay_ms(&self, ms: u64) -> impl core::future::Future<Output = ()> {
async move {
// Implement your async delay here , 1ms would be ok
}
}
}
// Assume you have implementations for spi, cs, and dc
let mut lcd = St7789::new(spi, cs, dc, MyTimer);
// Initialization and basic operations
lcd.init().await.unwrap();
lcd.set_row(0, 319).await.unwrap();
lcd.set_col(0, 239).await.unwrap();
lcd.write_memory().await.unwrap();// send write data command
lcd.write_data(&[0x00]).await.unwrap();// send real data
init(): Initialize the displayset_row(start, end): Set row addressset_col(start, end): Set column addresswrite_memory(): Write to video memorywrite_data(data): Write dataMIT License