Framebuffer approach helps to deal with display flickering when you update multiple parts of the display in separate operations. Intead, with this approach, you're going to write to a in-memory display and push it all at once into your hardware display once the whole picture is drawn.
This technique is useful when you're updating large portions of screen or just simply don't want to deal with partial display updates.
The approach has been tested on TTGO (esp32) with ST7789
Explore the docs »
Rust Crate
·
Report Bug
·
Request Feature
Table of Contents
This library is a Rust implementation of framebuffer approach that is often used when driving hardware displays. The goal is to perform bulk-write of all the screen pixels at once, avoiding multiple individual updates that could lead to screen flickering.
This library has been designed to work with Rust's embedded-graphics library.
Make sure you have your rust
environment configurated
Add library to your Cargo.toml
toml
...
[dependencies]
embedded-graphics-framebuf = "0.1.0"
Use the library in you code ```rust use embeddedgraphicsframebuf::FrameBuf; ...
let mut display = st7789::ST7789::new( di, rst.into_output()?, // SP7789V is designed to drive 240x320 screens, even though the TTGO physical screen is smaller 320, 240, );
static mut FBUFF: FrameBuf
fbuff.clearblack(); Text::new( &"Good luck!", Point::new(10, 13), MonoTextStyle::new(&FONT10X20, Rgb565::WHITE.into()), ) .draw(fbuff).unwrap();
// write to the actual display :-) let u16iter = fbuff .intoiter() .map(|px| px.into_storage());
// those are the offsets for my physical ST7789 display display.setpixels(40, 53, 240 - 1 + 40, 53 + 135, u16iter); ```
See the open issues for a full list of proposed features (and known issues).
Distributed under the MIT License. See LICENSE
for more information.
Bernard Kobos - @bkobos - bkobos@gmail.com
Project Link: https://github.com/bernii/embedded-graphics-framebuf