User’s Manual
51
5.2.8.1 Digital I/O
zb_dio_in
int zb_dio_in(int dio);
DESCRIPTION
Reads the logic state of a pin configured as a digital input pin. This value corresponds to the
dio
number.
PARAMETERS
dio
the Dynamic C digital input pin number (0 –
ZB_MAX_PIN
, valid values
are 0–5, 10–12) set up in
zb_io_init()
.
NOTE:
The pin number is not the same as the
DIO_xx
macros described in
zb_io_init()
,
which are used to configure the function of the pin only.
RETURN VALUE
0 or 1 — logic state.
–EINVAL
— error (pin not configured as a digital input).
zb_dio_out
int zb_dio_out(int dio, int value);
DESCRIPTION
Sets the digital output value.
PARAMETERS
dio
the Dynamic C digital output pin number (0 –
ZB_MAX_PIN
, valid values
are 0–5, 10–12) set up in
zb_io_init()
.
value
the logic level (0 or 1) the pin is set to.
NOTE:
The pin number is not the same as the
DIO_xx
macros described in
zb_io_init()
,
which are used to configure the function of the pin only.
RETURN VALUE
0 — success.
–EINVAL
— error (pin not configured as a digital output).