请教大家个问题:
cc1310 I2C通信。最后的读写控制位,不需要填写吗?1310会自己判断读写吗?
例程中是读写tmp007的温度,我查阅了tmp007的手册。例程中tmp007的地址为0x40.
假如按照手册中tmp007地址为 1000 000 前面补0 .则tmp007地址为0x40.可是看这个读写时序,读写位没有了,按照这个时序图,应该发0x80;
请教大家一下这个问题,
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
* I2C slave address with the appropriate read/write bit is handled internally * by this driver.i2cTransaction.slaveAddress = TMP116_ADDR;
i2cTransaction.writeBuf = txBuffer;
i2cTransaction.writeCount = 1;
i2cTransaction.readBuf = rxBuffer;
i2cTransaction.readCount = 2;
关于CC1310 I2C 读写如果你在writeCount或者readCount 置0以及buf设置为NULL, 则只会进行read/write操作。
/*!
* @brief Structure used to perform I2C bus transfers.
*
* The application is responsible for allocating and initializing an
* I2C_Transaction structure prior to passing it to I2C_Transfer(). This
* structure must persist in memory unmodified until the transfer is complete.
* This driver will always perform write operations first. Transmission of the
* I2C slave address with the appropriate read/write bit is handled internally
* by this driver.
*
* \note #I2C_Transaction structures cannot be re-used until the previous
* transaction has completed.
*
* @sa I2C_transfer()
*/
typedef struct I2C_Transaction_ {
/*! Pointer to a buffer of at least \p writeCount bytes. If \p writeCount
* is 0, this pointer may remain uninitialized. */
void *writeBuf;
/*! Number of bytes to write to the I2C slave device. A value of 0
* indicates no data will be written to the slave device. */
size_t writeCount;
/*! Pointer to a buffer of at least \p readCount bytes. If \p readCount
* is 0, this pointer may remain uninitialized. */
void *readBuf;
/*! Number of bytes to read from the I2C slave device. A value of 0
* indicates no data will be read from the slave device. */
size_t readCount;
/*! I2C slave address of the slave device */
uint_least8_t slaveAddress;
/*! Optional application argument. This argument will be passed to the
* callback function specified by #I2C_Params.transferCallbackFxn when
* using #I2C_MODE_CALLBACK. */
void *arg;
/*! This is reserved for use by the driver and must never be modified by
* the application. */
void *nextPtr;
} I2C_Transaction;