The example will guide you through creating a graphical user interface on STM32H7S78-DK which demonstrate the benefit of NeoChrom GPU. We will use TouchGFX designer tool to create this interface which is composed of two icon that continously rotating and a button which allows to activate/deactivate NeoChrom IP.
- TouchGFX Designer 4.24.0
- STM32H7S78-DK board
- USB type C cable
3 main steps will be needed :
- Create a project and add the widgets (background image, two texture mapper and a toggle button)
- Add interactions to made the texture mapper rotate and to activate/deactivate NeoChrom
- Compile / download and test the generated project
- Run TouchGFX Designer 4.24.0
- Add a new interaction
- Trigger :
On every N ticks
- Action :
Rotate the texture mapper
- Choose texture mapper :
textureMapper1
- Tick relative angle
- Z angle :
0.1
- Add a new interaction
- Trigger :
On every N ticks
- Action :
Rotate the texture mapper
- Choose texture mapper :
textureMapper2
- Tick relative angle
- Z angle :
-0.1
- Add a new intercation
- Trigger :
button is clicked
- Action :
Execute C++ code
- Code : copy the code below
#ifndef SIMULATOR
static uint8_t b_NeoChromEnabled = 1;
if (b_NeoChromEnabled)
{
b_NeoChromEnabled = 0;
// function natively in TouchGFX for STM32H7RS
((TouchGFXHAL*)touchgfx::HAL::getInstance())->activateNeoChrom(false);
}
else
{
b_NeoChromEnabled = 1;
// function natively in TouchGFX for STM32H7RS
((TouchGFXHAL*)touchgfx::HAL::getInstance())->activateNeoChrom(true);
}
#endif /*SIMULATOR*/
- Include : copy the code below
#ifndef SIMULATOR
#include <TouchGFXHAL.hpp>
#endif/*SIMULATOR*/