<?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 Read value of an output GPIO with NCS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87373/how-to-read-value-of-an-output-gpio-with-ncs</link><description>Hi, 
 I am develop with nRF5340, ncs1.5.1. 
 I am puzzled how to read the value of an output GPIO. 
 I saw the function gpio_pin_get_raw and gpio_port_get_raw, the comment said they are used to get the value of input pin/port. 
 1、How can I read value</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Apr 2022 13:11:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87373/how-to-read-value-of-an-output-gpio-with-ncs" /><item><title>RE: how to Read value of an output GPIO with NCS</title><link>https://devzone.nordicsemi.com/thread/365440?ContentTypeID=1</link><pubDate>Thu, 28 Apr 2022 13:11:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40b089c5-4003-4532-ad30-4d1ec1148935</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;There should be no problem to read a pin (even if it may for instance be used by a peripheral), you should get the level of the pin by calling for instance&amp;nbsp;&lt;span&gt;gpio_pin_get_raw&lt;/span&gt;() or gpio_port_get_raw().&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to Read value of an output GPIO with NCS</title><link>https://devzone.nordicsemi.com/thread/365403?ContentTypeID=1</link><pubDate>Thu, 28 Apr 2022 11:47:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06d13668-81d9-4399-8f20-6bb8f0d63174</guid><dc:creator>qwertynoon</dc:creator><description>&lt;p&gt;There were no precedents in history for reading OUTPUT GPIO STATE.&lt;/p&gt;
&lt;p&gt;I would recomend to set variable&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t GPIO_state = 0x00;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and then when you change the state of output you should write according bit in GPIO_state variable.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;GPIO_state |=  (1 &amp;lt;&amp;lt; gpio_number); // 0 to 1 state

GPIO_state &amp;amp;= ~(1 &amp;lt;&amp;lt; gpio_number); // 1 to 0 state&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;There is no other way for me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to Read value of an output GPIO with NCS</title><link>https://devzone.nordicsemi.com/thread/365274?ContentTypeID=1</link><pubDate>Thu, 28 Apr 2022 01:01:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b92792f4-86c2-4a73-930b-fecc505a5a7e</guid><dc:creator>helen</dc:creator><description>&lt;p&gt;Hello，&lt;/p&gt;
&lt;p&gt;The post you gave is about nRF5 SDK, what I mentioned is nRF connect SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to Read value of an output GPIO with NCS</title><link>https://devzone.nordicsemi.com/thread/365233?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2022 14:10:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44b52401-9bc0-4c52-903e-fc304c1a8cc0</guid><dc:creator>qwertynoon</dc:creator><description>&lt;p&gt;&lt;a title="https://devzone.nordicsemi.com/f/nordic-q-a/11275/read-gpio-output-state" href="https://devzone.nordicsemi.com/f/nordic-q-a/11275/read-gpio-output-state"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/11275/read-gpio-output-state&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>