Giter Site home page Giter Site logo

display-binding-rs's Introduction

display-binding-rs

Binding template/demo interfacing lvgl-rclib-rs with libafb-rs micro service architecture.

Building dependencies:

Compiling for frame-buffer

Default driver is frame-buffer, it is typically what is used for embedded devices.

nm /usr/local/lib64/liblv_drivers.so | grep fbdev_init
cargo build

Compiling with GTK emulator

For development and especially for business logic debug with vscode/llgb-gdb, it is far simpler to use GTK than FBDEV.

  • Check GTK driver is enabled
  • Select GTK by setting USE_GTK=1 environnement variable
nm /usr/local/lib64/liblv_drivers.so | grep gtk_init
USE_GTK=1 cargo build

start display-binding

display-binding/afb-binding/etc/binding-test.sh
firefox --new-window http://localhost:1234

Demo screen on framebuffer

In order to use GTK frame-buffer emulation, you should

  • check that kvgl-rclib-rs is installed with GTK enabled
  • USE_GTK=1 cargo build

LVGL demo screen

Demo afb-v4 API

LVGL demo api

Rust LVGL api sample

Check Display::draw_panel within display-lvgl.rs for more samples

Create a label

LvglLabel::new("Label-1", "Tux EvSe UI", 50, 400)
            .set_info("Demo Label widget")
            .set_size(300, 100)
            .set_color(LvglColor::rvb(0, 0, 0))
            .set_background(LvglColor::rvb(0xFF, 0xFF, 0xFF))
            .set_border(3, LvglColor::rvb(0, 0xff, 0))
            .finalize();

Create a button

LvglButton::new("Button-A", "Test-1", 100, 200)
    .set_info("Demo Button 1")
    .set_size(180, 100)
    .finalize();

Faire un screencast du framebuffer

Copy framebuffer and transform it yo PNG. If needed crop image to content with gimp.

cp /dev/fb0 > /tmp/screen.data
RESOLUTION="1920x1080"
ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s $RESOLUTION -i /tmp/screen.data -f image2 -vcodec png screenshot.png

testing without root privilege

  1. In order to test without admin privileges, you need access to
  • /dev/fb0 generally with 'video' group
  • /dev/input0 usually with 'input' group
  1. find which virtual console hold /dev/fb0 framebuffer
  • switch virtual console with (Alt+Ctrl+F1) (Alt+Ctrl+F2) ...
  • after login check with cat /dev/urandom >/dev/fb0

If your screen is repainted, then you are on /dev/fb0 other wise switch to next virtual console.

display-binding-rs's People

Contributors

ronan22 avatar fulup-bzh avatar romain-valeo avatar jiamingvaleo avatar tomatesh avatar

Watchers

 avatar Stephane Desneux avatar benierc avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.