27.4.3.1 Read-Modify-Write Pin Configuration

The Data Direction (DIR) and Data Output Value (OUT) registers each have three helper registers: Clear, Set and Toggle. These helper registers allow the user to update one or more I/O pins by performing a hardware Read-Modify-Write (RMW) operation on the register.

Writing a ‘1’ to one or more bits in the Data Direction Clear (DIRCLR), Data Direction Set (DIRSET), and Data Direction Toggle (DIRTGL) registers will respectively clear, set or toggle the corresponding bit(s) in the DIR register.

Similarly, writing a ‘1’ to one or more bits in the Data Output Value Clear (OUTCLR), Data Output Value Set (OUTSET), and Data Output Value Toggle (OUTTGL) registers will respectively clear, set or toggle the corresponding bit(s) in the OUT register.

Reading from the helper registers will return the value from the corresponding DIR or OUT register.