3.3.2.6 Switchable GPIO Direction Setting

int IndoorTouch.GPIOSetDirection(int pin, int direction);

Sets the direction of the switchable GPIO PIN. Pin is the PIN index, refer to 3.3.2.1 GPIO Pin Reading. This switch is valid until the next ICU restart or reconfiguration. The state is not stored in the configuration.

Direction is one of the values:

  • IndoorTouch.GPIO_DIRECTION_IN = 1;
  • IndoorTouch.GPIO_DIRECTION_OUT = 2;

The return value is as follows:

  • IndoorTouch.RC_OK = 0;
  • IndoorTouch.RC_ERR_CONN = -1; API daemon connection error
  • IndoorTouch.RC_ERR_SYS = -6; system error (the value cannot be set, etc.)
  • IndoorTouch.RC_ERR_DENIED = -7; GPIO does not exist or is unswitchable