STMPE1600 GPIO controller
Doc ID 16938 Rev 3 17/27
8 GPIO controller
A total of 16 GPIOs are available in the STMPE1600 port expander IC. The GPIO controller
contains the registers that allow the host system to configure each of the pins into either a
GPIO (input or output), or into one of the alternate functions. Unused GPIOs should be
configured as outputs to minimize the power consumption.
A group of registers are used to control the exact function of each of the 16 GPIOs. The
registers and their respective address are listed in the following table.
Note: Once the last register address 0x16-0x17 location is accessed, the locations of 0x18 to
0xFF are reserved. After 0xFF location, the pointer rolls over to the 0x00 register address
location.
All GPIO registers are named as GPxx, where:
xx represents the functional group.
The function of each bit is shown in the following table:
On power-up reset, all GPIOs are set as input.
Table 8. GPIO controller registers
Address Register name Description
Auto-increment
(during sequential
R/W)
0x10 GPMR
GPIO monitor pin state
register
Ye s
0x12 GPSR
GPIO set pin state
register
Ye s
0x14 GPDR
GPIO set pin direction
register
Ye s
0x16 GPPIR
GPIO polarity inversion
register
Ye s
1514131211109876543 2 1 0
IO-15 IO-14 IO-13 IO-12 IO-11 IO-10 IO-9 IO-8 IO-7 IO-6 IO-5 IO-4 IO-3 IO-2 IO-1 IO-0
Table 9. GPIO bit function
Register name Function
GPIO monitor pin state Reading this bit yields the current state of the bit. Writing has no effect.
GPIO set pin state
Writing ‘1’ to this bit causes the corresponding GPIO to go to ‘1’ state.
Writing ‘0’ to this bit causes the corresponding GPIO to go to ‘0’ state.
GPIO set pin direction
‘0’ sets the corresponding GPIO to input state, and ‘1’ sets it to output
state. All bits are ‘0’ on reset.
GPIO polarity inversion
Writing a ‘1’ enables polarity inversion on the Input Port.
Writing a ‘0’, the input port polarity is retained. The reset value is 0.