How to configure and use GPIOs to toggle the on-board user LEDs every 250 ms. This example is based on the STM32C0xx LL API. The peripheral is initialized with LL initialization function to demonstrate LL init usage.
PA.05 IO (configured in output pushpull mode) toggles in a forever loop. On NUCLEO-C071RB board this IO is connected to LED1.
In this example, HCLK is configured at 48 MHz.
System, GPIO, Output, No pull, Speed, Push-pull, Toggle
- GPIO/GPIO_InfiniteLedToggling_Init/Inc/stm32c0xx_it.h Interrupt handlers header file
- GPIO/GPIO_InfiniteLedToggling_Init/Inc/main.h Header for main.c module
- GPIO/GPIO_InfiniteLedToggling_Init/Inc/stm32_assert.h Template file to include assert_failed function
- GPIO/GPIO_InfiniteLedToggling_Init/Src/stm32c0xx_it.c Interrupt handlers
- GPIO/GPIO_InfiniteLedToggling_Init/Src/main.c Main program
- GPIO/GPIO_InfiniteLedToggling_Init/Src/system_stm32c0xx.c STM32C0xx system source file
This example runs on STM32C071RBTx devices.
This example has been tested with NUCLEO-C071RB board and can be easily tailored to any other supported device and development board.
In order to make the program work, you must do the following :