SWRU543B January 2019 – June 2025 CC3230S , CC3230SF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
Table 5-3 lists the GPIO memory-mapped registers. Each GPIO port can be accessed through the advanced peripheral bus (APB). The offset listed is a hexadecimal increment to the register address, relative to the base address of that GPIO port:
Each GPIO module clock must be enabled before the registers can be programmed. There must be a delay of three system clocks after the GPIO module clock is enabled before any GPIO module registers are accessed.
| Offset | Acronym | Register Name | Section |
|---|---|---|---|
| 0h | GPIODATA | GPIO Data | Section 5.5.1 |
| 400h | GPIODIR | GPIO Direction | Section 5.5.2 |
| 404h | GPIOIS | GPIO Interrupt Sense | Section 5.5.3 |
| 408h | GPIOIBE | GPIO Interrupt Both Edges | Section 5.5.4 |
| 40Ch | GPIOIEV | GPIO Interrupt Event | Section 5.5.5 |
| 410h | GPIOIM | GPIO Interrupt Mask | Section 5.5.6 |
| 414h | GPIORIS | GPIO Raw Interrupt Status | Section 5.5.7 |
| 418h | GPIOMIS | GPIO Masked Interrupt Status | Section 5.5.8 |
| 41Ch | GPIOICR | GPIO Interrupt Clear | Section 5.5.9 |
| - | GPIO_TRIG_EN(1) | GPIO Trigger Enable | Section 5.5.10 |
GPIODATA is shown in Figure 5-4 and described in Table 5-4.
The GPIODATA register is the data register. In software control mode, values written in the GPIODATA register are transferred onto the GPIO port pins if the respective pins have been configured as outputs through the GPIO Direction (GPIODIR) register.
The GPIODATA register has 256 aliased addresses from offset 0x000 to 0x3FF. A different address alias is used to directly read or write any combination of the 8 signal bits. This feature can help avoid time-consuming read-modify-writes and bit-masking operation for read-in software.
In this scheme, to write to GPIODATA, the corresponding bits in the mask, represented by the address bus bits [9:2], must be set. Otherwise, the bit values remain unchanged by the write.
Similarly, the values read from this register are determined for each bit by the mask bit derived from the alias address used to access the data register, bits [9:2]. Bits set in the address mask cause the corresponding bits in GPIODATA to be read, and bits that are clear in the address mask cause the corresponding bits in GPIODATA to be read as 0, regardless of their value.
A read from GPIODATA returns the last bit value written if the respective pins are configured as outputs, or it returns the value on the corresponding input pin when these are configured as inputs. All bits are cleared by a reset.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RESERVED | DATA | ||||||||||||||||||||||||||||||
| R-0h | R/W-0h | ||||||||||||||||||||||||||||||
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-8 | RESERVED | R | 0h | Software should not rely on the value of a reserved bit. To provide compatibility with future products, the value of a reserved bit should be preserved across a read-modify-write operation. |
| 7-0 | DATA | R/W | 0h | GPIO Data This register is virtually mapped to 256 locations in the address space. To facilitate the reading and writing of data to these registers by independent drivers, the data read from and written to the registers are masked by the eight address lines [9:2]. Reads from this register return its current state. Writes to this register only affect bits that are not masked by ADDR[9:2] and are configured as outputs. |
GPIODIR is shown in Figure 5-5 and described in Table 5-5.
The GPIODIR register is the data direction register. Setting a bit in the GPIODIR register configures the corresponding pin to be an output, while clearing a bit configures the corresponding pin to be an input. All bits are cleared by a reset, meaning all GPIO pins are inputs by default.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RESERVED | DIR | ||||||||||||||||||||||||||||||
| R-0h | R/W-0h | ||||||||||||||||||||||||||||||
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-8 | RESERVED | R | 0h | |
| 7-0 | DIR | R/W | 0h | GPIO Data Direction 0h = Corresponding pin is an input. 1h = Corresponding pins is an output. |
GPIOIS is shown in Figure 5-6 and described in Table 5-6.
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.
To prevent false interrupts, the following steps should be taken when reconfiguring GPIO edge and interrupt sense registers:
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RESERVED | IS | ||||||||||||||||||||||||||||||
| R-0h | R/W-0h | ||||||||||||||||||||||||||||||
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-8 | RESERVED | R | 0h | |
| 7-0 | IS | R/W | 0h | GPIO Interrupt Sense 0h = The edge on the corresponding pin is detected (edge-sensitive). 1h = The level on the corresponding pin is detected (level-sensitive). |
GPIOIBE is shown in Figure 5-7 and described in Table 5-7.
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.
To prevent false interrupts, the following steps should be taken when reconfiguring GPIO edge and interrupt sense registers:
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RESERVED | IBE | ||||||||||||||||||||||||||||||
| R-0h | R/W-0h | ||||||||||||||||||||||||||||||
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-8 | RESERVED | R | 0h | |
| 7-0 | IBE | R/W | 0h | GPIO Interrupt Both Edges 0h = Interrupt generation is controlled by the GPIO Interrupt Event (GPIOIEV) register. 1h = Both edges on the corresponding pin trigger an interrupt. |
GPIOIEV is shown in Figure 5-8 and described in Table 5-8.
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.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RESERVED | IEV | ||||||||||||||||||||||||||||||
| R-0h | R/W-0h | ||||||||||||||||||||||||||||||
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-8 | RESERVED | R | 0h | |
| 7-0 | IEV | R/W | 0h | GPIO Interrupt Event 0h = A falling edge or a Low level on the corresponding pin triggers an interrupt. 1h = A rising edge or a High level on the corresponding pin triggers an interrupt. |
GPIOIM is shown in Figure 5-9 and described in Table 5-9.
The GPIOIM register is the interrupt mask register. Setting a bit in the GPIOIM register allows interrupts 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.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RESERVED | IME | ||||||||||||||||||||||||||||||
| R-0h | R/W-0h | ||||||||||||||||||||||||||||||
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-8 | RESERVED | R | 0h | |
| 7-0 | IME | R/W | 0h | GPIO Interrupt Mask Enable 0h = The interrupt from the corresponding pin is masked. 1h = The interrupt from the corresponding pin is sent to the interrupt controller. |
GPIORIS is shown in Figure 5-10 and described in Table 5-10.
The GPIORIS register is the raw interrupt status register. A bit in this register is set when an interrupt condition occurs on the corresponding GPIO pin. If the corresponding bit in the GPIO Interrupt Mask (GPIOIM) register is set, the interrupt is sent to the interrupt controller. Bits read as 0 indicate that corresponding input pins have not initiated an interrupt. For a GPIO level-detect interrupt, the interrupt signal generating the interrupt must be held until serviced. Once the input signal deasserts from the interrupt generating logical sense, the corresponding RIS bit in the GPIORIS register clears. For a GPIO edge-detect interrupt, the RIS bit in the GPIORIS register is cleared by writing 1 to the corresponding bit in the GPIO Interrupt Clear (GPIOICR) register. The corresponding GPIOMIS bit reflects the masked value of the RIS bit.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RESERVED | RIS | ||||||||||||||||||||||||||||||
| R-0h | R-0h | ||||||||||||||||||||||||||||||
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-8 | RESERVED | R | 0h | |
| 7-0 | RIS | R | 0h | GPIO Interrupt Raw Status For edge-detect interrupts, this bit is cleared by writing a 1 to the corresponding bit in the GPIOICR register. For a GPIO level-detect interrupt, the bit is cleared when the level is deasserted. 0h = An interrupt condition has not occurred on the corresponding pin. 1h = An interrupt condition has occurred on the corresponding pin. |
GPIOMIS is shown in Figure 5-11 and described in Table 5-11.
The GPIOMIS register is the masked interrupt status register. If a bit is set in this register, the corresponding interrupt has triggered an interrupt to the interrupt controller. If a bit is clear, either no interrupt has been generated, or the interrupt is masked.
GPIOMIS is the state of the interrupt after masking.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RESERVED | MIS | ||||||||||||||||||||||||||||||
| R-0h | R-0h | ||||||||||||||||||||||||||||||
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-8 | RESERVED | R | 0h | |
| 7-0 | MIS | R | 0h | GPIO Masked Interrupt Status For edge-detect interrupts, this bit is cleared by writing a 1 to the corresponding bit in the GPIOICR register. For a GPIO level-detect interrupt, the bit is cleared when the level is deasserted. 0h = An interrupt condition on the corresponding pin is masked or has not occurred. 1h = An interrupt condition on the corresponding pin has triggered an interrupt to the interrupt controller. |
GPIOICR is shown in Figure 5-12 and described in Table 5-12.
The GPIOICR register is the interrupt clear register. For edge-detect interrupts, writing 1 to the IC bit in the GPIOICR register clears the corresponding bit in the GPIORIS and GPIOMIS registers. If the interrupt is a level-detect, the IC bit in this register has no effect. In addition, writing 0 to any of the bits in the GPIOICR register has no effect.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RESERVED | IC | ||||||||||||||||||||||||||||||
| R-0h | W1C-0h | ||||||||||||||||||||||||||||||
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-8 | RESERVED | R | 0h | |
| 7-0 | IC | W1C | 0h | GPIO Interrupt Clear 0h = The corresponding interrupt is unaffected. 1h = The corresponding interrupt is cleared. |
Register Outside GPIO Module: GPIO Trigger Enable (GPIO_TRIG_EN): This register configures a GPIO pin as a source for the DMA trigger. Setting a bit in the GPIO_TRIG_EN register allows to trigger DMA upon any pin toggle correspond that GPIO module.
Physical Address: 0x400F 70C8
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RESERVED | TRIG | ||||||||||||||||||||||||||||||
| R-0h | R/W-0h | ||||||||||||||||||||||||||||||
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-4 | RESERVED | R | 0h | |
| 3-0 | TRIG | R/W | 0h | GPIO DMA Trigger Enable Bit 0: when 1, enable GPIO0 trigger. This bit enables trigger for all GPIO0 pins (GPIO0 to GPIO7). Bit 1: when 1, enable GPIO1 trigger. This bit enables trigger for all GPIO1 pins (GPIO8 to GPIO15). Bit 2: when 1, enable GPIO2 trigger. This bit enables trigger for all GPIO2 pins (GPIO16 to GPIO23). Bit 3: when 1, enable GPIO3 trigger. This bit enables trigger for all GPIO3 pins (GPIO24 to GPIO31). |
| GPIO Module Instance | GPIO Bit | GPIO Number |
|---|---|---|
| GPIOA0 | 0 | GPIO_00 (PM/Dig Mux) |
| GPIOA0 | 1 | GPIO_01 |
| GPIOA0 | 2 | GPIO_02 (Dig/ADC Mux) |
| GPIOA0 | 3 | GPIO_03 (Dig/ADC Mux) |
| GPIOA0 | 4 | GPIO_04 (Dig/ADC Mux) |
| GPIOA0 | 5 | GPIO_05 (Dig/ADC Mux) |
| GPIOA0 | 6 | GPIO_06 |
| GPIOA0 | 7 | GPIO_07 |
| GPIOA1 | 0 | GPIO_08 |
| GPIOA1 | 1 | GPIO_09 |
| GPIOA1 | 2 | GPIO_10 |
| GPIOA1 | 3 | GPIO_11 |
| GPIOA1 | 4 | GPIO_12 |
| GPIOA1 | 5 | GPIO_13 |
| GPIOA1 | 6 | GPIO_14 |
| GPIOA1 | 7 | GPIO_15 |
| GPIOA2 | 0 | GPIO_16 |
| GPIOA2 | 1 | GPIO_17 |
| GPIOA2 | 2 | GPIO_18 (reserved) |
| GPIOA2 | 3 | GPIO_19 (reserved) |
| GPIOA2 | 4 | GPIO_20 (reserved) |
| GPIOA2 | 5 | GPIO_21 (reserved) |
| GPIOA2 | 6 | GPIO_22 |
| GPIOA2 | 7 | GPIO_23 |
| GPIOA3 | 0 | GPIO_24 |
| GPIOA3 | 1 | GPIO_25 |
| GPIOA3 | 2 | GPIO_26 (Restricted use; Antenna Selection 1 only) |
| GPIOA3 | 3 | GPIO_27 (Restricted use; Antenna Selection 2 only) |
| GPIOA3 | 4 | GPIO_28 |
| GPIOA3 | 5 | GPIO_29 |
| GPIOA3 | 6 | GPIO_30 (PM/Dig Mux) |
| GPIOA3 | 7 | GPIO_31 (PM/Dig Mux) |
| GPIOA4 | 0 | GPIO_32 |