<?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>Zephyr adc init in device tree versus runtime</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101561/zephyr-adc-init-in-device-tree-versus-runtime</link><description>I&amp;#39;m using the version 2.3.0 Zephyr toolchain. The chip is the nRF52832 and I&amp;#39;m setting up an ADC channel in the device tree overlay like so: 
 
 At runtime, I get the device using this call: 
 
 struct device * adc_dev = DEVICE_DT_GET ( DT_NODELABEL </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 06 Jul 2023 22:15:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101561/zephyr-adc-init-in-device-tree-versus-runtime" /><item><title>RE: Zephyr adc init in device tree versus runtime</title><link>https://devzone.nordicsemi.com/thread/435091?ContentTypeID=1</link><pubDate>Thu, 06 Jul 2023 22:15:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1a9fbf6-a107-441b-a603-fa6a3e592ebe</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Bret,&lt;/p&gt;
&lt;p&gt;Did you remember to configure the channel in code&amp;nbsp;with &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/zephyr/hardware/peripherals/adc.html#c.adc_channel_setup_dt"&gt;adc_channel_setup_dt()&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;You might already know this, but you can also refer to &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/zephyr/samples/drivers/adc/README.html"&gt;the ADC sample&lt;/a&gt;, where &lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/v3.3.99-ncs1/samples/drivers/adc"&gt;multiple channels are configured and used&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>