Doorbell
STM32 Button Interrupt Exercise
Task
On a coin-cell doorbell, the button on PA0 is pressed and released while your program runs. From EXTI0_IRQHandler (IRQ 6), control the LED on PA5 for as long as the board runs: if pressed -> LED on; if not pressed -> LED off. The registers and bit fields are on the Datasheet tab.
Circuit
Pass condition
PA5 follows every press and release, and the core takes IRQ 6 for every edge.
Notes
This question needs no clock enable. PA0 is EXTI line 0, and line 0 reaches the core as IRQ 6.