HPlogo HP-UX Reference Volume 4 of 5 > g

gpio_get_status(3I)

Series 800 Only
» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

gpio_get_status — return status lines of GPIO card

SYNOPSIS

#include <dvio.h>

int gpio_get_status(int eid);

DESCRIPTION

gpio_get_status() reads the status register of the GPIO interface associated with the device file identified by eid. eid is an entity identifier of an open GPIO device file obtained from an open(), dup(), fcntl(), or creat() call (see open(2), dup(2), fcntl(2), or creat(2)). The current state of each status line on the interface card is mapped to the value returned, with STS0 mapped to the least significant bit. Only x least-significant bits are used, where x is the number of status lines available on the hardware interface being used.

DEPENDENCIES

Series 800

For the HP27114A, x is 2.

For the HP27114B, x is 6.

For the HP28651A, x is 5.

RETURN VALUE

gpio_get_status() returns the value of the status register of the GPIO interface associated with eid, and -1 if an error was encountered.

ERRORS

gpio_get_status() fails if any of the following conditions are encountered and sets errno accordingly:

[EBADF]

eid does not refer to an open file.

[ENOTTY]

eid does not refer to a GPIO device file.

© Hewlett-Packard Development Company, L.P.