ADM-XRC SDK 2.8.1 User Guide (Linux)
© Copyright 2001-2009 Alpha Data


ADMXRC2_WaitForInterrupt

Prototype

ADMXRC2_STATUS
ADMXRC2_WaitForInterrupt(
    ADMXRC2_HANDLE Card,
    unsigned long* Timeout,
    unsigned long  Flags,
    void*          Ignored);

Arguments

Argument Type Purpose
Card In Handle of card on which to wait for an interrupt
Timeout In/out Specifies the length of time to wait, in microseconds
Flags In Flags that modify behaviour
Ignored In Pass NULL

Return value

Value Meaning
ADMXRC2_SUCCESS An interrupt occurred within the specified timeout period
ADMXRC2_CANCELLED Another thread called ADMXRC2_CancelWaitForInterrupt during the wait period
ADMXRC2_DEVICE_BUSY Another thread was already waiting for an FPGA interrupt
ADMXRC2_INVALID_HANDLE The card handle passed was invalid
ADMXRC2_TIMEOUT An FPGA interrupt did not occur within the specified timeout period

Description

This function waits for an FPGA interrupt to occur. At most one thread at any time may be waiting for an interrupt.

Timeout must be either NULL, or a valid pointer to a variable of type unsigned long.

Flags is used to modify the behaviour of the function; at present, it must be 0.

If Timeout is NULL, the function waits indefinitely for an interrupt to occur. Otherwise, Timeout must point to an unsigned long variable that has been initialized to the desired wait period. If an interrupt occurs within the desired wait period, this variable is modified to contain the remaining time left in the timeout period.

Whenever an FPGA interrupt occurs, by a high-to-low transition of the FPGA interrupt signal FINTI_L, the driver checks to see if there is a thread waiting for an interrupt. If there is, that thread is woken up and ADMXRC2_WaitForInterrupt returns ADMXRC2_SUCCESS. If not, the driver sets a per-card flag. If a thread subsequently calls ADMXRC2_WaitForInterrupt while the flag is set, the function returns immediately with ADMXRC2_SUCCESS and the flag is cleared.

Another thread may force an interrupt-wait operation to terminate, by calling ADMXRC2_CancelWaitForInterrupt. The sleeping thread is woken up and receives a status of ADMXRC_CANCELLED from its call to ADMXRC2_WaitForInterrupt.

 


 Top of page