<?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>How Use SPI sdk 1.6.1 zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79380/how-use-spi-sdk-1-6-1-zephyr</link><description>Hello, 
 i need a very sample code for ,open a SPI device ad send , receive a byte. 
 In particular how open the device tree spi device, 
 how write a byte 
 how read a byte. 
 Best Regards. 
 Fausto</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Sep 2021 17:10:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79380/how-use-spi-sdk-1-6-1-zephyr" /><item><title>RE: How Use SPI sdk 1.6.1 zephyr</title><link>https://devzone.nordicsemi.com/thread/328459?ContentTypeID=1</link><pubDate>Tue, 07 Sep 2021 17:10:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:193acc56-865a-489a-8270-7589ca22ef70</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;There are many ways this can be done:&lt;/p&gt;
&lt;p&gt;1. Use the zephyr spi driver, then see this example for reference (made for the nRF5340, but should be portable for the nRF52-series):&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/67065/how-to-configure-and-setup-an-spi-device-to-nrf5340/275002#275002"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/67065/how-to-configure-and-setup-an-spi-device-to-nrf5340/275002#275002&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are using nRF52-series it should be a bit simpler than nRF53 in terms of configuration, since you don&amp;#39;t have to consider that there are two cores like on the nRF5340 (network and app core, e.g. remove CONFIG_BOARD_ENABLE_CPUNET from prj.conf).&lt;/p&gt;
&lt;p&gt;2. Use the nrfx spi driver directly, then see this example for reference (made for nRF52-DK):&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/66488/using-spi-with-ppi-in-zephyr/272139#272139"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/66488/using-spi-with-ppi-in-zephyr/272139#272139&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3. Setup spi from scratch, then see this example this example for reference (the example show i2c, so you need to change to spi):&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/peripherals/posts/twi-ic2-implementation-with-nrfx-twis-driver"&gt;https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/peripherals/posts/twi-ic2-implementation-with-nrfx-twis-driver&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>