
PIO-D144 User’s Manual
Version: 2.1 Date: 1999/10 Page 9
Example 2: assume initial level=High, PC0 is used as interrupt source:
Refer to DEMO4.C for source code.
Initial=High
Iniaial_sub()
{ now_int_state=1
_outpd(wBase+0x2a,1)
/*(select the inverted signal)*/
Inverted=Low
ISR_sub()
{
If (now_int_state==0) /* old state=low
!
change to high now */
{
now_int_state=1; /* now int_signal is High */
/*** application codes are given here ***/
_outpd(wBase+0x2a,1); /* select the inverted signal */
}
else /* old state=high
!
change to low now */
{
now_int_state=0; /* now int_signal is Low */
/*** application codes are given here ***/
_outpd(wBase+0x2a,0);
/* select the non-inverted signal */
}
if (wIrq>=8) outp(A2_8259,0x20);
/* EOI */
outp(A1_8259,0x20);
/* EOI */
}
ГК
Атлант
Инжиниринг
–
официальный
представитель
в
РФ
и
СНГ
+7(495)109-02-08 [email protected] www.bbrc.ru