Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
46
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
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_SPI_MODE: The device is not in spi slave mode.
Prerequisite:
FT4222_SPISlave_InitEx or FT4222_SPISlave_Init or FT4222_SPIMaster_Init
3.6 I
2
C Master Functions
I
2
C (Inter Integrated Circuit) is a multi-master serial bus invented by Philips. I
2
C uses two bi-
directional open-drain wires called serial data (SDA) and serial clock (SCL). Common I²C bus
speeds are the 100 kbit/s standard mode (SM), 400 kbit/s fast mode (FM), 1 Mbit/s Fast mode
plus (FM+), and 3.4 Mbit/s High Speed mode (HS)
The FT4222H device can be initialized as either an I
2
C master or I
2
C slave under mode 0 and mode
3. Here is a brief overview of FT4222H I
2
C features:
Fully compatible to I
2
C v2.1 and v3 specification
7-bit address support
Support 4 speed configurations: 100KHz(SM), 400KHz(FM), 1MHz(FM+), and 3.4MHz(HS).
Clock stretching support in both master and slave mode.
Refer to DS_FT4222H for more details.
3.6.1 I2C Master Init
FT4222_STATUS FT4222_I2CMaster_Init(FT_HANDLE ftHandle, uint32 kbps)
Supported Chip:
Summary:
Initialize the FT4222H as an I
2
C master with the requested I
2
C speed.
Parameters:
The speed of I
2
C transmission. It ranges from 60K bps to 3400K bps. By specified
speed, the initialization function helps to setup the bus speed with the
corresponding mode. This parameter is used to configure the FT4222H to be
either SM, FB, FM+ or HS mode.