Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
52
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
Supported Chip:
Summary:
Read data from the specified I
2
C slave device with the specified I
2
C condition.
This function is supported by the rev B FT4222H or later.
Parameters:
Address of the target I
2
C slave.
The I
2
C condition will be sent with this I
2
C transaction
START = 0x02
Repeated_START = 0x03
Repeated_START will not send master code in HS mode
STOP = 0x04
START_AND_STOP = 0x06
Pointer to the buffer that receives the data from the device.
Number of bytes to read from the device.
Pointer to a variable of type uint16 which receives the number of bytes read
from the device.
Return Value:
FT4222_OK if successful, otherwise the return value is an FT error code.
Error code:
FT4222_DEVICE_NOT_OPENED: The initialization API is not called.
FT4222_IS_NOT_I2C_MODE: The device is not in i2c slave mode
FT4222_INVALID_POINTER: Parameter buffer is NULL
FT4222_INVALID_PARAMETER: bytesToRead is equal to zero
FT4222_FAILED_TO_READ_DEVICE: Failed to read data.
Prerequisite:
FT4222_I2CMaster_Init
Example:
Please refer to the example in FT4222_I2CMaster_WriteEx
I²C combined message support
In a combined message, each read or write begins with a START and the slave address. After the
first START, the subsequent starts are referred to as repeated START bits; repeated START bits are
not preceded by STOP bits, which indicate to the slave the next transfer is part of the same
message.