Port_Datadir; Port_Datadirbit - Conrad C-Control Pro Mega Series Manual

Table of Contents

Advertisement

171
C-Control Pro Mega Series

6.14.1 Port_DataDir

Port Functions
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
corresponding to the bit position is switched to output. Example: Is port = PortB and val = 0x02, then
PortB.1 is configured for output, all other ports on PortB are set to input (
and M128).
Parameter
port port number (see table)
val output byte
port number table
Definition
PortA
PortB
PortC
PortD
PortE (Mega128)
PortF (Mega128)
PortG (Mega128)

6.14.2 Port_DataDirBit

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 (
Example
Value
0
1
2
3
4
5
6
of
see Pin Assignment
of
M32
see Pin Assignment
© 2008 Conrad Electronic
M32

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the C-Control Pro Mega Series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

C-control pro mega32C-control pro mega128

Table of Contents