Cargo Features

[dependencies]
lvgl = { version = "0.6.2", default-features = false, features = ["embedded_graphics", "drivers", "alloc", "lvgl_alloc", "use-vendored-config", "rust_timer", "nightly", "unsafe_no_autoinit"] }
default = drivers, embedded_graphics

These default features are set whenever lvgl is added without default-features = false somewhere in the dependency tree.

embedded_graphics default = embedded-graphics

Enable the embedded_graphics crate as a backend for graphics and input devices. This is the 'legacy' method (supported in LVGL 0.5.2 and below) and requires some manual configuration. See the examples directory for usage examples, and see the documentation on Display and on input devices.

drivers default

Enable interop with the lv_drivers project as a graphics and input backend.
See the documentation on the drivers module, and the sdl example for a practical example.

Enables drivers of lvgl-sys

Affects lvgl::drivers

alloc lvgl_alloc?

Enable using the alloc crate internally on platforms that support it. Check if your platform supports this crate before enabling.

Enables cstr_core

lvgl_alloc = alloc

Sets the LVGL allocator as Rust's global allocator. This places ALL memory in LVGL-handled space, and may require growing the memory pool in lv_conf.h above the default.

use-vendored-config

Ignores the DEP_LV_CONFIG_PATH environment variable and instead selects the LVGL config that comes bundled with the lvgl-sys crate. Useful if you don't need any extra features, but the default config is quite conservative.

Enables use-vendored-config of lvgl-sys

rust_timer

Enables using a custom tick function in Rust for LVGL. See the documentation on the timer module for usage notes.

Enables rust_timer of lvgl-sys

Affects lvgl::timer

nightly

Enables some unstable features. Currently, only #[cfg_accessible] is used.
This feature will currently allow:
- Using built-in LVGL fonts other than the default

unsafe_no_autoinit

Disables auto-initializing LVGL. !!! WARNING !!! Enabling this feature and forgetting to call lvgl::init() before doing anything at all with LVGL will cause undefined behaviour and probably a segault. Only enable this if you're really, seriously, absolutely certain that you need it. Unless you're doing something particularly exotic, this is not needed, nor would it make anything measurably faster.

However, if you're running baremetal or on a platform that ctor doesn't support (https://github.com/mmastrac/rust-ctor/blob/master/ctor/src/lib.rs), this feature should be enabled. Remember to call lvgl::init() in your main function before constructing or using anything LVGL-related.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

embedded-graphics embedded_graphics

Enables embedded-graphics ^0.7.1