Hi all,
My project will use PPI to control COMP of nRF52832, connect Event of COPM and Task of GPIOTE.
Question 1,
How could I get the address of COMP event and use it for PPI?
Address1 = * nrf_comp_event_address_get(NRF_COMP_EVENT_UP); // The function is always wrong!
Question 2,
nrfx_gpiote_out_task_addr_get(COM_out)+0x30 ;
Is it right address for clearing GPIO by PPI? Or we have other better way.
Code attached:
static void ppi_init(void) { uint32_t err_code = NRF_SUCCESS; uint32_t Address1; uint32_t Address2; err_code = nrf_drv_ppi_init(); APP_ERROR_CHECK(err_code); err_code = nrf_drv_ppi_channel_alloc(&m_ppi_channel1); APP_ERROR_CHECK(err_code); Address1 = * nrf_comp_event_address_get(NRF_COMP_EVENT_UP); err_code = nrf_drv_ppi_channel_assign(m_ppi_channel1, Address1, nrfx_gpiote_out_task_addr_get(COM_out)+0x30); //clear APP_ERROR_CHECK(err_code); err_code = nrf_drv_ppi_channel_alloc(&m_ppi_channel2); APP_ERROR_CHECK(err_code); = nrf_drv_ppi_channel_assign(m_ppi_channel2, *nrf_comp_event_address_get(NRF_COMP_EVENT_DOWN), nrfx_gpiote_out_task_addr_get(COM_out)+0x60); //set APP_ERROR_CHECK(err_code); // Enable both configured PPI channels err_code = nrf_drv_ppi_channel_enable(m_ppi_channel1); APP_ERROR_CHECK(err_code); err_code = nrf_drv_ppi_channel_enable(m_ppi_channel2); APP_ERROR_CHECK(err_code); }