#raspberry-pi #embedded-graphics #waveshare #lcd #st7789v2

rpi-st7789v2-driver

Raspberry-Pi driver for the ST7789V2 TFT display controller (WaveShare 1.69" 240x280 LCD)

10 releases

0.3.7 Mar 5, 2025
0.3.6 Feb 4, 2025
0.3.5 Jan 6, 2025
0.3.4 Dec 24, 2024
0.1.0 May 18, 2024

#677 in Embedded development

Download history 86/week @ 2024-11-27 147/week @ 2024-12-04 17/week @ 2024-12-11 332/week @ 2024-12-18 52/week @ 2024-12-25 120/week @ 2025-01-01 36/week @ 2025-01-08 3/week @ 2025-01-22 24/week @ 2025-01-29 84/week @ 2025-02-05 61/week @ 2025-02-12 1/week @ 2025-02-26 148/week @ 2025-03-05 7/week @ 2025-03-12

173 downloads per month
Used in bestool

GPL-3.0-or-later

34KB
796 lines

bestool

All-in-one tool for BES ops and dev tasks.

It manifests as a single binary that can be easily uploaded to Windows machines, or downloaded from the internet, and also works cross-platform on Linux and Mac for many tasks.

See bestool <subcommand> --help for extensive help.

Download

Current release: 0.28.2

Platform Variant Download
Windows x86 bestool.exe
Linux x86 bestool
Linux x86 static bestool
Linux ARM64 bestool
Mac Intel bestool
Mac ARM64 bestool

Self-update

If you already have bestool, it can self-update to the latest version:

$ bestool self-update

Always-latest URLs

The above URLs are for the current release. If you want to always get the latest version, you can use the following URLs:

Platform Variant Download
Windows x86 bestool.exe
Linux x86 bestool
Linux x86 static bestool
Linux ARM64 bestool
Mac Intel bestool
Mac ARM64 bestool

In GitHub Actions

- name: Download bestool
  shell: bash
  run: |
    curl -Lo ${{ runner.os == 'Windows' && 'bestool.exe' || 'bestool' }} https://tools.ops.tamanu.io/bestool/gha/${{ runner.os }}-${{ runner.arch }}?bust=${{ github.run_id }}
    [[ -f bestool ]] && chmod +x bestool

- name: Use bestool
  shell: bash
  run: |
    bestool=bestool
    [[ ${{ runner.os }} == "Windows" ]] && bestool=bestool.exe
    ./$bestool --version # or something more useful

Or combined:

- name: Download bestool
  shell: bash
  run: |
    bestool=bestool
    [[ ${{ runner.os }} == "Windows" ]] && bestool=bestool.exe
    curl -Lo $bestool https://tools.ops.tamanu.io/bestool/gha/${{ runner.os }}-${{ runner.arch }}?bust=${{ github.run_id }}
    [[ -f bestool ]] && chmod +x bestool
    ./$bestool --version # or something more useful

With Binstall

$ cargo binstall bestool

With cargo (compiling)

$ cargo install bestool

Development

Install rust, clone the repo, then run:

$ cargo check

To run the tool:

$ cargo run -- --help

To build the tool like for production:

$ cargo build --release

Commits should follow the Conventional Commits format. Types are listed in the cliff.toml file.

Releasing

To make a release, install cargo-release and git-cliff, then:

$ git switch main
$ git pull
$ cargo release minor --execute

(or patch or major instead of minor)


lib.rs:

A Raspberry Pi driver for the ST7789V2-based WaveShare 1.69" LCD display.

This crate provides a high-level interface for controlling a WaveShare 1.69" LCD display connected to a Raspberry Pi over SPI.

It implements both a simple "image"-based interface and embedded_graphics' traits.

Example

let mut lcd = Driver::new(Default::default())?;
lcd.init()?;
lcd.probe_buffer_length()?;

let mut image = lcd.image();
image.solid(Rgb565::new(255, 0, 255));
lcd.print((0, 0), &image)?;

Dependencies

~6MB
~93K SLoC