153
8331B–AVR–03/12
Atmel AVR XMEGA AU
13.13 Register Descriptions – Ports
13.13.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.
13.13.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.
13.13.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.
13.13.4
DIRTGL – Data Direction Toggle register
Bit
7
6
5
4
3
2
1
0
DIR[7:0]
DIR
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
Bit
7
6
5
4
3
2
1
0
DIRSET[7:0]
DIRSET
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
Bit
7
6
5
4
3
2
1
0
DIRCLR[7:0]
DIRCLR
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
Bit
7
6
5
4
3
2
1
0
DIRTGL[7:0]
DIRTGL
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