hi support team,
customer want to use 54L15 radio event
nrfx_err_t err;
uint8_t gpiote_channel;
uint8_t ppi_set;
uint8_t ppi_clr;
nrfx_gpiote_t const gpiote_inst = NRFX_GPIOTE_INSTANCE(20);
err = nrfx_gpiote_init(&gpiote_inst,NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY);
if (err != NRFX_SUCCESS) {
printk("nrfx_gpiote_init error: %d\r\n", err);
// return;
}
err = nrfx_gpiote_channel_alloc(&gpiote_inst,&gpiote_channel);
if (err != NRFX_SUCCESS) {
printk("nrfx_gpiote_channel_alloc error: %08x", err);
return;
}
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_PULLUP,
};
const nrfx_gpiote_task_config_t task_config = {
.task_ch = gpiote_channel,
.polarity = NRF_GPIOTE_POLARITY_TOGGLE,
.init_val = NRF_GPIOTE_INITIAL_VALUE_LOW,
};
err = nrfx_gpiote_output_configure(&gpiote_inst,
RADIO_GPIO_PIN,
&output_config,
&task_config);
if (err != NRFX_SUCCESS) {
printk("nrfx_gpiote_output_configure , err:%d",err);
}
err = nrfx_gppi_channel_alloc(&ppi_set);
if (err != NRFX_SUCCESS) {
printk("nrfx_gppi_channel_alloc error: %08x", err);
return;
}
err = nrfx_gppi_channel_alloc(&ppi_clr);
if (err != NRFX_SUCCESS) {
printk("nrfx_gppi_channel_alloc error: %08x", err);
return;
}
nrfx_gppi_channel_endpoints_setup(ppi_set,
nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_READY),
nrfx_gpiote_set_task_address_get(&gpiote_inst,RADIO_GPIO_PIN));
nrfx_gppi_channel_endpoints_setup(ppi_clr,
nrf_radio_event_address_get(NRF_RADIO, NRF_RADIO_EVENT_DISABLED),
nrfx_gpiote_clr_task_address_get(&gpiote_inst,RADIO_GPIO_PIN));
nrfx_gppi_channels_enable(BIT(ppi_set));
nrfx_gppi_channels_enable(BIT(ppi_clr));
nrfx_gpiote_out_task_enable(&gpiote_inst,RADIO_GPIO_PIN);
