Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/release-interpreters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# A final release (vX.Y.Z) builds and attaches them. A dev, a, b or rc release
# gets none. Every build comes from the release's own tag, with the
# micropython-pydevices and lvgl-circuitpython commits that
# micropython-pydevices and omnipython-lvgl commits that
# scripts/release_interpreters/sources.lock pins, and the manifest lists every
# source commit that went in. Move the pins before a final with
# scripts/release_interpreters/sources.py bump (CONTRIBUTING.md).
Expand All @@ -16,7 +16,7 @@
# interpreter from the branch or tag you name and keeps them as a run artifact,
# attaching nothing. Tick "attach" with a final tag to (re)attach to that
# release; that always uses the pins. To try another micropython-pydevices or
# lvgl-circuitpython, name it in the two inputs below, and the run attaches
# omnipython-lvgl, name it in the two inputs below, and the run attaches
# nothing. Changes to this recipe run the same builds on their pull request.
name: Release interpreters

Expand All @@ -38,8 +38,8 @@ on:
description: micropython-pydevices branch, tag or commit to build with (empty uses the pin in sources.lock; never attached)
default: ""
type: string
lvgl-circuitpython-ref:
description: lvgl-circuitpython branch, tag or commit for the CircuitPython build (empty uses the pin in sources.lock; never attached)
omnipython-lvgl-ref:
description: omnipython-lvgl branch, tag or commit for the CircuitPython build (empty uses the pin in sources.lock; never attached)
default: ""
type: string
pull_request:
Expand All @@ -66,7 +66,7 @@ jobs:
tag: ${{ steps.gate.outputs.tag }}
ref: ${{ steps.ref.outputs.ref }}
mpp: ${{ steps.gate.outputs.mpp }}
lvgl_cp: ${{ steps.gate.outputs.lvgl_cp }}
lvgl: ${{ steps.gate.outputs.lvgl }}
steps:
- uses: actions/checkout@v7
- name: Decide whether this run builds and whether it attaches
Expand All @@ -77,7 +77,7 @@ jobs:
INPUT_REF: ${{ inputs.ref }}
INPUT_ATTACH: ${{ inputs.attach }}
INPUT_MPP: ${{ inputs.micropython-pydevices-ref }}
INPUT_LVGL: ${{ inputs.lvgl-circuitpython-ref }}
INPUT_LVGL: ${{ inputs.omnipython-lvgl-ref }}
run: |
case "$EVENT" in
release) ref="$RELEASE_TAG" ;;
Expand Down Expand Up @@ -145,12 +145,12 @@ jobs:
- name: CircuitPython's LVGL helpers
if: matrix.target == 'cp-unix'
env:
LVGL_CP_REF: ${{ inputs.lvgl-circuitpython-ref }}
LVGL_REF: ${{ inputs.omnipython-lvgl-ref }}
run: |
# lvgl-circuitpython at its pin; pdwidgets and palettes are frozen
# omnipython-lvgl at its pin; pdwidgets and palettes are frozen
# from this release's own library.
mkdir -p ws && cd ws
../recipe/scripts/release_interpreters.sh fetch lvgl-circuitpython lvgl-circuitpython "$LVGL_CP_REF"
../recipe/scripts/release_interpreters.sh fetch omnipython-lvgl omnipython-lvgl "$LVGL_REF"
ls

- name: Build ${{ matrix.target }}
Expand Down Expand Up @@ -186,9 +186,9 @@ jobs:
path: micropython-pydevices
- uses: actions/checkout@v7
with:
repository: PyDevices/lvgl-circuitpython
ref: ${{ inputs.lvgl-circuitpython-ref || needs.gate.outputs.lvgl_cp }}
path: lvgl-circuitpython
repository: PyDevices/omnipython-lvgl
ref: ${{ inputs.omnipython-lvgl-ref || needs.gate.outputs.lvgl }}
path: omnipython-lvgl
- uses: actions/download-artifact@v8
with:
pattern: interpreter-*
Expand Down Expand Up @@ -226,7 +226,7 @@ jobs:
SOURCES_JSON=$RUNNER_TEMP/sources.json
export SOURCES_JSON
python3 scripts/release_interpreters/sources.py record --mpp micropython-pydevices \
--lvgl-circuitpython lvgl-circuitpython --pydevices pydevices \
--omnipython-lvgl omnipython-lvgl --pydevices pydevices \
--pydevices-ref "${TAG#unreleased}" | tee "$SOURCES_JSON"
# An attached set is made only from the pins.
if [[ "$DRY_RUN" == 0 ]]; then
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ interpreters are made from fixed commits, never from a branch tip.
[`scripts/release_interpreters/sources.lock`](scripts/release_interpreters/sources.lock)
names the commit of `micropython-pydevices` (the build script, its patches, and
its own locks for MicroPython, the toolchains and every module) and of
`lvgl-circuitpython`. `interpreters.json` records every commit that went in:
`omnipython-lvgl`. `interpreters.json` records every commit that went in:
this release's `pydevices`, the two pins, the MicroPython commit, the
CircuitPython version and each module's commit, with `"pinned": true` when the
build used exactly the pins. A run that attaches always does; to try another
`micropython-pydevices` or `lvgl-circuitpython`, name it in the two inputs of a
`micropython-pydevices` or `omnipython-lvgl`, name it in the two inputs of a
manual run, which then attaches nothing.

**Before you cut a final, move the pins:**
Expand Down
4 changes: 2 additions & 2 deletions docs/boards/display-boards.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ variant (`C6_WIFI`).
(6, 3, 0, 5)`. Heap ~**450 KiB** free at idle; Simon / LVGL fit with appdev
+ multimer + `display_driver` (~370 KiB free while running).
- **Firmware:** custom `NUCLEO_H743ZI2` with **displayif** (stm32 port: spibus
+ notimpl stubs), **graphics**, **lvgl** (`lvgl-micropython`). Flash via
+ notimpl stubs), **graphics**, **lvgl** ([omnipython-lvgl](https://github.com/PyDevices/omnipython-lvgl)). Flash via
ST-Link MSD (`NOD_H743ZI2` / `firmware.bin`).
- **Demos verified:** RGB stripes; [`simon.py`](https://github.com/PyDevices/gallery/blob/main/lib/examples/simon.py) (graphics + appdev); headless
[`lvgl-bindings/tools/test_lvgl_smoke.py`](https://github.com/PyDevices/lvgl-bindings/blob/main/tools/test_lvgl_smoke.py); `lvgl_test.py` (tap-count button on real
[`omnipython-lvgl/tools/test_lvgl_smoke.py`](https://github.com/PyDevices/omnipython-lvgl/blob/main/tools/test_lvgl_smoke.py); `lvgl_test.py` (tap-count button on real
panel via `display_driver`). **`main.py`** boots `lvgl_test.py`.
- **Setup:** copy over serial the board_config + `displaydev/{__init__,busdisplay}.py` +
`appdev` + `multimer` + `display_driver.py` + `ili9341`/`ft6x36` + examples
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/bring-up-a-board.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ into an afternoon.

Check before installing anything. On an image built with the PyDevices C
modules (micropython-pydevices' `build_mp.py --modules
displayif,lvgl-micropython,usbhost,pygraphics,audiodsp,ulab`, say) the following
displayif,lvgl,usbhost,pygraphics,audiodsp,ulab`, say) the following
are **frozen or built in** — installing them is wasted effort:

- `lvgl` (from lvgl-micropython)
- `lvgl` (from [omnipython-lvgl](https://github.com/PyDevices/omnipython-lvgl))
- `dotclockframebuffer` (from displayif) — the RGB panel interface
- `_usbhost`, the USB host's C module (usbhost). The USB packages that use
it (`usb.core`, `usb.host.*`, `usb.device.*`, from this repository's
Expand Down Expand Up @@ -58,7 +58,7 @@ text so you can see which module is really absent; a frozen module that
reports `MISS` with somebody else's name in the message is present and fine.
Install `pydevices` (which carries `events`, `appdev` and `display_driver`),
then re-probe. Firmware built before display_driver moved to pydevices
froze it from lvgl-micropython, where it showed the same trap with
froze it from the LVGL module, where it showed the same trap with
`appdev`.

## 2. Installing, over Wi-Fi
Expand Down
31 changes: 15 additions & 16 deletions docs/guides/lvgl.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@
How to run [LVGL](https://lvgl.io/) on the PyDevices display, input, and timing
packages, and what [`display_driver.py`](https://github.com/PyDevices/pydevices/blob/main/lib/display_driver.py) does for you.

## The three sister projects
## One binding for three interpreters

The PyDevices LVGL family bundles this integration for each interpreter:
[omnipython-lvgl](https://github.com/PyDevices/omnipython-lvgl) bundles this
integration for each interpreter, from one generated binding:

| Repository | Interpreter |
| Port | Interpreter |
|---|---|
| [lvgl-micropython](https://github.com/PyDevices/lvgl-micropython) | MicroPython firmware |
| [lvgl-circuitpython](https://github.com/PyDevices/lvgl-circuitpython) | CircuitPython firmware |
| [lvgl-python](https://github.com/PyDevices/lvgl-python) | CPython (`pydevices-lvgl` wheels on TestPyPI) |

All three consume the bindings generated by
[lvgl-bindings](https://github.com/PyDevices/lvgl-bindings), and all three share `displaydev`,
neutral board capabilities, and `multimer` — so the same LVGL Python code is
portable across them. You can even develop it interactively in
| [`ports/micropython`](https://github.com/PyDevices/omnipython-lvgl/tree/main/ports/micropython) | MicroPython firmware |
| [`ports/circuitpython`](https://github.com/PyDevices/omnipython-lvgl/tree/main/ports/circuitpython) | CircuitPython firmware |
| [`ports/cpython`](https://github.com/PyDevices/omnipython-lvgl/tree/main/ports/cpython) | CPython (`pydevices-lvgl` wheels on TestPyPI) |

All three share `displaydev`, neutral board capabilities, and `multimer`, so
the same LVGL Python code is portable across them. You can even develop it interactively in
[Jupyter](run-in-jupyter.md).

The rest of this page covers wiring LVGL up by hand, which is what you need with
upstream [lv_micropython](https://github.com/lvgl/lv_micropython) rather than one
of the sister projects.
upstream [lv_micropython](https://github.com/lvgl/lv_micropython) rather than
omnipython-lvgl.

## 1. Install the minimum PyDevices packages

Expand Down Expand Up @@ -67,7 +66,7 @@ lives in this repository's `lib/` and ships with `pydevices` (the mip package,
the wheel, and the frozen module in a micropython-pydevices build), beside the
`board_config` idiom, `appdev`, `events`, `keys` and `multimer` it needs. The
sister projects carry only `lvgl` and `fs_driver`
([loading fonts at runtime](https://github.com/PyDevices/lvgl-bindings/blob/main/docs/reference/fonts.md)).
([loading fonts at runtime](https://github.com/PyDevices/omnipython-lvgl/blob/main/docs/reference/fonts.md)).

With `display_driver`, LVGL input is wired automatically through its own
`app` (an `appdev.App`) and virtual touch / encoder / keypad devices.
Expand Down Expand Up @@ -152,5 +151,5 @@ interpreter, use the harnesses documented in
- [displaydev](displays.md)
- [multimer](timers.md)
- [appdev](the-app-loop.md)
- [lvgl-bindings](https://github.com/PyDevices/lvgl-bindings) — the generator,
and [loading fonts at runtime](https://github.com/PyDevices/lvgl-bindings/blob/main/docs/reference/fonts.md)
- [omnipython-lvgl](https://github.com/PyDevices/omnipython-lvgl) — the generator and the three ports,
and [loading fonts at runtime](https://github.com/PyDevices/omnipython-lvgl/blob/main/docs/reference/fonts.md)
2 changes: 1 addition & 1 deletion docs/how-it-works/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ what you can compile:
|---|---|---|
| **Raw graphics / canvas** | Direct pixel, line, and shape drawing | [`displaydev`](../guides/displays.md) with [`pygraphics`](https://github.com/PyDevices/pygraphics) |
| **Pure-Python GUI** | Portable buttons, lists, themes, and screen management with nothing to compile | [`pdwidgets`](https://github.com/PyDevices/pydevices/tree/main/pdwidgets) |
| **C-native GUI** | Complex vector widgets and a C-accelerated animation engine | [`lvgl`](https://github.com/PyDevices/lvgl-bindings) — see [using LVGL with PyDevices](../guides/lvgl.md) |
| **C-native GUI** | Complex vector widgets and a C-accelerated animation engine | [`lvgl`](https://github.com/PyDevices/omnipython-lvgl) — see [using LVGL with PyDevices](../guides/lvgl.md) |

All three sit on the same board contract, so the choice does not change how your
hardware is configured.
Expand Down
5 changes: 1 addition & 4 deletions docs/how-it-works/ecosystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ Pure Python on any Python 3 host; pygraphics adds native wheels for Linux x86_64

Single-source LVGL C header binding generator and native interpreter modules.

- [`lvgl-bindings`](https://github.com/PyDevices/lvgl-bindings) — Automated binding generator parsing LVGL C headers into native CPython extensions, MicroPython usermods, and CircuitPython modules.
- [`lvgl-micropython`](https://github.com/PyDevices/lvgl-micropython) — Native MicroPython C module integrating LVGL v9 graphics engine with displayif bus drivers on ESP32 targets.
- [`lvgl-python`](https://github.com/PyDevices/lvgl-python) — Pre-built CPython extension wheels and Pyodide WASM packages bringing LVGL v9 to Linux, Windows, Android, and web browsers.
- [`lvgl-circuitpython`](https://github.com/PyDevices/lvgl-circuitpython) — CircuitPython native C module providing LVGL v9 bindings and displayif integration for the Adafruit Feather RP2040 and ESP32 boards.
- [`omnipython-lvgl`](https://github.com/PyDevices/omnipython-lvgl) — LVGL v9 for MicroPython, CircuitPython and CPython from one binding generator, which parses LVGL's C headers into a MicroPython user C module, a CircuitPython module and a CPython extension (the `pydevices-lvgl` wheels).

### Tier 4: App Hosts & Mobile

Expand Down
24 changes: 14 additions & 10 deletions scripts/release_interpreters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# .github/workflows/release-interpreters.yml calls this; every step also runs
# by hand on Linux or WSL.
#
# release_interpreters.sh gate <event> <ref> <attach> [<mpp-ref> <lvgl-cp-ref>]
# release_interpreters.sh gate <event> <ref> <attach> [<mpp-ref> <lvgl-ref>]
# Decide what a run does. <event> is "release", "workflow_dispatch" or
# "pull_request";
# <ref> is the release tag, or for a dispatch the branch or tag to
Expand All @@ -12,12 +12,13 @@
# $GITHUB_OUTPUT. Only a final tag (vX.Y.Z) is ever attached: a dev, a,
# b or rc release gets no interpreters, and a branch is only ever built.
# The optional refs override the commits release_interpreters/sources.lock
# pins for micropython-pydevices and lvgl-circuitpython; a run that
# overrides one never attaches. Also prints mpp= and lvgl_cp=, the pins.
# pins for micropython-pydevices and omnipython-lvgl; a run that
# overrides one never attaches. Also prints mpp= and lvgl=, the pins.
#
# release_interpreters.sh fetch <name> <dir> [<ref>]
# Check out lvgl-circuitpython (or another source in sources.lock) into
# <dir> at its pinned commit, or at <ref> when one is given.
# Check out omnipython-lvgl (or another source in sources.lock) into
# <dir> at its pinned commit, or at <ref> when one is given, with its
# submodules (omnipython-lvgl's LVGL).
#
# release_interpreters.sh build <target> <out-dir>
# Build one interpreter with micropython-pydevices' build_mp.py and put
Expand All @@ -31,7 +32,7 @@
# PYD_DIR the pydevices tree to build into the interpreters
# (default: the one this script lives in)
# WS_DIR cp-unix only: a directory holding a checkout of
# lvgl-circuitpython
# omnipython-lvgl
# JOBS make parallelism (default: nproc)
#
# Every interpreter carries every module, the way the desktop builds are
Expand Down Expand Up @@ -68,7 +69,7 @@ gate() {
;;
esac
if [[ "$do_attach" == "true" && ( -n "$mpp_ref" || -n "$lvgl_ref" ) ]]; then
echo "error: will not attach interpreters built from another micropython-pydevices or lvgl-circuitpython than sources.lock pins" >&2
echo "error: will not attach interpreters built from another micropython-pydevices or omnipython-lvgl than sources.lock pins" >&2
return 1
fi
echo "build=$build"
Expand Down Expand Up @@ -96,6 +97,9 @@ fetch() {
git -C "$dir" fetch --quiet "$url" '+refs/heads/*:refs/remotes/origin/*' '+refs/tags/*:refs/tags/*'
git -C "$dir" checkout --quiet "$ref"
fi
if [[ -f "$dir/.gitmodules" ]]; then
git -C "$dir" submodule update --quiet --init --depth 1
fi
}

build() {
Expand Down Expand Up @@ -133,16 +137,16 @@ build() {
install -m 755 builds/webassembly/pydevices/micropython.wasm "$out/micropython.wasm"
;;
cp-unix)
: "${WS_DIR:?set WS_DIR to a directory with a checkout of lvgl-circuitpython}"
: "${WS_DIR:?set WS_DIR to a directory with a checkout of omnipython-lvgl}"
local ws cp_dir
ws=$(cd "$WS_DIR" && pwd)
cp_dir="$HERE/release_interpreters/circuitpython"
[[ -f "$ws/lvgl-circuitpython/manifest.py" ]] || { echo "error: $ws/lvgl-circuitpython is not a checkout" >&2; return 1; }
[[ -f "$ws/omnipython-lvgl/ports/circuitpython/manifest.py" ]] || { echo "error: $ws/omnipython-lvgl is not a checkout" >&2; return 1; }
# pydevices, pdwidgets and palettes are frozen from the library, by build_mp.py.
# pydevices must be named: pdwidgets imports its events module.
JOBS="$jobs" python3 build_mp.py \
--interpreter circuitpython --port unix \
--modules "audiodsp,displayif,pygraphics,pydevices,pdwidgets,palettes,$ws/lvgl-circuitpython,$cp_dir/unix-extras"
--modules "audiodsp,displayif,pygraphics,pydevices,pdwidgets,palettes,$ws/omnipython-lvgl/ports/circuitpython,$cp_dir/unix-extras"
install -m 755 builds/circuitpython/unix/coverage/micropython "$out/circuitpython"
;;
*)
Expand Down
5 changes: 3 additions & 2 deletions scripts/release_interpreters/sources.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
# MicroPython commit, the toolchains, and every module;
# the library (pydevices, palettes, pdwidgets) is the
# release's tag
# lvgl-circuitpython the LVGL bindings the CircuitPython build compiles
# omnipython-lvgl LVGL and its bindings, whose ports/circuitpython the
# CircuitPython build compiles
#
# To move them to the current tips of their default branches, run
# python3 scripts/release_interpreters/sources.py bump
# and commit the result. docs/publishing.md has the rest.
micropython-pydevices https://github.com/PyDevices/micropython-pydevices.git 348da7a435876d2c74371ac5c2744cfa148497cb
lvgl-circuitpython https://github.com/PyDevices/lvgl-circuitpython.git 7fb257a5f3d0d5c2f28c27c235e6239714e740c4
omnipython-lvgl https://github.com/PyDevices/omnipython-lvgl.git 84d1de375b014c7d49b4ccbd3be551813091f9ef
Loading
Loading