--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
(1) Naming. requestFrom is ok, but sendTo() to be "transmitTo()" to mirror beginTransmission(). Not that this is the best naming, but it would be more consistent.
(2) The AVR core implements an interesting API:uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint32_t iaddress, uint8_t isize, uint8_t sendStop)So "iaddress" is a 32 bit quantity and "isize" decided how many bytes of this are send. Would it be possible to add something like this to the suggested APIs as well ?
(3) What is the maximum number for "quantity" ? Some devices will use DMA or other techniques where a limit to say 255 bytes might be desireable. Clearly anything above 65536 is uninteresting ...
(4) Those are for master mode only ...
Hi Thomas,Thanks for the feedback!(1) Naming. requestFrom is ok, but sendTo() to be "transmitTo()" to mirror beginTransmission(). Not that this is the best naming, but it would be more consistent.Good suggestion, I agree "transmitTo(...)" is more consistent. Another option is "writeTo", but I feel your "transmitTo()" suggestion is better.
(2) The AVR core implements an interesting API:uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint32_t iaddress, uint8_t isize, uint8_t sendStop)So "iaddress" is a 32 bit quantity and "isize" decided how many bytes of this are send. Would it be possible to add something like this to the suggested APIs as well ?I briefly looked at this one, it looks like it does a write request with the iaddress first (without stop bit) then performs a read request. So a nice short cut operation for reading values from register based I2C devices.We can certainly expand on adding this API, but for now I'd like to finalize the external buffer APIs proposed.
(3) What is the maximum number for "quantity" ? Some devices will use DMA or other techniques where a limit to say 255 bytes might be desireable. Clearly anything above 65536 is uninteresting ...So in my proposals "size_t" is used as the type quantity. "requestFrom(...")" in the SAMD core uses this for the quantity type. AVR currently uses "uint8_t" or "int" for quantity - we'll need to sort out this inconsistency.I don't think we should impose a limit, the I2C device I'm working with has operations that require read and writes up to 256 bytes.