Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Is there a provision in the SDK to handle the event NRF_SPIM_EVENT_STARTED?

Because if there is, I'm not seeing it. It seems to me that the SDKv14 has asks you where you want your event handler function like this:

APP_ERROR_CHECK(nrf_drv_spi_init(&spi_0, &spi_config_0, spi_0_event_handler, NULL));

Where spi_0_event_handler() is going to be used.

And later I have something like this:

void spi_0_event_handler(nrf_drv_spi_evt_t const * p_event, void *p_context)
{
   spi_xfer_done = true;
   NRF_LOG_INFO("Transfer completed.");

}

This works for ENDTX event. But I never said I was interested in ENDTX. What if I wanted NRF_SPIM_EVENT_STARTED ?  Is there a way to "register" which events I want to call the event_handler with the SPIM peripheral/driver/api/hal? Or would I have to use PPI to set a SWI?

Parents Reply Children
Related