<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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 get real gpio high/low</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/88537/how-to-get-real-gpio-high-low</link><description>Hi Nordic, 
 I am working with nRF52840, sdk17.1.0 and do the following test: 
 I use nrf_gpio_cfg_output(), nrf_gpio_pin_set(); to set gpio P1.00 to high and use nrf_gpio_pin_input_get() to read gpio level and the value is 1 (HIGH). 
 Next, I use a line</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Mon, 13 Jun 2022 05:28:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/88537/how-to-get-real-gpio-high-low" /><item><title>RE: how to get real gpio high/low</title><link>https://test-devzone.nordicsemi.com/thread/372002?ContentTypeID=1</link><pubDate>Mon, 13 Jun 2022 05:28:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba84bfcc-bb5c-4260-80fc-02a26b850cb3</guid><dc:creator>user116085</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I have tested the experience and it is workable.&lt;/p&gt;
&lt;p&gt;sample code:&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(1, 0));&lt;br /&gt; nrf_gpio_pin_set(NRF_GPIO_PIN_MAP(1, 0));&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg_input(NRF_GPIO_PIN_MAP(1, 1), NRF_GPIO_PIN_PULLDOWN);&lt;/p&gt;
&lt;p&gt;// connect P1.00 and P1.01&lt;br /&gt;value = nrf_gpio_pin_read(NRF_GPIO_PIN_MAP(1, 1)); // high&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Gavin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to get real gpio high/low</title><link>https://test-devzone.nordicsemi.com/thread/371048?ContentTypeID=1</link><pubDate>Tue, 07 Jun 2022 07:42:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4702b1db-a5d6-4a73-81da-53cad0a2c457</guid><dc:creator>user26071</dc:creator><description>&lt;p&gt;Hello Gavin,&lt;/p&gt;
[quote user="panpgg"]&lt;p&gt;Could I use&amp;nbsp;nrf_gpio_pin_read() to read P1.01 high/low ? Is the answer high ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Did you try?&lt;/p&gt;
&lt;p&gt;It should be possible to do so.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to get real gpio high/low</title><link>https://test-devzone.nordicsemi.com/thread/370974?ContentTypeID=1</link><pubDate>Mon, 06 Jun 2022 02:03:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:951ecd70-c984-4e98-aabf-ef25d42ec349</guid><dc:creator>user116085</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Thanks for the response. One more question.&lt;br /&gt;There are two gpios. For example, one is P1.00, the other is P1.01.&lt;/p&gt;
&lt;p&gt;If I set P1.00 as output high and P1.01 as input/no pull.&lt;br /&gt;Then, short P1.00 and P1.01.&lt;/p&gt;
&lt;p&gt;Could I use&amp;nbsp;nrf_gpio_pin_read() to read P1.01 high/low ? Is the answer high ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Gavin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to get real gpio high/low</title><link>https://test-devzone.nordicsemi.com/thread/370703?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 12:56:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce7e75f7-62db-4eed-81d9-b6981856b35a</guid><dc:creator>user26071</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;If you have configured it as an output pin, so when you short it to GND, you just make a circuit from VDD to GND drawing current (if you put an LED in between it would light up).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want to use it to check for high or low, you need to configure it as an input pin instead of an output pin.&amp;nbsp;&lt;span&gt;nrf_gpio_cfg_input() instead of nrf_gpio_cfg_output();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;FYI: A common thing to do is to set up an event handler/button handler to trigger an interrupt when a button is pressed. You can look into one of the example using button handlers to see how you can do that, such as the SDK\examples\peripheral\bsp.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>