<?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>how to enable gpio pin after button events</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10791/how-to-enable-gpio-pin-after-button-events</link><description>Hello 
 I wrote the program by referring the some examples after compiling the program GPIO pin becomes high immediately (3.3V ) bu my aim is to make the GPIO pin as output only after the button press so anyone suggest me how to make the function like</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 14 Dec 2015 13:13:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10791/how-to-enable-gpio-pin-after-button-events" /><item><title>RE: how to enable gpio pin after button events</title><link>https://devzone.nordicsemi.com/thread/40324?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2015 13:13:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:649b47e8-fed6-4ef7-b662-25f109bfdaf7</guid><dc:creator>MARTIN FR</dc:creator><description>&lt;p&gt;In my project i prefere to use HODI because intially i configure the pin 6 as output so set to  high(nrf_gpio_pin_set) so that it can produce 5mA at the output and make the buzzer beep little more louder after that i will clear that pin 6 to low  (nrf_gpio_pin_clear)so for this function HOD1 is better or HOH1? can you suggest me whicch is more preferable and overall less power consumption?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable gpio pin after button events</title><link>https://devzone.nordicsemi.com/thread/40323?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2015 12:34:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6ab3113-d234-47f2-a680-2d3bf91bdebc</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;See the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf51.v1.0.0/pdflinks/ref_manual.html"&gt;Reference Manual&lt;/a&gt; page 68.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;S0S1 0 Standard &amp;#39;0&amp;#39;, standard &amp;#39;1&amp;#39;
H0S1 1 High drive &amp;#39;0&amp;#39;, standard &amp;#39;1&amp;#39;
S0H1 2 Standard &amp;#39;0&amp;#39;, high drive &amp;#39;1&amp;#39;
H0H1 3 High drive &amp;#39;0&amp;#39;, high &amp;#39;drive &amp;#39;1&amp;#39;&amp;#39;
D0S1 4 Disconnect &amp;#39;0&amp;#39; standard &amp;#39;1&amp;#39;
D0H1 5 Disconnect &amp;#39;0&amp;#39;, high drive &amp;#39;1&amp;#39;
S0D1 6 Standard &amp;#39;0&amp;#39;. disconnect &amp;#39;1&amp;#39;
H0D1 7 High drive &amp;#39;0&amp;#39;, disconnect &amp;#39;1&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;H0H1 means that the pin is in high drive both when it is low (0), and when it is high (1). H0D1 Means that it is in high drive when it is low (0), and disconnected when it is high (1).&lt;/p&gt;
&lt;p&gt;If you want to &lt;a href="https://learn.sparkfun.com/tutorials/how-to-use-a-multimeter/measuring-current"&gt;measure current&lt;/a&gt;, use an &lt;a href="https://en.wikipedia.org/wiki/Ammeter"&gt;ampere meter&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable gpio pin after button events</title><link>https://devzone.nordicsemi.com/thread/40325?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2015 10:42:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:381d8ef3-b409-4516-a10b-95c7a6c1d2d5</guid><dc:creator>MARTIN FR</dc:creator><description>&lt;p&gt;thanks for your  reply i managed to do can you tell me i want to set the pin 6 and pin 7 in high drive mode i am using this function based on some other post&lt;/p&gt;
&lt;p&gt;NRF_GPIO-&amp;gt;PIN_CNF[6] = (GPIO_PIN_CNF_DRIVE_H0H1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos);&lt;/p&gt;
&lt;p&gt;does this will make the pin 6 drive in 5mA current mode ? how can i check this pin 6 is providing 5mA? can you give me some information about his HOH1and HOD1 because it is not clear for me&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable gpio pin after button events</title><link>https://devzone.nordicsemi.com/thread/40322?ContentTypeID=1</link><pubDate>Fri, 11 Dec 2015 13:12:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90f7f802-b1ed-4e36-8c8f-39abd2e82c50</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Since you did not write which pins you are talking about, i assume (from reading the code) that you mean pin 6 and 7.&lt;/p&gt;
&lt;p&gt;Inside init_gpio(); you do the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    nrf_gpio_range_cfg_input(BUTTON_1, BUTTON_2, NRF_GPIO_PIN_PULLUP);//
    nrf_gpio_range_cfg_output(0, 7); 
	nrf_gpio_pin_set(6); //clear the LED                              
    nrf_gpio_pin_set(7);//clear the LED
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The last two lines will set pin 6 and 7 high.
If you comment out these two lines, and put them inside your button handler instead, they will stay low until the button is pressed.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case BUTTON_1:		 
     app_timer_start(m_timer_id, MS_TO_TICKS(BUTTON_PRESS_TIME_MS), NULL); 
     nrf_gpio_pin_set(6); //clear the LED                              
     nrf_gpio_pin_set(7);//clear the LED
     break;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>