I have a SPI peripheral that will set an interrupt when data is ready (every 50ms). Right now I'm using software to read the data but i was hoping to use DPPI to save on power. I want the DPPI to make the SPI read out the data on every interrupt and only wake up the CPU once I've run out of RAM(with 256KiB buffer, it should take approx 3 minutes). I've gone through multiple posts about DPPI here. Came up with the following code but it doesn't work.
uint8_t ppiChannel{};
nrfx_gpiote_init(1);
nrfx_gpiote_in_config_t in_config{ NRF_GPIOTE_POLARITY_HITOLO, NRF_GPIO_PIN_NOPULL, false, false, false };
const auto p1_13 = NRF_GPIO_PIN_MAP(1, 13);
nrfx_gpiote_in_prealloc_init(p1_13, &in_config, ppiChannel, nullptr);
nrfx_dppi_channel_alloc(&ppiChannel);
nrf_gpiote_publish_set(NRF_GPIOTE1_NS, NRF_GPIOTE_EVENT_IN_0, ppiChannel);
nrf_spim_subscribe_set(NRF_SPIM2, NRF_SPIM_TASK_START, ppiChannel);
nrfx_dppi_channel_enable(ppiChannel);
I could not find any examples in either ncs or zephyr. Is there some code that i can refer to?