Home    Prev Next    
Contents
Programming For ISA Hardware
Overview
Programmers Guide
Scenario
I/O Ports control
Single read/write operations
Data array read/write operations
Accessing Physical Memory Addresses
Memory Mapping
Additional Functions
Hardware interrupts handling at user level
Common Functions
OpenRapidIsa
CloseRapidIsa
IsRapidIsaOpened
GetHardwareConfiguration
Direct Port I/O
GetPortByte
GetPortWord
GetPortLong
SetPortByte
SetPortWord
SetPortLong
ReadPortBuffer
WritePortBuffer
Memory Access
MapPhysToLinear
UnmapMemory
GetMem
GetMemW
GetMemL
SetMem
SetMemW
SetMemL
Hardware Interrupts
UnmaskIsaIrq
MaskIsaIrq
GetInterruptCounter
Hardware interrupts handling at user level
Go to RapidDriver Main Page


Function UnmaskIsaIrq installs a hardware interrupt handler. It works as follows:

ULONG IrqCounter = 0;

// Interrupt handler
void __stdcall MyInterruptHandler(ULONG TimeStampLoPart, ULONG TimeStampHiPart)
{
    ++ IrqCounter; 
}

// Main program
hIsa = 
OpenRapidIsa( 0 );
if (
IsRapidIsaOpened(hIsa)) {
    ...
    set ClearRec and ShareRec structures, see below 
    ...
    
UnmaskIsaIrq( hIsa, MyInterruptHandler );
}
else 
  ... // failed


Calling the function MaskIsaIrq stops hardware interrupt processing:

MaskIsaIrq ( hIsa );

Counter value for the number of handled interrupts is returned by function GetInterruptCounter.