Omega OME-PIO-D144 Hardware Manual page 46

Pci-bus digital i/o board
Table of Contents

Advertisement

for (;;)
{
printf("\n(CNT_L, CNT_H) = (%d,%d) (%d,%d) (%d,%d) (%d,%d) %x",
CNT_L1,CNT_H1,CNT_L2,CNT_H2,CNT_L3,CNT_H3,CNT_L4,CNT_H4,
int_num);
if (kbhit()!=0) {getch(); break;}
}
outp(wBase+5,0);
PIO_DriverClose();
}
/* ------------------------------------------------------------ */
/* Use PC0 as external interrupt signal
WORD init_low()
{
DWORD dwVal;
disable();
outp(wBase+5,0);
if (wIrq<8)
{
irqmask=inp(A1_8259+1);
outp(A1_8259+1,irqmask & (0xff ^ (1 << wIrq)));
setvect(wIrq+8, irq_service);
}
else
{
irqmask=inp(A1_8259+1);
outp(A1_8259+1,irqmask & 0xfb);
outp(A1_8259+1,irqmask & (0xff ^ (1 << wIrq)));
irqmask=inp(A2_8259+1);
outp(A2_8259+1,irqmask & (0xff ^ (1 << (wIrq-8))));
setvect(wIrq-8+0x70, irq_service);
}
invert=0x05;
outp(wBase+0x2a,invert);
now_int_state=0x0a;
CNT_L1=CNT_L2=CNT_L3=CNT_L4=0;
CNT_H1=CNT_H2=CNT_H3=CNT_H4=0;
int_num=0;
outp(wBase+5,0x0f);
enable();
}
void interrupt irq_service()
{
char cc;
int_num++;
new_int_state=inp(wBase+0x07)&0xff;
int_c=new_int_state ^ now_int_state;
OME-PIO-D144 User's Manual (Ver.2.1, Sep/2001)
/* disable all interrupt */
/* disable all interrupt */
/*
/*
CN1_PC1 =
/*
CN1_PC2 = non-inverte input */
/*
CN1_PC3 = non-inverte input */
/* Now CN1_PC0 = low
/*
CN1_PC1 = high
/*
CN1_PC2 = low
/*
CN1_PC3 = high
/* enable interrupt PC0,PC1,PC2,PC3 of CN1 */
CN1_PC0 = non-inverte input */
inverte input */
*/
*/
*/
/* low pulse count
/* high pulse count */
/* IRQ2 */
*/
*/
*/
---- 44

Advertisement

Table of Contents
loading

Table of Contents