Hello,
I would like to detect a change in a pin(GPIO_IN_NUMBER
) and depending on it I would like to trigger a SPI transaction, this should happen through PPI.
So far I have configured my PPI in this way, is there something faulty on this setting?
thanks in advance!
nrf_drv_gpiote_in_config_t configHighToLow = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
configHighToLow.sense = GPIOTE_CONFIG_POLARITY_HiToLo;
//Initializing GPIO_IN_NUMBER with the above configurations
err_code = nrf_drv_gpiote_in_init(GPIO_IN_NUMBER, &configHighToLow,gpio_event_handler);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_alloc(&ppi_channel_HighToLow);
APP_ERROR_CHECK(err_code);
gpiote_Transition_task_addr = nrf_drv_gpiote_in_event_addr_get(GPIO_IN_NUMBER);
spi_start_evt = nrf_drv_spi_start_task_get(&spi);
err_code = nrf_drv_ppi_channel_assign(ppi_channel_HighToLow, spi_start_evt, gpiote_Transition_task_addr);
APP_ERROR_CHECK(err_code);
// Enable both configured PPI channels
err_code = nrf_drv_ppi_channel_enable(ppi_channel_HighToLow);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_event_enable(GPIO_IN_NUMBER,false);