-
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/nrf5x_common: implement periph/gpio_ll{,_irq} #17980
Conversation
Output of the benchmark on the nRF52840-DK:
So |
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
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
The nRF9x has a different layout of the memory mapped I/O area, but the start address remaimed the same. There is value in using the start adress of the are father than e.g. the lowest GPIO register, as the least significant bytes are all zeros, allowing to construct the adress via a load immediate instruction (or st least I believe so). I opted for just creating a define for that by hand. With that, now all is green. |
static inline void * gpio_port_unpack_addr(gpio_port_t port) | ||
{ | ||
/* NRF5X_IO_AREA_START is the start of the memory mapped I/O area. Both data | ||
* and flash are mapped before it. So if it is an I/O address, it | ||
* cannot be a packed data address and (hopefully) is a GPIO port */ | ||
if (port >= NRF5X_IO_AREA_START) { | ||
return NULL; | ||
} | ||
|
||
return (void *)port; | ||
} |
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.
@benpicco are you fine with this? (Note that NRF5X_IO_AREA_START
is defined in this header, so it will be needed to be maintained by us. But I don't expect the I/O memory area to be mapped differently for future nRF MCUs that can share the same GPIO driver.)
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.
Sure, that will work
Contribution description
Implements
gpio_ll
andgpio_ll_irq
for NRF5x.Testing procedure
Both are passing locally for me
Issues/PRs references
Depends on and includes: #16787