linguini1 opened a new pull request, #2447:
URL: https://github.com/apache/nuttx-apps/pull/2447
## Summary
The `i2ctool dev` command will now use an empty 'write' header to scan the
I2C bus by default (if no register is provided), which results in the detection
of more I2C devices by default (including the SHT41 and MS5611).
This PR closes #994.
## Impact
This should save some developers time debugging or wondering why their
devices didn't show up (and trying to wrongly diagnose a hardware issue like
myself :laughing:).
## Testing
Using the previous version of this command on an I2C bus with the following
sensors:
- MS5611 barometric pressure sensor (2, at 0x76 and 0x77)
- SHT41 temperature and humidity sensor (0x44)
- MAXM10S GPS (0x42)
- M24C02 EEPROM (0x50)
- LSM6DSO32 IMU (0x6b)
The output of `i2c dev 00 77` was:
```console
nsh> i2c dev 00 77
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- 42 -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- 6b -- -- -- --
70: -- -- -- -- -- -- -- --
```
Even providing an argument to the register flag (`i2c dev -r 0 00 77`)
resulted in the saem output.
With these proposed changes, the result by default is:
```console
nsh> i2c dev 00 77
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- 42 -- 44 -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- 6b -- -- -- --
70: -- -- -- -- -- -- 76 77
```
Now all devices show up in the scan. Additionally, the general call address
of `00` does not appear anymore, which is good as it is not a real device.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]