Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
19
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
return;
}
FT_Close(ftHandle);
3.2.9 Set Event Notification
FT4222_STATUS FT4222_SetEventNotification(FT_HANDLE ftHandle, DWORD dwEventMask,
PVOID pvArg)
Supported Chip:
Summary:
Sets conditions for event notification.
An application can use this function to set up conditions which allow a thread to block until one of
the conditions is met. Typically, an application will create an event, call this function, and then
block on the event. When the conditions are met, the event is set, and the application thread
unblocked. Usually, the event is set to notify the application to check the condition. The application
needs to check the condition again before it goes to handle the condition. The API is only valid
when the device acts as SPI slave and SPI slave protocol is not SPI_SLAVE_NO_PROTOCOL.
Parameters:
Conditions that cause the event to be set. It is a bit-map that describes the
events the application is interested in. Currently, this function only supports the
event below:
FT4222_EVENT_RXCHAR
The event will be set when a data packet has been received by the
device.
Interpreted as the handle of an event which has been created by the application.
If one of the event conditions is met, the event is set.
Return Value:
FT4222_OK if successful, otherwise the return value is an FT error code.
Error code:
FT4222_DEVICE_NOT_OPENED: The initialization API is not called.
FT4222_EVENT_NOT_SUPPORTED: The device must acts as SPI salve and protocol is not
SPI_SLAVE_NO_PROTOCOL.
Prerequisite:
FT4222_SPISlave_InitEx or FT4222_SPISlave_Init
Example:
FT_HANDLE ftHandle = NULL;
FT_STATUS ftStatus;
FT4222_STATUS ft4222Status;