Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
i2c_msg Struct Reference

Interface to messages. More...

#include <mhal_i2c.h>

Data Fields

u8 addr
 The address of slave device which the master access. More...
 
enum i2c_trans_op flags
 I2C transfer operation mode. More...
 
u16 len
 Read or write data length, unit: byte.
 
u8 * buf
 Pointer to read or write data buffer.
 

Detailed Description

Interface to messages.

The struct i2c_msg needs to be configured before each transfer, and each i2c_msg represents a packet. One transaction of I2C master module can support up to three consecutive packets.

Field Documentation

u8 addr

The address of slave device which the master access.

Don't care when I2C controller as a slave device role.

enum i2c_trans_op flags

I2C transfer operation mode.

When I2C controller is set as a master role, the i2c_trans_op can choose I2C_WRRD, I2C_WR or I2C_RD. When I2C controller is set as a slave role, the i2c_trans_op can choose I2C_SLAVE_RX or I2C_SLAVE_TX.


The documentation for this struct was generated from the following file: