LVGL
The related code/working directory of this example resides in directory {WAMR_DIR}/samples/gui
Last updated
The related code/working directory of this example resides in directory {WAMR_DIR}/samples/gui
Last updated
Note: The sample has been migrated to bytecodealliance/wamr-app-framework/samples/gui.
This sample demonstrates that a graphic user interface application in WebAssembly programming with WAMR graphic library(WGL) which is part of WAMR app-framework.
Compared with the littlevgl sample, WGL compiles LittlevGL source code into the WAMR runtime and defines a set of wrapper API's for exporting to Webassembly application.
Below picture shows the WASM application is running on an STM board with an LCD touch panel.
When user clicks the blue button, the WASM application increases the counter, and the latest counter value is displayed on the top banner of the touch panel. The number on top will plus one each second, and the number on the bottom will plus one when clicked.
32 bit SDL(simple directmedia layer) (Note: only necessary when WAMR_BUILD_TARGET
is set to X86_32
when building WAMR runtime) Use apt-get:
Or download source from www.libsdl.org:
64 bit SDL(simple directmedia layer) (Note: only necessary when WAMR_BUILD_TARGET
is set to X86_64
when building WAMR runtime) Use apt-get:
Or download source from www.libsdl.org:
Build
All binaries are in "out", which contains "host_tool", "ui_decrease.wasm", "ui_increase.wasm" and "wasm_runtime_wgl".
Run WASM VM Linux applicaton & install WASM APP First start wasm_runtime_wgl in server mode.
Then install wasm APP by using host tool.
We can use a STM32 NUCLEO_F767ZI board with ILI9341 display and XPT2046 touch screen to run the test. Then use host_tool to remotely install wasm app into STM32.
Build WASM VM into Zephyr system a. clone zephyr source code Refer to Zephyr getting started.
b. copy samples
c. create a link to wamr root dir
d. build source code
Hardware Connections
Install WASM application to Zephyr using host_tool First, connect PC and STM32 with UART. Then install to use host_tool.
Install AOT version WASM application
The graphic user interface demo photo: