FT_STATUS
|
FT_SetLatencyTimer
|
(FT_HANDLE ftHandle, UCHAR ucTimer)
|
Parameters
ftHandle
|
Handle of the device.
|
ucTimer
|
Required value, in milliseconds, of latency timer. Valid range is 2 - 255.
|
Return Value
FT_OK if successful, otherwise the return value is an FT error code.
Remarks
In the FT8U232AM and FT8U245AM devices, the receive buffer timeout that is used to flush remaining data from the receive buffer was fixed at 16 ms. In all other FTDI devices, this timeout is programmable and can be set at 1 ms intervals between 2ms and 255 ms. This allows the device to be better optimized for protocols requiring faster response times from short data packets.
Example
HANDLE ftHandle;
FT_STATUS ftStatus;
UCHAR LatencyTimer = 10;
ftStatus = FT_Open(0, &ftHandle);
if(ftStatus != FT_OK) {
// FT_Open failed
return;
}
ftStatus = FT_SetLatencyTimer(ftHandle, LatencyTimer);
if (ftStatus == FT_OK) {
// LatencyTimer set to 10 milliseconds
}
else {
// FT_SetLatencyTimer FAILED!
}
FT_Close(ftHandle);