
2N TELEKOMUNIKACE a.s., www.2n.cz
15/42
3.3.2.5 Switchable GPIO Direction Getting
int
IndoorTouch.GPIOGetDirection(
int
pin);
Pin is the PIN index, refer to
. GPIO_PIN_IO1 and
GPIO_PIN_IO2 can be I/O switched. This command helps you get the currently set
direction. GPIO_DIRECTION_IN is set by default.
The return value is as follows:
IndoorTouch.GPIO_DIRECTION_IN = 1;
IndoorTouch.GPIO_DIRECTION_OUT = 2;
IndoorTouch.RC_ERR_CONN = -1; API daemon connection error
IndoorTouch.RC_ERR_SYS = -6; system error (the value cannot be read, etc.)
IndoorTouch.RC_ERR_DENIED = -7; GPIO does not exist or is unswitchable
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
. 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