Adding A Module To The Main Desktop - ST STM32CubeH7 User Manual

Demonstration platform
Table of Contents

Advertisement

How to create a new module
It begins with the creation of the main module structure as defined in
manager. Each module has its own Startup function that consists of the graphical module
creation, initialization and link to the main callback.
In the example above, _cbDialog refers to the main module callback routine. Its general
skeleton is structured as follows.
The list of window messages presented in the code portion above (WM_INIT_DIALOG and
WM_NOTIFY_PARENT) is not exhaustive, but represents the essential message IDs used:
WM_INIT_DIALOG allows the graphical elements initialization with their respective
initial values. It is also possible to restore the backup parameters (if any) to be used
during the dialog procedure.
WM_NOTIFY_PARENT describes the dialog procedure, for example the definition of
each button behavior.
The full list of window messages is available in the WM.h file.
4.4

Adding a module to the main desktop

Once the appearance and functionality of the module are defined and created, the module
still needs to be added to the main desktop view. This is done by adding it to the list
(structure) of menu items: module_prop[] defined into k_module.h. To do this,
k_ModuleAdd() function must be called just after the module initialization into the main.c
file. Note that the maximum modules number in the demonstration package is limited to 15;
this value can be changed by updating MAX_MODULES_NUM defined into k_module.c.
26/76
UM2222 Rev 2
UM2222
Section 3.6: Module

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32CubeH7 and is the answer not in the manual?

Table of Contents

Save PDF