Function UnmaskPciIrq installs a hardware interrupt handler. It works as follows:
ULONG IrqCounter = 0;
PIRQ_SHARE_REC ShareRec;
PIRQ_CLEAR_REC ClearRec;
// Interrupt handler
void __stdcall MyInterruptHandler(ULONG TimeStampLoPart, ULONG TimeStampHiPart)
{
++ IrqCounter;
}
// Main program
hPci = OpenRapidPci( 0 );
if (IsRapidPciOpened(hPci)) {
...
set ClearRec and ShareRec structures, see below
...
UnmaskPciIrq( hPci, &ShareRec, &ClearRec, MyInterruptHandler );
}
else
... // failed
Calling the function MaskPciIrq stops hardware interrupt processing:
MaskPciIrq ( hPci );
Counter value for the number of handled interrupts is returned by function GetInterruptCounter.
.
|