Datasheet

136
XMEGA B [DATASHEET]
8291B–AVR–01/2013
12.12 Register Descriptions – Ports
12.12.1 DIR – Data Direction register
Bit 7:0 – DIR[7:0]: Data Direction
This register sets the data direction for the individual pins of the port. If DIRn is written to one, pin n is configured as an
output pin. If DIRn is written to zero, pin n is configured as an input pin.
12.12.2 DIRSET – Data Direction Set Register
Bit 7:0 – DIRSET[7:0]: Port Data Direction Set
This register can be used instead of a read-modify-write to set individual pins as output. Writing a one to a bit will set the
corresponding bit in the DIR register. Reading this register will return the value of the DIR register.
12.12.3 DIRCLR – Data Direction Clear register
Bit 7:0 – DIRCLR[7:0]: Port Data Direction Clear
This register can be used instead of a read-modify-write to set individual pins as input. Writing a one to a bit will clear the
corresponding bit in the DIR register. Reading this register will return the value of the DIR register.
Bit 76543210
+0x00 DIR[7:0]
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value 00000000
Bit 76543210
+0x01 DIRSET[7:0]
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value 0 0000000
Bit 76543210
+0x02 DIRCLR[7:0]
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value 0 0 0 0 0 0 0 0