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
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ This repo is a consumer/build repo for the LVGL stack: it consumes generated bin

Requires a sibling clone of [lvgl-bindings](https://github.com/PyDevices/lvgl-bindings) whose generated binding inputs match the exact commit recorded in `LVGL_BINDINGS_COMMIT`. The Make and CMake integrations reject a mismatched source, LVGL pin, or configuration.

**Synced from lvgl-bindings:** `lib/display_driver.py` and `lib/fs_driver.py` are synced from [lvgl-bindings](https://github.com/PyDevices/lvgl-bindings) at the commit pinned in `LVGL_BINDINGS_COMMIT`, along with the generated bindings. Do not edit them here — change them in lvgl-bindings and re-sync.
**Synced from lvgl-bindings:** `lib/fs_driver.py` is synced from [lvgl-bindings](https://github.com/PyDevices/lvgl-bindings) at the commit pinned in `LVGL_BINDINGS_COMMIT`, along with the generated bindings. Do not edit it here — change it in lvgl-bindings and re-sync.

**`display_driver` is not here.** LVGL's PyDevices coordinator lives in [pydevices `lib/`](https://github.com/PyDevices/pydevices/blob/main/lib/display_driver.py) and comes with `pydevices` (`mip.install("pydevices", index="https://PyDevices.github.io/mip")`, or frozen by micropython-pydevices' `--modules pydevices`), beside the `appdev`, `events`, `keys` and `multimer` it needs.

## Documentation

Expand Down Expand Up @@ -59,7 +61,7 @@ include("/path/to/lvgl-micropython/manifest.py")
On unix that manifest is `ports/unix/variants/standard/manifest.py`; on esp32
and rp2 it is usually `ports/<port>/boards/manifest.py`, unless your board
brings its own. Then build as usual. The include brings in the `lvgl` C module
and freezes two helpers, `display_driver` and `fs_driver`. If lvgl-bindings is
and freezes `fs_driver`. If lvgl-bindings is
not a sibling, pass `BINDINGS_DIR=/path/to/lvgl-bindings` to `make` on a Make
port. The build stops if that checkout does not match the pin. Tested on the
unix port against MicroPython v1.29.0, where `import lvgl` reports 9.5.
Expand Down Expand Up @@ -129,7 +131,7 @@ through.

## App Usage & Timer Model

In MicroPython, `display_driver` uses `machine.Timer` (hardware interrupts):
With pydevices installed, pydevices' `display_driver` drives LVGL from `machine.Timer` (hardware interrupts):
- **Interactive REPL (`micropython -i` or on-board prompt)**: Simply create widgets and drop out to the prompt. Hardware timer interrupts keep LVGL animations, timers, and touch input running continuously in the background while you inspect variables or test code interactively.
- **Standalone Scripts**: Use `app.run()` if you need an explicit loop for non-interactive desktop scripts.

Expand Down Expand Up @@ -161,8 +163,8 @@ The smoke suite belongs to the exact pinned `lvgl-bindings` source; this repo do
| `micropython.mk` | Make ports (pre-1.29: `USER_C_MODULES` = parent directory) |
| `micropython.cmake` | CMake ports (pre-1.29: `USER_C_MODULES` = this repo) |
| `src/lv_mem_core_micropython.c` | GC-aware LVGL allocator |
| `manifest.py` | Names the C module and freezes `lib/display_driver.py`, `lib/fs_driver.py` (synced from lvgl-bindings) |
| `lib/display_driver.py` | Vendored PyDevices LVGL glue (`import display_driver`) |
| `manifest.py` | Names the C module and freezes `lib/fs_driver.py` (synced from lvgl-bindings) |
| `lib/fs_driver.py` | Python-backed LVGL filesystem driver (`import fs_driver`) |
| `LVGL_BINDINGS_COMMIT` | Exact generator/artifact source consumed by builds |
| `scripts/sync_from_lvgl_bindings.sh` | Refresh helpers and record an exact commit/tag |

Expand Down
16 changes: 8 additions & 8 deletions docs/newcomers.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ consumes an exact sibling checkout of

## Start by using the firmware entrypoint

On firmware built with this module, an application starts with the synced
display helper:
On firmware built with this module and with
[pydevices](https://github.com/PyDevices/pydevices) installed, an application
starts with pydevices' display helper:

```python
import display_driver
Expand All @@ -26,9 +27,9 @@ label = lv.label(button)
label.set_text("Hello MicroPython LVGL!")
```

`display_driver` wires the display, input, and timer integration. It needs
pydevices' `appdev`, `events`, and `keys` on the device, plus a `board_config`
unless your code has already created an `appdev.App`. At an interactive
`display_driver` wires the display, input, and timer integration. It comes
with pydevices, beside the `appdev`, `events`, and `keys` it needs, and wants a
`board_config` unless your code has already created an `appdev.App`. At an interactive
MicroPython prompt, hardware timer callbacks keep LVGL active after the script
reaches the prompt.

Expand All @@ -44,13 +45,13 @@ lvgl-micropython build glue + GC-aware allocator
MicroPython firmware module: import lvgl
|
v
synced display_driver helper -> display/input/timers
pydevices' display_driver -> display/input/timers
```

The Make and CMake integrations reject a mismatched binding source, LVGL pin, or
generated configuration. Update `lvgl-bindings` first, then re-sync here; do not
hand-edit the generated binding inputs or the synced
`display_driver.py`/`fs_driver.py` copies.
`fs_driver.py` copy.

## Repository map

Expand All @@ -60,7 +61,6 @@ hand-edit the generated binding inputs or the synced
| `micropython.cmake` | CMake-port user-module entrypoint. |
| `src/lv_mem_core_micropython.c` | GC-aware LVGL allocator. |
| `src/lvgl_micropython_build.c` | `lvgl_micropython.__revision__` build stamp. |
| `lib/display_driver.py` | Synced display, input, and timer helper. |
| `lib/fs_driver.py` | Synced LVGL filesystem helper. |
| `LVGL_BINDINGS_COMMIT` | Exact generated-binding source commit. |
| `scripts/sync_from_lvgl_bindings.sh` | Refresh synced helpers and recorded source. |
Expand Down
Loading