<?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>using nrf5340 and Zephyr OS , Is device binding and device tree the only way to use nrf5340&amp;#39;s peripheral?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75608/using-nrf5340-and-zephyr-os-is-device-binding-and-device-tree-the-only-way-to-use-nrf5340-s-peripheral</link><description>In a .c file ,code like below (build a image using nrf5340dk_cpuappns) : 
 #include &amp;quot;nrf_gpio.h&amp;quot; 
 #define SPIM2_CS NRF_GPIO_ PIN_MAP(0,15) #define SPIM2_SDO NRF_GPIO_ PIN_MAP(0,18) #define SPIM2_CLK NRF_GPIO PIN_MAP(0,12) #define SPIM2_SDI NRF_GPIO_</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 May 2021 13:22:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75608/using-nrf5340-and-zephyr-os-is-device-binding-and-device-tree-the-only-way-to-use-nrf5340-s-peripheral" /><item><title>RE: using nrf5340 and Zephyr OS , Is device binding and device tree the only way to use nrf5340's peripheral?</title><link>https://devzone.nordicsemi.com/thread/311825?ContentTypeID=1</link><pubDate>Wed, 26 May 2021 13:22:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1751203-04f0-4ed9-bb63-11e3b571a3c2</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Yes, you can do this. Using lower layers may require more work, and you don&amp;#39;t get all the advantages Zephyr comes with, but it is absolutely possible to use the functions in&amp;nbsp;&lt;span&gt;nrf_gpio.h and nrf_spim.h directly.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The &lt;a href="https://github.com/nrfconnect/sdk-hal_nordic/tree/v1.5.1/nrfx/drivers/src"&gt;nrfx layer&lt;/a&gt;&amp;nbsp;is also an option (there is not an nrfx driver for GPIO, so you have to use nrf_gpio.h, like done &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.99-ncs2/drivers/gpio/gpio_nrfx.c#L8"&gt;here&lt;/a&gt;). You can take a look at the sample &lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/v2.4.99-ncs2/samples/boards/nrf/nrfx"&gt;zephyr/samples/boards/nrf/nrfx&lt;/a&gt;&amp;nbsp;to get an intuition on how to use the nrfx layer.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>