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

GPIO IN_EVENT to GPIO PORT Event

Hello, I'm new to Nordic SDK and I would like to ask you for help with change of GPIO IN_EVENT to GPIO PORT event implementation. The reason is we are using revision < 3 and I need to decrease power consumption.

Current implementation is like following:

void init_gpio_button()
{
    nrf_gpio_cfg_input(GPIO_BUTTON, NRF_GPIO_PIN_PULLUP);

	uint32_t err_code = nrf_drv_gpiote_init();
	APP_ERROR_CHECK(err_code);
  
    nrf_drv_gpiote_in_config_t btn = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
	btn.pull = NRF_GPIO_PIN_PULLUP;

	nrf_drv_gpiote_in_uninit(GPIO_BUTTON);
	err_code = nrf_drv_gpiote_in_init(GPIO_BUTTON, &btn, btn_handler_isr);
	APP_ERROR_CHECK(err_code);

	nrf_drv_gpiote_in_event_enable(GPIO_BUTTON, true);
}

Is it enough to just set GPIOTE_CONFIG_IN_SENSE_HITOLO.hi_accuracy = false?

Thank you very much for your help.

Parents Reply
  • Thank you I will have a look on the post.

    I have one more question. In case I have more than one input GPIOs, how the interrupt handling must be changed? In our implementation we have 4 input GPIOs and if change .hi_accuracy to false for all four GPIOs after I receive first interrupt, I don't receive any else. Do I need to clear any interrupt flag?

    Thank you very much.

Children
No Data
Related