<?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>NCS v2.6.0: Instructions to use GPIOTE and Zephyr GPIO API</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110123/ncs-v2-6-0-instructions-to-use-gpiote-and-zephyr-gpio-api</link><description>Hello All, 
 
 This is an instructional post that answers the following question with explanations and code samples: &amp;quot;How do I use GPIOTE while also using Zephyr to control the GPIOs?&amp;quot; 
 I am making this post because there is a LOT of confusion on Devzone</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Apr 2024 19:42:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110123/ncs-v2-6-0-instructions-to-use-gpiote-and-zephyr-gpio-api" /><item><title>RE: NCS v2.6.0: Instructions to use GPIOTE and Zephyr GPIO API</title><link>https://devzone.nordicsemi.com/thread/478401?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2024 19:42:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81ceebf3-bc9f-48bd-ab97-500c114c26df</guid><dc:creator>Nathan45</dc:creator><description>&lt;p&gt;Just wanted to add a few details that I left out:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:150%;"&gt;Device Tree Overlay Fragment&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;You should add the following fragment to you device tree. This is because there are TWO different GPIO interrupt mechanisms (at least on the nRF52840!). One is through the PORT event and one is through the IN event. The IN event is what we need and actually requires a different hardware &amp;quot;path&amp;quot;. But don&amp;#39;t worry! it&amp;#39;s not difficult! Just add the below to your overlay and change the following to your needs:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;gpio0: gpio@50000000&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;OR&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;gpio1: gpio@50000300&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;(find the gpio bank in your device tree and use that)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;and also change the sense-edge-mask value to select the correct pins! I think you need to mask the bit position of the pin as 0.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;soc 
    {
        gpio0: gpio@50000000 {                                          
            sense-edge-mask = &amp;lt; 0xffff3fff &amp;gt;; Use a bit mask for the needed pins!!                       
        };
    }; &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As an aside, I&amp;#39;m not sure if the project I linked to that I made includes this (I deleted my device tree except for the minimum right before commiting).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:150%;"&gt;Prj.conf&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;a id="" href="https://github.com/nrfconnect/sdk-zephyr/commit/a86ac1f8c2a48e32ed824f0f5ea49d45ceaa345f"&gt;https://github.com/nrfconnect/sdk-zephyr/commit/a86ac1f8c2a48e32ed824f0f5ea49d45ceaa345f&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;It seems to indicate that the config&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;CONFIG_GPIO_NRFX=y&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;is necessary, but I&amp;#39;m not sure. You may want to try this in lieu of or in addition to&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;CONFIG_GPIO=y&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS v2.6.0: Instructions to use GPIOTE and Zephyr GPIO API</title><link>https://devzone.nordicsemi.com/thread/478210?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2024 07:55:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d51a40ef-cb0e-449b-8067-f7868fd94162</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi Nathan,&lt;/p&gt;
&lt;p&gt;Truly impressive!&lt;br /&gt;Thanks a ton for the excellent explanation of both the problem and the solution!&lt;/p&gt;
&lt;p&gt;In technical support, we use a list of &amp;quot;frequently asked samples&amp;quot; as a lookup table to help our users faster, and this post goes straight into that list.&lt;/p&gt;
&lt;p&gt;Again thanks,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>