Hi Greg,
/* Scan all valid I2C addresses (0x03..0x77) */
for (addr = 0x08; addr < 0x78; addr++) {
fix the comment :-P
I fixed that locally, yes ... caught it after copying and pasting :)
Well, the address isn't necessarily "invalid", it just isn't defined by the
I2C specification.
Definitely, those reserved addresses should not be probed.
For the API, I don't think an error is warranted, as address 0x00 is
well-defined as a "general call" address. Calling applications should know
what they are doing with the 0-7 addresses, and I don't think mynewt should
hamper them without a strong rationale for doing so. (or possibly a
separate set of APIs for the behaviors of those special addresses)
Fair enough. 0x00 is valid, yes (though not every IC supports general
call). I'm just surprised using reserved addresses would throw the
entire peripheral into the weeds, but it's fair to say that the burden
is on the end user not to use those registers. It just seems like
something that might be hard to debug if you make a typo, but again ...
the burden is on you to know what you are sending to the device.
At least the issue is clear now, though, thanks for looking into this
and highlighting the cause of the problem! I spent a day reading all the
I2C details from the product spec, checking errata, etc., when the
problem was right in front of my nose. :P
K.