<?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>Questions about SPI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117063/questions-about-spi</link><description>Hello. nrf5340, in SDK v2.8.0 I&amp;#39;m going to use 3 cs pins for spi communication. Is there an example to refer to?? 
 
 And did the setting below go well?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 09 Dec 2024 11:40:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117063/questions-about-spi" /><item><title>RE: Questions about SPI</title><link>https://devzone.nordicsemi.com/thread/513997?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 11:40:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e76a5655-9c93-4c0e-ba3a-63b9386b39fb</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Please zip your application folder and upload it here. There are still files that will affect how your application is being built that are not uploaded yet. If you zip the entire application, I know that the files are all from the same point in time.&amp;nbsp;&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: Questions about SPI</title><link>https://devzone.nordicsemi.com/thread/513878?ContentTypeID=1</link><pubDate>Fri, 06 Dec 2024 15:33:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54a47d23-4c4f-4f7f-98a4-69c6879be1e7</guid><dc:creator>ozoz05</dc:creator><description>&lt;p&gt;&lt;span&gt;as attached above&lt;/span&gt;&lt;br /&gt;&lt;span&gt;I&amp;#39;m doing it like this,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;When building, an error occurs.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;/////////////////////////////////////////////SPI START/////////////////////////////////////////////
// #define SPI_DEV DT_LABEL(DT_NODELABEL(spi1))

#define CS1_PIN DT_GPIO_PIN_BY_IDX(DT_NODELABEL(spi0), cs_gpios, 0)
#define CS2_PIN DT_GPIO_PIN_BY_IDX(DT_NODELABEL(spi0), cs_gpios, 1)
#define CS3_PIN DT_GPIO_PIN_BY_IDX(DT_NODELABEL(spi0), cs_gpios, 2)

static struct spi_config spi_cfg = {
    .frequency = 1000000,  // SPI clock frequency (1 MHz)
    .operation = SPI_OP_MODE_MASTER | SPI_TRANSFER_MSB | SPI_WORD_SET(8),
    .slave = 0,            // SPI device 0 (chip-select 1)
    .cs = NULL             // CS pin will be managed manually
};

// static const struct device *spi_dev;
// static const struct device *cs_gpio_1;
// static const struct device *cs_gpio_2;
// static const struct device *cs_gpio_3;

static struct gpio_dt_spec cs_gpio_1 = GPIO_DT_SPEC_GET(DT_NODELABEL(spi0), CS1_PIN);
// static struct gpio_dt_spec cs_gpio_2 = GPIO_DT_SPEC_GET(DT_NODELABEL(spi0), CS2_PIN);
// static struct gpio_dt_spec cs_gpio_3 = GPIO_DT_SPEC_GET(DT_NODELABEL(spi0), CS3_PIN);

void spi_init(void)
{
}
/////////////////////////////////////////////SPI END/////////////////////////////////////////////&lt;/pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&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/pastedimage1733499139690v1.png" alt=" " /&gt;&lt;span&gt;&lt;/span&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/pastedimage1733499174834v2.png" alt=" " /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions about SPI</title><link>https://devzone.nordicsemi.com/thread/513869?ContentTypeID=1</link><pubDate>Fri, 06 Dec 2024 14:54:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84317bec-1393-4c55-ae91-fb0eba735967</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;That looks fine to me. Does it work? How do you differentiate between the three devices in your application? Are either of them working?&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>