ICP DAS USA PIO-D144 User Manual page 41

Hide thumbs Also See for PIO-D144:
Table of Contents

Advertisement

ГК Атлант Инжиниринг – официальный представитель в РФ и СНГ
+7(495)109-02-08 sales@bbrc.ru www.bbrc.ru
outp(wBase+5,0);
PIO_DriverClose();
}
/* ------------------------------------------------------------ */
/* Use PC0 as external interrupt signal
WORD init_high()
{
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);
}
outp(wBase+5,1);
now_int_state=1;
outp(wBase+0x2a,1);
enable();
}
void interrupt irq_service()
{
if (now_int_state==0)
{
outp(wBase+0x2a,1);
now_int_state=1;
}
else
{
COUNT++;
outp(wBase+0x2a,0);
now_int_state=0;
}
if (wIrq>=8) outp(A2_8259,0x20);
outp(A1_8259,0x20);
}
Refer to Sec. 2.5.2 for more information.
/* disable all interrupt */
/* disable all interrupt */
/* enable interrupt
/* now int_signal is low
/* select the inverte input */
/* find a high_pulse here
/* select the inverte input */
/* now int_signal is High
/* find a low_pulse
/* select the non-inverte input */
/* now int_signal is High
Version: 2.1
Date: 1999/10
PIO-D144 User's Manual
*/
/* IRQ2 */
*/
*/
*/
*/
*/
*/
Page 41

Advertisement

Table of Contents
loading

Table of Contents