I would like to set a gpio pin on Radio RX Ready and clear it on Radio Disable all via PPI. Below is my code. I only get the pin to change levels when the OUT task polarity is set to NRF_GPIOTE_POLARITY_TOGGLE. Why is this? I'm using the Set & Clear tasks explicitly, with nothing connected to the OUT task so my expectation is that this field shouldn't make a difference in operations but it does.
static const struct gpio_dt_spec test_pin = GPIO_DT_SPEC_GET(DT_ALIAS(test_pin), gpios);
nrfx_gpiote_init(0);
static uint8_t gpiote_channel;
nrfx_gpiote_channel_alloc(&gpiote_channel);
static const nrfx_gpiote_output_config_t output_config = {
.drive = NRF_GPIO_PIN_S0S1,
.input_connect = NRF_GPIO_PIN_INPUT_DISCONNECT,
.pull = NRF_GPIO_PIN_NOPULL,
};
const nrfx_gpiote_task_config_t task_config = {
.task_ch = gpiote_channel,
.polarity = NRF_GPIOTE_POLARITY_TOGGLE,
.init_val = 1,
};
nrfx_gpiote_output_configure(test_pin.pin, &output_config, &task_config);
nrfx_gpiote_out_task_enable(test_pin.pin);
nrf_ppi_channel_t ppi_channels[2];
nrfx_ppi_channel_alloc(&ppi_channels[0]);
nrfx_ppi_channel_alloc(&ppi_channels[1]);
nrfx_ppi_channel_assign(ppi_channels[0], nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_RXREADY), nrfx_gpiote_set_task_addr_get(test_pin.pin));
nrfx_ppi_channel_assign(ppi_channels[1], nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_DISABLED), nrfx_gpiote_clr_task_addr_get(test_pin.pin));
nrfx_ppi_channel_enable(ppi_channels[0]);
nrfx_ppi_channel_enable(ppi_channels[1]);