Extended interrupts and events controller (EXTI) RM0440
448/2126 RM0440 Rev 4
15.3.3 Peripherals asynchronous Interrupts
Some peripherals are able to generate events when the system is in run mode and also
when the system is in Stop mode, allowing to wake up the system from Stop mode.
To accomplish this, the peripheral generates both a synchronized (to the system clock, e.g.
APB clock) and an asynchronous version of the event. This asynchronous event is
connected to an EXTI direct line.
Note: Few peripherals with wakeup from Stop capability are connected to an EXTI configurable
line. In this case, the EXTI configuration is necessary to allow the wakeup from Stop mode.
15.3.4 Hardware interrupt selection
To configure a line as an interrupt source, use the following procedure:
1. Configure the corresponding mask bit in the EXTI_IMR register.
2. Configure the Trigger Selection bits of the Interrupt line (EXTI_RTSR and EXTI_FTSR).
3. 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 lines can be correctly
acknowledged.
Note: The direct lines do not require any EXTI configuration.
15.3.5 Hardware event selection
To configure a line as an event source, use the following procedure:
1. Configure the corresponding mask bit in the EXTI_EMR register.
2. Configure the Trigger Selection bits of the Event line (EXTI_RTSR and EXTI_FTSR).
15.3.6 Software interrupt/event selection
Any of the configurable lines can be configured as a software interrupt/event line. The
procedure to generate a software interrupt is as follows:
1. Configure the corresponding mask bit (EXTI_IMR, EXTI_EMR).
2. Set the required bit of the software interrupt register (EXTI_SWIER).
15.4 EXTI interrupt/event line mapping
In the STM32G4 Series, 42 interrupt/event lines are available. The GPIOs are connected to
16 configurable interrupt/event lines (see Figure 36).