<?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>Device Tree Configuration Generic GPIO Inputs &amp;amp; Outputs</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102125/device-tree-configuration-generic-gpio-inputs-outputs</link><description>nRF52833-DK nRF Connect SDK v2.3.0 Zephyr v3.2.99 I am trying to figure out the best practise for defining generic GPIO input &amp;amp; output pins. To my understanding, devicetree is where all the hardware configuration resides. 
 It appears these are the goto</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Aug 2023 09:19:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102125/device-tree-configuration-generic-gpio-inputs-outputs" /><item><title>RE: Device Tree Configuration Generic GPIO Inputs &amp; Outputs</title><link>https://devzone.nordicsemi.com/thread/442242?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2023 09:19:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b284e185-0086-4b8f-9092-cca02a716d03</guid><dc:creator>CCL-KH</dc:creator><description>&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;I am using gpio_pin_configure() to set all the properties of the GPIO (e.g. &lt;span&gt;direction,&amp;nbsp;&lt;/span&gt;polarity, biasing) pragmatically during app code initialisation. I believe this means&amp;nbsp;the GPIO will behave as default configuration during the kernel pre init (etc) stages. This approach is simpler and avoids DTS for non-module (SPI, I2C etc) related GPIOs&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device Tree Configuration Generic GPIO Inputs &amp; Outputs</title><link>https://devzone.nordicsemi.com/thread/437920?ContentTypeID=1</link><pubDate>Mon, 24 Jul 2023 14:56:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17c1e403-7ab6-40e9-9fb9-a84f362b7e16</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes, the Device Tree is supposed to describe the hardware configuration of your board, such as whether the LED/button is active low or not. This allows you to use the GPIO *_dt functions in your program without worrying about the polarity for different boards. However, the code is still responsible for configuring the direction of the GPIO, but I would have to ask the developers about the reasoning behind this. The GPIO flags, which can be defined in the gpio handle, can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/434be7b575ce338645801140fbd2e64738f8994e/include/zephyr/dt-bindings/gpio/gpio.h"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/434be7b575ce338645801140fbd2e64738f8994e/include/zephyr/dt-bindings/gpio/gpio.h&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>