Skip to content

Part 5: TouchGFX Designer

Kris Petrič edited this page Sep 20, 2024 · 10 revisions

The Screen Concept

TouchGFX applications are modeled after Model-View-Presenter design pattern.

Class hierarchy Overriding

TouchGFX Designer (re)generates code that provides base classes. User classes are derived from these base classes and implement the graphical interface and business logic. We may only edit the code in /TouchGFX/gui/ and provide needed assets in /TouchGFX/assets/, since these are guaranteed to never be overwritten.

Screenshot 2024-09-19 130407

Running simulator

To avoid having to flash the memory each time we compile the application, which is slow and wears down embedded flash, we can use the simulator provided by TouchGFX Designer. Click the middle button to open it.

Screenshot 2024-09-19 130412

You can also use the simulator in Visual Studio and use its debugging capabilites, which I found very convenient. Open the Visual Studio project located in src\stm32\KrisRaycaster\TouchGFX\simulator\msvs.

image

Flashing to memory

Screenshot 2024-09-19 130412

Press the rightmost button to flash program to embedded memory. If you have a different board than mine, you will have to edit build settings in TouchGFX Designer. I recommend you copy build settings from one of the example projects provided by TouchGFX, which will be auto-generated to work on your board. Afterwise you can tailor the defaults to your needs.

Resources

Clone this wiki locally