2N TELEKOMUNIKACE a.s., www.2n.cz
13/42
3.3.2 GPIO
3.3.2.5 Switchable GPIO Direction Getting
3.3.2.6 Switchable GPIO Direction Setting
3.3.2.7 Active Low Pin Value Setting
3.3.2.8 GPIO Input Value Change Detection
3.3.2.1 GPIO Pin Reading
int
IndoorTouch.GPIOGet(
int
pin);
Reads the current GPIO register value. Pin is one of the options:
IndoorTouch.GPIO_PIN_IN1 = 0x01;
IndoorTouch.GPIO_PIN_IN2 = 0x02;
IndoorTouch.GPIO_PIN_OUT1 = 0x04;
IndoorTouch.GPIO_PIN_OUT2 = 0x08;
IndoorTouch.GPIO_PIN_IO1 = 0x10;
IndoorTouch.GPIO_PIN_IO2 = 0x20;
IndoorTouch.GPIO_PIN_RELAY1 = 0x40;
IndoorTouch.GPIO_PIN_RELAY2 = 0x80;
The return value is {0,1} or
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; system error (GPIO does not exist)
3.3.2.2 GPIO Pin Setting
int
IndoorTouch.GPIOSet(
int
pin,
int
value);
Pin is the PIN index, refer to
, and value is {0,1}.
The return value is as follows: