ADLINK PCI-8144 User Manual

Page 149

Advertising
background image

Function Library

139

the function returns when the state of any one of the interrupt
factors you specified in GpioIntFactorInBits is signaled. In the
latter case, you can check which factors whose state caused
the function to return by compare the parameter “GpioIntTrig-
geredInBits”.

I32 TimeOutMs

: Specifies the time-out interval, in millisec-

onds.

I32 *GpioIntTriggeredInBits

: Information of interrupt

state in bit format.

Z

The value of each bit means: 0: not triggered, 1: be trig-
gered

Return Values:

ERR_NoError

ERR_ParametersInvalid

ERR_DeviceNotInitial

ERR_InsufficientMemory

ERR_InterruptNotEnable

ERR_Win32Error

Example:

I32 GpioIntFactorInBits = 0x101; //Wait DI Ch0

falling edge and rising edge

ret = _8144_set_gpio_interrupt_factor( CardId,

GpioIntFactorInBits);

// wait multiple GPIO interrupts…

I32 TimeOutMs = 10000; //10 sec timeout

I16 WaitOption = 1; //wait all interrupts occured

I32 GpioIntTriggeredInBits;

ret = _8144_wait_multiple_gpio_interrupt(

gCardId, GpioIntFactorInBits, WaitOption,

TimeOutMs, &GpioIntTriggeredInBits );

if( ret == ERR_NoError ){

// Interrupt be triggered

}else{

//Timeout or wait failed

}

_8144_set_gpio_interrupt_factor( gCardId, 0 ); //

Disable GPIO interrupt

Advertising