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

Configuration of Buttons with different settings

 Hello,

 

I am using nRF52832, SDK_15.3.0, S132 SoftDevice and Segger for flash the image.

I started development on top of ‘ble_app_blinky’ code.

 

I have few queries on GPIO configuration.

 

1) For LEDs I am seeing bsp_board_init(BSP_INIT_LEDS) to configure LEDs. But for buttons I am not seeing any such function (bsp_board_init(BSP_INIT_BUTTONS). How buttons are configured (Input, pull-up/pull-down, priority etc…).

2) In this example, both button press & release is detected. I want to detect only press. How to change this.

3) How Raising & Edge trigger interrupts are configured for buttons.

4) In example code, all buttons are configured to same delay/debounce. Whether can I configure different buttons to different debounce (Button 1 with 5 sec, Button 2 with 1 sec etc...).

5) What is the max debounce time can I configure ?

 

Thanks & Regards

Vishnu Beema

Parents
  • Hi, 

     

    1) For LEDs I am seeing bsp_board_init(BSP_INIT_LEDS) to configure LEDs. But for buttons I am not seeing any such function (bsp_board_init(BSP_INIT_BUTTONS). How buttons are configured (Input, pull-up/pull-down, priority etc…).

     The buttoms are configured by app_button_init().

     

    2) In this example, both button press & release is detected. I want to detect only press. How to change this.

    3) How Raising & Edge trigger interrupts are configured for buttons.

    Please see this post.

    4) In example code, all buttons are configured to same delay/debounce. Whether can I configure different buttons to different debounce (Button 1 with 5 sec, Button 2 with 1 sec etc...).

    The Button Handler  uses the GPIOTE Handler to detect that a button has been pushed. To handle debouncing, it will start a timer in the GPIOTE event handler. The button will only be reported as pushed if the corresponding pin is still active when the timer expires. If there is a new GPIOTE event while the timer is running, the timer is restarted.

     

    5) What is the max debounce time can I configure ?

    app_button_init() uses the app_timer, so the max here will be the same for app_button detection_delay. According this post, it's 256 seconds if APP_TIMER_CONFIG_RTC_FREQUENCY is configured to 0.

     

    Best regards,

    Amanda

     

Reply
  • Hi, 

     

    1) For LEDs I am seeing bsp_board_init(BSP_INIT_LEDS) to configure LEDs. But for buttons I am not seeing any such function (bsp_board_init(BSP_INIT_BUTTONS). How buttons are configured (Input, pull-up/pull-down, priority etc…).

     The buttoms are configured by app_button_init().

     

    2) In this example, both button press & release is detected. I want to detect only press. How to change this.

    3) How Raising & Edge trigger interrupts are configured for buttons.

    Please see this post.

    4) In example code, all buttons are configured to same delay/debounce. Whether can I configure different buttons to different debounce (Button 1 with 5 sec, Button 2 with 1 sec etc...).

    The Button Handler  uses the GPIOTE Handler to detect that a button has been pushed. To handle debouncing, it will start a timer in the GPIOTE event handler. The button will only be reported as pushed if the corresponding pin is still active when the timer expires. If there is a new GPIOTE event while the timer is running, the timer is restarted.

     

    5) What is the max debounce time can I configure ?

    app_button_init() uses the app_timer, so the max here will be the same for app_button detection_delay. According this post, it's 256 seconds if APP_TIMER_CONFIG_RTC_FREQUENCY is configured to 0.

     

    Best regards,

    Amanda

     

Children
Related