EasyManua.ls Logo

FTDI LibFT4222 - SPI Slave Set Mode Function

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
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:
FT4222 chip version
Supported
FT4222 Rev A
YES
FT4222 Rev B
YES
FT4222 Rev C
YES
FT4222 Rev D
YES
Summary:
Set SPI slave CPOL and CPHA. The Default value of CPOL is CLK_IDLE_LOW , default value of
CPHA is CLK_LEADING.
Parameters:
ftHandle
Handle of the device.
cpol
Clock polarity:
CLK_IDLE_LOW
CLK_IDLE_HIGH
cpha
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))
{

Table of Contents