This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

If I use s110, Doesn't work gpiote interrupt

static void gpio_init(void)

{

  	  nrf_gpio_cfg_input(Record, NRF_GPIO_PIN_PULLUP);
      nrf_gpio_cfg_input(Play, NRF_GPIO_PIN_PULLUP);
      nrf_gpio_cfg_input(Menu_Dw, NRF_GPIO_PIN_PULLUP);

      //NVIC_DisableIRQ(GPIOTE_IRQn);
	  //NVIC_ClearPendingIRQ(GPIOTE_IRQn);
      /*
       NRF_GPIOTE->CONFIG[0] =  (GPIOTE_CONFIG_POLARITY_HiToLo << GPIOTE_CONFIG_POLARITY_Pos)
                   | (0x1E << GPIOTE_CONFIG_PSEL_Pos)     
                   | (GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos);
                     NRF_GPIOTE->INTENSET  = GPIOTE_INTENSET_IN0_Set << GPIOTE_INTENSET_IN0_Pos;  

       NRF_GPIOTE->CONFIG[1] =  (GPIOTE_CONFIG_POLARITY_HiToLo << GPIOTE_CONFIG_POLARITY_Pos)
                   | (0x1C << GPIOTE_CONFIG_PSEL_Pos)      
                   | (GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos);
                     NRF_GPIOTE->INTENSET  = GPIOTE_INTENSET_IN1_Set << GPIOTE_INTENSET_IN1_Pos;  
      */
      nrf_gpiote_unconfig(0);
      nrf_gpiote_unconfig(1);
      nrf_gpiote_event_config(0, Menu_Dw, NRF_GPIOTE_POLARITY_LOTOHI);
      nrf_gpiote_event_config(1, Record, NRF_GPIOTE_POLARITY_LOTOHI);
  	  __NOP();
      __NOP();
      __NOP();
 
	  NRF_GPIOTE->EVENTS_IN[0] = 0; 
	  NRF_GPIOTE->EVENTS_IN[1] = 0; 

      NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_IN0_Enabled << GPIOTE_INTENSET_IN0_Pos;
      NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_IN1_Enabled << GPIOTE_INTENSET_IN1_Pos;
      sd_nvic_SetPriority(GPIOTE_IRQn, 3);
	  sd_nvic_EnableIRQ(GPIOTE_IRQn);										  			

}

Now, If I use the function(gpio_init()), Doesn't work advertising.

I want to use the button during the ad.

What function should I use this case?

I have been using nrf51822.

Related