This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Where to find functions from nrf_drv_common.c in SDK15.3?

I am migrating from SDK11? to SDK15.3 and noticed nrf_drv_common.c is no longer available and has no replacement although nrfx_common seems to have replaced nrf_drv_common.h.

In this post:

https://devzone.nordicsemi.com/f/nordic-q-a/42489/question-regarding-migrating-from-sdk14-2-to-sdk15-2

Jorgen mentions that it is not required in the new SDK. Are there replacements for the missing functions such as  nrf_drv_common_irq_enable() or do I have to implement it myself?

  • Hi,

    Are there replacements for the missing functions such as  nrf_drv_common_irq_enable() or do I have to implement it myself?

    It is not there, but there is no need to reimplement. The common functionality was used by the old drivers but is not used by the new. So it is not needed when migrating to the new SDK version. If you are using it outside the driver, you may want the same functionality. Looking at nrf_drv_common_irq_enable() the implementation is very simple:

    void nrf_drv_common_irq_enable(IRQn_Type IRQn, uint8_t priority)
    {
        INTERRUPT_PRIORITY_ASSERT(priority);
    
        NVIC_SetPriority(IRQn, priority);
        NVIC_ClearPendingIRQ(IRQn);
        NVIC_EnableIRQ(IRQn);
    }
    

    You do not have this exact function in nRFx, but for just enabling the IRQ you have NRFX_IRQ_ENABLE(). Which in turn just calls NVIC_EnableIRQ(). You can see more in <SDK15.3>\integration\nrfx\nrfx_glue.h.

Related