embedded_graphics_framebuffer 0.1.1

Framebuffer driver for lvgl-rs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
b0VIM 8.1ea�p�ivji2i0vji2i0-X405UA~vji2i0/Development/LVGLtty1_rust/embedded_graphics_framebuffer/src/lib.rsutf-8
3210#"! UtpcadL�c��
��lhdW	�
�
�
n
S



��t+������tda`BA!�
�
�
�
�
�
N
?
9
7
6

�	�	�	�	\	R			��kj2��}6��tfe[ZKJDBA�����~U����A����}    }        }            iface: Framebuffer::new("/dev/fb0} } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }}    }        }            iface: Fra} } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }    }        }            iface: Framebuffer::new("/dev/fb0").unwrap(),            framebuffer: vec![0u8; (line_length * h) as usize],        FrameBufferDisplay {        let line_length = framebuffer.fix_screen_info.line_length;        let h = framebuffer.var_screen_info.yres;        let framebuffer = Framebuffer::new("/dev/fb0").unwrap();    pub fn new() -> FrameBufferDisplay {impl FrameBufferDisplay {}    }        Size::new(self.iface.var_screen_info.xres, self.iface.var_screen_info.yres)    fn size(&self) -> Size {impl OriginDimensions for FrameBufferDisplay {}    }        Ok(())        }            }                self.framebuffer[index as usize + 2] = color.r();                self.framebuffer[index as usize + 1] = color.g();                self.framebuffer[index as usize] = color.b();                let index: u32 = (x as u32 + y as u32 * xres)*bytespp;            if 0 <= x && x < xres as i32 && 0 <= y && y < yres as i32  {            let y: i32 = coord.y.try_into().unwrap();            let x: i32 = coord.x.try_into().unwrap();        for Pixel(coord, color) in pixels.into_iter() {        let bytespp = self.iface.var_screen_info.bits_per_pixel / 8;        let yres = self.iface.var_screen_info.yres;        let xres = self.iface.var_screen_info.xres;    {        I: IntoIterator<Item = Pixel<Self::Color>>,    where    fn draw_iter<I>(&mut self, pixels: I) -> Result<(), Self::Error>    // Map draw onto the frame buffer    type Error = core::convert::Infallible;    type Color = Rgb888;impl DrawTarget for FrameBufferDisplay {}    }        Ok(())        self.iface.write_frame(&self.framebuffer);    pub fn flush(&mut self) -> Result<(), ()> {    // Send buffer to the displayimpl FrameBufferDisplay{}    iface: Framebuffer,    framebuffer: Vec<u8>,pub struct FrameBufferDisplay {use framebuffer::Framebuffer;};    prelude::*,    pixelcolor::{Rgb888, RgbColor},use embedded_graphics::{use core::convert::TryInto;//!```//!}//!    Ok(())//!    display.flush().unwrap();//!    circle.draw(&mut display)?;//!        .into_styled(PrimitiveStyle::with_stroke(Rgb888::GREEN, 10));//!    let circle = Circle::new(Point::new(190, 122), 230)//!    let mut display = FrameBufferDisplay::new();//!fn main() -> Result<(), Box<dyn Error>> {//!//!};//!                primitives::{Circle, PrimitiveStyle},//!            prelude::*,//!        pixelcolor::{Rgb888, RgbColor},//!use embedded_graphics::{//!use std::error::Error;//!use embedded_graphics_framebuffer::FrameBufferDisplay;//!```//!To run the examples follow https://github.com/rafaelcaricio/lvgl-rs//!# Example//!//!//!framebuffer library site: http://roysten.github.io/rust-framebuffer/target/doc/framebuffer/index.html//! //!LVGL library site: https://docs.lvgl.io//! //!The wiring is done according to https://docs.rs/embedded-graphics/0.7.1/embedded_graphics/draw_target/trait.DrawTarget.html//! //!Allow to use LVGL library with framebuffer. The library wires together lvgl-rs library and framebuffer library