MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
I2C Peripheral and Driver Overview

Peripheral feature and how this peripheral works

The inter-integrated circuit(I2C) module provides a method of communication between a number of devices.

Features

How this peripheral works

Once I2C module configuration is finished, and its clock is ungated, the I2C module is ready to initiate I2C transfer on bus as master or process bus events as slave.

When MCU is in stop mode, if a primary/range/general call address match occurs, and also the I2C module's low power wakeup is enabled, the 'addressed as slave' interrupt will be generated that wakes up the MCU.

How this driver is designed to make this peripheral works

On abstraction level, the I2C driver provides 2 parallel layers for different users with different requirements on flexibility: Functional layer and Transactional layer. Do not mix the usage of these 2 layers.

Functional Layer

Transactional Layer

How to use this driver

API Return Types

APIs with non-void return have 3 return types: uint8_t/uint32_t, bool and status_t. All APIs that issue bus event during execution, including Functional APIs from Bus Operation Sub-group and all transactional APIs, all use status_t as their return type. The return tells user the bus's current status as the result of API's execution. <ACTION item="" add="" ref="" here="" to="" jump="" to="" anonymous="" enum="" definition="" of="" the="" status>="">

General Control Macro

Configuration Items Before Calling I2C Driver APIs

Functional layer usage model

Transactional layer usage model

Typical Use Cases

These code snipets shows the general calling sequence to use functional APIs and transactional APIs. For detail usage on appilcation level, refer to I2C driver examples in SDK package under boards/<board_name>/driver_examples/i2c.