<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configuration of Buttons with different settings</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47674/configuration-of-buttons-with-different-settings</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 May 2019 08:12:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47674/configuration-of-buttons-with-different-settings" /><item><title>RE: Configuration of Buttons with different settings</title><link>https://devzone.nordicsemi.com/thread/189224?ContentTypeID=1</link><pubDate>Mon, 27 May 2019 08:12:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be7dc2c9-16a4-4140-963a-d50037e7b2a5</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Thank you for your inputs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuration of Buttons with different settings</title><link>https://devzone.nordicsemi.com/thread/189221?ContentTypeID=1</link><pubDate>Mon, 27 May 2019 08:06:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abd0ea1c-4aa9-4e0c-ac8f-36fc0e643353</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="beemavishnu"]Whether can I configure the debouncing delay dynamically. [/quote]
&lt;p&gt;&amp;nbsp;I think it should be fine as long as you first call &lt;em&gt;app_button_disable()&lt;/em&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;app_button_init()&lt;/em&gt; calls &lt;em&gt;app_timer_create()&lt;/em&gt;, which will return an error if p_timer_id-&amp;gt;is_running.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="beemavishnu"]For GPIOTE if I configure button for delay of 5 seconds, then within 5 seconds whether chip will go to low power mode.[/quote]
&lt;p&gt;I am not sure if I understand correctly. Do you ask if the chip will go to sleep while holding the button?&lt;/p&gt;
&lt;p&gt;When the button is pushed, GPIOTE handler will be called where the detection timer is started. When the timer times out, timer event handler will be called. If you puts device in sleep mode in main application, it should also sleep during detection delay (unless there is other tasks that needs to be done).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuration of Buttons with different settings</title><link>https://devzone.nordicsemi.com/thread/189104?ContentTypeID=1</link><pubDate>Fri, 24 May 2019 16:16:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54cd6f33-4941-492d-8ab7-bc129c765100</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Hello Amanda,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your inputs. I am trying to understand more about query 4.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Whether can I configure the debouncing delay dynamically. Assume for first time I want a debouncing delay of 5 sec, later I want debouncing delay on &lt;strong&gt;same pin&lt;/strong&gt; for 2 sec. For this whether can I call&amp;nbsp;app_button_init() whenever I want to change the delay settings.&lt;/li&gt;
&lt;li&gt;For GPIOTE if I configure button for delay of 5 seconds, then within 5 seconds whether chip will go to low power mode.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Even in the below link all buttons are configured to same delay.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/10721/button-interrupt-problem-when-booting"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/10721/button-interrupt-problem-when-booting&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards&lt;/p&gt;
&lt;p&gt;Vishnu Beema&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuration of Buttons with different settings</title><link>https://devzone.nordicsemi.com/thread/189032?ContentTypeID=1</link><pubDate>Fri, 24 May 2019 12:02:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:998bb403-c610-499f-a576-d9151d9e09a3</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]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…).[/quote]
&lt;p&gt;&amp;nbsp;The buttoms are configured by &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Fgroup__app__button.html&amp;amp;anchor=ga5948c3d8e3e385820dc7d8df0976e8eb"&gt;app_button_init&lt;/a&gt;().&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user=""][/quote]&lt;/p&gt;
&lt;p&gt;2) In this example, both button press &amp;amp; release is detected. I want to detect only press. How to change this.&lt;/p&gt;
&lt;p&gt;3) How Raising &amp;amp; Edge trigger interrupts are configured for buttons.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please see this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/14494/button-release-and-button-press-event"&gt;post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]4) In example code, all buttons are configured to same delay/debounce. Whether can I configure different buttons to different &lt;span&gt;debounce (Button 1 with 5 sec, Button 2 with 1 sec etc...).&lt;/span&gt;[/quote]
&lt;p&gt;The &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__app__button.html?resultof=%22%42%55%54%54%4f%4e%5f%44%45%54%45%43%54%49%4f%4e%5f%44%45%4c%41%59%22%20"&gt;Button Handler &lt;/a&gt;&amp;nbsp;uses the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__app__gpiote.html"&gt;GPIOTE Handler&lt;/a&gt;&amp;nbsp;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.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]5) What is the max debounce time can I configure ?[/quote]
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__app__button.html?cp=5_5_0_6_11_9_9#ga5948c3d8e3e385820dc7d8df0976e8eb"&gt;app_button_init&lt;/a&gt;() uses the app_timer, so the max here will be the same for app_button detection_delay. According this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/41532/app-timer-maximum-time-in-sdk-15-2/161682#161682"&gt;post&lt;/a&gt;, it&amp;#39;s 256 seconds if &lt;em&gt;APP_TIMER_CONFIG_RTC_FREQUENCY&lt;/em&gt; is configured to 0.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Amanda&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>