Enables or disables an event handler.
GxFpgaSetEvent (nHandle, nEvevntType, bEnable, procCallback, pvUserData, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX3500 board. |
nEventType |
SHORT |
Event type. Use the constant GT_EVENT_INTERRUPT (1). No other value is supported. |
bEnable |
BOOL |
Enable (<>0) or disable (0) the event. |
procCallback |
PROCEDURE |
Optional. User supplied procedure, called by the driver when an event occurred. |
pvUserData |
PVOID |
User data (pointer or value) that is passed to the callback procedure when an event occurred. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
If NULL is passed in to the procCallback parameter the only way to get notified that an event has occurred is to call the GxFpgaWaitOnEvent function.
The procCallback should be defined as follows:
GxFpgaCallback (nHandle, nEventType,,pvUserData, pnStatus) : Long
The following example output whether an event received during 1 second:
GxFpgaInitialize (1, &nHandle, &nStatus);
GxFpgaSetEvent(nHandle, GT_EVENT_INTERRUPT, TRUE, NULL, (PVOID)1, &nStatus);
! wait up to 1000 ms for the event
GxFpgaWaitOnEvent(nHandle, GT_EVENT_INTERRUPT, 1000, &nStatus);
if (nStatus==0) ! success event occurred
printf(“event occurred”);
else
printf(“No event occurred”);
GxFpgaSetEvent(nHandle, GT_EVENT_INTERRUPT, FALSE, NULL, (PVOID)1, &nStatus);
GxFpgaInitialize, GxFpgaGetErrorString, GxFpgaWaitOnEvent, GxFpgaDiscardEvents