<?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>Reading the output pin value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91024/reading-the-output-pin-value</link><description>Hi! 
 
 We use the following approach: 
 
 If the pin is configured using nrf_gpio_cfg_input we read the pin value via nrf_gpio_pin_read; 
 If the pin is configured using nrf_gpio_cfg_output we read the pin value via nrf_gpio_pin_out_read ; 
 
 We use</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Aug 2022 13:28:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91024/reading-the-output-pin-value" /><item><title>RE: Reading the output pin value</title><link>https://devzone.nordicsemi.com/thread/381802?ContentTypeID=1</link><pubDate>Tue, 16 Aug 2022 13:28:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16131c05-9b6a-41c7-bed3-3939e82364e9</guid><dc:creator>nikitag</dc:creator><description>&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading the output pin value</title><link>https://devzone.nordicsemi.com/thread/381794?ContentTypeID=1</link><pubDate>Tue, 16 Aug 2022 13:13:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a16ae1f1-ec72-4ee7-b4e1-c6ef3178cf12</guid><dc:creator>Kenneth</dc:creator><description>[quote user="nikitag"]Can we use&amp;nbsp;nrf_gpio_pin_out_read in this case?[/quote]
&lt;p&gt;Sure, but make sure to look at the implementaton of each of the calls you are making and read the GPIO chapter I linked so you can understand what each of them do, ref:&lt;br /&gt;&lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/v1.9.0/hal/nrf_gpio.h"&gt;https://github.com/NordicSemiconductor/nrfx/blob/v1.9.0/hal/nrf_gpio.h&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html#register.OUT"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html#register.OUT&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading the output pin value</title><link>https://devzone.nordicsemi.com/thread/381787?ContentTypeID=1</link><pubDate>Tue, 16 Aug 2022 12:56:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:992fccee-22e4-400b-a995-ac05e85cd878</guid><dc:creator>nikitag</dc:creator><description>&lt;p&gt;Yes. I want to read the value of OUTPUT GPIO pin that I have written. But I have found that&amp;nbsp;&lt;span&gt;nrf_gpio_pin_out_read gives me back incorrect value. I am trying to figure out whether&amp;nbsp;my flow is correct, because we use&amp;nbsp;nrf_gpio_pin_write -&amp;gt;&amp;nbsp;nrf_gpio_pin_set -&amp;gt;&amp;nbsp;nrf_gpio_port_out_set to set the value of the pin and&amp;nbsp;nrf_gpio_pin_out_read to read the state of the output pin. Is it correct? Can we use&amp;nbsp;nrf_gpio_pin_out_read in this case?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading the output pin value</title><link>https://devzone.nordicsemi.com/thread/381785?ContentTypeID=1</link><pubDate>Tue, 16 Aug 2022 12:51:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f095e059-8e84-4b01-9453-33e557e081eb</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I am not entirely sure what you want to do here, since you are basically reading back the register you just set, but yes.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading the output pin value</title><link>https://devzone.nordicsemi.com/thread/381783?ContentTypeID=1</link><pubDate>Tue, 16 Aug 2022 12:45:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b31a8727-3d87-4d57-ac0b-95fab51658a1</guid><dc:creator>nikitag</dc:creator><description>&lt;p&gt;As I understand,&amp;nbsp;&lt;span&gt;nrf_gpio_pin_out_read can be used only if&amp;nbsp;nrf_gpio_port_out_write is used. Am I right?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading the output pin value</title><link>https://devzone.nordicsemi.com/thread/381763?ContentTypeID=1</link><pubDate>Tue, 16 Aug 2022 12:05:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ab41552-1146-4946-bd5f-c5f3a81c6346</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;You can read the difference between OUT and OUTSET here:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html#register.OUT"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html#register.OUT&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For instance notice the &amp;quot;Write: a &amp;#39;1&amp;#39; sets the pin high; a &amp;#39;0&amp;#39; has no effect&amp;quot; for OUTSET.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>