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