SetDirectionBit Method

void SetDirectionBit(int port, int bit, int direction)
void SetDirectionBit(int port, int bit, bool direction)

Summary

This overloaded 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.

Parameters

  • port - The port number (0-5).

  • bit - Which bit within the port to alter (0-7).

  • direction - Make the bit an input (0 or false) or an output (1 or true).

Return Value

This method does not return a value.

Remarks

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 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.

See Also

GetDirection Method, GetDirectionBit Method, SetDirection Method