Public Sub SetDirectionBit(ByVal port As Long, ByVal bit As Long, ByVal direction As Long)
This method alters a single bit of a port's direction register without affecting the value of any other bits. See the SetDirection Method for further description of the direction register.
port - The port number (0-5).
bit - Which bit within the port to alter (0-7).
direction - Make the bit an input (0) or an output (1).
This method alters the specified direction register bit in a single operation directly on the ETH32 device. In other words, it does NOT read the current value over the network, modify it and then write it back. By doing it in a single operation, this avoids the potential of inadvertently overwriting changes made to other bits within the port by other connections.
Port 3 shares its pins with the analog channels. When the ADC is enabled, all pins of port 3 are forced into input mode. The direction register of port 3 cannot be modified while the ADC is enabled.