Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
53
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
SR = repeated START condition
Here is an example for typical usage of I
2
C combined message:
// Write to I2C slave with START bit
FT4222_I2CMaster_WriteEx(ftHandle, deviceAddress, START, buffer, bufferSize,
sizeTransferred);
// Read from I2C slave with Repeated START and STOP bit
// Use Repeated_START flag instead of START to avoid the FT4222H sending master
code
// again in HS mode
FT4222_I2CMaster_ReadEx(ftHandle, deviceAddress, Repeated_START | STOP, buffer,
bufferSize, sizeTransferred);
3.6.6 I
2
C Master GetStatus
FT4222_STATUS FT4222_I2CMaster_GetStatus(FT_HANDLE ftHandle, uint8 *controllerStatus)
Supported Chip:
Summary:
Read the status of the I
2
C master controller. This can be used to poll a slave after i2c
transmission is complete.
Parameters:
Address of byte to receive status flags:
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
The header file provides convenience macros (such as I2CM_BUS_BUSY) to
test these bits.
Return Value:
FT4222_OK if successful, otherwise the return value is an FT error code.
Prerequisite:
FT4222_I2CMaster_Init