Closed GoogleCodeExporter closed 9 years ago
I strongly support a change to permit Repeated Start operations on I2C. There
are several chips which require repeated starts to work usefully, notably any
which require a read address to be sent.
However, I would like to suggest a different method. Rather than require
additional parameters (which in my view complicates the documentation), I
suggest that, when requestFrom is called, the library examines the state of the
transmit buffer. If it has not yet been transmitted (ie endTransmission has not
been called), then it should start the transmission with an internal option
that causes the repeated start state to be entered and the requestFrom
operation to be chained onto it.
Since Send followed by requestFrom is not normal usage, this should not
significantly impact any existing use. A possible correct existing use would be
where an application builds the next transmission buffer while reading the
previous response, but this strikes me as rather exotic for common arduino use
and I doubt that precluding it would be a serious problem.
This solution does not preclude Gene's suggestion : it would be possible to
implement additional parameters as he suggests if there are devices which
cannot be driven in this way. However, it would be more convenient if the
parameter requesting no STOP were added to endTransmission rather than
beginTransmission. This seems to me more intuitive in any case.
Original comment by artgod...@gmail.com
on 26 Nov 2011 at 5:41
Here is a diff that supports repeated starts in both read and write
transactions.
Original comment by ToddKrei...@gmail.com
on 17 Feb 2012 at 12:27
Attachments:
Original comment by dmel...@gmail.com
on 19 Feb 2012 at 12:54
https://github.com/arduino/Arduino/commit/2f29f898de9c8375b37269c26948be59a515e8
01
Thanks Todd!
Original comment by dmel...@gmail.com
on 19 Feb 2012 at 1:06
Original issue reported on code.google.com by
dmel...@gmail.com
on 1 Oct 2011 at 6:41