Expand description
Safe LVGL v9 wrappers for the oveRTOS Rust SDK.
Provides idiomatic Rust bindings matching the C++ ove::lvgl wrapper:
- Minimal overhead — every widget is
Copy+ pointer-sized; per-op cost is benchmarked at https://varcain.github.io/oveRTOS/benchmarks/ - Fluent API — method chaining via
self -> SelfonCopytypes - Trait composition —
Layout,Styleable,EventTargetblanket-impl on anything implementingWidget, replacing C++ CRTP mixins - RAII —
LvglGuardfor lock/unlock,StylewithDrop no_stdcompatible — no allocator needed
Re-exports§
Modules§
- display
- Helpers querying the default LVGL display.
Structs§
- Animation
- Fluent builder for an LVGL animation.
- Arc
- LVGL arc widget — a circular gauge or slider. Track uses
arc_coloronLV_PART_MAIN, the filled indicator usesarc_coloronLV_PART_INDICATOR, and the draggable knob usesbg_coloronLV_PART_KNOB. - Bar
- LVGL bar widget.
- Box
- Plain container object with scrolling disabled.
- Button
- LVGL button widget — a clickable container.
- Calendar
- LVGL calendar widget — month-grid date picker with optional arrow/dropdown navigation header.
- Canvas
- LVGL canvas — a widget backed by a user-supplied pixel buffer.
- Canvas
Buffer - Pixel storage for a
Canvas. Borrows the buffer for the lifetime'a. - Chart
- LVGL chart widget — line / bar / scatter with multiple series and axes.
- Checkbox
- LVGL checkbox widget — a labelled binary toggle.
- Color
- RGB888 color matching
lv_color_t { blue, green, red }layout. - Color
Format - LVGL color format selector (matches
LV_COLOR_FORMAT_*). - Dropdown
- LVGL dropdown — click opens a popup list of options (newline-separated).
- Event
Ctx - Borrowed view of an active
lv_event_t. Valid only inside an event callback. - Event
Handler - Static descriptor for a stateful event handler.
- Group
- RAII wrapper for an LVGL input focus group (
lv_group_t). - Image
- LVGL image widget.
- Image
Src - A safe LVGL image source, constructible only from
'staticdata. - Keyboard
- LVGL on-screen keyboard. Attach to a
Textareaso key presses flow into it. - Label
- LVGL label widget.
- Led
- LVGL LED widget — a small colored indicator circle with adjustable brightness.
- List
- LVGL list — scrollable list of text headings and icon+text buttons.
- Lvgl
Guard - RAII guard for the LVGL mutex.
Dropcallsove_lvgl_unlock(). - Msgbox
- LVGL message box widget — a modal dialog with optional title, body text, close button, and footer buttons.
- Obj
- Non-owning handle to an LVGL object (
lv_obj_t *). - Roller
- LVGL roller — iOS-picker-style scrollable option wheel.
- Scale
- LVGL scale widget — linear or radial scale with ticks and labels.
- Scale
Section - Handle to an
lv_scale_section_t *. - Screen
- Top-level LVGL screen (display root without a parent).
- Series
- Handle to an
lv_chart_series_t *. Owned by the Chart; non-owning copy. - Slider
- LVGL slider widget. Shares the bar value/range shape and adds knob
styling and drag interaction. Listen for changes with
EventTarget::on_value_change. - Spinbox
- LVGL spinbox — numeric stepper with
+/−buttons. - Spinner
- LVGL spinner widget — a continuously rotating arc used as a loading indicator.
- State
- Reactive integer state backed by LVGL’s observer subsystem
(
lv_subject_t). Bind widget properties to aStateand they update automatically when you callState::set. - Style
- RAII wrapper around
lv_style_t. Callslv_style_reseton drop. - Switch
- LVGL switch widget (binary toggle). State is tracked via
STATE_CHECKED; listen for changes withEventTarget::on_value_change. - Table
- LVGL table — 2D grid of cells with per-cell text.
- Tabview
- LVGL tabview — tabbed container with swipeable pages.
- Textarea
- LVGL textarea — single- or multi-line text input with placeholder, password mode, max length, and accepted-character filter.
- Timer
- RAII wrapper for LVGL’s built-in timer.
Enums§
- Flex
Align - Flex track / item alignment (matches
lv_flex_align_t). - Flex
Flow - Flex flow direction.
- Layout
Kind - Container layout kind (matches
lv_obj_set_layoutargument). - Palette
- LVGL palette family (matches
LV_PALETTE_*).
Constants§
- ALIGN_
BOTTOM_ LEFT - LVGL alignment constant: align to the bottom-left of the parent.
- ALIGN_
BOTTOM_ MID - LVGL alignment constant: align to the bottom-center of the parent.
- ALIGN_
BOTTOM_ RIGHT - LVGL alignment constant: align to the bottom-right of the parent.
- ALIGN_
CENTER - LVGL alignment constant: center the widget relative to its parent.
- ALIGN_
DEFAULT - LVGL alignment constant: default (inherit from parent).
- ALIGN_
LEFT_ MID - LVGL alignment constant: align to the middle of the left edge.
- ALIGN_
RIGHT_ MID - LVGL alignment constant: align to the middle of the right edge.
- ALIGN_
TOP_ LEFT - LVGL alignment constant: align to the top-left of the parent.
- ALIGN_
TOP_ MID - LVGL alignment constant: align to the top-center of the parent.
- ALIGN_
TOP_ RIGHT - LVGL alignment constant: align to the top-right of the parent.
- ANIM_
REPEAT_ INFINITE - LVGL repeat-forever sentinel for
Animation::repeat_count. - CHART_
AXIS_ PRIMARY_ X - Chart axis: primary X.
- CHART_
AXIS_ PRIMARY_ Y - Chart axis: primary Y.
- CHART_
AXIS_ SECONDARY_ X - Chart axis: secondary X.
- CHART_
AXIS_ SECONDARY_ Y - Chart axis: secondary Y.
- CHART_
TYPE_ BAR - LVGL chart type: bar chart.
- CHART_
TYPE_ LINE - LVGL chart type: line chart.
- CHART_
TYPE_ NONE - LVGL chart type: no chart (empty).
- CHART_
TYPE_ SCATTER - LVGL chart type: scatter chart.
- CHART_
UPDATE_ MODE_ CIRCULAR - Chart update mode: wrap around (circular buffer).
- CHART_
UPDATE_ MODE_ SHIFT - Chart update mode: shift existing points left when adding.
- GRID_
ALIGN_ CENTER - Grid cell alignment: centred within the cell (
LV_GRID_ALIGN_CENTER). - GRID_
ALIGN_ END - Grid cell alignment: flush with the cell’s end edge (
LV_GRID_ALIGN_END). - GRID_
ALIGN_ START - Grid cell alignment: flush with the cell’s start edge (
LV_GRID_ALIGN_START). - GRID_
ALIGN_ STRETCH - Grid cell alignment: stretch to fill the cell (
LV_GRID_ALIGN_STRETCH). - GRID_
CONTENT - Grid track size: size to content (
LV_GRID_CONTENT). Equal toLV_COORD_MAX - 101. - GRID_
TEMPLATE_ LAST - Grid descriptor sentinel that terminates column/row arrays
(
LV_GRID_TEMPLATE_LAST). Equal toLV_COORD_MAX = (1 << 29) - 1. - KEYBOARD_
MODE_ NUMBER - Keyboard layout: numeric keypad.
- KEYBOARD_
MODE_ SPECIAL - Keyboard layout: special characters.
- KEYBOARD_
MODE_ TEXT_ LOWER - Keyboard layout: lowercase QWERTY.
- KEYBOARD_
MODE_ TEXT_ UPPER - Keyboard layout: uppercase QWERTY.
- PALETTE_
BLUE - LVGL palette index for the blue palette family (
LV_PALETTE_BLUE). - PART_
INDICATOR - LVGL style selector for the indicator part (e.g. bar fill, checkbox mark).
- PART_
ITEMS - LVGL style selector for the items part (e.g. table cells, list items).
- PART_
KNOB - LVGL style selector for the knob of interactive widgets (slider, arc).
- PART_
MAIN - LVGL style selector for the main (background) part of a widget.
- ROLLER_
MODE_ INFINITE - Roller mode: infinite — selection can wrap through the list repeatedly.
- ROLLER_
MODE_ NORMAL - Roller mode: normal — selection clamps at ends of the list.
- SCALE_
MODE_ HORIZONTAL_ BOTTOM - SCALE_
MODE_ HORIZONTAL_ TOP - LVGL scale modes (
LV_SCALE_MODE_*). - SCALE_
MODE_ ROUND_ INNER - SCALE_
MODE_ ROUND_ OUTER - SCALE_
MODE_ VERTICAL_ LEFT - SCALE_
MODE_ VERTICAL_ RIGHT - SIZE_
CONTENT - LVGL v9
LV_SIZE_CONTENT— sets widget to size-to-content mode. Computed from:LV_COORD_SET_SPEC(LV_COORD_MAX)whereLV_COORD_TYPE_SHIFT = 29, giving((1<<29)-1) | (1<<29). - STATE_
CHECKED - LVGL state bit for checked/toggled widgets (
LV_STATE_CHECKED). - TEXT_
ALIGN_ AUTO - Text alignment selector (
LV_TEXT_ALIGN_*). - TEXT_
ALIGN_ CENTER - TEXT_
ALIGN_ LEFT - TEXT_
ALIGN_ RIGHT
Traits§
- Event
Target - Event callback registration. Uses
fnpointers forno_stdcompatibility. Blanket-implemented for allWidgettypes. - Layout
- Fluent positioning, sizing, and flag manipulation.
Blanket-implemented for all
Widgettypes. - Styleable
- Fluent inline style setters. Applied to
LV_PART_MAINby default. Blanket-implemented for allWidgettypes. - Widget
- Core trait for all LVGL widget wrappers. Provides access to the raw
lv_obj_tpointer. All higher-level traits (Layout,Styleable,EventTarget) are blanket-implemented for any type implementingWidget.
Functions§
- animate_
arc_ value - Animate an
Arcwidget’s value fromfromtotooverduration_ms. - animate_
arc_ value_ playback - Animate an
Arcvalue forward then back, looping forever. - animate_
opa - Fade an object’s main-part opacity from
fromtotooverduration_ms. - animate_
scroll_ y - Animate the vertical scroll position to
to(no easing — direct scroll). - animate_
scroll_ y_ playback - Animate the vertical scroll position forward then back, looping forever.
- animate_
translate_ y - Animate the
translate_ystyle property fromfromtotooverduration_ms(ease-in-out). - animate_
translate_ y_ playback - Animate
translate_yforward forforward_msthen back forplayback_ms, looping forever. Useful for subtle “shake” / bob animations. - animate_
width - Animate an object’s width to
tooverduration_ms(ease-out). - animate_
x - Animate an object’s X position to
tooverduration_ms(ease-out). - animate_
y - Animate an object’s Y position to
tooverduration_ms(ease-out). - component_
from_ ⚠event - Walk up from the event’s target through the parent chain looking for
any non-null
user_datapointer, returning the first one found. - font_
montserrat_ 14 - Safe pointer to
lv_font_montserrat_14. - font_
montserrat_ 24 - Safe pointer to
lv_font_montserrat_24. - font_
montserrat_ 32 - Safe pointer to
lv_font_montserrat_32. - grid_fr
- Grid track size: fractional unit.
grid_fr(1)means “one FR unit”. Equal toLV_COORD_MAX - 100 + x. - handler
- Run the LVGL task handler.
- hbox
- Create a horizontal flex container.
- init
- Initialize LVGL via
ove_lvgl_init(). - layer_
top - Top-most overlay layer of the default display (sits above all screens).
- lock
- Acquire the LVGL mutex and return an RAII guard.
- path_
bounce - Bounce path (
lv_anim_path_bounce). - path_
ease_ in - Ease-in path (
lv_anim_path_ease_in). - path_
ease_ in_ out - Ease-in-out path (
lv_anim_path_ease_in_out). - path_
ease_ out - Ease-out path (
lv_anim_path_ease_out). - path_
linear - Linear easing path (
lv_anim_path_linear). - path_
overshoot - Overshoot path (
lv_anim_path_overshoot). - path_
step - Step path (
lv_anim_path_step). - screen_
active - Get the currently active screen.
- stop_
animations - Stop all animations with any exec callback running on
obj. - text_
size - Measure the rendered size of
textusingfont. Returns(width, height)in pixels. - tick
- Feed LVGL tick counter.
- vbox
- Create a vertical flex container.
Type Aliases§
- Image
Dsc - Safe re-export of the LVGL image descriptor type, so generated asset
modules (e.g.
images::badge) can declare their externals without needing to reach into theove::ffiescape hatch.