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

Overview

This example demonstrates how to read and write digital I/O on the GaIA board.

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 inspected in the Keil watch window or CubeIDE debugger.


Bootloader support

At startup, the program checks whether all DIP switches are high. If they are, the board is reset and enters the 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 SystemInit:

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

As the first instructions inside SystemInit:

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