User`s manual

BL4S100 Users Manual 49
4.4.2 Digital I/O
setDigIn
int setDigIn(int channel);
FUNCTION DESCRIPTION
Sets an input channel to be a general digital input.
PARAMETERS
channel digital input channel, 0–11 (pins IN0–IN11)
RETURN VALUE
0 — success.
-EINVAL — invalid parameter value.
SEE ALSO
brdInit, digIn, digInBank
digIn
int digIn(int channel);
FUNCTION DESCRIPTION
Reads the state of a digital input channel.
PARAMETERS
channel digital input channel, 0–11 (pins IN0–IN11)
RETURN VALUE
The logic state of the specified channel.
0 — logic low
1 — logic high
-EINVAL — channel value is out of range.
-EPERM:— channel functionality does not permit this operation.
SEE ALSO
brdInit, setDigIn, digInBank