-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu/nrf52: allow accessing multiple i2c peripherals #12372
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.