AM263x MCU+ SDK  08.02.00
I2C_Transaction Struct Reference

Detailed Description

I2C transaction.

This structure defines the nature of the I2C transaction.

I2C master mode: This structure specifies the buffer and buffer's size that is to be written to or read from the I2C slave peripheral.

I2C slave mode: This structure specifies the buffer and buffer's size that is to be read from or written to the I2C master. In restart condition, readBuf/writeBuf and readCount/writeCount are used repeatedly for every start in one transfer. When each restart happens, driver will call back to application with the restart transfer status, and application should save the data transferred in the previous start, and provide the new data to the current start. When all the starts complete (stop condition), driver will call back to application with transfer success status, and readBuf/writeBuf and readCount/writeCount will only record the data transferred in the last start condition.

Data Fields

const void * writeBuf
 
size_t writeCount
 
void * readBuf
 
size_t readCount
 
uint32_t slaveAddress
 
void * nextPtr
 
void * arg
 
uint32_t timeout
 
bool masterMode
 
bool expandSA
 

Field Documentation

◆ writeBuf

const void* I2C_Transaction::writeBuf

master mode: buffer containing data to be written to slave slave mode: buffer containing data to be written to master

◆ writeCount

size_t I2C_Transaction::writeCount

master mode: number of bytes to be written to the slave slave mode: number of bytes to be written to the master

◆ readBuf

void* I2C_Transaction::readBuf

master mode: buffer to which data from slave is to be read into slave mode: buffer to which data from master is to be read into

◆ readCount

size_t I2C_Transaction::readCount

master mode: number of bytes to be read from the slave slave mode: number of bytes to be read to the master

◆ slaveAddress

uint32_t I2C_Transaction::slaveAddress

master mode: input field from user to set the address of I2C slave slave mode: output field from driver to report the address of a slave channel when multi-slave channels are supported, if only one channel is supported, this field is ignored

◆ nextPtr

void* I2C_Transaction::nextPtr

used for queuing in I2C_MODE_CALLBACK mode

◆ arg

void* I2C_Transaction::arg

used for passing argument to callback function

◆ timeout

uint32_t I2C_Transaction::timeout

Timeout value for i2c transaction

◆ masterMode

bool I2C_Transaction::masterMode

I2C master or slave mode

◆ expandSA

bool I2C_Transaction::expandSA

Expand slave address: true: 10-bit address mode, false: 7-bit address mode