#embedded-graphics #framebuffer #graphics #embedded

embedded_graphics_framebuffer

Framebuffer driver for lvgl-rs

2 releases

0.1.1 Aug 7, 2021
0.1.0 Aug 2, 2021

#27 in #framebuffer

MIT license

5KB
55 lines

embedded_graphics_framebuffer

Framebuffer support for lvgl-rs


lib.rs:

Allow to use LVGL library with framebuffer. The library wires together lvgl-rs library and framebuffer library

The wiring is done according to https://docs.rs/embedded-graphics/0.7.1/embedded_graphics/draw_target/trait.DrawTarget.html

LVGL library site: https://docs.lvgl.io

framebuffer library site: http://roysten.github.io/rust-framebuffer/target/doc/framebuffer/index.html

Example

To run the examples follow https://github.com/rafaelcaricio/lvgl-rs

use embedded_graphics_framebuffer::FrameBufferDisplay;
use std::error::Error;
use embedded_graphics::{
        pixelcolor::{Rgb888, RgbColor},
            prelude::*,
                primitives::{Circle, PrimitiveStyle},
};

fn main() -> Result<(), Box<dyn Error>> {
    let mut display = FrameBufferDisplay::new();
    let circle = Circle::new(Point::new(190, 122), 230)
        .into_styled(PrimitiveStyle::with_stroke(Rgb888::GREEN, 10));
    circle.draw(&mut display)?;
    display.flush().unwrap();
    Ok(())
}

Dependencies

~3.5MB
~38K SLoC