<?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 configure default state of GPIO ouput</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45972/how-to-configure-default-state-of-gpio-ouput</link><description>Working with NRF5 SDK 15.0.x, if I configure an GPIO as output, its initial state is low. I can set it high after configuration, but it is briefly low. Is there anyway to configure the initial state to be high/set before the pin is connected as ouput</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Apr 2019 22:05:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45972/how-to-configure-default-state-of-gpio-ouput" /><item><title>RE: How to configure default state of GPIO ouput</title><link>https://devzone.nordicsemi.com/thread/181188?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 22:05:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b57deb7e-4839-4c41-8662-fcf2a2e6a012</guid><dc:creator>ampad</dc:creator><description>&lt;p&gt;Digging through the code as @awneil suggested, I found that&amp;nbsp;nrf_gpio_pin_set() simply updates the OUTSET register, so the pin does not need to be configured as output first. Calling this before configuring the pin as output results in the behavior I was looking for.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_gpio_pin_set(pin);
nrf_gpio_cfg(pin,
    NRF_GPIO_PIN_DIR_OUTPUT,
    NRF_GPIO_PIN_INPUT_DISCONNECT,
    NRF_GPIO_PIN_NOPULL,
    NRF_GPIO_PIN_S0D1,
    NRF_GPIO_PIN_NOSENSE);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure default state of GPIO ouput</title><link>https://devzone.nordicsemi.com/thread/181184?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 20:53:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9227c5c-9abb-4715-96c9-814c282cd754</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;You can see the source of&amp;nbsp;nrf_gpio_cfg() - it just writes to the&amp;nbsp;PIN_CNF register.&lt;/p&gt;
&lt;p&gt;Check the &lt;strong&gt;Product Specification&lt;/strong&gt; for register descriptions &amp;amp; to see if there&amp;#39;s an option to do what you want...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure default state of GPIO ouput</title><link>https://devzone.nordicsemi.com/thread/181175?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 19:57:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19bca498-2550-405a-a46e-a4d516ce01c4</guid><dc:creator>ampad</dc:creator><description>&lt;p&gt;It does have an external pullup, I am configuring the pin in an open drain configuration using&amp;nbsp;NRF_GPIO_PIN_S0D1 as the drive type as follows&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    nrf_gpio_cfg(pin,
        NRF_GPIO_PIN_DIR_OUTPUT,
        NRF_GPIO_PIN_INPUT_DISCONNECT,
        NRF_GPIO_PIN_NOPULL,
        NRF_GPIO_PIN_S0D1,
        NRF_GPIO_PIN_NOSENSE);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When this function is called, the pin&amp;nbsp;is pulled low as the default state for the output pin is cleared. What I am looking for is a way for the value associated with the pin to be set to 1 (i.e. disconnected) at configuration time so that the pin is not pulled low.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure default state of GPIO ouput</title><link>https://devzone.nordicsemi.com/thread/181168?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 19:15:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c13240bb-5e79-40e6-bc7d-ad5b1ef64b77</guid><dc:creator>Fred</dc:creator><description>&lt;p&gt;Unless I understand it incorrectly, if you need to be sure that it is high even before you have started your program adn/or do the configuration, I guess you would required a pull-up on the board?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>