Crate embedded_graphics_framebuffer[][src]

Expand description

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(())
}

Structs