I am not understanding that what should be event pointer and task pointer address. Can you please explain it with some example in detail.
I am not understanding that what should be event pointer and task pointer address. Can you please explain it with some example in detail.
Thank you very much for your answer. But in this below code what will be *event_ptr and *task_ptr?
void ppi_enable_channel(uint32_t ch_num, volatile uint32_t *event_ptr, volatile uint32_t *task_ptr)
{
if(ch_num >= 16)
{
return;
}
else
{
#if(USE_WITH_SOFTDEVICE == 1)
sd_ppi_channel_assign(ch_num, event_ptr, task_ptr);
sd_ppi_channel_enable_set(1 << ch_num);
#else
// Otherwise we configure the channel and return the channel number
NRF_PPI->CH[ch_num].EEP = (uint32_t)event_ptr;
NRF_PPI->CH[ch_num].TEP = (uint32_t)task_ptr;
NRF_PPI->CHENSET = (1 << ch_num);
#endif
moderator edit: use of code tags
Thank you very much for your answer. But in this below code what will be *event_ptr and *task_ptr?
void ppi_enable_channel(uint32_t ch_num, volatile uint32_t *event_ptr, volatile uint32_t *task_ptr)
{
if(ch_num >= 16)
{
return;
}
else
{
#if(USE_WITH_SOFTDEVICE == 1)
sd_ppi_channel_assign(ch_num, event_ptr, task_ptr);
sd_ppi_channel_enable_set(1 << ch_num);
#else
// Otherwise we configure the channel and return the channel number
NRF_PPI->CH[ch_num].EEP = (uint32_t)event_ptr;
NRF_PPI->CH[ch_num].TEP = (uint32_t)task_ptr;
NRF_PPI->CHENSET = (1 << ch_num);
#endif
moderator edit: use of code tags
This is a function that handles configuration of PPI channels when the softdevice is enabled and disabled. Since the softdevice uses the PPI, it is a restricted peripheral and should be accessed via the nrf_soc library when it's enabled.
You can call this function similar to this: "ppi_enable_channel(MY_PPI_CHANNEL, &NRF_TIMER0->EVENTS_COMPARE[0], &NRF_ADC->TASKS_START);"