HP 9000 Series 300 Tutorials Manual page 46

Device i/o and user interfacing hp-ux concepts and tutorials
Hide thumbs Also See for HP 9000 Series 300:
Table of Contents

Advertisement

Assuming that the open device file has the entity identifier eid,
io_width_ctl
is called using a code segment similar to the following:
int
eid. width;
where width is the number of parallel bits in the new data path. The
io_width_ctl
returns
-1
to indicate an error if the specified width is not
supported on the interface identified by eid.
For example, to reconfigure a GPIO device to use all 16 data lines in the
interface cable instead of the default lower 8 bits, use a a code segment similar
to the following:
#include <fcntl.h>
#include <errno.h>
maine)
{
}
int
eid. width;
width
=
16;
/*width of new data path */
if
((eid
=
open("/dev/raw_hpib". O_RDWR»
==
-1) {
printf(IIopen failed. errno
=
%d\n". errno);
exit(2) ;
}
io_width_ctl(eid. width); /*assign new width for GPIO bus*/
/*data transfers using "/dev/raw_gpio" will now
use a 16-bit bus*/
Use of
io_width_ctl
to change interface data path width affects only the
device associated with that particular eid. Use
io_reset
or
io_width_ctl
to
restore the default 8-bit path width. On a Series 800 system,
io_width_ctl
affects all users of the interface referred to by eid.
2-18
General-Purpose Routines

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 9000 series 800

Table of Contents