Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
38
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
Error code:
FT4222_DEVICE_NOT_SUPPORTED: This device is not a FT4222 chip.
3.4.3 SPI Slave Set mode function
FT4222_STATUS FT4222_SPISlave_SetMode(FT_HANDLE ftHandle ,FT4222_SPICPOL cpol,
FT4222_SPICPHA cpha)
Supported Chip:
Summary:
Set SPI slave CPOL and CPHA. The Default value of CPOL is CLK_IDLE_LOW , default value of
CPHA is CLK_LEADING.
Parameters:
Clock polarity:
CLK_IDLE_LOW
CLK_IDLE_HIGH
Clock phase:
CLK_LEADING
CLK_TRAILING
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_DEVICE_NOT_SUPPORTED: This device is not a FT4222 chip.
FT4222_IS_NOT_SPI_MODE: The device is not in spi slave mode.
Prerequisite:
FT4222_SPISlave_InitEx or FT4222_SPISlave_Init
Example:
FT_HANDLE ftHandle = NULL;
FT_STATUS ftStatus;
FT4222_STATUS ft4222Status;
ftStatus = FT_OpenEx("FT4222 A",FT_OPEN_BY_DESCRIPTION, &ftHandle);
if (FT_OK != ftStatus)
{
// open failed
return;
}
if (FT4222_OK != FT4222_SPISlave_InitEx(ftHandle, SPI_SLAVE_NO_PROTOCOL))
{