lvgl-bindings
PyDevices / lvgl-bindings

lvgl-bindings

LVGL header-to-C binding generator for MicroPython, CircuitPython, and CPython from one source of truth. You regenerate after LVGL or lv_conf.h changes; the outputs are the generated/ trees consumed by the runtime-specific cmods.

That single pipeline keeps import lvgl coherent across three interpreters. When the API surface moves, fix and regenerate here — do not hand-edit three binding trees — then rebuild the matching consumer and smoke-test through cmods or the per-repo scripts.

Source on GitHub cmods Publishing

What it generates

One generator, three targets

MicroPython

generated/lvgl_micropython.c — consumed by lvgl-micropython.

CircuitPython

generated/lvgl_circuitpython.{c,h} — consumed by lvgl-circuitpython.

CPython

generated/lvgl_python.c — auto-synced into lvgl-python on push to main.

Regenerate after changes

After editing lvgl/, lv_conf.h, or binding/
git clone https://github.com/PyDevices/lvgl-bindings.git
cd lvgl-bindings
git submodule update --init lvgl

python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

./regenerate_lvmp.sh   # MicroPython  → lvgl_micropython.c
./regenerate_lvcp.sh   # CircuitPython → lvgl_circuitpython.c/.h
./regenerate_lvpy.sh   # CPython       → lvgl_python.c
./regenerate_all.sh    # all three, plus commit + tag

./scripts/verify_bindings.sh   # regen + regression checks

Consumers

Rebuild these after regenerating

Related