<?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>Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38802/including-libraries-for-adc-usage</link><description>Hello, I am trying to develop an application using the ADC of the nrf52832. For this, I have included the &amp;quot;nrfx_adc.h&amp;quot; library into my main code. When I try compiling the project though, I get loads of errors saying that basically every variable in the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Oct 2018 13:48:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38802/including-libraries-for-adc-usage" /><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/152711?ContentTypeID=1</link><pubDate>Fri, 12 Oct 2018 13:48:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58eb5a7e-a02d-47fa-88f6-ec2c71e7a0b2</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;You must provide a event handler for &lt;em&gt;nrfx_clock_init(..)&lt;/em&gt;, as mentioned in the comment for the function in nrfx_clock.h:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;Event handler provided by the user, Must not be NULL.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If you choose to use the old functions along with the glue layer (&lt;em&gt;nrf_drv_clock.c/h&lt;/em&gt;), this&amp;nbsp;will be fixed for you &amp;quot;behind the scenes&amp;quot;.&amp;nbsp;&lt;span style="font-family:inherit;"&gt;However if you choose to use the nrfx functions, you should look inside nrf_drv_clock.c of how to&amp;nbsp;use&amp;nbsp;&lt;em&gt;nrfx_clock_init(..)&lt;/em&gt;.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/152418?ContentTypeID=1</link><pubDate>Wed, 10 Oct 2018 20:03:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62a2b375-309c-49a8-9c6f-32cc8eb68c6c</guid><dc:creator>EntroP</dc:creator><description>&lt;p&gt;Well, I used the &amp;quot;serial&amp;quot; example as the base for my project and added the libraries and code from the &amp;quot;SAADC&amp;quot; example. Since the serial example works with some legacy libraries, I decided to replace those with the new ones, which worked fine, except in this one case where the &amp;quot;nrfx_clock_init&amp;quot; method needs to be given an event handler while the old &amp;quot;nrf_drv_clock_init&amp;quot; doesn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;So I&amp;#39;m wondering how to go about this event handler, since the serial code doesn&amp;#39;t work anymore now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/152059?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 12:46:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d655e644-0d1f-4e02-9741-775e271462f4</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;That is true, the nrx drivers are used in the newer SDK&amp;#39;s, but you can still use the old functions, if you add the legacy layer for the driver.&lt;/p&gt;
&lt;p&gt;Do you need the clock driver for the ADC? The&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fnrf_dev_saadc_example.html&amp;amp;cp=4_0_0_4_5_33"&gt;SAADC Example&lt;/a&gt;&amp;nbsp;uses the timer driver (which&amp;nbsp;&lt;span&gt;runs on the high-frequency clock&lt;/span&gt;) along with PPI to trigger a sample task.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/151721?ContentTypeID=1</link><pubDate>Thu, 04 Oct 2018 17:52:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d3acbbe-a47a-469e-b8cc-ace4826d14f9</guid><dc:creator>EntroP</dc:creator><description>&lt;p&gt;Yep, I didn&amp;#39;t realize that the &amp;quot;nrf_drv_xxxxx&amp;quot; drivers are the outdated ones at first. Simply replacing them all with the equivalent &amp;quot;nrfx_xxxxx&amp;quot; drivers resolved my issue.&lt;/p&gt;
&lt;p&gt;I have one question regarding the &amp;quot;nrfx_clock&amp;quot; driver though: Do I have to define a proper event handler for the parameter, or can I simply give it an empty one (not NULL obviously, but one that doesn&amp;#39;t do anything)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/151422?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 12:12:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1f9ecd8-0733-4aee-b189-e0cbe1d5169f</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Have you been able to work this out?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/150561?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 21:47:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e9d83b9-5cc0-4cce-b33c-2a572a9780c4</guid><dc:creator>EntroP</dc:creator><description>&lt;p&gt;Thank you, I already guessed that this would be the way to go. However, when trying to include the &amp;quot;nrf_drv_saadc.h&amp;quot; file, I get the following errors:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1537998365476v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;But when I include &amp;quot;nrfx_saadc.h&amp;quot; directly, the errors disappear! What&amp;#39;s up with that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/150411?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 08:31:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14fff0c5-d5a3-499d-9174-53a7643ace02</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;The difference between the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fhardware_driver_saadc.html"&gt;SAADC driver&lt;/a&gt;&amp;nbsp;and the ADC driver, is that the former is intended to use for the nRF52 series while the latter originates from the nRF51 series. Also, as mentioned&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33419/does-nrf51822-supports-saadc"&gt;here&lt;/a&gt;, SAADC has direct memory access and can move its samples into RAM without using the CPU.&amp;nbsp;The reason&amp;nbsp;&lt;span&gt;nrf_adc.h is still included in SDK 15 is for backwards compatibility.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I would recommend you to&amp;nbsp;implement ADC using the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fhardware_driver_saadc.html"&gt;SAADC driver&lt;/a&gt;.&amp;nbsp;Using the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fnrf_dev_saadc_example.html"&gt;SAADC Example&lt;/a&gt;&amp;nbsp;as a reference might help you with&amp;nbsp;that.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please ask if you encounter any problems while doing this.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards, Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/150347?ContentTypeID=1</link><pubDate>Tue, 25 Sep 2018 23:28:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f590bf68-8ce2-425c-b70d-5a8aac564967</guid><dc:creator>EntroP</dc:creator><description>&lt;p&gt;Yes. I tried both versions, as you can see here:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1537918034748v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I had to manually include those lines into the sdk_config though, is that normal? When I checked the other example, it already had those options, but set to 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/150344?ContentTypeID=1</link><pubDate>Tue, 25 Sep 2018 22:50:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3f7b4e6-6083-4541-9599-7601df57271a</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;But have you set the appropriate options in the &lt;strong&gt;sdk_config.h&lt;/strong&gt; file?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/150339?ContentTypeID=1</link><pubDate>Tue, 25 Sep 2018 20:27:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:448325b2-73fb-4f6b-a879-c07c951ce2a7</guid><dc:creator>EntroP</dc:creator><description>&lt;p&gt;I am pretty sure I did include the header files correctly, since I don&amp;#39;t get the &amp;quot;No such file or directory&amp;quot; error. In fact, I just tested doing it manually and it doesn&amp;#39;t resolve the issue. Same for the other advice.&lt;br /&gt;&lt;br /&gt;The error doesn&amp;#39;t occur when the file is included, but afterwards. I added a screenshot to make this more clear.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1537907068907v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I check out the saadc example, those definitions (like &amp;quot;SAADC_INTENSET_END_Msk&amp;quot;) for example are in the nrf52_bitfields.h, while &amp;quot;ADC_INTENSET_END_Msk&amp;quot; and the other definitions used in nrf_adc.h are not. Where can I find those?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/150098?ContentTypeID=1</link><pubDate>Mon, 24 Sep 2018 15:13:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5113e0d7-5180-494f-acbd-1fbfb9a662ea</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Have you included the header files correctly? See&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37534/why-can-not-compile-the-h-from-the-nrf5_sdk_15-0-0_a53641a-to-the-nrf5_sdk_for_mesh_v2-1-1_src-s-light_switch--server-project"&gt;this&lt;/a&gt;&amp;nbsp;link. Also remember to include the .c files, and enable the features needed for ADC in the sdk_config file, as specified in the answer below. However, when enabling the features in the sdk_config.h file, there are two different kind of definitions: The old kind (SAADC_ENABLED) and the new NRFX kind (NRFX_SAADC_ENABLED). Look at&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38149/iar-error-pe020-identifier-nrfx_timer1_inst_idx-is-undefined"&gt;this&lt;/a&gt;&amp;nbsp;link for a guide on how to do it correctly.&lt;/p&gt;
&lt;p&gt;Best regards, Simon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/150095?ContentTypeID=1</link><pubDate>Mon, 24 Sep 2018 15:13:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b52f4db-a930-49ed-83be-738a37ffd146</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Have you included the header files correctly? See&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37534/why-can-not-compile-the-h-from-the-nrf5_sdk_15-0-0_a53641a-to-the-nrf5_sdk_for_mesh_v2-1-1_src-s-light_switch--server-project"&gt;this&lt;/a&gt;&amp;nbsp;link. Also remember to include the .c files, and enable the features needed for ADC in the sdk_config file, as specified in the answer above. However, when enabling the features in the sdk_config.h file, there are two different kind of definitions: The old kind (SAADC_ENABLED) and the new NRFX kind (NRFX_SAADC_ENABLED). Look at&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38149/iar-error-pe020-identifier-nrfx_timer1_inst_idx-is-undefined"&gt;this&lt;/a&gt;&amp;nbsp;link for a guide on how to do it correctly.&lt;/p&gt;
&lt;p&gt;Best regards, Simon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Including libraries for ADC usage</title><link>https://devzone.nordicsemi.com/thread/149956?ContentTypeID=1</link><pubDate>Mon, 24 Sep 2018 08:30:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2db49f96-7372-4b7d-a91f-5473fc728c13</guid><dc:creator>awneil</dc:creator><description>[quote userid="74123" url="~/f/nordic-q-a/38802/including-libraries-for-adc-usage"] I have included the &amp;quot;nrfx_adc.h&amp;quot; library[/quote]
&lt;p&gt;Note that&amp;#39;s just a header file - not a library!&lt;/p&gt;
&lt;p&gt;You will also need the &lt;strong&gt;.c&lt;/strong&gt; files.&lt;/p&gt;
&lt;p&gt;The above is standard &amp;#39;C&amp;#39; stuff - nothing specifically to do with Nordic.&lt;/p&gt;
&lt;p&gt;In addition, the Nordic SDK requires you to enable the features in the &lt;strong&gt;sdk_config.h&lt;/strong&gt; file ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>