I had been doing this:
nrfx_dppi_t dppi20 = NRFX_DPPI_INSTANCE(20); rc = nrfx_dppi_channel_alloc(&dppi20,&dppi_ch_2); rc = nrfx_dppi_group_alloc(&dppi20,&chg_2); NRF_DPPIC20->CHG[chg_2] = BIT(dppi_ch_2); NRF_GPIOTE20->PUBLISH_IN[channel_in_2] = dppi_ch_2 | 0x80000000; NRF_EGU20->SUBSCRIBE_TRIGGER[2] = dppi_ch_2 | 0x80000000; NRF_TIMER20->SUBSCRIBE_CAPTURE[2] = dppi_ch_2 | 0x80000000; NRF_DPPIC20->SUBSCRIBE_CHG[chg_2].DIS = dppi_ch_2 | 0x80000000; NRF_DPPIC20->TASKS_CHG[chg_2].EN = 1; // enable
What it does:
- create a CHG (channel group)
- DPPI is triggered by a GPIOTE in-event
- DPPI then triggers and EGU, a TIMER capture, and...
- DPPI also triggers its own CHG.DIS task (i.e. disables further captures)
But I now need to do this with gppi, in order connect a DPPI across domains... I want to have a GPIOTE30->EVENTS.IN[] trigger a TIMER20->TASKS.CAPTURE[]
So I take a deep breath, then #include <helpers/nrfx_gppi.h> and read the documentation, such as it is:
- the file ncs/v2.9.0/modules/hal/nordic/nrfx/helpers/nrfx_gppi.h
- and the online "and the Nordic online docs "nrfx: Generic PPI layer"
Oh, so it seems easy... there is a "nrfx_gppi_group_alloc()" function just like you'd expect. Let's code it up and compile it:
rc = nrfx_gppi_channel_alloc(&gppi_ch_2); nrfx_gppi_channels_enable(BIT(gppi_ch_2)); static nrfx_gppi_channel_group_t g_chg_2; rc = nrfx_gppi_group_alloc(&g_chg_2); // NRF_DPPIC20->CHG[chg_2] = BIT(dppi_ch_2); nrfx_gppi_channels_include_in_group(BIT(gppi_ch_2),g_chg_2);
But no, it isn't easy!
While nrfx_gppi_group_alloc() and nrfx_gppi_channels_include_in_group() are nicely defined in helpers/nrfx_gppi.h.... they are not IMPLEMENTED in the file nrfx/helpers/nrfx_gppi_dppi_ppib_lumos.c (where nrfx_gppi_channel_alloc() etc are implemented).
/(....c.obj): in function `l15timings_init': /(......).c:940: undefined reference to `nrfx_gppi_group_alloc' /(...).c:948: undefined reference to `nrfx_gppi_channels_include_in_group' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed.
So my question is.... how am I supposed to use channel groups, using the GPPI system?