HP 9000 Series 300 Tutorials Manual page 58

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

Advertisement

The following example illustrates how an interrupt handler can be set up to
handle requests on the HP--IB service request lin.e (SRQ):
#include <dvio.h>
#include <fcntl.h>
#include <stdio.h>
extern int service_routine () ;
handler (eid,. cause_vec)
int eid;
struct interrupt_struct *cause_vec;
{
if (cause_ vec->cause
==
SRQ)
service_routine 0;
/*
application-specific service routine*/
}
maine)
{
}
iIit eid;
struct interrupt_struct cause_vec;
if «eid
=
open(ll/dev/raw_hpib
ll
,
O_RDWR»
==
-1) {
printf(lIopen failed, errno
==
%d\n
ll
,
errno);
exit(2);
}
io_reset(eid);
cause_vec.cause
=
SRQ;
io_on_intertupt(eid, &cause_vec, handler);
2-30
General-Purpose Routines

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 9000 series 800

Table of Contents