RM0091
11.2.5
Functional description
For the external interrupt lines, to generate the interrupt, the interrupt line should be
configured and enabled. This is done by programming the two trigger registers with the
desired edge detection and by enabling the interrupt request by writing a '1' to the
corresponding bit in the interrupt mask register. When the selected edge occurs on the
external interrupt line, an interrupt request is generated. The pending bit corresponding to
the interrupt line is also set. This request is reset by writing a '1' in the pending register.
For the internal interrupt lines, the active edge is always the rising edge, the interrupt is
enabled by default in the interrupt mask register and there is no corresponding pending bit in
the pending register.
To generate the event, the event line should be configured and enabled. This is done by
programming the two trigger registers with the desired edge detection and by enabling the
event request by writing a '1' to the corresponding bit in the event mask register. When the
selected edge occurs on the event line, an event pulse is generated. The pending bit
corresponding to the event line is not set.
For the external lines, an interrupt/event request can also be generated by software by
writing a '1' in the software interrupt/event register.
Note:
The interrupts or events associated to the internal lines can be triggered only when the
system is in STOP mode. If the system is still running, no interrupt/event is generated.
Hardware interrupt selection
To configure a line as interrupt source, use the following procedure:
●
Configure the corresponding mask bit in the EXTI_IMR register.
●
Configure the Trigger Selection bits of the Interrupt line (EXTI_RTSR and EXTI_FTSR)
●
Configure the enable and mask bits that control the NVIC IRQ channel mapped to the
EXTI so that an interrupt coming from one of the EXTI line can be correctly
acknowledged.
Hardware event selection
To configure a line as event source, use the following procedure:
●
Configure the corresponding mask bit in the EXTI_EMR register.
●
Configure the Trigger Selection bits of the Event line (EXTI_RTSR and EXTI_FTSR)
Software interrupt/event selection
Any of the external lines can be configured as software interrupt/event lines. The following is
the procedure to generate a software interrupt.
●
Configure the corresponding mask bit (EXTI_IMR, EXTI_EMR)
●
Set the required bit of the software interrupt register (EXTI_SWIER)
11.2.6
External and internal interrupt/event line mapping
In the STM32F05xxx, 28 interrupt/event lines are available: 7 lines are internal (including the
reserved ones and the remaining 21 lines are external.
The GPIOs are connected to the 16 external interrupt/event lines in the following manner:
Doc ID 018940 Rev 1
Interrupts and events
161/742
Need help?
Do you have a question about the STM32F05 series and is the answer not in the manual?
Questions and answers