In the "i2ctmp007" example application, only a reading action is being performed because there are no commands to send to the sensor. However, in my application, I am using the BME280 humidity, pressure, and temperature sensor which needs to be configured. Consequently, I need to send commands to it via I2C.
How to read bytes from the sensor is clear to me using this I2C configuration:
/* Point to sensor data*/
txBuffer[0] = BME280_DATA_ADDR; // sensor data address
i2cTransaction.slaveAddress = BME280_I2C_ADDR_SEC; // I2C address
i2cTransaction.writeBuf = txBuffer;
i2cTransaction.writeCount = 1;
i2cTransaction.readBuf = rxBuffer;
i2cTransaction.readCount = 8; // data length
Then the data is stored in rxBuffer and can be accessed.
Can you please quickly explain how to write data into a register?
Thank you!!