<?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>Need help configuring nrfx qdec irq in Zephyr project</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114248/need-help-configuring-nrfx-qdec-irq-in-zephyr-project</link><description>Hello, 
 Currently I am implementing the nrfx qdec driver in our Zephyr project using the nRF52840 DK. We choose the nrfx driver as this provides events. I am using the nRF Connect vs code extension, toolchain v2.7.0 and Zephyr 3.5.0. 
 The setup and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Sep 2024 12:11:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114248/need-help-configuring-nrfx-qdec-irq-in-zephyr-project" /><item><title>RE: Need help configuring nrfx qdec irq in Zephyr project</title><link>https://devzone.nordicsemi.com/thread/500763?ContentTypeID=1</link><pubDate>Mon, 02 Sep 2024 12:11:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b13921f-f2a3-49ef-aa4b-f91115862c14</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;I see that Zephyr has a &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/samples/sensor/qdec/README.html"&gt;QDEC sample&lt;/a&gt;. Could you try this with your setup?&lt;br /&gt;It should be kinda quick to try I think, and if it works it would be good to have it as a base-line.&lt;/p&gt;
&lt;p&gt;Maybe you are even happy to use the Zephyr drivers for this instead of using nrfx directly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help configuring nrfx qdec irq in Zephyr project</title><link>https://devzone.nordicsemi.com/thread/500111?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2024 06:52:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b2aa5b5-a263-4b97-97d3-7451069ee9ff</guid><dc:creator>RonaldInv</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;I&amp;#39;am using the nRF52840-DK with a quadrature rotary knob with signals connected to P1.10 and P1.11. The sample which I refer to is not more than a code snippet found in&amp;nbsp;&lt;span&gt;nrfx_qdec.h how to connect the IRQ. This is the part which is not working for me and need help configuring. Below is the code I use in the project to init the QDEC driver.&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/devicetree.h&amp;gt;
#include &amp;lt;zephyr/irq.h&amp;gt;
#include &amp;lt;nrfx.h&amp;gt;
#include &amp;lt;nrfx_qdec.h&amp;gt;

nrfx_qdec_t g_qdec_dev = NRFX_QDEC_INSTANCE(0);
volatile uint8_t g_test = 0;

void qdec_event_handler(nrfx_qdec_event_t event, void *p_context)
{
	test++;
}

void qdec_init()
{
	// IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_QDEC_INST_GET(0)), IRQ_PRIO_LOWEST,
	// NRFX_QDEC_INST_HANDLER_GET(0), 0);

	nrfx_qdec_config_t config = NRFX_QDEC_DEFAULT_CONFIG(42, 43, NRF_QDEC_PIN_NOT_CONNECTED);

	config.sample_inten = true;
	config.reportper_inten = true;

	nrfx_err_t err = nrfx_qdec_init(&amp;amp;g_qdec_dev, &amp;amp;config, qdec_event_handler, NULL);
	nrfx_qdec_enable(&amp;amp;g_qdec_dev);
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;&lt;span&gt;Ronald&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help configuring nrfx qdec irq in Zephyr project</title><link>https://devzone.nordicsemi.com/thread/500027?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 14:29:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d974e20d-bad2-4cdc-907a-85f480f12e4c</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]The example[/quote]
&lt;p&gt;Which example?&lt;/p&gt;
&lt;p&gt;Are you using a DK for this?&lt;br /&gt;Are you using an external sensor for this?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>