Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
11
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
Summary:
Release allocated resources. FT4222_Uninitialize should be called before calling FT_Close.
FT4222_Uninitialize must be called after one of the following API.
FT4222_SPIMaster_Init
FT4222_SPISlave_Init
FT4222_I2CMaster_Init
FT4222_I2CSlave_Init
FT4222_GPIO_Init
Parameters:
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.
Example:
FT_HANDLE ftHandle = NULL;
FT_STATUS ftStatus;
FT4222_STATUS ft4222Status;
ftStatus = FT_Open(0, &ftHandle);
if (FT_OK != ftStatus)
{
// open failed
return;
}
ft4222Status = FT4222_SPIMaster_Init(ftHandle, SPI_IO_SINGLE, CLK_DIV_4, CLK_IDLE_LOW,
CLK_LEADING, 0x01);
if (FT4222_OK != ft4222Status)
{
// spi master init failed
return;
}
FT4222_UnInitialize(ftHandle);
FT_Close(ftHandle);
3.2.3 Set Clock
FT4222_STATUS FT4222_SetClock(FT_HANDLE ftHandle, FT4222_ClockRate clk)
Supported Chip: