image/svg+xml
Brteve's API for EveApps
Version 0.0.1
The reference document for common folder of EveApps project.
 
Loading...
Searching...
No Matches
LibFT4222.h File Reference

FT4222 APIs. More...

#include <stdint.h>
#include "ftd2xx.h"

Go to the source code of this file.

Data Structures

struct  FT4222_Version
 
struct  SPI_Slave_Header
 

Macros

#define LIBFT4222_API
 
#define FT4222_EVENT_RXCHAR   8
 
#define FT4222_SPI_SLAVE_SYNC_WORD   0x5A
 
#define GPIO_Tigger   GPIO_Trigger
 
spi slave cmd
#define SPI_MASTER_TRANSFER   0x80
 
#define SPI_SLAVE_TRANSFER   0x81
 
#define SPI_SHORT_MASTER_TRANSFER   0x82
 
#define SPI_SHORT_SLAVE_TRANSFER   0x83
 
Backwards compatibility for typo in earlier version
#define SPI_SHART_SLAVE_TRANSFER   0x83
 
#define SPI_ACK   0x84
 
I2C Master Controller Status

bit 0 = controller busy: all other status bits invalid
bit 1 = error condition
bit 2 = slave address was not acknowledged during last operation
bit 3 = data not acknowledged during last operation
bit 4 = arbitration lost during last operation
bit 5 = controller idle
bit 6 = bus busy

#define I2CM_CONTROLLER_BUSY(status)   (((status)&0x01) != 0)
 
#define I2CM_DATA_NACK(status)   (((status)&0x0A) != 0)
 
#define I2CM_ADDRESS_NACK(status)   (((status)&0x06) != 0)
 
#define I2CM_ARB_LOST(status)   (((status)&0x12) != 0)
 
#define I2CM_IDLE(status)   (((status)&0x20) != 0)
 
#define I2CM_BUS_BUSY(status)   (((status)&0x40) != 0)
 

Typedefs

typedef uint8_t uint8
 
typedef uint16_t uint16
 
typedef uint32_t uint32
 
typedef uint64_t uint64
 
typedef int8_t int8
 
typedef int16_t int16
 
typedef int32_t int32
 
typedef int64_t int64
 
typedef enum FT4222_STATUS FT4222_STATUS
 
typedef enum FT4222_ClockRate FT4222_ClockRate
 
typedef enum FT4222_FUNCTION FT4222_FUNCTION
 
typedef enum FT4222_SPIMode FT4222_SPIMode
 
typedef enum FT4222_SPIClock FT4222_SPIClock
 
typedef enum FT4222_SPICPOL FT4222_SPICPOL
 
typedef enum FT4222_SPICPHA FT4222_SPICPHA
 
typedef enum SPI_DrivingStrength SPI_DrivingStrength
 
typedef enum GPIO_Port GPIO_Port
 
typedef enum GPIO_Dir GPIO_Dir
 
typedef enum GPIO_Trigger GPIO_Trigger
 
typedef enum GPIO_Output GPIO_Output
 
typedef enum I2C_MasterFlag I2C_MasterFlag
 
typedef enum SPI_SlaveProtocol SPI_SlaveProtocol
 
typedef struct FT4222_Version FT4222_Version
 

Enumerations

enum  FT4222_STATUS {
  FT4222_OK , FT4222_INVALID_HANDLE , FT4222_DEVICE_NOT_FOUND , FT4222_DEVICE_NOT_OPENED ,
  FT4222_IO_ERROR , FT4222_INSUFFICIENT_RESOURCES , FT4222_INVALID_PARAMETER , FT4222_INVALID_BAUD_RATE ,
  FT4222_DEVICE_NOT_OPENED_FOR_ERASE , FT4222_DEVICE_NOT_OPENED_FOR_WRITE , FT4222_FAILED_TO_WRITE_DEVICE , FT4222_EEPROM_READ_FAILED ,
  FT4222_EEPROM_WRITE_FAILED , FT4222_EEPROM_ERASE_FAILED , FT4222_EEPROM_NOT_PRESENT , FT4222_EEPROM_NOT_PROGRAMMED ,
  FT4222_INVALID_ARGS , FT4222_NOT_SUPPORTED , FT4222_OTHER_ERROR , FT4222_DEVICE_LIST_NOT_READY ,
  FT4222_DEVICE_NOT_SUPPORTED = 1000 , FT4222_CLK_NOT_SUPPORTED , FT4222_VENDER_CMD_NOT_SUPPORTED , FT4222_IS_NOT_SPI_MODE ,
  FT4222_IS_NOT_I2C_MODE , FT4222_IS_NOT_SPI_SINGLE_MODE , FT4222_IS_NOT_SPI_MULTI_MODE , FT4222_WRONG_I2C_ADDR ,
  FT4222_INVAILD_FUNCTION , FT4222_INVALID_POINTER , FT4222_EXCEEDED_MAX_TRANSFER_SIZE , FT4222_FAILED_TO_READ_DEVICE ,
  FT4222_I2C_NOT_SUPPORTED_IN_THIS_MODE , FT4222_GPIO_NOT_SUPPORTED_IN_THIS_MODE , FT4222_GPIO_EXCEEDED_MAX_PORTNUM , FT4222_GPIO_WRITE_NOT_SUPPORTED ,
  FT4222_GPIO_PULLUP_INVALID_IN_INPUTMODE , FT4222_GPIO_PULLDOWN_INVALID_IN_INPUTMODE , FT4222_GPIO_OPENDRAIN_INVALID_IN_OUTPUTMODE , FT4222_INTERRUPT_NOT_SUPPORTED ,
  FT4222_GPIO_INPUT_NOT_SUPPORTED , FT4222_EVENT_NOT_SUPPORTED , FT4222_FUN_NOT_SUPPORT
}
 
enum  FT4222_ClockRate { SYS_CLK_60 = 0 , SYS_CLK_24 , SYS_CLK_48 , SYS_CLK_80 }
 
enum  FT4222_FUNCTION { FT4222_I2C_MASTER = 1 , FT4222_I2C_SLAVE , FT4222_SPI_MASTER , FT4222_SPI_SLAVE }
 
enum  FT4222_SPIMode { SPI_IO_NONE = 0 , SPI_IO_SINGLE = 1 , SPI_IO_DUAL = 2 , SPI_IO_QUAD = 4 }
 
enum  FT4222_SPIClock {
  CLK_NONE = 0 , CLK_DIV_2 , CLK_DIV_4 , CLK_DIV_8 ,
  CLK_DIV_16 , CLK_DIV_32 , CLK_DIV_64 , CLK_DIV_128 ,
  CLK_DIV_256 , CLK_DIV_512
}
 
enum  FT4222_SPICPOL { CLK_IDLE_LOW = 0 , CLK_IDLE_HIGH = 1 }
 
enum  FT4222_SPICPHA { CLK_LEADING = 0 , CLK_TRAILING = 1 }
 
enum  SPI_DrivingStrength { DS_4MA = 0 , DS_8MA , DS_12MA , DS_16MA }
 
enum  GPIO_Port { GPIO_PORT0 = 0 , GPIO_PORT1 , GPIO_PORT2 , GPIO_PORT3 }
 
enum  GPIO_Dir { GPIO_OUTPUT = 0 , GPIO_INPUT }
 
enum  GPIO_Trigger { GPIO_TRIGGER_RISING = 0x01 , GPIO_TRIGGER_FALLING = 0x02 , GPIO_TRIGGER_LEVEL_HIGH = 0x04 , GPIO_TRIGGER_LEVEL_LOW = 0X08 }
 
enum  GPIO_Output { GPIO_OUTPUT_LOW , GPIO_OUTPUT_HIGH }
 
enum  I2C_MasterFlag {
  NONE = 0x80 , START = 0x02 , Repeated_START = 0x03 , STOP = 0x04 ,
  START_AND_STOP = 0x06
}
 
enum  SPI_SlaveProtocol { SPI_SLAVE_WITH_PROTOCOL = 0 , SPI_SLAVE_NO_PROTOCOL , SPI_SLAVE_NO_ACK }
 

Functions

FT4222 General Functions
LIBFT4222_API FT4222_STATUS FT4222_UnInitialize (FT_HANDLE ftHandle)
 
LIBFT4222_API FT4222_STATUS FT4222_SetClock (FT_HANDLE ftHandle, FT4222_ClockRate clk)
 
LIBFT4222_API FT4222_STATUS FT4222_GetClock (FT_HANDLE ftHandle, FT4222_ClockRate *clk)
 
LIBFT4222_API FT4222_STATUS FT4222_SetWakeUpInterrupt (FT_HANDLE ftHandle, BOOL enable)
 
LIBFT4222_API FT4222_STATUS FT4222_SetInterruptTrigger (FT_HANDLE ftHandle, GPIO_Trigger trigger)
 
LIBFT4222_API FT4222_STATUS FT4222_SetSuspendOut (FT_HANDLE ftHandle, BOOL enable)
 
LIBFT4222_API FT4222_STATUS FT4222_GetMaxTransferSize (FT_HANDLE ftHandle, uint16 *pMaxSize)
 
LIBFT4222_API FT4222_STATUS FT4222_SetEventNotification (FT_HANDLE ftHandle, DWORD mask, PVOID param)
 
LIBFT4222_API FT4222_STATUS FT4222_GetVersion (FT_HANDLE ftHandle, FT4222_Version *pVersion)
 
LIBFT4222_API FT4222_STATUS FT4222_ChipReset (FT_HANDLE ftHandle)
 
FT4222 SPI Functions
LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_Init (FT_HANDLE ftHandle, FT4222_SPIMode ioLine, FT4222_SPIClock clock, FT4222_SPICPOL cpol, FT4222_SPICPHA cpha, uint8 ssoMap)
 
LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_SetLines (FT_HANDLE ftHandle, FT4222_SPIMode spiMode)
 
LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_SingleRead (FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeOfRead, BOOL isEndTransaction)
 
LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_SingleWrite (FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred, BOOL isEndTransaction)
 
LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_SingleReadWrite (FT_HANDLE ftHandle, uint8 *readBuffer, uint8 *writeBuffer, uint16 bufferSize, uint16 *sizeTransferred, BOOL isEndTransaction)
 
LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_MultiReadWrite (FT_HANDLE ftHandle, uint8 *readBuffer, uint8 *writeBuffer, uint8 singleWriteBytes, uint16 multiWriteBytes, uint16 multiReadBytes, uint32 *sizeOfRead)
 
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_Init (FT_HANDLE ftHandle)
 
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_InitEx (FT_HANDLE ftHandle, SPI_SlaveProtocol protocolOpt)
 
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_SetMode (FT_HANDLE ftHandle, FT4222_SPICPOL cpol, FT4222_SPICPHA cpha)
 
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_GetRxStatus (FT_HANDLE ftHandle, uint16 *pRxSize)
 
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_Read (FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeOfRead)
 
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_Write (FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred)
 
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_RxQuickResponse (FT_HANDLE ftHandle, BOOL enable)
 
LIBFT4222_API FT4222_STATUS FT4222_SPI_Reset (FT_HANDLE ftHandle)
 
LIBFT4222_API FT4222_STATUS FT4222_SPI_ResetTransaction (FT_HANDLE ftHandle, uint8 spiIdx)
 
LIBFT4222_API FT4222_STATUS FT4222_SPI_SetDrivingStrength (FT_HANDLE ftHandle, SPI_DrivingStrength clkStrength, SPI_DrivingStrength ioStrength, SPI_DrivingStrength ssoStrength)
 
FT4222 I2C Functions
LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_Init (FT_HANDLE ftHandle, uint32 kbps)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_Read (FT_HANDLE ftHandle, uint16 deviceAddress, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_Write (FT_HANDLE ftHandle, uint16 deviceAddress, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_ReadEx (FT_HANDLE ftHandle, uint16 deviceAddress, uint8 flag, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_WriteEx (FT_HANDLE ftHandle, uint16 deviceAddress, uint8 flag, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_Reset (FT_HANDLE ftHandle)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_GetStatus (FT_HANDLE ftHandle, uint8 *controllerStatus)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Init (FT_HANDLE ftHandle)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Reset (FT_HANDLE ftHandle)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_GetAddress (FT_HANDLE ftHandle, uint8 *addr)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_SetAddress (FT_HANDLE ftHandle, uint8 addr)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_GetRxStatus (FT_HANDLE ftHandle, uint16 *pRxSize)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Read (FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Write (FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_SetClockStretch (FT_HANDLE ftHandle, BOOL enable)
 
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_SetRespWord (FT_HANDLE ftHandle, uint8 responseWord)
 
FT4222 GPIO Functions
LIBFT4222_API FT4222_STATUS FT4222_GPIO_Init (FT_HANDLE ftHandle, GPIO_Dir gpioDir[4])
 
LIBFT4222_API FT4222_STATUS FT4222_GPIO_Read (FT_HANDLE ftHandle, GPIO_Port portNum, BOOL *value)
 
LIBFT4222_API FT4222_STATUS FT4222_GPIO_Write (FT_HANDLE ftHandle, GPIO_Port portNum, BOOL bValue)
 
LIBFT4222_API FT4222_STATUS FT4222_GPIO_SetInputTrigger (FT_HANDLE ftHandle, GPIO_Port portNum, GPIO_Trigger trigger)
 
LIBFT4222_API FT4222_STATUS FT4222_GPIO_GetTriggerStatus (FT_HANDLE ftHandle, GPIO_Port portNum, uint16 *queueSize)
 
LIBFT4222_API FT4222_STATUS FT4222_GPIO_ReadTriggerQueue (FT_HANDLE ftHandle, GPIO_Port portNum, GPIO_Trigger *events, uint16 readSize, uint16 *sizeofRead)
 
LIBFT4222_API FT4222_STATUS FT4222_GPIO_SetWaveFormMode (FT_HANDLE ftHandle, BOOL enable)
 

Detailed Description

FT4222 APIs.

Author
FTDI
Date
10/08/2015

MIT License

Copyright (c) [2015] [FTDI]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Revision History: 1.0 - initial version 1.2 - allow use on non-Windows platforms; add I2CMaster ReadEx/WriteEx/GetStatus 1.3 add FT4222_I2CSlave_SetClockStretch FT4222_I2CSlave_SetRespWord

Definition in file LibFT4222.h.

Macro Definition Documentation

◆ FT4222_EVENT_RXCHAR

#define FT4222_EVENT_RXCHAR   8

Definition at line 87 of file LibFT4222.h.

◆ FT4222_SPI_SLAVE_SYNC_WORD

#define FT4222_SPI_SLAVE_SYNC_WORD   0x5A

spi slave sync word

Definition at line 89 of file LibFT4222.h.

◆ GPIO_Tigger

#define GPIO_Tigger   GPIO_Trigger

Backwards compatibility for typo in earlier version

Definition at line 248 of file LibFT4222.h.

◆ I2CM_ADDRESS_NACK

#define I2CM_ADDRESS_NACK (   status)    (((status)&0x06) != 0)

Definition at line 116 of file LibFT4222.h.

◆ I2CM_ARB_LOST

#define I2CM_ARB_LOST (   status)    (((status)&0x12) != 0)

Definition at line 117 of file LibFT4222.h.

◆ I2CM_BUS_BUSY

#define I2CM_BUS_BUSY (   status)    (((status)&0x40) != 0)

Definition at line 119 of file LibFT4222.h.

◆ I2CM_CONTROLLER_BUSY

#define I2CM_CONTROLLER_BUSY (   status)    (((status)&0x01) != 0)

Definition at line 114 of file LibFT4222.h.

◆ I2CM_DATA_NACK

#define I2CM_DATA_NACK (   status)    (((status)&0x0A) != 0)

Definition at line 115 of file LibFT4222.h.

◆ I2CM_IDLE

#define I2CM_IDLE (   status)    (((status)&0x20) != 0)

Definition at line 118 of file LibFT4222.h.

◆ LIBFT4222_API

#define LIBFT4222_API

Definition at line 76 of file LibFT4222.h.

◆ SPI_ACK

#define SPI_ACK   0x84

Definition at line 101 of file LibFT4222.h.

◆ SPI_MASTER_TRANSFER

#define SPI_MASTER_TRANSFER   0x80

Definition at line 93 of file LibFT4222.h.

◆ SPI_SHART_SLAVE_TRANSFER

#define SPI_SHART_SLAVE_TRANSFER   0x83

Definition at line 100 of file LibFT4222.h.

◆ SPI_SHORT_MASTER_TRANSFER

#define SPI_SHORT_MASTER_TRANSFER   0x82

Definition at line 95 of file LibFT4222.h.

◆ SPI_SHORT_SLAVE_TRANSFER

#define SPI_SHORT_SLAVE_TRANSFER   0x83

Definition at line 96 of file LibFT4222.h.

◆ SPI_SLAVE_TRANSFER

#define SPI_SLAVE_TRANSFER   0x81

Definition at line 94 of file LibFT4222.h.

Typedef Documentation

◆ FT4222_ClockRate

◆ FT4222_FUNCTION

◆ FT4222_SPIClock

◆ FT4222_SPICPHA

◆ FT4222_SPICPOL

◆ FT4222_SPIMode

◆ FT4222_STATUS

FT4222 Device status

◆ FT4222_Version

◆ GPIO_Dir

typedef enum GPIO_Dir GPIO_Dir

◆ GPIO_Output

typedef enum GPIO_Output GPIO_Output

◆ GPIO_Port

typedef enum GPIO_Port GPIO_Port

◆ GPIO_Trigger

typedef enum GPIO_Trigger GPIO_Trigger

◆ I2C_MasterFlag

◆ int16

typedef int16_t int16

Definition at line 71 of file LibFT4222.h.

◆ int32

typedef int32_t int32

Definition at line 72 of file LibFT4222.h.

◆ int64

typedef int64_t int64

Definition at line 73 of file LibFT4222.h.

◆ int8

typedef int8_t int8

Definition at line 70 of file LibFT4222.h.

◆ SPI_DrivingStrength

◆ SPI_SlaveProtocol

◆ uint16

typedef uint16_t uint16

Definition at line 67 of file LibFT4222.h.

◆ uint32

typedef uint32_t uint32

Definition at line 68 of file LibFT4222.h.

◆ uint64

typedef uint64_t uint64

Definition at line 69 of file LibFT4222.h.

◆ uint8

typedef uint8_t uint8

Definition at line 66 of file LibFT4222.h.

Enumeration Type Documentation

◆ FT4222_ClockRate

Enumerator
SYS_CLK_60 

0

SYS_CLK_24 
SYS_CLK_48 
SYS_CLK_80 

Definition at line 171 of file LibFT4222.h.

172{
173 SYS_CLK_60 = 0,
177
FT4222_ClockRate
Definition LibFT4222.h:172
@ SYS_CLK_80
Definition LibFT4222.h:176
@ SYS_CLK_48
Definition LibFT4222.h:175
@ SYS_CLK_24
Definition LibFT4222.h:174
@ SYS_CLK_60
Definition LibFT4222.h:173

◆ FT4222_FUNCTION

Enumerator
FT4222_I2C_MASTER 

1

FT4222_I2C_SLAVE 
FT4222_SPI_MASTER 
FT4222_SPI_SLAVE 

Definition at line 180 of file LibFT4222.h.

181{
186
FT4222_FUNCTION
Definition LibFT4222.h:181
@ FT4222_SPI_MASTER
Definition LibFT4222.h:184
@ FT4222_I2C_MASTER
Definition LibFT4222.h:182
@ FT4222_SPI_SLAVE
Definition LibFT4222.h:185
@ FT4222_I2C_SLAVE
Definition LibFT4222.h:183

◆ FT4222_SPIClock

Enumerator
CLK_NONE 
CLK_DIV_2 

< 0 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

Definition at line 198 of file LibFT4222.h.

199{
200 CLK_NONE = 0,
201 CLK_DIV_2,
202 CLK_DIV_4,
203 CLK_DIV_8,
204 CLK_DIV_16,
205 CLK_DIV_32,
206 CLK_DIV_64,
210
FT4222_SPIClock
Definition LibFT4222.h:199
@ CLK_DIV_512
Definition LibFT4222.h:209
@ CLK_NONE
Definition LibFT4222.h:200
@ CLK_DIV_128
Definition LibFT4222.h:207
@ CLK_DIV_32
Definition LibFT4222.h:205
@ CLK_DIV_8
Definition LibFT4222.h:203
@ CLK_DIV_4
Definition LibFT4222.h:202
@ CLK_DIV_2
Definition LibFT4222.h:201
@ CLK_DIV_16
Definition LibFT4222.h:204
@ CLK_DIV_64
Definition LibFT4222.h:206
@ CLK_DIV_256
Definition LibFT4222.h:208

◆ FT4222_SPICPHA

Enumerator
CLK_LEADING 

0

CLK_TRAILING 

1

Definition at line 219 of file LibFT4222.h.

220{
221 CLK_LEADING = 0,
222 CLK_TRAILING = 1,
FT4222_SPICPHA
Definition LibFT4222.h:220
@ CLK_LEADING
Definition LibFT4222.h:221
@ CLK_TRAILING
Definition LibFT4222.h:222

◆ FT4222_SPICPOL

Enumerator
CLK_IDLE_LOW 

0

CLK_IDLE_HIGH 

1

Definition at line 213 of file LibFT4222.h.

214{
215 CLK_IDLE_LOW = 0,
216 CLK_IDLE_HIGH = 1,
FT4222_SPICPOL
Definition LibFT4222.h:214
@ CLK_IDLE_HIGH
Definition LibFT4222.h:216
@ CLK_IDLE_LOW
Definition LibFT4222.h:215

◆ FT4222_SPIMode

Enumerator
SPI_IO_NONE 

0

SPI_IO_SINGLE 

1

SPI_IO_DUAL 

2

SPI_IO_QUAD 

4

Definition at line 189 of file LibFT4222.h.

190{
191 SPI_IO_NONE = 0,
192 SPI_IO_SINGLE = 1,
193 SPI_IO_DUAL = 2,
194 SPI_IO_QUAD = 4,
195
FT4222_SPIMode
Definition LibFT4222.h:190
@ SPI_IO_QUAD
Definition LibFT4222.h:194
@ SPI_IO_DUAL
Definition LibFT4222.h:193
@ SPI_IO_SINGLE
Definition LibFT4222.h:192
@ SPI_IO_NONE
Definition LibFT4222.h:191

◆ FT4222_STATUS

FT4222 Device status

Enumerator
FT4222_OK 
FT4222_INVALID_HANDLE 
FT4222_DEVICE_NOT_FOUND 
FT4222_DEVICE_NOT_OPENED 
FT4222_IO_ERROR 
FT4222_INSUFFICIENT_RESOURCES 
FT4222_INVALID_PARAMETER 
FT4222_INVALID_BAUD_RATE 
FT4222_DEVICE_NOT_OPENED_FOR_ERASE 
FT4222_DEVICE_NOT_OPENED_FOR_WRITE 
FT4222_FAILED_TO_WRITE_DEVICE 
FT4222_EEPROM_READ_FAILED 
FT4222_EEPROM_WRITE_FAILED 
FT4222_EEPROM_ERASE_FAILED 
FT4222_EEPROM_NOT_PRESENT 
FT4222_EEPROM_NOT_PROGRAMMED 
FT4222_INVALID_ARGS 
FT4222_NOT_SUPPORTED 
FT4222_OTHER_ERROR 
FT4222_DEVICE_LIST_NOT_READY 
FT4222_DEVICE_NOT_SUPPORTED 

1000, FT_STATUS extending message

FT4222_CLK_NOT_SUPPORTED 
FT4222_VENDER_CMD_NOT_SUPPORTED 
FT4222_IS_NOT_SPI_MODE 
FT4222_IS_NOT_I2C_MODE 
FT4222_IS_NOT_SPI_SINGLE_MODE 
FT4222_IS_NOT_SPI_MULTI_MODE 
FT4222_WRONG_I2C_ADDR 
FT4222_INVAILD_FUNCTION 
FT4222_INVALID_POINTER 
FT4222_EXCEEDED_MAX_TRANSFER_SIZE 
FT4222_FAILED_TO_READ_DEVICE 
FT4222_I2C_NOT_SUPPORTED_IN_THIS_MODE 
FT4222_GPIO_NOT_SUPPORTED_IN_THIS_MODE 
FT4222_GPIO_EXCEEDED_MAX_PORTNUM 
FT4222_GPIO_WRITE_NOT_SUPPORTED 
FT4222_GPIO_PULLUP_INVALID_IN_INPUTMODE 
FT4222_GPIO_PULLDOWN_INVALID_IN_INPUTMODE 
FT4222_GPIO_OPENDRAIN_INVALID_IN_OUTPUTMODE 
FT4222_INTERRUPT_NOT_SUPPORTED 
FT4222_GPIO_INPUT_NOT_SUPPORTED 
FT4222_EVENT_NOT_SUPPORTED 
FT4222_FUN_NOT_SUPPORT 

Definition at line 123 of file LibFT4222.h.

124{
125 FT4222_OK,
145
FT4222_STATUS
Definition LibFT4222.h:124
@ FT4222_DEVICE_NOT_FOUND
Definition LibFT4222.h:127
@ FT4222_FAILED_TO_WRITE_DEVICE
Definition LibFT4222.h:135
@ FT4222_EEPROM_ERASE_FAILED
Definition LibFT4222.h:138
@ FT4222_INVAILD_FUNCTION
Definition LibFT4222.h:154
@ FT4222_DEVICE_NOT_OPENED_FOR_ERASE
Definition LibFT4222.h:133
@ FT4222_INVALID_ARGS
Definition LibFT4222.h:141
@ FT4222_GPIO_EXCEEDED_MAX_PORTNUM
Definition LibFT4222.h:160
@ FT4222_GPIO_NOT_SUPPORTED_IN_THIS_MODE
Definition LibFT4222.h:159
@ FT4222_EXCEEDED_MAX_TRANSFER_SIZE
Definition LibFT4222.h:156
@ FT4222_INVALID_POINTER
Definition LibFT4222.h:155
@ FT4222_CLK_NOT_SUPPORTED
Definition LibFT4222.h:147
@ FT4222_IS_NOT_SPI_SINGLE_MODE
Definition LibFT4222.h:151
@ FT4222_EEPROM_NOT_PRESENT
Definition LibFT4222.h:139
@ FT4222_DEVICE_LIST_NOT_READY
Definition LibFT4222.h:144
@ FT4222_INTERRUPT_NOT_SUPPORTED
Definition LibFT4222.h:165
@ FT4222_GPIO_PULLUP_INVALID_IN_INPUTMODE
Definition LibFT4222.h:162
@ FT4222_EVENT_NOT_SUPPORTED
Definition LibFT4222.h:167
@ FT4222_INVALID_PARAMETER
Definition LibFT4222.h:131
@ FT4222_FAILED_TO_READ_DEVICE
Definition LibFT4222.h:157
@ FT4222_OTHER_ERROR
Definition LibFT4222.h:143
@ FT4222_GPIO_OPENDRAIN_INVALID_IN_OUTPUTMODE
Definition LibFT4222.h:164
@ FT4222_INVALID_BAUD_RATE
Definition LibFT4222.h:132
@ FT4222_IS_NOT_SPI_MULTI_MODE
Definition LibFT4222.h:152
@ FT4222_EEPROM_WRITE_FAILED
Definition LibFT4222.h:137
@ FT4222_GPIO_INPUT_NOT_SUPPORTED
Definition LibFT4222.h:166
@ FT4222_DEVICE_NOT_SUPPORTED
Definition LibFT4222.h:146
@ FT4222_GPIO_WRITE_NOT_SUPPORTED
Definition LibFT4222.h:161
@ FT4222_IS_NOT_SPI_MODE
Definition LibFT4222.h:149
@ FT4222_WRONG_I2C_ADDR
Definition LibFT4222.h:153
@ FT4222_IO_ERROR
Definition LibFT4222.h:129
@ FT4222_IS_NOT_I2C_MODE
Definition LibFT4222.h:150
@ FT4222_VENDER_CMD_NOT_SUPPORTED
Definition LibFT4222.h:148
@ FT4222_DEVICE_NOT_OPENED_FOR_WRITE
Definition LibFT4222.h:134
@ FT4222_DEVICE_NOT_OPENED
Definition LibFT4222.h:128
@ FT4222_INVALID_HANDLE
Definition LibFT4222.h:126
@ FT4222_NOT_SUPPORTED
Definition LibFT4222.h:142
@ FT4222_I2C_NOT_SUPPORTED_IN_THIS_MODE
Definition LibFT4222.h:158
@ FT4222_INSUFFICIENT_RESOURCES
Definition LibFT4222.h:130
@ FT4222_OK
Definition LibFT4222.h:125
@ FT4222_GPIO_PULLDOWN_INVALID_IN_INPUTMODE
Definition LibFT4222.h:163
@ FT4222_EEPROM_NOT_PROGRAMMED
Definition LibFT4222.h:140
@ FT4222_FUN_NOT_SUPPORT
Definition LibFT4222.h:168
@ FT4222_EEPROM_READ_FAILED
Definition LibFT4222.h:136

◆ GPIO_Dir

enum GPIO_Dir
Enumerator
GPIO_OUTPUT 

0

GPIO_INPUT 

Definition at line 241 of file LibFT4222.h.

242{
243 GPIO_OUTPUT = 0,
245} GPIO_Dir;
GPIO_Dir
Definition LibFT4222.h:242
@ GPIO_INPUT
Definition LibFT4222.h:244
@ GPIO_OUTPUT
Definition LibFT4222.h:243

◆ GPIO_Output

Enumerator
GPIO_OUTPUT_LOW 
GPIO_OUTPUT_HIGH 

Definition at line 257 of file LibFT4222.h.

258{
GPIO_Output
Definition LibFT4222.h:258
@ GPIO_OUTPUT_LOW
Definition LibFT4222.h:259
@ GPIO_OUTPUT_HIGH
Definition LibFT4222.h:260

◆ GPIO_Port

enum GPIO_Port
Enumerator
GPIO_PORT0 

0

GPIO_PORT1 
GPIO_PORT2 
GPIO_PORT3 

Definition at line 233 of file LibFT4222.h.

234{
235 GPIO_PORT0 = 0,
239} GPIO_Port;
GPIO_Port
Definition LibFT4222.h:234
@ GPIO_PORT0
Definition LibFT4222.h:235
@ GPIO_PORT3
Definition LibFT4222.h:238
@ GPIO_PORT2
Definition LibFT4222.h:237
@ GPIO_PORT1
Definition LibFT4222.h:236

◆ GPIO_Trigger

Enumerator
GPIO_TRIGGER_RISING 

0x01

GPIO_TRIGGER_FALLING 

0x02

GPIO_TRIGGER_LEVEL_HIGH 

0x04

GPIO_TRIGGER_LEVEL_LOW 

0x08

Definition at line 249 of file LibFT4222.h.

250{
251 GPIO_TRIGGER_RISING = 0x01,
252 GPIO_TRIGGER_FALLING = 0x02,
GPIO_Trigger
Definition LibFT4222.h:250
@ GPIO_TRIGGER_RISING
Definition LibFT4222.h:251
@ GPIO_TRIGGER_LEVEL_HIGH
Definition LibFT4222.h:253
@ GPIO_TRIGGER_FALLING
Definition LibFT4222.h:252
@ GPIO_TRIGGER_LEVEL_LOW
Definition LibFT4222.h:254

◆ I2C_MasterFlag

Enumerator
NONE 

0x80

START 

0x02

Repeated_START 

0x03, Repeated_START will not send master code in HS mode

STOP 

0x04

START_AND_STOP 

0x06, START condition followed by SEND and STOP condition

Definition at line 263 of file LibFT4222.h.

264{
265 NONE = 0x80,
266 START = 0x02,
267 Repeated_START = 0x03,
268 STOP = 0x04,
269 START_AND_STOP = 0x06,
I2C_MasterFlag
Definition LibFT4222.h:264
@ START
Definition LibFT4222.h:266
@ STOP
Definition LibFT4222.h:268
@ Repeated_START
Definition LibFT4222.h:267
@ NONE
Definition LibFT4222.h:265
@ START_AND_STOP
Definition LibFT4222.h:269

◆ SPI_DrivingStrength

Enumerator
DS_4MA 

0

DS_8MA 
DS_12MA 
DS_16MA 

Definition at line 225 of file LibFT4222.h.

226{
227 DS_4MA = 0,
228 DS_8MA,
229 DS_12MA,
230 DS_16MA,
SPI_DrivingStrength
Definition LibFT4222.h:226
@ DS_12MA
Definition LibFT4222.h:229
@ DS_4MA
Definition LibFT4222.h:227
@ DS_16MA
Definition LibFT4222.h:230
@ DS_8MA
Definition LibFT4222.h:228

◆ SPI_SlaveProtocol

Enumerator
SPI_SLAVE_WITH_PROTOCOL 

0

SPI_SLAVE_NO_PROTOCOL 
SPI_SLAVE_NO_ACK 

Definition at line 272 of file LibFT4222.h.

273{
SPI_SlaveProtocol
Definition LibFT4222.h:273
@ SPI_SLAVE_NO_ACK
Definition LibFT4222.h:276
@ SPI_SLAVE_NO_PROTOCOL
Definition LibFT4222.h:275
@ SPI_SLAVE_WITH_PROTOCOL
Definition LibFT4222.h:274

Function Documentation

◆ FT4222_ChipReset()

LIBFT4222_API FT4222_STATUS FT4222_ChipReset ( FT_HANDLE  ftHandle)

◆ FT4222_GetClock()

LIBFT4222_API FT4222_STATUS FT4222_GetClock ( FT_HANDLE  ftHandle,
FT4222_ClockRate clk 
)

◆ FT4222_GetMaxTransferSize()

LIBFT4222_API FT4222_STATUS FT4222_GetMaxTransferSize ( FT_HANDLE  ftHandle,
uint16 pMaxSize 
)

◆ FT4222_GetVersion()

LIBFT4222_API FT4222_STATUS FT4222_GetVersion ( FT_HANDLE  ftHandle,
FT4222_Version pVersion 
)

◆ FT4222_GPIO_GetTriggerStatus()

LIBFT4222_API FT4222_STATUS FT4222_GPIO_GetTriggerStatus ( FT_HANDLE  ftHandle,
GPIO_Port  portNum,
uint16 queueSize 
)

◆ FT4222_GPIO_Init()

LIBFT4222_API FT4222_STATUS FT4222_GPIO_Init ( FT_HANDLE  ftHandle,
GPIO_Dir  gpioDir[4] 
)

◆ FT4222_GPIO_Read()

LIBFT4222_API FT4222_STATUS FT4222_GPIO_Read ( FT_HANDLE  ftHandle,
GPIO_Port  portNum,
BOOL value 
)

◆ FT4222_GPIO_ReadTriggerQueue()

LIBFT4222_API FT4222_STATUS FT4222_GPIO_ReadTriggerQueue ( FT_HANDLE  ftHandle,
GPIO_Port  portNum,
GPIO_Trigger events,
uint16  readSize,
uint16 sizeofRead 
)

◆ FT4222_GPIO_SetInputTrigger()

LIBFT4222_API FT4222_STATUS FT4222_GPIO_SetInputTrigger ( FT_HANDLE  ftHandle,
GPIO_Port  portNum,
GPIO_Trigger  trigger 
)

◆ FT4222_GPIO_SetWaveFormMode()

LIBFT4222_API FT4222_STATUS FT4222_GPIO_SetWaveFormMode ( FT_HANDLE  ftHandle,
BOOL  enable 
)

◆ FT4222_GPIO_Write()

LIBFT4222_API FT4222_STATUS FT4222_GPIO_Write ( FT_HANDLE  ftHandle,
GPIO_Port  portNum,
BOOL  bValue 
)

◆ FT4222_I2CMaster_GetStatus()

LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_GetStatus ( FT_HANDLE  ftHandle,
uint8 controllerStatus 
)

◆ FT4222_I2CMaster_Init()

LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_Init ( FT_HANDLE  ftHandle,
uint32  kbps 
)

◆ FT4222_I2CMaster_Read()

LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_Read ( FT_HANDLE  ftHandle,
uint16  deviceAddress,
uint8 buffer,
uint16  bufferSize,
uint16 sizeTransferred 
)

◆ FT4222_I2CMaster_ReadEx()

LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_ReadEx ( FT_HANDLE  ftHandle,
uint16  deviceAddress,
uint8  flag,
uint8 buffer,
uint16  bufferSize,
uint16 sizeTransferred 
)

◆ FT4222_I2CMaster_Reset()

LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_Reset ( FT_HANDLE  ftHandle)

◆ FT4222_I2CMaster_Write()

LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_Write ( FT_HANDLE  ftHandle,
uint16  deviceAddress,
uint8 buffer,
uint16  bufferSize,
uint16 sizeTransferred 
)

◆ FT4222_I2CMaster_WriteEx()

LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_WriteEx ( FT_HANDLE  ftHandle,
uint16  deviceAddress,
uint8  flag,
uint8 buffer,
uint16  bufferSize,
uint16 sizeTransferred 
)

◆ FT4222_I2CSlave_GetAddress()

LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_GetAddress ( FT_HANDLE  ftHandle,
uint8 addr 
)

◆ FT4222_I2CSlave_GetRxStatus()

LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_GetRxStatus ( FT_HANDLE  ftHandle,
uint16 pRxSize 
)

◆ FT4222_I2CSlave_Init()

LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Init ( FT_HANDLE  ftHandle)

◆ FT4222_I2CSlave_Read()

LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Read ( FT_HANDLE  ftHandle,
uint8 buffer,
uint16  bufferSize,
uint16 sizeTransferred 
)

◆ FT4222_I2CSlave_Reset()

LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Reset ( FT_HANDLE  ftHandle)

◆ FT4222_I2CSlave_SetAddress()

LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_SetAddress ( FT_HANDLE  ftHandle,
uint8  addr 
)

◆ FT4222_I2CSlave_SetClockStretch()

LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_SetClockStretch ( FT_HANDLE  ftHandle,
BOOL  enable 
)

◆ FT4222_I2CSlave_SetRespWord()

LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_SetRespWord ( FT_HANDLE  ftHandle,
uint8  responseWord 
)

◆ FT4222_I2CSlave_Write()

LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Write ( FT_HANDLE  ftHandle,
uint8 buffer,
uint16  bufferSize,
uint16 sizeTransferred 
)

◆ FT4222_SetClock()

LIBFT4222_API FT4222_STATUS FT4222_SetClock ( FT_HANDLE  ftHandle,
FT4222_ClockRate  clk 
)

◆ FT4222_SetEventNotification()

LIBFT4222_API FT4222_STATUS FT4222_SetEventNotification ( FT_HANDLE  ftHandle,
DWORD  mask,
PVOID  param 
)

◆ FT4222_SetInterruptTrigger()

LIBFT4222_API FT4222_STATUS FT4222_SetInterruptTrigger ( FT_HANDLE  ftHandle,
GPIO_Trigger  trigger 
)

◆ FT4222_SetSuspendOut()

LIBFT4222_API FT4222_STATUS FT4222_SetSuspendOut ( FT_HANDLE  ftHandle,
BOOL  enable 
)

◆ FT4222_SetWakeUpInterrupt()

LIBFT4222_API FT4222_STATUS FT4222_SetWakeUpInterrupt ( FT_HANDLE  ftHandle,
BOOL  enable 
)

◆ FT4222_SPI_Reset()

LIBFT4222_API FT4222_STATUS FT4222_SPI_Reset ( FT_HANDLE  ftHandle)

◆ FT4222_SPI_ResetTransaction()

LIBFT4222_API FT4222_STATUS FT4222_SPI_ResetTransaction ( FT_HANDLE  ftHandle,
uint8  spiIdx 
)

◆ FT4222_SPI_SetDrivingStrength()

LIBFT4222_API FT4222_STATUS FT4222_SPI_SetDrivingStrength ( FT_HANDLE  ftHandle,
SPI_DrivingStrength  clkStrength,
SPI_DrivingStrength  ioStrength,
SPI_DrivingStrength  ssoStrength 
)

◆ FT4222_SPIMaster_Init()

LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_Init ( FT_HANDLE  ftHandle,
FT4222_SPIMode  ioLine,
FT4222_SPIClock  clock,
FT4222_SPICPOL  cpol,
FT4222_SPICPHA  cpha,
uint8  ssoMap 
)

◆ FT4222_SPIMaster_MultiReadWrite()

LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_MultiReadWrite ( FT_HANDLE  ftHandle,
uint8 readBuffer,
uint8 writeBuffer,
uint8  singleWriteBytes,
uint16  multiWriteBytes,
uint16  multiReadBytes,
uint32 sizeOfRead 
)

◆ FT4222_SPIMaster_SetLines()

LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_SetLines ( FT_HANDLE  ftHandle,
FT4222_SPIMode  spiMode 
)

◆ FT4222_SPIMaster_SingleRead()

LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_SingleRead ( FT_HANDLE  ftHandle,
uint8 buffer,
uint16  bufferSize,
uint16 sizeOfRead,
BOOL  isEndTransaction 
)

◆ FT4222_SPIMaster_SingleReadWrite()

LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_SingleReadWrite ( FT_HANDLE  ftHandle,
uint8 readBuffer,
uint8 writeBuffer,
uint16  bufferSize,
uint16 sizeTransferred,
BOOL  isEndTransaction 
)

◆ FT4222_SPIMaster_SingleWrite()

LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_SingleWrite ( FT_HANDLE  ftHandle,
uint8 buffer,
uint16  bufferSize,
uint16 sizeTransferred,
BOOL  isEndTransaction 
)

◆ FT4222_SPISlave_GetRxStatus()

LIBFT4222_API FT4222_STATUS FT4222_SPISlave_GetRxStatus ( FT_HANDLE  ftHandle,
uint16 pRxSize 
)

◆ FT4222_SPISlave_Init()

LIBFT4222_API FT4222_STATUS FT4222_SPISlave_Init ( FT_HANDLE  ftHandle)

◆ FT4222_SPISlave_InitEx()

LIBFT4222_API FT4222_STATUS FT4222_SPISlave_InitEx ( FT_HANDLE  ftHandle,
SPI_SlaveProtocol  protocolOpt 
)

◆ FT4222_SPISlave_Read()

LIBFT4222_API FT4222_STATUS FT4222_SPISlave_Read ( FT_HANDLE  ftHandle,
uint8 buffer,
uint16  bufferSize,
uint16 sizeOfRead 
)

◆ FT4222_SPISlave_RxQuickResponse()

LIBFT4222_API FT4222_STATUS FT4222_SPISlave_RxQuickResponse ( FT_HANDLE  ftHandle,
BOOL  enable 
)

◆ FT4222_SPISlave_SetMode()

LIBFT4222_API FT4222_STATUS FT4222_SPISlave_SetMode ( FT_HANDLE  ftHandle,
FT4222_SPICPOL  cpol,
FT4222_SPICPHA  cpha 
)

◆ FT4222_SPISlave_Write()

LIBFT4222_API FT4222_STATUS FT4222_SPISlave_Write ( FT_HANDLE  ftHandle,
uint8 buffer,
uint16  bufferSize,
uint16 sizeTransferred 
)

◆ FT4222_UnInitialize()

LIBFT4222_API FT4222_STATUS FT4222_UnInitialize ( FT_HANDLE  ftHandle)