The T-Watch Graphical User Interface and how to add your own applications and settings
Introduction
The "
factory firmware" is developed by Dirk Brosswick. It is a rather complex C++ program developed under platformio in an Arduino framework. I tried to follow, as far as possible, the same structure and I translated the C++ calls to LVGL into their MicroPython equivalents.
The infrastructure can be tested with the Unix port of MicroPython in conjunction with LVGL, based on the SDL2 driver. This allows me to quickly test the complete GUI on the PC as long as no hardware dependent features are used. This means that power management using the axp202, time functionality using the pcf8563 or applications using the bma423 accelerometer must be separated from the GUI code.
The Graphical User Interface
When the program boots a splash screen is shown, while hardware initialization takes place.
Once that the hardware is ready the twatch first connects to WiFi and then reads the current date and time from NTP and sets the pcf8563 real time clock. After that the GUI is started
The
GUI is based on the LVGL tile view widget (lv.tileview). The base GUI consists of 8 tiles as a matrix with 4 columns and 2 rows. The upper row is used for
applications while the lower row contains a
note tile and all the
setup functions.
- The upper row:
- The main tile (position 0,0) comes up when the program is started. In this tile the default application is run
- 3 tiles are reserved for applications (only the first 2 tiles are used for the moment)
- The lower row
- The first tile is reserved as a note tile, which is unused for the moment
- 3 tiles are reserved for setups (only the first 2 tiles are used for the moment)
The individual tiles use a style with transparent OPA (opacity) such that the wallpaper on the tile view is visible on all tiles. In addition, a status bar shows the current state of the hardware like
- WiFi state
- battery charge
- step counter
- BlueTooth state
Adding applications
--
Uli Raich - 2021-01-28
Comments