EasyManua.ls Logo

FTDI LibFT4222 - C Master; I 2 C Master Getstatus

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
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:
FT4222 chip version
Supported
FT4222 Rev A
YES
FT4222 Rev B
YES
FT4222 Rev C
YES
FT4222 Rev D
YES
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:
ftHandle
Handle of the device.
controllerStatus
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

Table of Contents