<?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>Pinctrl and PWM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86867/pinctrl-and-pwm</link><description>Does anyone have an example of using pinctrl and pwm on a Nordic device using Zephyr for a motor driver or something like that? 
 All the examples appear to NOT use the pinctrl, even though there are messages all over that not using pinctrl is deprecated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Apr 2022 12:38:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86867/pinctrl-and-pwm" /><item><title>RE: Pinctrl and PWM</title><link>https://devzone.nordicsemi.com/thread/363195?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2022 12:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12189a2b-1a6c-4f46-9d4b-5a3c229ab62e</guid><dc:creator>spekary</dc:creator><description>&lt;p&gt;Oh, and looking at that example you mentioned, which is actually just a pwm test, I see this comment:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;/*&lt;/span&gt;&lt;span&gt;&amp;nbsp;Default port should be adapted per board to fit the channel&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;* associated to the PWM pin. For intsance, for following device,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;* &amp;nbsp; &amp;nbsp; &amp;nbsp;pwm1: pwm {&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;status = &amp;quot;okay&amp;quot;;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pinctrl-0 = &amp;lt;&amp;amp;tim1_ch3_pe13&amp;gt;;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;* &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;* the following should be used:&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;* #define DEFAULT_PWM_PORT 3&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;There are a ton of ifdefs here too. In other words, even the test file is not using pinctrl to define the pwm pin, but rather testing for a specific #define and then manually setting the pin.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Again I ask, what is the point of pinctrl if you have to redefine the exact same pin elsewhere. It actually makes things worse because now you MUST define the same pin in two different places and keep them synchronized if something changes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pinctrl and PWM</title><link>https://devzone.nordicsemi.com/thread/363188?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2022 12:30:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb1d955b-de0a-48ec-af50-dbbb13455b4a</guid><dc:creator>spekary</dc:creator><description>&lt;p&gt;In zephyr/dts/bindings/pwm/nordic,nrf-pwm.yaml:&lt;/p&gt;
&lt;p&gt;ch0-pin:&lt;br /&gt; type: int&lt;br /&gt; required: false&lt;br /&gt; description: |&lt;br /&gt; IMPORTANT: This option will only be used if the new pin control driver&lt;br /&gt; is not enabled. It will be deprecated in the future.&lt;/p&gt;
&lt;p&gt;Note that this phrase:&lt;/p&gt;
&lt;p&gt;IMPORTANT: This option will only be used if the new pin control driver&lt;br /&gt;is not enabled. It will be deprecated in the future.&lt;/p&gt;
&lt;p&gt;Is in lots of other nordic yaml files. I assume the word IMPORTANT means its important NOW.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, when I try to define things without pinctrl, I get a warning that pinctrl is on so I MUST use it. I did not turn pinctrl on in my config file. It appears that the file&amp;nbsp;nrf52840dk_nrf52840_defconfig has&amp;nbsp;CONFIG_PINCTRL=y. So Nordic is essentially forcing us to use pinctrl at this point.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pinctrl and PWM</title><link>https://devzone.nordicsemi.com/thread/363170?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2022 11:35:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c11d39fa-aa98-4b83-b6e9-b3ffc90c7b2b</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;Where is it stated that not using pinctrl is deprecated? Maybe you could try to use&amp;nbsp;&lt;span&gt;DEVICE_DT_GET&lt;/span&gt;&lt;span&gt;(PWM_DEV_NODE) as in &lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/4b9b30c99da7d7264ee69187681962dea7477e6a/tests/drivers/pwm/pwm_api/src/test_pwm.c"&gt;this &lt;/a&gt;example?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>