5 Replies Latest reply on May 3, 2016 6:36 PM by gdepaula

    GPIO interrupt

      Hello everybody,

       

      I need to wake-up the BCM20736S via an external button to ground that's connected to P2 of the BLE module.

      The GPIO is configured as input with a pull-up resistor and is generating an interrupt callback which already works flawlessly.

       

      But I also need to pull this pin down as a normal GPIO output, as it is shared with our main MCU that will wake-up on falling edge. So if the buttons not pressed by the user but a BLE event is generated, the module must be able to restart the main MCU.

       

      Two questions:

      How can I ensure the BLE module will wake-up even from deep sleep?

      Is this enough:

      devlpm_enableWakeFrom(DEV_LPM_WAKE_SOURCE_GPIO);
      bleprofile_PrepareHidOff();
      
      
      

       

      Do I need to disable the interrupt routine, if I reconfigure the GPIO as an output?

      I use this code to init it as an input interrupt source:

      UINT16 masks[3] = {0, 0, 0};
      masks[TACT_PORT] |= (1 << TACT_PIN);
      gpio_registerForInterrupt(masks, gpioTactInterruptHandler, NULL);
      gpio_configurePin(TACT_PORT, TACT_PIN, GPIO_EN_INT_FALLING_EDGE | GPIO_INPUT_ENABLE | GPIO_PULL_UP, GPIO_PIN_INPUT_HIGH);
      

       

      Find a schematic detail attached:

      BLE_schem.png

       

      Best regards

      Hannes Baumgart