39#ifndef _FTDI_LIB_FT4222_H_
40#define _FTDI_LIB_FT4222_H_
56#ifdef LIBFT4222_EXPORTS
57#define LIBFT4222_API __declspec(dllexport)
59#define LIBFT4222_API __declspec(dllimport)
82#pragma warning(disable : 4819)
87#define FT4222_EVENT_RXCHAR 8
89#define FT4222_SPI_SLAVE_SYNC_WORD 0x5A
93#define SPI_MASTER_TRANSFER 0x80
94#define SPI_SLAVE_TRANSFER 0x81
95#define SPI_SHORT_MASTER_TRANSFER 0x82
96#define SPI_SHORT_SLAVE_TRANSFER 0x83
100#define SPI_SHART_SLAVE_TRANSFER 0x83
114#define I2CM_CONTROLLER_BUSY(status) (((status)&0x01) != 0)
115#define I2CM_DATA_NACK(status) (((status)&0x0A) != 0)
116#define I2CM_ADDRESS_NACK(status) (((status)&0x06) != 0)
117#define I2CM_ARB_LOST(status) (((status)&0x12) != 0)
118#define I2CM_IDLE(status) (((status)&0x20) != 0)
119#define I2CM_BUS_BUSY(status) (((status)&0x40) != 0)
248#define GPIO_Tigger GPIO_Trigger
unsigned long long uint64_t
static ft_uint32_t ft_uint8_t * buffer
LIBFT4222_API FT4222_STATUS FT4222_GPIO_GetTriggerStatus(FT_HANDLE ftHandle, GPIO_Port portNum, uint16 *queueSize)
@ SPI_SLAVE_WITH_PROTOCOL
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_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_SPIMaster_MultiReadWrite(FT_HANDLE ftHandle, uint8 *readBuffer, uint8 *writeBuffer, uint8 singleWriteBytes, uint16 multiWriteBytes, uint16 multiReadBytes, uint32 *sizeOfRead)
LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_SetLines(FT_HANDLE ftHandle, FT4222_SPIMode spiMode)
LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_ReadEx(FT_HANDLE ftHandle, uint16 deviceAddress, uint8 flag, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred)
@ FT4222_DEVICE_NOT_FOUND
@ FT4222_FAILED_TO_WRITE_DEVICE
@ FT4222_EEPROM_ERASE_FAILED
@ FT4222_INVAILD_FUNCTION
@ FT4222_DEVICE_NOT_OPENED_FOR_ERASE
@ FT4222_GPIO_EXCEEDED_MAX_PORTNUM
@ FT4222_GPIO_NOT_SUPPORTED_IN_THIS_MODE
@ FT4222_EXCEEDED_MAX_TRANSFER_SIZE
@ FT4222_CLK_NOT_SUPPORTED
@ FT4222_IS_NOT_SPI_SINGLE_MODE
@ FT4222_EEPROM_NOT_PRESENT
@ FT4222_DEVICE_LIST_NOT_READY
@ FT4222_INTERRUPT_NOT_SUPPORTED
@ FT4222_GPIO_PULLUP_INVALID_IN_INPUTMODE
@ FT4222_EVENT_NOT_SUPPORTED
@ FT4222_INVALID_PARAMETER
@ FT4222_FAILED_TO_READ_DEVICE
@ FT4222_GPIO_OPENDRAIN_INVALID_IN_OUTPUTMODE
@ FT4222_INVALID_BAUD_RATE
@ FT4222_IS_NOT_SPI_MULTI_MODE
@ FT4222_EEPROM_WRITE_FAILED
@ FT4222_GPIO_INPUT_NOT_SUPPORTED
@ FT4222_DEVICE_NOT_SUPPORTED
@ FT4222_GPIO_WRITE_NOT_SUPPORTED
@ FT4222_VENDER_CMD_NOT_SUPPORTED
@ FT4222_DEVICE_NOT_OPENED_FOR_WRITE
@ FT4222_DEVICE_NOT_OPENED
@ FT4222_I2C_NOT_SUPPORTED_IN_THIS_MODE
@ FT4222_INSUFFICIENT_RESOURCES
@ FT4222_GPIO_PULLDOWN_INVALID_IN_INPUTMODE
@ FT4222_EEPROM_NOT_PROGRAMMED
@ FT4222_EEPROM_READ_FAILED
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_Read(FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeOfRead)
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_GetRxStatus(FT_HANDLE ftHandle, uint16 *pRxSize)
@ GPIO_TRIGGER_LEVEL_HIGH
LIBFT4222_API FT4222_STATUS FT4222_UnInitialize(FT_HANDLE ftHandle)
LIBFT4222_API FT4222_STATUS FT4222_GetMaxTransferSize(FT_HANDLE ftHandle, uint16 *pMaxSize)
LIBFT4222_API FT4222_STATUS FT4222_SetWakeUpInterrupt(FT_HANDLE ftHandle, BOOL enable)
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_Init(FT_HANDLE ftHandle)
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_SetSuspendOut(FT_HANDLE ftHandle, BOOL enable)
LIBFT4222_API FT4222_STATUS FT4222_ChipReset(FT_HANDLE ftHandle)
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_GetAddress(FT_HANDLE ftHandle, uint8 *addr)
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_SetEventNotification(FT_HANDLE ftHandle, DWORD mask, PVOID param)
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_RxQuickResponse(FT_HANDLE ftHandle, BOOL enable)
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_GPIO_Read(FT_HANDLE ftHandle, GPIO_Port portNum, BOOL *value)
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_SetMode(FT_HANDLE ftHandle, FT4222_SPICPOL cpol, FT4222_SPICPHA cpha)
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Write(FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred)
LIBFT4222_API FT4222_STATUS FT4222_GetVersion(FT_HANDLE ftHandle, FT4222_Version *pVersion)
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_GetRxStatus(FT_HANDLE ftHandle, uint16 *pRxSize)
LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_Reset(FT_HANDLE ftHandle)
LIBFT4222_API FT4222_STATUS FT4222_SPI_ResetTransaction(FT_HANDLE ftHandle, uint8 spiIdx)
LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_SingleRead(FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeOfRead, BOOL isEndTransaction)
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Reset(FT_HANDLE ftHandle)
LIBFT4222_API FT4222_STATUS FT4222_GPIO_SetInputTrigger(FT_HANDLE ftHandle, GPIO_Port portNum, GPIO_Trigger trigger)
LIBFT4222_API FT4222_STATUS FT4222_SPIMaster_SingleWrite(FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred, BOOL isEndTransaction)
LIBFT4222_API FT4222_STATUS FT4222_GPIO_SetWaveFormMode(FT_HANDLE ftHandle, BOOL enable)
LIBFT4222_API FT4222_STATUS FT4222_SPI_Reset(FT_HANDLE ftHandle)
LIBFT4222_API FT4222_STATUS FT4222_SetClock(FT_HANDLE ftHandle, FT4222_ClockRate clk)
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_InitEx(FT_HANDLE ftHandle, SPI_SlaveProtocol protocolOpt)
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_SetRespWord(FT_HANDLE ftHandle, uint8 responseWord)
LIBFT4222_API FT4222_STATUS FT4222_SetInterruptTrigger(FT_HANDLE ftHandle, GPIO_Trigger trigger)
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_SetAddress(FT_HANDLE ftHandle, uint8 addr)
LIBFT4222_API FT4222_STATUS FT4222_SPI_SetDrivingStrength(FT_HANDLE ftHandle, SPI_DrivingStrength clkStrength, SPI_DrivingStrength ioStrength, SPI_DrivingStrength ssoStrength)
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_SetClockStretch(FT_HANDLE ftHandle, BOOL enable)
LIBFT4222_API FT4222_STATUS FT4222_SPISlave_Write(FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred)
LIBFT4222_API FT4222_STATUS FT4222_GPIO_Write(FT_HANDLE ftHandle, GPIO_Port portNum, BOOL bValue)
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Init(FT_HANDLE ftHandle)
LIBFT4222_API FT4222_STATUS FT4222_GetClock(FT_HANDLE ftHandle, FT4222_ClockRate *clk)
LIBFT4222_API FT4222_STATUS FT4222_GPIO_Init(FT_HANDLE ftHandle, GPIO_Dir gpioDir[4])
LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_Init(FT_HANDLE ftHandle, uint32 kbps)
LIBFT4222_API FT4222_STATUS FT4222_I2CSlave_Read(FT_HANDLE ftHandle, uint8 *buffer, uint16 bufferSize, uint16 *sizeTransferred)
LIBFT4222_API FT4222_STATUS FT4222_I2CMaster_GetStatus(FT_HANDLE ftHandle, uint8 *controllerStatus)
Native USB device driver for FTDI FT232x, FT245x, FT2232x and FT4232x devices FTD2XX library definiti...