lvgl-circuitpython
PyDevices / lvgl-circuitpython

lvgl-circuitpython

CircuitPython LVGL extension kept out of Adafruit's tree: spike sources under src/, plus ./apply_cp_patches.sh to patch a local CircuitPython clone and copy templates so import lvgl builds as a native module. Binding artifacts come from lvgl-bindings (generated/lvgl_circuitpython.c / .h).

Adafruit has no MicroPython-style USER_C_MODULES path — this repo is the out-of-tree workflow. Pin a CircuitPython release tag, regenerate bindings when needed, then ./apply_cp_patches.sh --apply and make.

Source on GitHub lvgl-bindings

First-time setup

Sibling clones of lvgl-bindings/ and a tagged circuitpython/
# Pick a stable tag from github.com/adafruit/circuitpython/releases
git clone --branch 10.2.1 \
  https://github.com/adafruit/circuitpython.git circuitpython
cd circuitpython && make fetch-all-submodules && cd ..

git clone https://github.com/PyDevices/lvgl-bindings.git lvgl-bindings
cd lvgl-bindings
git submodule update --init lvgl
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
./regenerate_lvcp.sh
cd ..

Patch and build

./apply_cp_patches.sh --apply then plain make

unix coverage

Good for the CP test suite / gcov.

cd lvgl-circuitpython
./apply_cp_patches.sh --apply \
  --port unix --variant coverage
cd ../circuitpython/ports/unix
make -j VARIANT=coverage

./build-coverage/micropython \
  ../../lvgl-circuitpython/tools/test_lvgl_cp_unix.py

Board firmware

Patch + make directly. Install GCC 14+ toolchains first (see README).

./apply_cp_patches.sh --apply --port espressif \
  --board espressif_esp32p4_function_ev
cd ../circuitpython/ports/espressif && make -j \
  BOARD=espressif_esp32p4_function_ev

Related