Hello All I am trying to send some data out over I2C and am running into an issue.
Right now I am trying to get a Model_ID from a VL53l1x sensor this part has a base address of 52, and the index for model ID is 0X010F. Currently when scoping the SLA SDA lines my I2C write is in the form Address 29 write bit set (so this is correct) however my data packet is in the form D2 01 0F and I have no idea where the D2 is coming from or how to remove it. Here is the code I am using to set the I2CMasterBuffer and the rest is taken care of in LPC23x8I2C
if((ReserveI2C()) == OK) /* First we need access to the i2c bus. */
{
I2CWriteLength = 3; // 3 bytes.
I2CMasterBuffer[0] = VL53l1_I2C_Write_ADDRESS; /* 0x52 */
I2CMasterBuffer[1] = Version_address; //0x01
I2CMasterBuffer[2] = ID_address; //0x0F
I2CMasterBuffer[3] = VL53l1_I2C_Read_ADDRESS; //0x53
I2CReadLength = 2; /* The size of the part so the address pointer always returns where it started. */
stat = I2CEngine(3); ;
os_dly_wait(7); /* WriteCycle >= TIME_5mS */
ReleaseI2C();
I2CMasterBuffer[4]=data;
return data;