int eth32_set_direction_bit(eth32 handle, int port, int bit, int direction);
This function alters a single bit of a port's direction register without affecting the value of any other bits. See the eth32_set_direction function for further description of the direction register.
handle - The value returned by the eth32_open function.
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 function returns zero on success and a negative error code on failure. Please see the Error Codes section for possible error codes.
This function 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 put into analog mode. The direction register of port 3 cannot be modified while the ADC is enabled.