I've looked at all the info that I could find on I2C repeated starts, and I tested a simple example that uses ioctl calls with the standard two message structure required to cause a repeated start:
struct i2c_msg rdwr_msg[] =
{
{ // Start address
.addr = 0x52,
.flags = 0, // write
.len = 1,
.buf = &command
},
{ // Read buffer
.addr = 0x52,
.flags = I2C_M_RD, // read
.len = 1,
.buf = read_buffer
}
};
...
rdwr_data.msgs = rdwr_msg;
rdwr_data.nmsgs = 2;
command = 0x00;
read_buffer[0] = 0xEE; // Preset to see if it is overwritten by read
result = ioctl( fd, I2C_RDWR, &rdwr_data );
I can see that the I2C signals are different when the combined parameter is set to enable repeated starts. There is sort of a repeated start, but the data is off by one bit. The repeated start is circled in red in the two following screenshots. The address sent after the restart is 0x52. The first one is from the PI2 and the second one is from a USB I2C interface. Only the second one correctly accesses the device. So the question remains, has anyone successfully used repeated starts on the PI2?