EasyManua.ls Logo

FTDI LibFT4222 - Get Max Transfer Size

Default Icon
78 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
18
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
}
}
}
FT4222_UnInitialize(ftHandle);
FT_Close(ftHandle);
3.2.8 Get Max Transfer Size
FT4222_STATUS FT4222_GetMaxTransferSize(FT_HANDLE ftHandle, uint16* pMaxSize)
Supported Chip:
FT4222 chip version
Supported
FT4222 Rev A
YES
FT4222 Rev B
YES
FT4222 Rev C
YES
FT4222 Rev D
YES
Summary:
This function returns the maximum packet size in a transaction. It will be affected by different bus
speeds, chip modes, and functions. The maximum transfer size is maximum size in writing path.
Parameters:
ftHandle
Handle of the device.
pMaxSize
Pointer to a variable of type unit16 where the returning value will be stored.
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_INVALID_POINTER: Parameter pMaxSize is NULL
Example:
FT_HANDLE ftHandle = NULL;
FT_STATUS ftStatus;
FT4222_STATUS ft4222Status;
uint16 maxSize;
ftStatus = FT_Open(0, &ftHandle);
if (FT_OK != ftStatus)
{
// open failed
return;
}
ft4222Status = FT4222_I2CMaster_Init(ftHandle, 1000);
if (FT4222_OK != ft4222Status)
{
// init i2c master failed
return;
}
ft4222Status = FT4222_GetMaxTransferSize(ftHandle, &maxSize);
if (FT4222_OK != ft4222Status)
{
// get max transfer size failed

Table of Contents