EasyManua.ls Logo

FTDI LibFT4222 - I 2 C Slave Read; I 2 C Slave Write

Default Icon
78 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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:
FT4222 chip version
Supported
FT4222 Rev A
YES
FT4222 Rev B
YES
FT4222 Rev C
YES
FT4222 Rev D
YES
Summary:
Read data from the buffer of the I
2
C slave device.
Parameters:
ftHandle
Handle of the device.
buffer
Pointer to the buffer that receives the data from the device.
bytesToRead
Number of bytes to read from the device.
sizeTransferred
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:
ftHandle
Handle of the device.
buffer
Pointer to the buffer that contains the data to be written to the device.
bytesToWrite
Number of bytes to write to the device.
sizeTransferred
Pointer to a variable of type uint16 which receives the number of bytes
written to the device.

Table of Contents