I was developing with the nRF54L15DK, creating a Radio driver to do Proprietary 2.4GHz communication. In the driver, I use nrfx_event_to_bitpos() and nrfx_bitpos_to_event() to calculate interrupt masks given NRF_RADIO_EVENT_X enumeration values, and I was running into issues with that approach.
It looks like the nrfx_common.h file assumes an offset of 0x100, but the nRF54L15 Radio peripheral has an offset of 0x200 for the event registers.
NRF_STATIC_INLINE uint32_t nrfx_bitpos_to_event(uint32_t bit)
{
static const uint32_t event_reg_offset = 0x100u;
return event_reg_offset + (bit * sizeof(uint32_t));
}
NRF_STATIC_INLINE uint32_t nrfx_event_to_bitpos(uint32_t event)
{
static const uint32_t event_reg_offset = 0x100u;
return (event - event_reg_offset) / sizeof(uint32_t);
}
Is there an alternative NRFX supported function for this conversion that I am missing?