<?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>add pin configuration in overlay file</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110388/add-pin-configuration-in-overlay-file</link><description>Hi 
 I want to set P0.01 as gpio high, how do I configure in overlay file? 
 so that it remain high whenever I used overlay file. 
 Thanks !!</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 May 2024 14:07:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110388/add-pin-configuration-in-overlay-file" /><item><title>RE: add pin configuration in overlay file</title><link>https://devzone.nordicsemi.com/thread/481830?ContentTypeID=1</link><pubDate>Fri, 03 May 2024 14:07:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:454f0c91-cf20-41aa-9b7e-1e78faad5fb7</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hi Amol,&lt;/p&gt;
&lt;p&gt;The following code would do the work. It would set pin 14 high whenever the mcu is booted. (I have tested with the pin number 14 that is connected to the led1).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/devicetree.h&amp;gt;
#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;

#define PORT    gpio0
#define PIN  	14
#define DIRFLAG 1

static const struct device * DEV = DEVICE_DT_GET(DT_NODELABEL(PORT));

int main(void)
{
	struct gpio_dt_spec pinspec = {.port=DEV, .pin=PIN, .dt_flags=DIRFLAG};
	gpio_pin_configure_dt(&amp;amp;pinspec, GPIO_OUTPUT_ACTIVE);
	gpio_pin_set_dt(&amp;amp;pinspec,1);	
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add pin configuration in overlay file</title><link>https://devzone.nordicsemi.com/thread/481248?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2024 10:04:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8593bb89-9852-4d59-9f79-df46429abae0</guid><dc:creator>Amol_Chor</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I want to set p0.21 pin high/low on every boot.&lt;br /&gt;How to configure it?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Amol&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add pin configuration in overlay file</title><link>https://devzone.nordicsemi.com/thread/480040?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2024 14:52:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4201c6f9-30b4-40e5-8240-e73da3cd93da</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;This line should be used in main code, not in the overlay.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add pin configuration in overlay file</title><link>https://devzone.nordicsemi.com/thread/479846?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2024 04:34:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22f30442-5124-40a0-a008-bc5fd5598669</guid><dc:creator>Amol_Chor</dc:creator><description>&lt;p&gt;Thanks for reply !!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I do want to change the application code,&lt;/p&gt;
&lt;p&gt;using overlay file want to modify the pin status.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;In which location/section of overlay file I have to use below line&lt;pre class="ui-code" data-mode="text"&gt;gpio_pin_configure_dt(&amp;amp;led, GPIO_OUTPUT_ACTIVE);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add pin configuration in overlay file</title><link>https://devzone.nordicsemi.com/thread/479806?ContentTypeID=1</link><pubDate>Sat, 20 Apr 2024 12:56:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef5f64b1-af92-4cfd-864d-7f28e29b90f1</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;You can configure the pins for extra flags using GPIO.H functions&lt;/p&gt;
&lt;p&gt;like:&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;gpio_pin_configure_dt(&amp;amp;led, GPIO_OUTPUT_ACTIVE);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;where the label&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;led&lt;span style="font-family:arial, helvetica, sans-serif;"&gt; is obtained from the overlay using&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>