ADLINK PCI-8164 User Manual

Page 156

Advertising
background image

144

Operation Theory

8164 Interrupt Service Routine (ISR) with DOS

A DOS function library is included with the card for developing
applications under DOS environment. This library also includes
a few functions to work with the ISR. It is highly recommended
that programs be written according to the following example for
applications working with the ISR. Since the PCI bus has the
ability to do IRQ sharing when multiple cards are installed,
each card must have a corresponding ISR. The library pro-
vided have the names of the ISR fixed, for example:
_8164_isr0(void), _8164_isr1(void)…etc. A sample program is
described below. It assumes that two cards are present in the
system, axes 1 and 5 are requested to work with the ISR:

// header file declare
#include“pci_8164.h”

void main(void) {
I16 TotalCard,i; // Initialize cards
_8164_initial(&TotalCard);
if( TotalCard == 0 ) exit(1);

_8164_set_int_factor(0,0x1);// Set int factor
_8164_int_control(0,1);// enable int service

:

:

// Insert User’s Code in Main

:

//

_8164_int_control(0,0);// disable int
service


_8164_close();// Close PCI-8164

}

void interrupt _8164_isr0(void)
{
U16 irq_status;// Declaration
U16 int_type;

I16 i;

U32 i_int_status1[4],i_int_status2[4];


disable();

// Stop all int service

Advertising