cpu/nrf52: allow accessing multiple i2c peripherals#12372
cpu/nrf52: allow accessing multiple i2c peripherals#12372aabadie merged 1 commit intoRIOT-OS:masterfrom
Conversation
benpicco
left a comment
There was a problem hiding this comment.
I don't have a device to test atm, but this is such an obvious fix.
i2c_config[dev] is used everywhere else in the driver too.
|
I am trying it with the thingy52 with #10793 but I am not getting any response when going through either testing procedure. I do however think this is a no brainer. |
MrKevinWeiss
left a comment
There was a problem hiding this comment.
Still some funny stuff going on when testing with
USEMODULE=i2c_scan make BOARD=thingy52 -C tests/shell/ flash term
or
make BOARD=thingy52 -C tests/periph_i2c/ flash term
Though this makes sense does the cpu properly support multiple i2c devices?
Blocking until someone tells me I am crazy and shows some output of a working test on i2c_dev 0.
I'm setting up a board (nrf52840-dk) with 2 I2C sensors on 2 different buses. |
MrKevinWeiss
left a comment
There was a problem hiding this comment.
The failure I was experience was for a different reason. I believe this is correct now.
ACK!
|
Details in #10793 |
|
@aabadie I leave it to you to click the merge button just in case you wanted to do or add anything else. However I am happy. |
|
I made a custom setup with nrf52840dk, one sensor on one i2c bus (TWIM0), one sensor on a second I2C bus (TWIM1). I had to find the right pins combination (apparently not all pins can be used with TWIM). I also tried i2c_scan and it reports the right addresses on the right bus. Auto-ACK. Also thanks for testing @MrKevinWeiss ! |
|
Nice job 📯 |
Contribution description
While trying to find out what was wrong with #10793, I found that the i2c driver was always returning the pointer on the first device. This PR is fixing this problem, since the driver should be able to handle multiple configured devices.
Testing procedure
Try this PR with #10793, the new configured devices should work with the saul application.
Issues/PRs references
Found while debugging #10793.