EasyManua.ls Logo

FTDI LibFT4222 - Page 25

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
24
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
SPI_IO_QUAD
clock_div
Clock divider:
CLK_DIV_2 (1/2 System Clock)
CLK_DIV_4 (1/4 System Clock)
CLK_DIV_8 (1/8 System Clock)
CLK_DIV_16 (1/16 System Clock)
CLK_DIV_32 (1/32 System Clock)
CLK_DIV_64 (1/64 System Clock)
CLK_DIV_128 (1/128 System Clock)
CLK_DIV_256 (1/256 System Clock)
CLK_DIV_512 (1/512 System Clock)
cpol
Clock polarity:
CLK_IDLE_LOW
CLK_IDLE_HIGH
cpha
Clock phase:
CLK_LEADING
CLK_TRAILING
ssoMap
Slave selection output pins. Its a bitmap:
Bit 0: select device connected with ss0o
Bit 1: select device connected with ss1o
Bit 2: select device connected with ss2o
Bit 3: select device connected with ss3o
Return Value:
FT4222_OK if successful, otherwise the return value is an FT error code.
Error code:
FT4222_DEVICE_NOT_SUPPORTED: This device is not a FT4222 chip.
FT4222_INVALID_PARAMETER: Parameter is not suitable.
Example: single SPI master initialization
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);
Example: multiple SPI master initialization, this sample runs in Mode 1 or Mode 2
FT_HANDLE ftHandle1 = NULL;

Table of Contents