Register | Description |
---|---|
PORTx.PINCONFIG | PINnCTRL (ISC, PULLUPEN, INLVL and INVEN) setting to prepare simultaneous configuration of multiple PINnCTRL registers |
PORTx.PINCTRLUPD | Writing a ‘1 ’ to bit n in
the PINCTRLUPD register will copy the PINCONFIG
register content to the PINnCTRL register |
PORTx.PINCTRLSET(1) | Writing a ‘1 ’ to bit n in
the PINCTRLSET register will set the individual
bits in the PINnCTRL register, according to the
bits set to ‘1 ’ in the PINCONFIG
register |
PORTx.PINCTRLCLR(2) | Writing a ‘1 ’ to bit n in
the PINCTRLCLR register will clear the individual
bits in the PINnCTRL register, according to the
bits set to ‘1 ’ in the PINCONFIG
register |
The following code snippet demonstrates how to configure multiple PINnCTRL registers of several ports. Note that, because the PINCONFIG register is mirrored across all the ports, it is enough to only write it once, for PORT A, in this example.
PORTA.PINCONFIG = PORT_ISC_INPUT_DISABLE_gc; /* The setting to load to the PINnCTRL registers */ PORTA.PINCTRLUPD = 0xff; PORTB.PINCTRLUPD = 0xff; PORTC.PINCTRLUPD = 0xff; PORTD.PINCTRLUPD = 0xff; PORTE.PINCTRLUPD = 0xff;