Other Parts Discussed in Thread: HDC1080
Tool/software: TI-RTOS
Hi,
I found an example code online, but I am not sure that I understand the following code.I would really appreciate if someone can explain what is txBuffer address should be.
//Read HDC1080 device ID
txBuffer[0] = 0xFF;
txBuffer[1] = 0x10;
txBuffer[2] = 0x00;
i2cTransaction.slaveAddress = 0x64;//HDC1080 ADDR;
i2cTransaction.writeBuf = txBuffer;
i2cTransaction.writeCount = 1;
i2cTransaction.readBuf = rxBuffer;
i2cTransaction.readCount = 2;
if (I2C_transfer(i2c, &i2cTransaction)){
System_printf("Device ID: %x%x\n", rxBuffer[0], rxBuffer[1]);
} else {
System_printf("Device ID fail!\n");
}
if (I2C_transfer(i2c, &i2cTransaction)){
System_printf("Device ID: %x%x\n", rxBuffer[0], rxBuffer[1]);
} else {
System_printf("Device ID fail!\n");
}
Thank you so much.