【STM32H7S78-DK】Evaluation + Application of Graphics Library TouchGFX
[Copy link]
The original plan was to port LVGL, but after reading some materials, I found that LVGL does not currently support the high-performance graphics engine GPU of STM32H7S78. After learning about the relevant materials in detail, I found that ST's own TouchGFX alignment support is the most complete and can give full play to its high-performance graphics features. The TouchGFX framework includes an easy-to-use drag-and-drop graphics construction PC tool TouchGFX Designer (TouchGFXDesigner) and a powerful optimized graphics processing kernel TouchGFX engine. Combined with WYSIWYG simulator and automatic code generation functions, TouchGFX greatly simplifies GUI development. TouchGFX has its own host computer TouchGFX Designer for developing graphical UIs. The current version is 4.24.1. The author downloaded this version, and TouchGFX is also integrated into the STM32CubeMX ecosystem, which is very convenient to use. This post initially explores the application of TouchGFX, and subsequently uses TouchGFX to refresh and display the voltage acquisition waveform.
Software used:
TouchGFX Designer (4.21.4)
STM32CubeIDE (own IDE, with the most complete support)
Download and install TouchGFX Designer, open the software, and click the New Project button on the home page to get started. The current version is much more optimized than previous versions, and it is very easy to use:
Just search for the board keyword in the search box. The advantage of creating a project through a board template is that all kinds of peripherals are configured for us, which is very convenient to quickly experience the demo and create a project:
In screen 1, I added an image as the background, and then added a button. The button has a variety of styles and sizes to choose from. Here I choose the flip style:
Then configure the parameters of the button, mainly the callback name triggered after pressing it. Here we use the default function1:
Click the button in the lower right corner or press F4 to generate the project:
After generating the project, you can simulate and run it on your computer to view the basic UI effects:
You can also directly click Compile and Download, burn the project to the development board and run it to see the effect:
Use stm32cubeide to import the project and add a GPIO to control the LED:
Then save and update the code. In the generated code, it is easy to find the part where the user needs to add logic. Add the key flip LED control code in User/gui/Screen11view.cpp. The function name here is the same as the callback name filled in when creating the button before:
Add the following declaration to the class:
Effect
WeChat_20241027222945
|