16.3.2.3 Pin Configuration
The Pin n Control (PORTx.PINnCTRL) register is used to configure inverted I/O, pull-up, and input sensing of a pin. The control register for pin n is at the byte address .
All input and output on the respective pin n can be inverted by writing a
‘1
’ to the Inverted I/O Enable (INVEN) bit in PORTx.PINnCTRL. When
INVEN is ‘1
’, the PORTx.IN/OUT/OUTSET/OUTTGL registers will have an
inverted operation for this pin.
Toggling the INVEN bit causes an edge on the pin, which can be detected by all peripherals using this pin, and is seen by interrupts or events if enabled.
The input pull-up of pin n is enabled by writing a ‘1
’ to the
Pull-up Enable (PULLUPEN) bit in PORTx.PINnCTRL. The pull-up is disconnected when the pin
is configured as an output, even if PULLUPEN is ‘1
’.
Pin interrupts can be enabled for pin n by writing to the Input/Sense Configuration (ISC) bit field in PORTx.PINnCTRL. Refer to Interrupts for further details.
The digital input buffer for pin n can be disabled by writing the INPUT_DISABLE setting to ISC. This can reduce power consumption and may reduce noise if the pin is used as analog input. While configured to INPUT_DISABLE, bit n in PORTx.IN will not change since the input synchronizer is disabled.