Omega Vehicle Security OME-PIO-D56 manual Read all interrupt state

Page 19

void interrupt irq_service()

 

 

 

{

 

/* read all interrupt state */

new_int_state=inportb(wBase+7)&0x0f;

int_c=new_int_state^now_int_state;

/* compare which interrupt

*/

if ((int_c&0x1)!=0)

 

/* signal be change

*/

 

/* INT_CHAN_0 is active

*/

{

/* now PC0 change to high

*/

if ((new_int_state&0x01)!=0)

{

 

 

 

CNT_H1++;

 

 

 

}

/* now PC0 change to low

*/

else

{

 

 

 

CNT_L1++;

 

 

 

}

/* to generate a high pulse

*/

invert=invert^1;

}

 

 

 

if ((int_c&0x2)!=0)

 

 

 

{

/* now PC1 change to high

*/

if ((new_int_state&0x02)!=0)

{

 

 

 

CNT_H2++;

 

 

 

}

/* now PC1 change to low

*/

else

{

 

 

 

CNT_L2++;

 

 

 

{

/* to generate a high pulse

*/

invert=invert^2;

}

 

 

 

if ((int_c&0x4)!=0)

 

 

 

{

/* now PC2 change to high

*/

If ((new_int_state&0x04)!=0)

{

 

 

 

CNT_H3++;

 

 

 

}

/* now PC2 change to low

*/

else

{

 

 

 

CNT_L3++;

 

 

 

}

/* to generate a high pulse

*/

invert=invert^4;

}

 

 

 

if ((int_c&0x8)!=0)

 

 

 

{

/* now PC3 change to high

*/

if ((new_int_state&0x08)!=0)

{

 

 

 

CNT_H4++;

 

 

 

{

/* now PC3 change to low

*/

else

{

 

 

 

CNT_L4++;

 

 

 

}

/* to generate a high pulse

*/

invert=invert^8;

}

 

 

 

now_int_state=new_int_state; outportb(wBase+0x2a,invert);

if (wIrq>=8) outportb(A2_8259,0x20); outportb(A1_8259,0x20);

}

OME-PIO-D56/OME-PIO-D24 User Manual (Ver.2.1, Oct/2003)

---- 17

Image 19
Contents User’sGuide Czech Republic CanadaMexico BeneluxOME-PIO-D56/D24 Table of Contents Introduction FeaturesOrder Description SpecificationsOptions PCI Data Acquisition Family Product ChecklistOME-PISO-series cost-effective generation, isolated cards Board Layout Hardware configurationEnabling I/O Operation I/O Port Location1 DI/DO Port Architecture CON3 Select Sec RESET\ Sec DI Port Architecture CON2 Do Port Architecture CON1 Interrupt Operation If INT signal is Low now Æ select the non-inverted inputMake sure the initial level is High or Low Interrupt output signal of OME-PIO-D56/OME-PIO-D24, INT\ is Interrupt Block Diagram of OME-PIO D56/D24INTCHAN0/1/2/3 COUNTL++ Initialhigh, activelow Interrupt sourceInitiallow, activehigh Interrupt source PC0 PC1 PC2 PC3 Muliti-Interrupt SourceRead all interrupt state OME-DB-8125 Daughter BoardsOME-DB-37 OME-DN-37OME-ADP-20/PCI OME-DB-24PD Isolated Input Board OME-DB-24RD Relay Board OME-DB-24PRD, OME-DB-24POR, OME DB-24C Daughter Board Comparison Table Pin Assignment All signals are TTL compatibleDI0 DI1 DI2 DI3 DI4 DI5 DI6 DI7 DI8 DI9 PC’s physical slot information How to Find the I/O AddressResource-allocated information PIO/PISO identification informationD56/D24 PIODriverInitPIODriverInit&wBoards, wSubVendor,wSubDevice,wSubAux WSubVendor=0x80 wSubDevice=1 wSubAux=0x40 ForPrintf\nThrer are %d Piopiso Cards in this PC,wBoards OME-PISO-P32C32 Enable all D/I/O operations of card0 PIOGetConfigAddressSpaceEnable all D/I/O operations of card1 ShowPIOPISOwSubVendor,wSubDevice,wSubAux ShowPIOPISOSlot5 0x0A Slot6 0x08 Slot7 0x09 Slot8 0x07 Assignment of I/O AddressAddress Read Write I/O Address MapAUX Control Register RESET\ Control RegisterAUX data Register Aux Status Register INT Mask Control Register7 I/O Selection Control Register Interrupt Polarity Control RegisterRead/Write 8-bit data Register Demo program How to install software & utility?Piopiso PIOPISO.EXE for Windows DEMO1 DEMO2 COUNT=0 DEMO3COUNT++ DEMO4 COUNT++ PC3 DEMO5CNTL1=CNTL2=CNTL3=CNTL4=0 Page WARRANTY/DISCLAIMER Temperature