Instructions
303 C-Control Pro IDE
© 2013 Conrad Electronic
set PullDown
PORT_ATTR_PULL_DOWN
08
minimum Drive Strength
PORT_ATTR_DRIVE_MIN
00
normal Drive Strength
PORT_ATTR_DRIVE_LOW
10
high Drive Strength
PORT_ATTR_DRIVE_HIGH
20
maximum Drive Strength
PORT_ATTR_DRIVE_MAX
30
To obtain more accurate values ??of the drive strength of a port please refer to the chapter "Elec-
trical Characteristics" in the Atmel AT32UC3C datasheet.
5.18.2 Port_DataDir (Mega)
Port Functions Example
Syntax
void Port_DataDir(byte port, byte val);
Sub Port_DataDir(port As Byte, val As Byte)
Description
The function Port_DataDir configures the port for input or output direction. Is a bit set, then the Pin corres-
ponding to the bit position is switched to output. Example: Is port = PortB and val = 02, then PortB.1 is
configured for output, all other ports on PortB are set to input (see Pin Assignment of M32 and
M128).
Parameter
port port number (see Port Table)
val output byte
5.18.3 Port_DataDirBit (Mega)
Port Functions
Syntax
void Port_DataDirBit(byte portbit, byte val);
Sub Port_DataDirBit(portbit As Byte, val As Byte)
Description
The function Port_DataDirBit configures one bit (Pin) of a port for input or output direction. Is a bit set, then
the Pin corresponding to the bit position is switched to output. Example: Is portbit = 10 and val = 0, then
PortB.2 is configured for input. All other ports on PortB stay the same (see Pin Assignment of M32
and M128.).
Please use the function Port_Attribute instead of Port_DataDirBit for the AVR32Bit. The AVR32
MCU provides advanced options such as pull-down or adjust the drive strength.