Hi,
The problem statement mentioned below.
What we are trying to do is Read Light value from the MAX44009 sensor on the TWI interface.
Looking at the data sheet for the MAX44009, the device freezes updates of the light value (registers 0x03 and 0x04) during an I2C action and releases them for update on seeing an I2C STOP. The data sheet suggests
“If the user wants to read both the Lux High-Byte register 0x03 and Lux Low-Byte register 0x04, then the master should not send a STOP command between the reads of the two registers. Instead a Repeated START command should be used. This ensures accurate data is obtained from the I2C registers (by disabling internal updates during the read process).”
We want to use the function nrf_drv_twi_xfer() with the flags NRF_DRV_TWI_XFER_TXRX. Is it a right approach ? . How this operation works? one read, one write followed by another read and write? or two continuous reads and two continuous writes?. Please suggest us a way to get updated value from both the registers. also Please suggest the correct flags or alternate API to achieve this functionality.