NXP Semiconductors
UM191812
PN544 C2 User Manual
191812 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2010. All rights reserved.
User Manual Rev. 1.2 — 2010-06-16 143 of 172
9.17.3.3 Input configuration
To config
ure permanently GPIO5 in input
• Set 0x9893 GPIO_Config_PDIR bit 5 to 0.
• Set 0x9899 GPIO_Config_PEN bit 5 to 1.
• The value is stored in EEPROM; it will be loaded at next power up of the IC.
• In order not to change the other GPIO configuration, it is advised to first read the
GPIO_Config_PDIR and GPIO_Config_PEN bytes, to apply then new values which
change only the desired bit.
To configure temporarily GPIO5 in input
• Set 0xF821 PDIR bit 5 to 0. It writes directly into the hardware register.
• Set 0xF829 PEN bit 5 to 1. It writes directly into the hardware register
• In order not to change the other GPIO configuration, it is advised to first read the
PDIR and PEN bytes, to apply then new values which change only the desired bit.
9.17.3.4 Read an input pin (write is not possible)
To rea
d an input pin value, e.g. GPIO5 considered configured in input
• Read 0xF82A PIN. GPIO5 value is bit 5 of the register.
9.17.3.5 Connect internal Pull up or pull down to the GPIO
To con
nect permanently a pull up to e.g GPIO5 (the configuration will be kept even after
a reset)
• Set 0x9894 GPIO_Config_UPUD bit 5 to 1.
To connect temporarily a pull up to e.g GPIO5 (the configuration will be lost after a reset)
• Set 0xF823 UPUD bit 5 to 1.
To connect permanently a pull down to e.g GPIO5 (the configuration will be kept even
after a reset)
• Set 0x9895 GPIO_Config_ DPUD bit 5 to 1.
To connect temporarily a pull down to e.g GPIO5 (the configuration will be lost after a
reset)
• Set 0xF822 DPUD bit 5 to 1.
9.17.3.6 Inverse polarity
To inverse te
mporarily the polarity of a GPIO port, the corresponding bit to 1 in 0xF820
PINV register.