xPCI-1500 API
APCI-1500 interrupt management functions

Functions

_INT_ i_APCI1500_SetBoardIntRoutineWin32 (BYTE_ b_BoardHandle, BYTE_ b_UserCallingMode, ULONG_ ul_GlobalBufferSize, VOID **ppv_UserGlobalBuffer, void(far pascal *v_FunctionName)(BYTE_b_BoardHandle, BYTE_b_InterruptMask, BYTE_b_InputChannelNbr, BYTE_b_UserCallingMode, VOID *pv_UserSharedMemory))
 
_INT_ i_APCI1500_ResetBoardIntRoutine (BYTE_ b_BoardHandle)
 
_INT_ i_APCI1500_TestInterrupt (PBYTE_ pb_BoardHandle, PBYTE_ pb_InterruptMask, PBYTE_ pb_InputChannelNbr)
 

Detailed Description

Function Documentation

_INT_ i_APCI1500_SetBoardIntRoutineWin32 ( BYTE_  b_BoardHandle,
BYTE_  b_UserCallingMode,
ULONG_  ul_GlobalBufferSize,
VOID **  ppv_UserGlobalBuffer,
void(far pascal *v_FunctionName)(BYTE_b_BoardHandle, BYTE_b_InterruptMask, BYTE_b_InputChannelNbr, BYTE_b_UserCallingMode, VOID *pv_UserSharedMemory)   
)

Install an interrupt callback function. This function will be called each time the board generate an interruption.
The value of b_InterruptMask will enable you to determine the source of the interruption:

Parameters
[in]b_BoardHandle: Handle of the board
[in]b_UserCallingMode: Interrupt calling mode, synchronous mode not available, this parameter must be 0.
[in]ul_GlobalBufferSize: User shared memory size.
[in]ppv_UserGlobalBuffer: User shared memory.
[in]v_FunctionName: Address of the callback function
b_BoardHandle : Handle of the board
b_InterruptMask : Source of the interrupt
b_InputChannelNbr : Values of the input
b_UserCallingMode : Parameter not used
pv_UserSharedMemory : Parameter not used

The source of the interrupt can be:

  • 0x1: Port A interrupt
  • 0x2: Port B interrupt
  • 0x4: Timer 1 interrupt
  • 0x8: Timer 2 interrupt
  • 0x10: Timer 3 interrupt
  • 0x20: Watchdog interrupt
  • 0x40: voltage error detected on port 1
  • 0x80: voltage error detected on port 2
Return values
0: No Error
-1: The device handle parameter is wrong
-2: An interrupt routine was still isntalled. Remove it with i_APCI1500_ResetBoardIntRoutine and retry
-3: User interrupt routine calling mode selection wrong (synchrone mode is not available)
-103: Error while creating kill event
-104: Error while creating interrupt event
-105: Error while creating interrupt thread
-106: Error while changing the priority class of the thread
-107: Error while changing the priority of the thread
-108: Error while calling the IOCTL command
-109: Error in the interrupt callback function
_INT_ i_APCI1500_ResetBoardIntRoutine ( BYTE_  b_BoardHandle)

Deinstall the interrupt callback function.

Parameters
[in]b_BoardHandle: Handle of the board
Return values
0: No Error
-1: The device handle parameter is wrong
-2: No interrupt routine installed
-103: Error in the reset interrupt callback function
_INT_ i_APCI1500_TestInterrupt ( PBYTE_  pb_BoardHandle,
PBYTE_  pb_InterruptMask,
PBYTE_  pb_InputChannelNbr 
)

This function tests if the APCI1500 has generated an interrupt. If yes, the function returns the handle of the board and the interrupt source.

Parameters
[in]pb_BoardHandle: Handle of the board
[in]pb_InterruptMask: interrupt mask
[in]pb_InputChannelNbrinterrupt channel number
Return values
0: No Interrupt
>0: Number of interrupt generated