How to add GPIO bindings to my VS Application?
I made a test project for my discovery board with TouchGFX.
I needed the UI to react for a pin state change.
I've seen tutorials, where a GPIO accessing function was added to the `main.c` file. Then it could be added as `extern "C"` from `Model.cpp` file.
It looks awful! The main.c file is huge and full of generated stuff, even finding my function there is challenging.
So what I'm looking for is a way to just put my additional code into a separate header file.
The problem is the STM32CubeIDE project doesn't even have headers directory.
Another weird thing is VS showing a warning about my externed function, because it doesn't have the file it was defined in its `Application` project. However, when the code is compiled for the device, the symbol can be linked and my test application works.
What is the proper and normal way of calling `HAL_GPIO_ReadPin()` from my VS project?
The only way I found is to add the function that does it to the `main.c` from STM32CubeIDE project level, then extern it in `Model.cpp`.
What I need is a kind of bridge / binding file that from the one end can access all symbols `main.c` can access, and on the other end it is visible and usable for `Model.cpp`.
BTW, is there a way to stop VS from complaining about undefined function in `Model.cpp`? The function is defined in `main.c`. But I can't put `main.c` in my VS project, can I?
I'm thinking of making a class or a namespace that contains HAL accessing functions, but the problem is, that the other side of it is not in the VS project, it is in STM32CubeIDE project, and even there - I can't create a header file.
I'm also thinking about ugly workaround with creating the header file in the same directory as main.c and then include it in main.c. That should work, but that's an ugly hack.
