xiao-ble (sense), nrf52840 misleading I2C0 comment
The comment // I2C0 (external) pins is misleading, because although configuring the bus with machine.I2C0.Configure(machine.I2CConfig{}) the external pins will not be used. The reason seems to be the same code for all "I2Cx" together with the defaulting to internal.
To get the external pins to work you need to set the pins explicitly like this: machine.I2C0.Configure(machine.I2CConfig{SCL: machine.SCL0_PIN, SDA: machine.SDA0_PIN}).
Should we change the comment, or change the default values?
It would be nice, if the comment will be implemented. This means I2C0 would have the external pins per default and the I2C1 would have the internal pins per default. The internal pins are needed to access the IMU (LSM6DS3TR) in the "Sense"-version of the MCU. For the normal version only the external pins are needed.
This suggestion leads to a small problem with the existing example for IMU-driver, which uses the I2C0.
This suggestion leads to a small problem with the existing example for IMU-driver, which uses the I2C0
So what is the best solution for the most users, do you think?
Because the example is used for all MCU's and the xiao-ble sense is just one exception, I think implementing my suggestion would help the users of xiao-ble with and without sense a lot. A comment in the example could close the gap.
I have no knowledge about the "Seeed XIAO ESP32 Sense" variant at all.
A comment in the example could close the gap.
Sounds good. Can you please submit a PR with your proposed language?
To me it seems like dropping "I2C0" and "I2C1" from the pin description comments will be enough to de-confuse.