-
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
nrf52: Implement EasyDMA-based SPI peripheral implemenation #14057
Conversation
b520aca
to
48d72ef
Compare
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.
Looking good - some small comments.
@benpicco I've modified the code to minimize the number of ifdefs and let the compiler handle removing any resulting dead code. |
ed6e7f5
to
4f2db36
Compare
Rebased on top of #14061 (and now waiting on that PR) |
1b5c543
to
ce8c795
Compare
Rebased! |
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.
Looks good to me - just some minor nits.
You can squash directly.
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.
Please squash!
4b6920e
to
d0047dd
Compare
Squashed! |
Ho, That rebase is not how it should be, give me a second for a next attempt |
d0047dd
to
e76ee57
Compare
Should be good now, at least the content of the commits now matches their description |
Thanks for the review @benpicco! |
Contribution description
This PR splits the common nrf5x SPI peripheral into the old (,and for the nrf52 deprecated peripheral,) nRF51 driver and a new EasyDMA-based driver for the nRF52. The new driver is significantly faster than the old one as the bytes can be send back-to-back without overhead from the CPU.
I decided to split the nrf5x common peripheral driver, it became too much of an ifdef hell to keep them merged.
The peripheral driver requires a GPIO interrupt on the nrf52832 due to errata 58. The proposed driver uses an adapted form of the workaround presented by Nordic. This anomaly also exists on engineering sample A of the nrf52840. I decided not to support that to shave off some additional flash usage and runtime checks. This might be an issue on the nrf52840-pdk boards.
Testing procedure
Compilation should verify that all nrf52 boards have been adapted, the board config requires modification from
NRF_SPI#
toNRF_SPIM#
. Maybe @MrKevinWeiss can give this a try on the RobotFW tests to verify the runtime behaviour.Issues/PRs references
None