This example describes how to configure the EXTI and use GPIOs to toggle the user LEDs available on the board when a Joystick Selection push-button is pressed. This example is based on the STM32C0xx LL API. Peripheral initialization is done using LL initialization function to demonstrate LL init usage.
In this example, one EXTI line (EXTI_Line4) is configured to generate an interrupt on each rising edge.
In the interrupt routine a led connected to a specific GPIO pin is toggled.
In this example:
On STM32C0316-DISCO:
System, GPIO, Output, Alternate function, EXTI, Toggle
This example runs on STM32C031C6Tx devices.
This example has been tested with STM32C0316-DISCO 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 :