cpu/nrf5x_common: implement periph/gpio_ll{,_irq}#17980
Conversation
|
Output of the benchmark on the nRF52840-DK: So |
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.
@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.)
Contribution description
Implements
gpio_llandgpio_ll_irqfor NRF5x.Testing procedure
Both are passing locally for me
Issues/PRs references
Depends on and includes: #16787