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_Line8) 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 STM32C0116-DISCO:
- EXTI_Line8 is connected to Joystick Selection push-button
System, GPIO, Output, Alternate function, EXTI, Toggle
This example runs on STM32C011F6Ux devices.
This example has been tested with STM32C0116-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 :