Technical description Chapter 10
APCI-/CPCI-1500
101
c) Example in C for Windows NT and Windows 95/98 (in asynchronous mode)
unsigned char b_EventCpt [2], b_TimerCounterCpt [3];
/* Global buffer
*/
unsigned char b_WatchdogCpt, b_VoltageErrorCpt;
_VOID_ v_InterruptRoutine (BYTE_ b_BoardHandle, BYTE_ b_InterruptMask, BYTE_
b_InputChannelNbr,
BYTE_ b_UserCallingMode, VOID *pv_UserSharedMemory)
{
if (b_InterruptMask & 0x1)
{
/**************************/
b_EventCpt [0] = b_EventCpt [0] + 1;
/* Event port 1 interrupt */
}
/**************************/
if (b_InterruptMask & 0x1)
{
/**************************/
b_EventCpt [1] = b_EventCpt [1] + 1;
/* Event port 2 interrupt */
}
/**************************/
if (b_InterruptMask & 0x4)
{
/*****************************/
b_TimerCounterCpt [0] = b_TimerCounterCpt [0] + 1; /* Timer/Counter 1 interrupt */
}
/*****************************/
if (b_InterruptMask & 0x8)
{
/*****************************/
b_TimerCounterCpt [1] = b_TimerCounterCpt [1] + 1; /* Timer/Counter 2 interrupt */
}
/*****************************/
if (b_InterruptMask & 0x10)
{
/***********************/
b_TimerCounterCpt [2] = b_TimerCounterCpt [2] + 1; /* Counter 3 interrupt */
}
/***********************/
if (b_InterruptMask & 0x20)
{
/**********************/
b_WatchdogCpt = b_Watch 1;
/* Watchdog interrupt */
}
/**********************/
if (b_InterruptMask & 0xC0)
{
/*****************/
b_VoltageErrorCpt = b_VoltageEr 1;
/* Voltage error */
}
/*****************/