<?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>Switching between SPIS and SPIM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90963/switching-between-spis-and-spim</link><description>How do I switch between being SPIS/SPIM with the Zephyr library? 
 I am using ncs v1.9.1. I have code that works separately as a slave or master but I need to make it dynamic. Is there any way to do this?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Aug 2022 09:23:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90963/switching-between-spis-and-spim" /><item><title>RE: Switching between SPIS and SPIM</title><link>https://devzone.nordicsemi.com/thread/381721?ContentTypeID=1</link><pubDate>Tue, 16 Aug 2022 09:23:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2832435-e13c-4754-be71-45c4e82a35ed</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;In that case, that is not possible. In Zephyr, the support to disable peripherals is in general a bit bad. The workaround is typically to use the nrfx drivers directly, instead of the zephyr drivers. That way, you can enable and disable on the fly. You can&amp;#39;t have both active at the same time, howerver, so you need to pick one at the time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switching between SPIS and SPIM</title><link>https://devzone.nordicsemi.com/thread/381612?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 14:17:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6c0fac3-bc87-4f7b-9a2c-c0de163b683f</guid><dc:creator>Tom Nowak</dc:creator><description>&lt;ul&gt;
&lt;li&gt;I would like to connect to the same device as either SPIM or SPIS. The SCLK, MISO, MOSI lines would remain the same but there would be two GPIO&amp;#39;s, one for the Nordic to control as a CS and one for the other MCU to control as a CS&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Switching between SPIS and SPIM</title><link>https://devzone.nordicsemi.com/thread/381601?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 13:29:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:258d0030-b4e9-4217-ae56-708ddf8339b7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Can you please clarify a thing for me. Are you trying to connect to two different devices? One SPI slave and one SPI master? Do you want to/need to use the same GPIOs for the SPI slave and the SPI master?&lt;/p&gt;
&lt;p&gt;The only reason that I can think of to have both SPIS and SPIM is that you are talking to two different devices, so wouldn&amp;#39;t it be easier just to set up both (on different GPIOs)?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>