Actions

EmSys

Difference between revisions of "TM4C123GXL GPIO - Set up the type-event-and-mask of the interrupts for each port"

From EdWiki

m
m (GPIO Interrupt Mask (GPIOIM))
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
== GPIO - Set up the type, event, and mask of the interrupts for each port ==
 
== 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.
+
We 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) ===
 
=== GPIO Interrupt Sense (GPIOIS) ===
Line 7: Line 7:
  
 
[[image:tm4c_gpiois.png|center]]
 
[[image:tm4c_gpiois.png|center]]
 +
 +
{| class="wikitable" style="margin: auto; border-style: solid; border-width: 4px"
 +
|-
 +
! Bit/Field !! Name !! Description
 +
|-
 +
| 7:0 || IS || <u>GPIO Interrupt Sense</u><br />0: The edge on the corresponding pin is detected (edge-sensitive).<br />1: The level on the corresponding pin is detected (level-sensitive).
 +
|-
 +
| 31:8 || Reserved || Software should not rely on the value of a reserved bit.
 +
|}
  
 
=== GPIO Interrupt Both Edges (GPIOIBE) ===
 
=== GPIO Interrupt Both Edges (GPIOIBE) ===
Line 12: Line 21:
  
 
[[image:tm4c_gpioibe_r.png|center]]
 
[[image:tm4c_gpioibe_r.png|center]]
 +
 +
{| class="wikitable" style="margin: auto; border-style: solid; border-width: 4px"
 +
|-
 +
! Bit/Field !! Name !! Description
 +
|-
 +
| 7:0 || IBE || <u>GPIO Interrupt Both Edges</u><br />0: Interrupt generation is controlled by the GPIO Interrupt Event (GPIOIEV).<br />1: Both edges on the corresponding pin trigger an interrupt.
 +
|-
 +
| 31:8 || Reserved || Software should not rely on the value of a reserved bit.
 +
|}
  
 
=== GPIO Interrupt Event (GPIOIEV) ===
 
=== GPIO Interrupt Event (GPIOIEV) ===
Line 17: Line 35:
  
 
[[image:tm4c_gpioiev_r.png]]
 
[[image:tm4c_gpioiev_r.png]]
 +
 +
{| class="wikitable" style="margin: auto; border-style: solid; border-width: 4px"
 +
|-
 +
! Bit/Field !! Name !! Description
 +
|-
 +
| 7:0 || IEV || <u>GPIO Interrupt Event</u><br />0: A falling edge or a Low level on the corresponding pin triggers an interrupt.<br />1: A rising edge or a High level on the corresponding pin triggers an interrupt.
 +
|-
 +
| 31:8 || Reserved || Software should not rely on the value of a reserved bit.
 +
|}
  
 
=== GPIO Interrupt Mask (GPIOIM) ===
 
=== GPIO Interrupt Mask (GPIOIM) ===
Line 23: Line 50:
 
[[image:tm4c_gpioime_r.png|center]]
 
[[image:tm4c_gpioime_r.png|center]]
  
 +
 +
{| class="wikitable" style="margin: auto; border-style: solid; border-width: 4px"
 +
|-
 +
! Bit/Field !! Name !! Description
 +
|-
 +
| 7:0 || IME || <u>GPIO Interrupt Mask Enable</u><br />0: The interrupt from the corresponding pin is masked.<br />1: The interrupt from the corresponding pin is sent to the interrupt controller.
 +
|-
 +
| 31:8 || Reserved || Software should not rely on the value of a reserved bit.
 +
|}
  
 
'''Note:'''
 
'''Note:'''
Line 31: Line 67:
 
# Clear the GPIORIS register.
 
# Clear the GPIORIS register.
 
# Unmask the port by setting the IME field in the GPIOIM register.
 
# Unmask the port by setting the IME field in the GPIOIM register.
 +
 +
<!--
 +
[[File:prev.gif|left|link=EmSys:TM4C123GXL GPIO - Configure each pad in the port to have pull-up-pull-down-open drain]]
 +
[[File:next.gif|right|link=EmSys:TM4C123GXL GPIO - lock the configurations of the NMI and JTAG-SWD pins on the GPIO port]]
 +
[[File:home.gif|center|link=EmSys:Programming the GPIO in TM4C123#Initialization and Configuration]]
 +
-->

Latest revision as of 06:22, 3 March 2020

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

We 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.

Tm4c gpiois.png
Bit/Field Name Description
7:0 IS GPIO Interrupt Sense
0: The edge on the corresponding pin is detected (edge-sensitive).
1: The level on the corresponding pin is detected (level-sensitive).
31:8 Reserved Software should not rely on the value of a reserved bit.

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.

Tm4c gpioibe r.png
Bit/Field Name Description
7:0 IBE GPIO Interrupt Both Edges
0: Interrupt generation is controlled by the GPIO Interrupt Event (GPIOIEV).
1: Both edges on the corresponding pin trigger an interrupt.
31:8 Reserved Software should not rely on the value of a reserved bit.

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.

Tm4c gpioiev r.png

Bit/Field Name Description
7:0 IEV GPIO Interrupt Event
0: A falling edge or a Low level on the corresponding pin triggers an interrupt.
1: A rising edge or a High level on the corresponding pin triggers an interrupt.
31:8 Reserved Software should not rely on the value of a reserved bit.

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.

Tm4c gpioime r.png


Bit/Field Name Description
7:0 IME GPIO Interrupt Mask Enable
0: The interrupt from the corresponding pin is masked.
1: The interrupt from the corresponding pin is sent to the interrupt controller.
31:8 Reserved Software should not rely on the value of a reserved bit.

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.