Data Fields
I2C_Transaction Struct Reference

Defines a transaction to be used with I2C_transfer() More...

#include <I2C.h>

Data Fields

void * writeBuf
 
size_t writeCount
 
void * readBuf
 
size_t readCount
 
uint_least8_t slaveAddress
 
void * arg
 

Detailed Description

Defines a transaction to be used with I2C_transfer()

See also
I2C_transfer()

Field Documentation

§ writeBuf

void* I2C_Transaction::writeBuf

Pointer to a buffer of at least I2C_Transaction.writeCount bytes. If I2C_Transaction.writeCount is 0, this pointer is not used.

§ writeCount

size_t I2C_Transaction::writeCount

Number of bytes to write to the I2C slave device. A value of 0 indicates no data will be written to the slave device and only a read will occur. If this value is not 0, the driver will always perform the write transfer first. The data written to the I2C bus is preceded by the I2C_Transaction.slaveAddress with the write bit set. If writeCount bytes are successfully sent and acknowledged, the transfer will complete or perform a read–depending on I2C_Transaction.readCount.

Note
Both I2C_Transaction.writeCount and I2C_Transaction.readCount can not be 0.

§ readBuf

void* I2C_Transaction::readBuf

Pointer to a buffer of at least I2C_Transaction.readCount bytes. If I2C_Transaction.readCount is 0, this pointer is not used.

§ readCount

size_t I2C_Transaction::readCount

Number of bytes to read from the I2C slave device. A value of 0 indicates no data will be read and only a write will occur. If I2C_Transaction.writeCount is not 0, this driver will perform the write first, followed by the read. The data read from the bus is preceded by the I2C_Transaction.slaveAddress with the read bit set. After readCount bytes are successfully read, the transfer will complete.

Note
Both I2C_Transaction.writeCount and I2C_Transaction.readCount can not be 0.

§ slaveAddress

uint_least8_t I2C_Transaction::slaveAddress

I2C slave address used for the transaction. The slave address is the first byte transmitted during an I2C transfer. The read/write bit is automatically set based upon the I2C_Transaction.writeCount and I2C_Transaction.readCount.

§ arg

void* I2C_Transaction::arg

Pointer to a custom argument to be passed to the I2C_CallbackFxn function via the I2C_Transaction structure.

Note
The I2C_CallbackFxn function is only called when operating in I2C_MODE_CALLBACK.
See also
I2C_MODE_CALLBACK
I2C_CallbackFxn

The documentation for this struct was generated from the following file:
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale