Functions | |
| HPI_ERR | HPI_AsyncEventOpen (HPI_HSUBSYS *phSubSys, HW16 wAdapterIndex, HPI_HASYNC *phAsync) |
| Open an ASync object. | |
| HPI_ERR | HPI_AsyncEventClose (HPI_HSUBSYS *phSubSys, HPI_HASYNC hAsync) |
| Closes an ASync object. | |
| HPI_ERR | HPI_AsyncEventWait (HPI_HSUBSYS *phSubSys, HPI_HASYNC hAsync, HW16 wMaximumEvents, struct hpi_async_event *pEvents, HW16 *pwNumberReturned) |
| Waits for a asynchronous events. | |
| HPI_ERR | HPI_AsyncEventGetCount (HPI_HSUBSYS *phSubSys, HPI_HASYNC hAsync, HW16 *pwCount) |
| Returns the number of asynchronous events waiting. | |
| HPI_ERR | HPI_AsyncEventGet (HPI_HSUBSYS *phSubSys, HPI_HASYNC hAsync, HW16 wMaximumEvents, struct hpi_async_event *pEvents, HW16 *pwNumberReturned) |
| Returns single or many asynchronous events. | |
An Async object can be used to reciev notifications for both GPIO and other signal detection events. A typical coding sequence would look something like:
// The below code represents the bits that would go in an application. ... // application startup section HPI_AsyncEventOpen(pSS,0,&hAsync); CreateThread(ThreadAsync); ... ... // application shutdown HPI_AsyncEventOpen(pSS,hAsync); ... #define MAX_EVENTS 10 void ThreadAsync() { int ExitSignalled=0; HW16 wError; tHPIAsyncEvent e[MAX_EVENTS] while(!ExitSignalled) { wError = HPI_ERR HPI_AsyncEventWait( pSS, hAsync, MAX_EVENTS, &e[0], &wEvents); if(wError==HPI_ASYNC_TERMINATE_WAIT) ExitSignalled=1; else { if(!wError) for(i=0;i<wEvents;i++) CallCodeToProcessEvent(e[i]); } } }
|
||||||||||||||||
|
Open an ASync object. Opens a GPIO object and returns a handle to the same.
|
|
||||||||||||
|
Closes an ASync object.
|
|
||||||||||||||||||||||||
|
Waits for a asynchronous events. This call waits for any async event. The calling thread is suspended until an ASync event is detected. After the async event is detected the call completes and returns information about the event(s) that occured.
|
|
||||||||||||||||
|
Returns the number of asynchronous events waiting.
|
|
||||||||||||||||||||||||
|
Returns single or many asynchronous events. This call will read any waiting events from the asynchronous event queue and return a description of the event. It is non-blocking.
|
1.4.6-NO