|
5 | 5 | <script>try{if(localStorage.getItem('pydevices-theme')==='light'){document.documentElement.setAttribute('data-theme','light');}}catch(e){}</script> |
6 | 6 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
7 | 7 | <title>lv_circuitpython_mod — PyDevices</title> |
8 | | - <meta name="description" content="CircuitPython integration for LVGL."> |
| 8 | + <meta name="description" content="CircuitPython integration for LVGL — tree patches, build_cp.sh, and tests. Not a MicroPython USER_C_MODULES usermod."> |
9 | 9 | <link rel="icon" type="image/svg+xml" href="https://pydevices.github.io/assets/img/logo.svg"> |
10 | 10 | <link rel="preconnect" href="https://fonts.googleapis.com"> |
11 | 11 | <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
|
21 | 21 | PyDevices |
22 | 22 | </a> |
23 | 23 | <nav class="nav"> |
24 | | - <a href="https://pydevices.github.io/pydisplay/">pydisplay</a> |
| 24 | + <a href="https://pydevices.github.io/lv_bindings/">lv_bindings</a> |
25 | 25 | <a href="https://pydevices.github.io/cmods/">cmods</a> |
26 | 26 | <a href="https://github.com/PyDevices/lv_circuitpython_mod">Source</a> |
27 | 27 | </nav> |
|
33 | 33 | </header> |
34 | 34 |
|
35 | 35 | <section class="hero wrap"> |
36 | | - <div class="logo-badge"><img src="https://pydevices.github.io/assets/img/logo.svg" alt="PyDevices logo" width="112" height="112"></div> |
| 36 | + <div class="logo-badge product-mark"><img src="https://pydevices.github.io/assets/img/products/lv_circuitpython_mod.svg" alt="lv_circuitpython_mod" width="112" height="112"></div> |
37 | 37 | <span class="eyebrow">PyDevices / lv_circuitpython_mod</span> |
38 | | - <h1>CircuitPython integration for LVGL</h1> |
39 | | - <p>lv_circuitpython_mod carries the CircuitPython-side integration for LVGL: tree patches, build glue, and tests that consume the CircuitPython artifacts from lv_bindings. It is how <code>import lvgl</code> becomes a CircuitPython-friendly native module instead of a MicroPython-only usermod.</p> |
40 | | - <p>Work here when CircuitPython's module layout or build system needs LVGL-specific wiring. Pair it with a regenerated lv_bindings CircuitPython output and the cmods <code>cp-unix</code> path (or this repo's <code>build_cp.sh</code>) to verify the coverage build still smoke-tests cleanly.</p> |
| 38 | + <h1>lv_circuitpython_mod</h1> |
| 39 | + <p>CircuitPython integration for LVGL: tree patches, build glue (<code>build_cp.sh</code>), spike templates, and tests. It consumes <a href="https://pydevices.github.io/lv_bindings/">lv_bindings</a> CircuitPython artifacts (<code>generated/lvgl_circuitpython.c</code> / <code>.h</code>) so <code>import lvgl</code> works as a CircuitPython-native module.</p> |
| 40 | + <p>This is <strong>not</strong> a MicroPython <code>USER_C_MODULES</code> usermod — CircuitPython uses a different module layout and patch-driven build. Pair a stable CircuitPython release tag with regenerated bindings, then drive any port/board/variant through <code>./build_cp.sh</code>.</p> |
41 | 41 | <div class="cta"> |
42 | 42 | <a class="btn primary" href="https://github.com/PyDevices/lv_circuitpython_mod"> |
43 | 43 | <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.9a3.4 3.4 0 0 0-1-2.6c3-.3 6-1.5 6-6.5a5 5 0 0 0-1.4-3.5 4.6 4.6 0 0 0-.1-3.5s-1.1-.3-3.5 1.3a12 12 0 0 0-6 0C6.6 1.7 5.5 2 5.5 2a4.6 4.6 0 0 0-.1 3.5A5 5 0 0 0 4 9c0 5 3 6.2 6 6.5a3.4 3.4 0 0 0-1 2.6V22"/></svg> |
44 | 44 | Source on GitHub |
45 | 45 | </a> |
46 | | - <a class="btn" href="https://pydevices.github.io/">PyDevices</a> |
| 46 | + <a class="btn" href="https://pydevices.github.io/lv_bindings/">lv_bindings</a> |
| 47 | + <a class="btn" href="https://pydevices.github.io/cmods/">cmods</a> |
47 | 48 | </div> |
48 | 49 | </section> |
49 | 50 |
|
50 | 51 | <main class="cards wrap"> |
51 | 52 | <div class="section-head"> |
52 | | - <h2>Build with lv_bindings + a tagged CircuitPython clone</h2> |
| 53 | + <h2>First-time setup</h2> |
| 54 | + <span class="hint">Sibling clones of <code>lv_bindings/</code> and a tagged <code>circuitpython/</code></span> |
53 | 55 | </div> |
54 | 56 | <div class="install-block"> |
55 | | - <pre><code>git clone https://github.com/PyDevices/lv_bindings.git |
56 | | -cd lv_bindings && git submodule update --init lvgl && cd .. |
57 | | -./lv_bindings/regenerate_lvcp.sh |
| 57 | + <pre><code># Pick a stable tag from github.com/adafruit/circuitpython/releases |
| 58 | +git clone --branch 10.2.1 \ |
| 59 | + https://github.com/adafruit/circuitpython.git circuitpython |
| 60 | +cd circuitpython && make fetch-all-submodules && cd .. |
58 | 61 |
|
59 | | -git clone https://github.com/PyDevices/lv_circuitpython_mod.git |
60 | | -./lv_circuitpython_mod/build_cp.sh --port unix --variant coverage</code></pre> |
| 62 | +git clone https://github.com/PyDevices/lv_bindings.git lv_bindings |
| 63 | +cd lv_bindings |
| 64 | +git submodule update --init lvgl |
| 65 | +python3 -m venv .venv |
| 66 | +.venv/bin/pip install -r requirements.txt |
| 67 | +./regenerate_lvcp.sh |
| 68 | +cd ..</code></pre> |
| 69 | + </div> |
| 70 | + |
| 71 | + <div class="section-head" style="margin-top: 36px;"> |
| 72 | + <h2>Patch and build</h2> |
| 73 | + <span class="hint"><code>build_cp.sh</code> always runs <code>apply_cp_lvgl_patches.sh --apply</code> first</span> |
| 74 | + </div> |
| 75 | + <div class="snippet-grid"> |
| 76 | + <div class="snippet-card"> |
| 77 | + <h3>unix coverage</h3> |
| 78 | + <p>Default cmods <code>cp-unix</code> target; good for the CP test suite / gcov.</p> |
| 79 | + <pre><code>cd lv_circuitpython_mod |
| 80 | +./apply_cp_lvgl_patches.sh --apply \ |
| 81 | + --port unix --variant coverage |
| 82 | +./build_cp.sh --port unix --variant coverage |
| 83 | + |
| 84 | +../circuitpython/ports/unix/build-coverage/micropython \ |
| 85 | + ./test_lvgl_cp_unix.py</code></pre> |
| 86 | + </div> |
| 87 | + <div class="snippet-card"> |
| 88 | + <h3>Board firmware</h3> |
| 89 | + <p>Interactive or CLI port/board/variant selection. Install GCC 14+ toolchains first (see README).</p> |
| 90 | + <pre><code>./build_cp.sh --port espressif \ |
| 91 | + --board espressif_esp32p4_function_ev |
| 92 | + |
| 93 | +./build_cp.sh # interactive selection</code></pre> |
| 94 | + </div> |
61 | 95 | </div> |
62 | 96 |
|
63 | 97 | <div class="section-head" style="margin-top: 36px;"> |
64 | 98 | <h2>Related</h2> |
65 | 99 | </div> |
66 | 100 | <ul class="linklist"> |
67 | | - <li><a href="https://pydevices.github.io/lv_bindings/"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>lv_bindings — the binding generator</a></li> |
68 | | - <li><a href="https://pydevices.github.io/cmods/"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>cmods — the build workspace</a></li> |
| 101 | + <li><a href="https://pydevices.github.io/lv_bindings/"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>lv_bindings — binding generator</a></li> |
| 102 | + <li><a href="https://pydevices.github.io/cmods/"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>cmods — optional sibling workspace</a></li> |
69 | 103 | <li><a href="https://pydevices.github.io/pydisplay/"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>pydisplay</a></li> |
| 104 | + <li><a href="https://pydevices.github.io/lv_micropython_cmod/"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>lv_micropython_cmod — MicroPython usermod</a></li> |
70 | 105 | </ul> |
71 | 106 | </main> |
72 | 107 |
|
|
0 commit comments