GaIA BIOS Library
Loading...
Searching...
No Matches
High Speed Digital IO

Overview

This example demonstrates how to read and write digital I/O on the GaIA board using a high-speed scan routine.

Behavior

The application continuously writes the value of a counter every 200 ms to:

  • Display (DISP0)
  • LED column (next to DISP0)
  • Digital output (CN_OUT0)

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.


Bootloader support

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:

/* Begin BOOT */
#include "gwa_reset.h"
extern uint32_t reset_type;
extern void gwa_enter_bootloader(void);
/* End BOOT */
Reset utilities.

As first instructions of the SystemInit:

/* Begin BOOT */
if (reset_type == MAGIC_RESET_0)
{
reset_type = 0;
gwa_enter_bootloader();
}
/* End BOOT */