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

How to use GPIOTE_IRQHandler for multiple interrupt request ?

Hi,

I have an issue in using GPIOTE_IRQHandler.

Let me give an explanation about our implementaiton.

we have nRF controller which is connected to STM32 controller.

Currently the GPIO pin P0.17 on nRF is used as a interrupt pin for NRF for some purpose.

Now i am planning to implement system off mode on nRF side, i am using GPIO P0.20 as nRF interrupt to wake up from the system off mode.

But how i can use GPIO interrupt handler GPIOTE_IRQHandler for the above two interrupt.

Can you please guide me on this and share some examples for the same.

Regards, Anand

Parents
  • Hi Anand,

    Could you upload your full code ?

    To configure a GPIO pin to work as input interrupt for GPIOTE Port event, besides enabling "NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_PORT_Set << GPIOTE_INTENSET_PORT_Pos;"

    You would also need to configure the PIN_CNF[] register for that pin to set the SENSE level (high or low). You can have a look at chapter 14 in the nRF51 Reference Manual.

    You can use this API: nrf_gpio_cfg_sense_input() to configure a pin as input for SENSE signal.

    So if you have that configured for pin P0.17 you can apply the same for pin P0.20.

    PORT event and IN[] are different in the sense that for PORT event there is only one interrupt for all pins with Sense signal. IN events, you have 4 separated event for each, but you have maximum 4 pins can be used at a time when PORT event can have no limit pins with Sense signal. PORT event consume much less power (1uA) compare to IN event that can comsume upto 1mA. Also IN event can't wake system up from SystemOFF.

  • @Rita: Please create another question don't piggybacking a question here.

    I don't see any reason why you can't configure 2 pins with different sense level. You just have to call the nrf_gpio_cfg_sense_input() 2 times, one for each pin.

Reply Children
No Data
Related