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

The GPIOTE Handler was triggered several times (SD14, 52840)

Hi, I was confused about the behavior of GPIOTE Handler  module。I defined a handler(gpiote_event_handler) and I hope when the GPIO Pin(0.14) is changed from high to low or low to high, this handler could be triggered. When I reversed the state of Pin(0.14) just one time, my handler was triggered several times.

My code:


static app_gpiote_user_id_t   m_gpiote_user_id;
static uint32_t  p014_bitmask = 0x00004000; 

static void gpiote_event_handler(uint32_t const * p_event_pins_low_to_high, uint32_t const * p_event_pins_high_to_low){
	if(*p_event_pins_low_to_high & p014_bitmask){
		NRF_LOG_INFO("gpiote_event_handler p014 low_to_high");
	}else if(*p_event_pins_high_to_low & p014_bitmask){
		NRF_LOG_INFO("gpiote_event_handler p014 high_to_low");
	}
}

void init(void){
	APP_GPIOTE_INIT(3);
	
	nrf_gpio_cfg_input(NRF_GPIO_PIN_MAP(0,14), NRF_GPIO_PIN_PULLDOWN);
	
	uint32_t err_code;
	err_code = app_gpiote_user_register(&m_gpiote_user_id, &p014_bitmask, &p014_bitmask, gpiote_event_handler);
	APP_ERROR_CHECK(err_code);
	
	err_code = app_gpiote_user_enable(m_gpiote_user_id);
	APP_ERROR_CHECK(err_code);
}

and the result:

I hope my handler could be triggered just one time when the P(0.14) pin is set from low to high,and just one time when the P(0.14) pin is clear from high to low.

Is that possible?

Parents Reply Children
No Data
Related