[comp.sys.hp] HP gpio info requested

jlhamilt@phoenix.PRINCETON.EDU (Jennifer Lynn Hamilton) (04/16/87)

Keywords:





My thesis advisor and I are hoping that someone in Netland can help with
the following problem:

Hewlett-Packard gave the school lots of neat UNIX boxes, but seem to
have neglected to give us any useful documentation.  (Useful = "explains
what I need to know now.")  I am trying to interface a robot to an 
HP 9000 series 300 computer via a GPIO board, using a C program.  HP
documentation mentions several C routines that look useful, such as
"gpio_set_ctl ()".  The problem is, no info is given on where the source
code for this routine is.  An older document stated that such code was
in the dvio library, but that isn't the case (now).

Any info would be greatly appreciated, and would earn you a footnote &
undying gratitude.

		-Jeni Hamilton

rocky@hpfcms.HP.COM ( Rocky Craig ) (04/20/87)

> HP documentation mentions several C routines that look useful, such as
> "gpio_set_ctl ()".  The problem is, no info is given on where the source
> code for this routine is.  An older document stated that such code was
> in the dvio library, but that isn't the case (now).

The routines to which you refer are documented in the "HP-UX Concepts and
Tutorials (Volume 4): Device I/O and User Interfacing" manual.  The routines
form the "Device I/O Library" (DIL) which is an HP-UX extension to allow
device (peripheral) I/O.  Individual manual pages are found in section 3 
( gpio_set_ctl(3I) ).  No source code is provided; there is an include
file and a library (written in C).  I'm speaking in reference to Series 300,
Revision 5.2 (current).  DIL also exists on the Series 500 and 800.

Each GPIO card needs a character special file.  The driver is "gpio", major 
number 22; only the select code is valid in the minor number.  This information
can be found in the Configuration Reference Manual section for the 98622A.

The device can be accessed via open(2), close(2), read(2) and write(2) for
simple data transfer.  The DIL routines all require the file descriptor
returned from an open(2).

I have actually gotten things to work fairly easily.  The biggest chance for
problems is with the hardware: incompatible polarity settings on PCTL/PFLG,
etc.  Many people use  HP's BASIC Workstation (much more friendly and I/O-
oriented) to verify correct hardware operation before tackling the HP-UX 
implementation.  One easy gotcha: The BASIC driver will ignore PSTS by 
default, whereas the HP-UX driver won't.  The result: your BASIC code works,
but HP-UX may claim the card/peripheral is dead.

> Any info would be greatly appreciated, and would earn you a footnote &
> undying gratitude.

Good; I would hate to have "dying ungratitude" on my HP conscience :-)

Rocky Craig
Hewlett-Packard, Systems Software Operation
...hplabs!hpfcla!rocky