ArduinoCore-API icon indicating copy to clipboard operation
ArduinoCore-API copied to clipboard

Wire.requestFrom with 5 params is undocumented & exists only on AVR & SAM, not SAMD & megaAVR

Open PaulStoffregen opened this issue 6 years ago • 2 comments

Looks like a requestFrom() function taking 5 parameters is undocumented, and only implemented in 2 of the 4 platforms Arduino supports.

Here are the definitions in the AVR and SAM platforms:

https://github.com/arduino/ArduinoCore-avr/blob/master/libraries/Wire/src/Wire.h#L63 https://github.com/arduino/ArduinoCore-sam/blob/master/libraries/Wire/src/Wire.h#L49

However, the SAMD and megaAVR plaforms only have the 2 and 3 parameter requestFrom() functions in their Wire libs:

https://github.com/arduino/ArduinoCore-samd/blob/master/libraries/Wire/Wire.h#L45 https://github.com/arduino/ArduinoCore-megaavr/blob/master/libraries/Wire/src/Wire.h#L60

The Wire library requestFrom() reference page also only documents the 2 and 3 parameter functions:

https://www.arduino.cc/en/Reference/WireRequestFrom

This 5 parameter function should be properly documented, and should be consistently implemented on all platforms. Perhaps issues need to be opened on the repositories for the SAMD and megaAVR platforms?

PaulStoffregen avatar Jun 11 '19 00:06 PaulStoffregen

FWIW, this is the only library I know which is actually using the undocumented 5-param Wire.requestFrom()

https://github.com/infinityPV/infinityPV_INA233_Arduino-library

PaulStoffregen avatar Jun 11 '19 01:06 PaulStoffregen