This is an old revision of the document!
AVR32 UC3A controlling GPIO
For the UC3A0512, read the pin value register and then write to the output value register.
// Set the output value of PORT0 \\ AVR32_GPIO.port[ 0 ].ovrs = value ; \\
//Clear the output value of PORT0 \\ AVR32_GPIO.port[ 0 ].ovrc = value ;\\
//Read the port pins \\ value = AVR32_GPIO.port[ 0 ].pvr ; \\
You can also use the .ovr function:
Example PORT0 has the value 0xAAFF55FF
AVR32_GPOI.port[0].ovr = 0x55AAFFBB;\\
then all the bits will change, because if you use the ovrs or ovrc you can only change set or clear.
Look at the user manual page 44 you will find the PORTA, PORTB, PORTC and PORTX to GPIO mapping.
These GPIOs are divided in 32 bit ports or registers. This division is called as PORT0, PORT1, and so forth. While selecting any pin functionality, one has to modify the PORT0, PORT1, etc registers. The registers related to these ports are GPER, PMR0, PMR1 etc.
To select a particular pin as gpio, for example PORTB.0. Goto to page 44, the GPIO mapping is 32. Hence, it is PORT1.0. So, set the LSB of PORT1 GPER register.
On page 174 you will find the PORT0, PORT1, etc offsets from the base address. Section 22.5 from the user manual explains it all.