AM273x MCU+ SDK  08.06.00
I2C_Transaction Struct Reference

Detailed Description

I2C transaction.

This structure defines the nature of the I2C transaction.

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

I2C target mode: This structure specifies the buffer and buffer's size that is to be read from or written to the I2C controller. 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 targetAddress
 
void * nextPtr
 
void * arg
 
uint32_t timeout
 
bool controllerMode
 
bool expandSA
 

Field Documentation

◆ writeBuf

const void* I2C_Transaction::writeBuf

controller mode: buffer containing data to be written to target target mode: buffer containing data to be written to controller

◆ writeCount

size_t I2C_Transaction::writeCount

controller mode: number of bytes to be written to the target target mode: number of bytes to be written to the controller

◆ readBuf

void* I2C_Transaction::readBuf

controller mode: buffer to which data from target is to be read into target mode: buffer to which data from controller is to be read into

◆ readCount

size_t I2C_Transaction::readCount

controller mode: number of bytes to be read from the target target mode: number of bytes to be read to the controller

◆ targetAddress

uint32_t I2C_Transaction::targetAddress

controller mode: input field from user to set the address of I2C target target mode: output field from driver to report the address of a target channel when multi-target 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

◆ controllerMode

bool I2C_Transaction::controllerMode

I2C controller or target mode

◆ expandSA

bool I2C_Transaction::expandSA

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