Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
59
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
3.7.5 I
2
C Slave Read
FT4222_STATUS FT4222_I2CSlave_Read(FT_HANDLE ftHandle, uint8* buffer, uint16
bytesToRead, uint16* sizeTransferred)
Supported Chip:
Summary:
Read data from the buffer of the I
2
C slave device.
Parameters:
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 or sizeTransferred is NULL
FT4222_INVALID_PARAMETER: Parameter bytesToRead is equal to zero
Prerequisite:
FT4222_I2CSlave_Init
Example:
Please refer to the example in FT4222_I2CSlave_GetRxStatus
3.7.6 I
2
C Slave Write
FT4222_STATUS FT4222_I2CSlave_Write(FT_HANDLE ftHandle, uint8* buffer, uint16
bytesToWrite, uint16* sizeTransferred)
Summary:
Write data to the buffer of I
2
C slave device.
Parameters:
Pointer to the buffer that contains the data to be written to the device.
Number of bytes to write to the device.
Pointer to a variable of type uint16 which receives the number of bytes
written to the device.