Actions

EmSys

TM4C123GXL GPIO - Set up the type-event-and-mask of the interrupts for each port

From EdWiki

Revision as of 09:35, 3 June 2019 by Jshankar (Talk | contribs)

GPIO - Set up the type, event, and mask of the interrupts for each port

Optionally, you can configure the GPIOIS, GPIOIBE, GPIOEV, and GPIOIM registers to set up the type, event, and mask of the interrupts for each port if interrupts are used for the port.

GPIO Interrupt Sense (GPIOIS)

The GPIOIS register is the interrupt sense register. Setting a bit in the GPIOIS register configures the corresponding pin to detect levels, while clearing a bit configures the corresponding pin to detect edges. All bits are cleared by a reset.

Note:

To prevent false interrupts, the following steps should be taken when re-configuring GPIO edge and interrupt sense registers:

  1. Mask the corresponding port by clearing the IME field in the GPIOIM register.
  2. Configure the IS field in the GPIOIS register and the IBE field in the GPIOIBE register.
  3. Clear the GPIORIS register.
  4. Unmask the port by setting the IME field in the GPIOIM register.

GPIO Interrupt Both Edges (GPIOIBE)

The GPIOIBE register allows both edges to cause interrupts. When the corresponding bit in the GPIO Interrupt Sense (GPIOIS) register is set to detect edges, setting a bit in the GPIOIBE register configures the corresponding pin to detect both rising and falling edges, regardless of the corresponding bit in the GPIO Interrupt Event (GPIOIEV) register. Clearing a bit configures the pin to be controlled by the GPIOIEV register. All bits are cleared by a reset.

GPIO Interrupt Event (GPIOIEV)

The GPIOIEV register is the interrupt event register. Setting a bit in the GPIOIEV register configures the corresponding pin to detect rising edges or high levels, depending on the corresponding bit value in the GPIO Interrupt Sense (GPIOIS) register. Clearing a bit configures the pin to detect falling edges or low levels, depending on the corresponding bit value in the GPIOIS register. All bits are cleared by a reset.

GPIO Interrupt Mask (GPIOIM)

The GPIOIM register is the interrupt mask register. Setting a bit in the GPIOIM register allows interrupts that are generated by the corresponding pin to be sent to the interrupt controller on the combined interrupt signal. Clearing a bit prevents an interrupt on the corresponding pin from being sent to the interrupt controller. All bits are cleared by a reset.


To prevent false interrupts, the following steps should be taken when re-configuring GPIO edge and interrupt sense registers:

  1. Mask the corresponding port by clearing the IME field in the GPIOIM register.
  2. Configure the IS field in the GPIOIS register and the IBE field in the GPIOIBE register.
  3. Clear the GPIORIS register.
  4. Unmask the port by setting the IME field in the GPIOIM register.