<?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 do I use the GPIO pin on nrf52 devices?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23786/how-do-i-use-the-gpio-pin-on-nrf52-devices</link><description>Hello, just a few quick short questions regarding nrf52 devices: 
 
 
 Do I have to configure and initialize them before using? 
 
 
 Which function should I use? I&amp;#39;m going with nrf_gpio_pin_write, hope its alright. 
 
 
 The most important one</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Nov 2019 09:13:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23786/how-do-i-use-the-gpio-pin-on-nrf52-devices" /><item><title>RE: How do I use the GPIO pin on nrf52 devices?</title><link>https://devzone.nordicsemi.com/thread/221494?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2019 09:13:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53cc87b6-4027-4070-986e-ca621008ac97</guid><dc:creator>Luke Galea</dc:creator><description>&lt;p&gt;How would you use nrf_gpio_cfg_output with pins on other ports such as P1,03 etc...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I use the GPIO pin on nrf52 devices?</title><link>https://devzone.nordicsemi.com/thread/192878?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2019 09:36:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf63f1d4-7a85-4e8f-bb5f-b38a990a8692</guid><dc:creator>Walther</dc:creator><description>&lt;p&gt;Thank you for this information! I have been looking for this for half an hour now because I want to know it backwards. I wanted to know which pin is pin 45. All threads just lead to the macro which is no help. Why does nordic not provide such basic information somewhere? The folder &lt;code&gt;components\drivers_nrf\hal\nrf_gpio.h&lt;/code&gt;&amp;nbsp; does not even exist in my SDK 15.3...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I use the GPIO pin on nrf52 devices?</title><link>https://devzone.nordicsemi.com/thread/149911?ContentTypeID=1</link><pubDate>Sun, 23 Sep 2018 01:40:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:416a00d1-96f4-4a1d-8c7b-4d197d24341b</guid><dc:creator>brian fleming</dc:creator><description>&lt;p&gt;Is the closing bracket &amp;#39; ] &amp;#39; a typo?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I use the GPIO pin on nrf52 devices?</title><link>https://devzone.nordicsemi.com/thread/149910?ContentTypeID=1</link><pubDate>Sun, 23 Sep 2018 01:38:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4751705-dc54-4172-b190-1e1dc20a3e03</guid><dc:creator>brian fleming</dc:creator><description>&lt;p&gt;This is the best answer, but for all the newbies out there (like me) it is always helpful to put the complete code in the answer like the below.&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg_output(0) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;;&amp;nbsp; // In this case the &amp;#39;0&amp;#39; is the pin number you wish to config as an output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I use the GPIO pin on nrf52 devices?</title><link>https://devzone.nordicsemi.com/thread/93562?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 02:42:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85388b79-d335-4d60-bf27-f186d58259e6</guid><dc:creator>Mitch996</dc:creator><description>&lt;p&gt;You are right, I tried to use my mock-up version of the pin map macro function, and there was an error in it. nrf_gpio_cfg_output is the way to go. Once that got done right, everything is AOK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I use the GPIO pin on nrf52 devices?</title><link>https://devzone.nordicsemi.com/thread/93559?ContentTypeID=1</link><pubDate>Wed, 26 Jul 2017 08:35:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33a9b56e-4a5c-463a-94a1-2f54d1fc80a0</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Come on, no function from &lt;code&gt;components\drivers_nrf\hal\nrf_gpio.h&lt;/code&gt; have ever let me down. Simply init PIN or range as output by&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_gpio_cfg_output
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_gpio_range_cfg_output(...)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and then set it high or low by one of functions&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_gpio_pin_set(...)
nrf_gpio_pin_clear(...)
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I use the GPIO pin on nrf52 devices?</title><link>https://devzone.nordicsemi.com/thread/93561?ContentTypeID=1</link><pubDate>Wed, 26 Jul 2017 07:31:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f16ae8a7-c459-4f2a-9c8a-2e533f692fff</guid><dc:creator>Mitch996</dc:creator><description>&lt;p&gt;@koniho Yes I used this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You can also use the NRF_GPIO_PIN_MAP macro which is defined as:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And @ Roger Clark I called that first, but it didn&amp;#39;t work, as I feared most.&lt;/p&gt;
&lt;p&gt;Is their any register magic possible? like hypothetically this:&lt;/p&gt;
&lt;p&gt;GPIO_P1-&amp;gt;Output_Lat=0x0080;  ???&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I use the GPIO pin on nrf52 devices?</title><link>https://devzone.nordicsemi.com/thread/93560?ContentTypeID=1</link><pubDate>Wed, 26 Jul 2017 07:07:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c51590ec-1bf0-4af5-8687-e0ba70798544</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;Don&amp;#39;t you need to call&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; nrf_gpio_cfg_output(PIN_NUMBER]);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;first?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I use the GPIO pin on nrf52 devices?</title><link>https://devzone.nordicsemi.com/thread/93558?ContentTypeID=1</link><pubDate>Wed, 26 Jul 2017 06:56:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b698a349-d9f8-47ef-a140-1b3c33e43582</guid><dc:creator>koniho</dc:creator><description>&lt;p&gt;For P0.22:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_gpio_pin_write(22, 1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;should be correct.&lt;/p&gt;
&lt;p&gt;For P1.07:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_gpio_pin_write(39, 1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where 32+7 = 39.&lt;/p&gt;
&lt;p&gt;You can also use the &lt;code&gt;NRF_GPIO_PIN_MAP&lt;/code&gt; macro which is defined as:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define 	NRF_GPIO_PIN_MAP(port, pin)   ((port &amp;lt;&amp;lt; 5) | (pin &amp;amp; 0x1F))
// Macro for mapping port and pin numbers to values understandable for nrf_gpio functions. 
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>