Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
25
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
FT_HANDLE ftHandle2 = NULL;
FT_STATUS ftStatus;
FT4222_STATUS ft4222Status;
ftStatus = FT_Open(0, &ftHandle1);
if (FT_OK != ftStatus)
{
// open failed
return;
}
ftStatus = FT_Open(1, &ftHandle2);
if (FT_OK != ftStatus)
{
// open failed
return;
}
ft4222Status = FT4222_SPIMaster_Init(ftHandle1, SPI_IO_SINGLE, CLK_DIV_4,
CLK_IDLE_LOW, CLK_LEADING, 0x03);
if (FT4222_OK != ft4222Status)
{
// spi master init failed
return;
}
ft4222Status = FT4222_SPIMaster_Init(ftHandle2, SPI_IO_SINGLE, CLK_DIV_4,
CLK_IDLE_LOW, CLK_LEADING, 0x03);
if (FT4222_OK != ft4222Status)
{
// spi master init failed
return;
}
FT4222_UnInitialize(ftHandle1);
FT4222_UnInitialize(ftHandle2);
FT_Close(ftHandle1);
FT_Close(ftHandle2);
3.3.2 SPI Master Set Lines
FT4222_STATUS FT4222_SPIMaster_SetLines(FT_HANDLE ftHandle, FT4222_SPIMode spiMode)
Supported Chip:
Summary:
Switch the FT4222H SPI master to single, dual, or quad mode. This overrides the mode passed to
FT4222_SPIMaster_init. This might be needed if a device accepts commands in single mode but
data transfer is to use dual or quad mode.