Developing the EXTI driver
The STM32 EXTI module relies on several key registers to configure its operation. These registers allow you to set up trigger conditions, enable interrupts, and manage pending interrupt requests. Understanding these registers is crucial for effectively using the EXTI module in your embedded projects.
EXTI_IMR
We use the EXTI_IMR to enable or disable interrupts on each EXTI line.
The bits in this register are named MRx. They are mask bits for each EXTI line (x
= 0
to 22
). Setting a bit to 1
unmasks the interrupt line, allowing it to generate an interrupt request. Conversely, setting it to 0
masks the line, preventing it from generating interrupts.
EXTI_RTSR
The EXTI_RTSR configures the rising edge trigger for each EXTI line. When a rising edge is detected on a line configured in this register, it can generate an interrupt or an event.
The bits in this register are named TRx. They are trigger selection bits for each EXTI line (x
= 0
to 22
...