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 | |
void * | writeBuf |
size_t | writeCount |
void * | readBuf |
size_t | readCount |
uint32_t | targetAddress |
void * | nextPtr |
void * | arg |
uint32_t | timeout |
bool | controllerMode |
bool | expandSA |
bool | memTxnEnable |
I2C_Mem_Transaction * | memTransaction |
int32_t | status |
void* I2C_Transaction::writeBuf |
controller mode: buffer containing data to be written to target target mode: buffer containing data to be written to controller
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
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
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
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
void* I2C_Transaction::nextPtr |
used for queuing in I2C_MODE_CALLBACK mode
void* I2C_Transaction::arg |
used for passing argument to callback function
uint32_t I2C_Transaction::timeout |
Timeout value for i2c transaction
bool I2C_Transaction::controllerMode |
I2C controller or target mode
bool I2C_Transaction::expandSA |
Expand target address: true: 10-bit address mode, false: 7-bit address mode
bool I2C_Transaction::memTxnEnable |
Transaction type: true: Memory read/write Operation, false: Simple read and write operation
I2C_Mem_Transaction* I2C_Transaction::memTransaction |
Memory Transfer related Parameters
int32_t I2C_Transaction::status |
Transaction Status