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 |
Defines a transaction to be used with I2C_transfer()
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.
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.
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.
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.
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.
void* I2C_Transaction::arg |
Pointer to a custom argument to be passed to the I2C_CallbackFxn function via the I2C_Transaction structure.