Need help with lvgl-rs?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

rafaelcaricio
171 Stars 16 Forks MIT License 135 Commits 13 Opened issues

Description

LittlevGL bindings for Rust. A powerful and easy-to-use embedded GUI with many widgets, advanced visual effects (opacity, antialiasing, animations) and low memory requirements (16K RAM, 64K Flash).

Services available

!
?

Need anything else?

Contributors list

# 42,292
Flask
GraphQL
swagger
api-res...
128 commits
# 199,596
Neovim
React
Rust
Vue.js
1 commit

LittlevGL - Open-source Embedded GUI Library in Rust

Original LittlevGL demo image

LittlevGL provides everything you need to create a Graphical User Interface (GUI) on embedded systems with easy-to-use graphical elements, beautiful visual effects and low memory footprint.

LittlevGL is compatible with #![no_std] environments by default.

Official LittlevGL Website · C library repository · Live demo


Rust bindings usage demo code.

Usage

Edit your

Cargo.toml
file dependencies with:
$ cargo add lvgl

The build requires the environment variable bellow to be set:

  • DEP_LV_CONFIG_PATH
    : Path to the directory containing the
    lv_conf.h
    header file used for configuration of LittlevGL library.

We recommend the

lv_conf.h
file to be in your project's root directory. If so, the command to build your project would be:
shell script
$ DEP_LV_CONFIG_PATH=`pwd` cargo build

Building for embedded environments

We make use of

bindgen
for generating the bindings to LittlevGL at build time. There is a problem in cargo when building for
no_std
, so we need to use a workaround to build "lvgl-rs". The mainstrem issue in cargo is being tracked at rust-lang/cargo#7915.
$ DEP_LV_CONFIG_PATH=`pwd` cargo build -Zfeatures=build_dep

Running the demo

Hint for macOS users: Before you run the demos you need to make sure you have libsdl installed on your machine. To install it, use HomeBrew:

$ brew install sdl2

This project contains examples that can run in a desktop simulator.

First, make sure to pull

lvgl-rs
submodules:
shell
$ git submodule init
$ git submodule update 

Then run the

demo
example:
$ DEP_LV_CONFIG_PATH=`pwd`/examples/include cargo run --example demo

Feature Support

The bindings are still in development. There are many features of LVGL that needs to be exposed by

lvgl-rs
. In this section you can check what is implemented at the moment.

Features

List of LVGL features that impacts the library usage in general. - [x] Displays: We use

embedded_graphics
library to draw to the display. You can use

lvgl-rs
with any of the
embedded_graphics
supported displays
. - [x] Events: You can listen and trigger events in widget objects. - [x] Styles: You can set styles in any exposed object. We are still missing the possibility of defining global base styles. - [ ] Input Devices - [ ] Fonts - [ ] Images - [ ] File system - [ ] Animations - [ ] Tasks

Widgets

Widgets currently implemented might have some missing features. If the widget you want to use is not exposed or is missing a feature you want to make use, please send a Pull Request or open an issue.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.