This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to use only one input pin to perform GPIOTE?

Hi everyone:

New to the DevZone, nice to meet you guys.

I have an problem to the GPIOTE.

I'm now using an AFE4404 to calculate the heart rate and heart rate variability.

In fact, after initializing AFE4404, the chip will automatically generate the interrupt signal itself.

I want to use that to input nRF 52840 then determine the whether there's the signal or not.

After I implement the initial code, nothing happened.

Here's my code below:

void AFE4404_EXIT_Init(void){
	ret_code_t err_code;
  err_code = nrf_drv_gpiote_init();
	APP_ERROR_CHECK(err_code);
	
	nrf_drv_gpiote_in_config_t config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
	config.pull = NRF_GPIO_PIN_PULLDOWN;
	err_code = nrf_drv_gpiote_in_init(AFE4404_RDY, &config, AFE4404_EXIT_Callback);
	APP_ERROR_CHECK(err_code);
	nrf_drv_gpiote_in_event_enable(AFE4404_RDY, true);
}

void AFE4404_EXIT_Callback(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action){
	printf("DONE \r\n");
}

The callback function is for only testing, but it doesn't print DONE at all.

Are there any problems?

Thank you guys.

Parents Reply Children
No Data
Related