Re: i2c_burst_write API
On 3 April 2017 at 11:18, Piotr Mienkowski <piotr.mienkowski@...> wrote:
Invalid and not working, it has to be fixed. My issue is which part
Agreed. Driver should be fixed to generated RESTART instead of STOP/START.
Sorry if I missed an element, but I'm not sure to get your point here.
As you described, for burst write operation, only one message has to be sent,
S Addr Wr [A] subAddr [A] Data [A] Data [A] ... [A] Data [A] P
(unlike for burst read where 2 messages are expected).
If we keep the burst write API as is, we define an incorrect sequence of 2 messages:
msg.buf = &start_addr;
msg.len = 1;
msg.flags = I2C_MSG_WRITE;
msg.buf = buf;
msg.len = num_bytes;
msg.flags = I2C_MSG_WRITE | I2C_MSG_STOP;
and then expect the driver to generate a correct single message.
I mean this is doable, but adds unneeded complexity and would require to
explicit the contact in the API.