How do I set up GPPI/DPPI with the new nrfx 4.0.1 drivers?

I am evaluating the nRF54L15 with the nRF54L15DK. Previously, I was developing with NCS 3.1.1 and successfully implemented a high precision frequency measurement using a timer, the gpiote and connecting them using the gppi helper functions. The relevant part of code which was doing that is this:

static void connect_edge_to_timer(uint32_t pin)
{
    nrfx_err_t err;
    uint8_t gppi_ch;

    err = nrfx_gppi_channel_alloc(&gppi_ch);
    NRFX_ASSERT(err == NRFX_SUCCESS);

    uint32_t evt_addr = nrfx_gpiote_in_event_address_get(&gpiote, pin);
    uint32_t task_addr = nrfx_timer_task_address_get(&timer_inst,
                                                     NRF_TIMER_TASK_CAPTURE0);

    nrfx_gppi_channel_endpoints_setup(gppi_ch, evt_addr, task_addr);
    nrfx_gppi_channels_enable(BIT(gppi_ch));
}

I want to update the project to NCS 3.2.1 with the new nrfx 4.0.1 drivers. The nrfx 4.0 migration notes state: "Contrary to the legacy solution, GPPI needs to be initialized prior to using the GPPI API. Ensure that nrfx_gppi_init is called before calling any GPPI API." Also "Removed nrfx_gppi_event_endpoint_setup. Action : Use nrfx_gppi_ep_attach instead."

I don't understand how to initiallize gppi with the nrfx_gppi_init and how to connect the event with the task. I found this docs page, but don't understand how to apply this to my case.

Any help is highly appreciated.

BR Moritz

Parents Reply Children
No Data
Related