<?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>Set Device Pointer to NULL</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106101/set-device-pointer-to-null</link><description>In my application I would like to inhibit the CS control. How can this be achieved? Is this done at Device Tree level? Can it be done in the code, in the lines of:</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Nov 2023 13:47:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106101/set-device-pointer-to-null" /><item><title>RE: Set Device Pointer to NULL</title><link>https://devzone.nordicsemi.com/thread/458315?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 13:47:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b87276d-9462-48a0-988e-217297cc1c2a</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Yes, in NCS 2.5.0 (tagged with zephyr 3.4.0), the &lt;strong&gt;cs&lt;/strong&gt; is a member of type &lt;strong&gt;cpi_cs_control&lt;/strong&gt; within &lt;strong&gt;spi_config&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1701351957061v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;but in NCS 2.4.0 (tagged with zephyr 3.3.0) the &lt;strong&gt;cs&lt;/strong&gt; is a pointer to &lt;strong&gt;spi_cs_control&lt;/strong&gt; within &lt;strong&gt;spi_config&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1701352044566v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Device Pointer to NULL</title><link>https://devzone.nordicsemi.com/thread/458240?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 09:12:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b6bf81b-3129-4d84-994a-fb58dd221787</guid><dc:creator>RadicalTomato</dc:creator><description>&lt;p&gt;Please provide the recommended way of setting this structure to NULL.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If using this:&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1701335471392v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;I am getting the following build error:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt; error: incompatible types when assigning to type &amp;#39;struct spi_cs_control&amp;#39; from type &amp;#39;void *&amp;#39;
   66 |         spi.config.cs = NULL;
      |                         ^~~~&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the SDK is v2.5.0.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Previously the same code has been based on SDK v2.4.0 and it was building fine. Looks like there is breaking change when switching from 2.4.0 to 2.5.0 for the SPI driver.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1701337311994v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Going into the driver header files, the change becomes obvious so yes, the build error makes sense, as there is no pointer in the struct anymore, but another struct.&lt;br /&gt;&lt;br /&gt;Hmmm ... looks like the changes are coming from here:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/zephyr/releases/release-notes-3.4.html"&gt;Zephyr 3.4.0 &amp;mdash; Zephyr Project documentation (nRF Connect SDK) (nordicsemi.com)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Device Pointer to NULL</title><link>https://devzone.nordicsemi.com/thread/457815?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2023 11:46:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab18b74e-7946-4508-be1e-e5166bb05018</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you for contacting DevZone at NordicSemi.&lt;/p&gt;
&lt;p&gt;The &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;spi_config&lt;/span&gt; struct contains the &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;spi_cs_control&amp;nbsp;&lt;/span&gt;struct.&lt;/p&gt;
&lt;p&gt;So essentially you can set it in the spi configuration that you will use for the spi istance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>