Interrupts : Interrupt vs. Polling
int main()
{
while(1){
. . .
}
}
OnSwitch_ISR{
getData()
}
Interrupt
int main()
{
while(1){
if(switch = on ){
getData();
}
. . .
}
}
Polling
Interrupts NVIC

- Interrupts from the processor core are know as exceptions.
- Interrupts from outside the processor core are known as hardware exceptions or Interrupt Requests.
Interrupts: The Vector Table
The vector table contains the addresses of the Interrupt Handlers and Exception Handlers.

Interrupts: External Interrupt (EXTI) Lines

- GPIO pins are connected to EXTI lines
- It possible to enable interrupt for any GPIO pin
- Multiple pins share the same EXTI line
- Pin 0 of every Port is connected EXTI0_IRQ
- Pin 1 of every Port is connected EXTI1_IRQ
- Pin 2 of every Port is connected EXTI2_IRQ