rpi_st7789v2_driver/
lib.rs

1#![cfg(target_os = "linux")]
2
3//! A Raspberry Pi driver for the ST7789V2-based WaveShare 1.69" LCD display.
4//!
5//! This crate provides a high-level interface for controlling a [WaveShare 1.69" LCD display][lcd]
6//! connected to a Raspberry Pi over SPI.
7//!
8//! It implements both a simple "image"-based interface and [`embedded_graphics`]' traits.
9//!
10//! [lcd]: https://www.waveshare.com/wiki/1.69inch_LCD_Module
11//!
12//! # Example
13//!
14//! ```no_run
15//! # use embedded_graphics::pixelcolor::Rgb565;
16//! # use rpi_st7789v2_driver::{Driver, Result};
17//! # fn main() -> Result<()> {
18//! let mut lcd = Driver::new(Default::default())?;
19//! lcd.init()?;
20//! lcd.probe_buffer_length()?;
21//!
22//! let mut image = lcd.image();
23//! image.solid(Rgb565::new(255, 0, 255));
24//! lcd.print((0, 0), &image)?;
25//! # Ok(()) }
26//! ```
27
28#[doc(inline)]
29pub use commands::Command;
30
31#[doc(inline)]
32pub use error::{Error, Result};
33
34#[doc(inline)]
35pub use helpers::*;
36
37#[doc(inline)]
38pub use io::*;
39
40#[doc(inline)]
41pub use simple::*;
42
43mod buffer;
44mod commands;
45mod error;
46mod graphics;
47mod helpers;
48mod io;
49mod simple;