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

How to enable radio interrupts using SDK?

mainc.txt

we can use INTENSET to enable certain events on the radio as in line 460 in mainc file attached. But how to enable this on the radio as a whole. I basically need a couple of events like ready, address, payload, end, etc.

Radio interrupt RADIO_IRQHandler is defined just above the main function which needs to be called in the main for the interrupt functionality.

Parents
  • Hi

    If you need the interrupt handler to respond to multiple events you need to check each event before calling the corresponding code (and then clearing the event afterwards).

    This is a very common snippet in the Nordic libraries, and could look something like this:

    if (NRF_RADIO->EVENTS_READY && (NRF_RADIO->INTENSET & RADIO_INTENSET_READY_Msk))
    {
        NRF_RADIO->EVENTS_READY = 0;
        
        ....
    }
    

    If you are looking to do a proprietary RF protocol I would suggest having a look at the ESB or Gazell libraries available in the SDK. Then you don't have to spend time implementing things such as packet buffering, acknowledgements, auto retransmit and so forth.

    Best regards
    Torbjørn

  • Don't you also need to enable the radio IRQ line or something? (I think what is asked is how to do this)

Reply Children
No Data
Related