![]() |
GaIA BIOS Library
|
This example demonstrates how to read and write digital I/O on the GaIA board using a high-speed scan routine.
The application continuously writes the value of a counter every 200 ms to:
It also reads digital inputs continuously into the variable digital_input, which can be viewed in the Keil watch window or CubeIDE debugger.
Digital I/Os are refreshed with a period of 100 µs.
At startup, the program checks whether all DIP switches are high. If they are, the board resets and enters bootloader mode so that new firmware can be downloaded via USB using the ST DFuSe application or STM32CubeProgrammer.
To enable this behavior, add the following code around SystemInit.
Just before the SystemInit:
As first instructions of the SystemInit: