Reading STIO and STI1
The call to gpio_get_status has the following form:
int
eid, value;
value
=
gpio_get_status(eid);
where
eid
is the entity identifier for an open GPIO interface file.
gpio_get_status returns an integer whose least significant two bits are the
values of STIO and STIl.
Like CTLO and CTL1, STIO and STI1 are ground-true logic meaning
they are at a logic LOW level when asserted. Thus the
value
returned by
gpio_get_status is as follows (be sure to AND value with 3 to clear upper
bits before testing):
• If value =0: STIO and STI1 both false (HIGH logic level)
• If value =1: STIO true (LOW logic level) and STI1 false (HIGH logic
level)
• If value =2: STIO false (HIGH logic level) and STI1 true (LOW logic
level)
• If value =3: STIO and STI1 both true (LOW logic level)
4-6
Controlling the GPIO Interface