nrf: allocate two I2C on CPB #2252
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On nrf, SPIM1/TWIM1 and SPIM2/TWIM2 are shared. They can be either SPI or I2C. Because of driver interrupt routine issues, it's difficult to allocate them dynamically.
Currently, we can't use SPIM3 on nrf, so we allocate TWIM0 as the sole I2C, and use SPIM1/TWIM1 and SPIM2/TWIM2 both for SPI.
But on the CPB board, we really need an off-board I2C, in addition to the on-board I2C for the accelerometer, so this PR will allocate TWIM0 and SPIM1/TWIM1 for I2C , and have just one SPI, on SPIM2/TWIM2
Once we get SPIM3 working, we can have two I2C and two SPI for all boards, and remove this trade-off code.