coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
i2c_msg Struct Reference

struct i2c_msg - an I2C transaction segment beginning with START @addr: Slave address, either seven or ten bits. More...

#include <i2c.h>

Collaboration diagram for i2c_msg:
Collaboration graph

Data Fields

uint16_t flags
 
uint16_t slave
 
uint16_t len
 
uint8_tbuf
 

Detailed Description

struct i2c_msg - an I2C transaction segment beginning with START @addr: Slave address, either seven or ten bits.

When this is a ten bit address, I2C_M_TEN must be set in @flags. @flags: I2C_M_RD is handled by all adapters. @len: Number of data bytes in @buf being read from or written to the I2C slave address. For read transactions where I2C_M_RECV_LEN is set, the caller guarantees that this buffer can hold up to 32 bytes in addition to the initial length byte sent by the slave (plus, if used, the SMBus PEC). @buf: The buffer into which data is read, or from which it's written.

An i2c_msg is the low level representation of one segment of an I2C transaction. It is visible to drivers in the @i2c_transfer() procedure.

All I2C adapters implement the standard rules for I2C transactions. Each transaction begins with a START. That is followed by the slave address, and a bit encoding read versus write. Then follow all the data bytes, possibly including a byte with SMBus PEC. The transfer terminates with a NAK, or when all those bytes have been transferred and ACKed. If this is the last message in a group, it is followed by a STOP. Otherwise it is followed by the next @i2c_msg transaction segment, beginning with a (repeated) START.

Definition at line 32 of file i2c.h.

Field Documentation

◆ buf

◆ flags

◆ len

◆ slave


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