<?xml-stylesheet type="text/xsl" href="https://community.element14.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/"><channel><title>Handle Raspberry Pico PIO &amp;quot;relative interrupts&amp;quot; in C</title><link>/products/raspberry-pi/b/blog/posts/handle-raspberry-pico-pio-interrupts-in-c</link><description>There are decent examples available on how to handle PIO interrupts in C. But not so much on dealing with relative IRQs.
With a normal IRQ, PIO fires an interrupt with a fixed number. The number that you give it. A relative IRQ - ...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Handle Raspberry Pico PIO &amp;quot;relative interrupts&amp;quot; in C</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/handle-raspberry-pico-pio-interrupts-in-c</link><pubDate>Tue, 15 Apr 2025 19:21:43 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:355e4add-2319-4440-8bfd-348ee862c775</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice post Jan.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=28831&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Handle Raspberry Pico PIO &amp;quot;relative interrupts&amp;quot; in C</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/handle-raspberry-pico-pio-interrupts-in-c</link><pubDate>Tue, 15 Apr 2025 18:45:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:355e4add-2319-4440-8bfd-348ee862c775</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;For the C++ inclined crowd:&amp;nbsp;&amp;nbsp;[mention:301aa380c4e84007a488aadeebc7fbd4:f7d226abd59f475c9d224a79e3f0ec07:label=Handle%20Raspberry%20Pico%20PIO%20%26quot%3Brelative%20interrupts%26quot%3B%20in%20C%2B%2B]&amp;nbsp;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=28831&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Handle Raspberry Pico PIO &amp;quot;relative interrupts&amp;quot; in C</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/handle-raspberry-pico-pio-interrupts-in-c</link><pubDate>Mon, 14 Apr 2025 12:02:19 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:355e4add-2319-4440-8bfd-348ee862c775</guid><dc:creator>BigG</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Wow! I would never have figured this out from the SDK documentation. Thanks for sharing. This has really helped me.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=28831&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Handle Raspberry Pico PIO &amp;quot;relative interrupts&amp;quot; in C</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/handle-raspberry-pico-pio-interrupts-in-c</link><pubDate>Sun, 13 Apr 2025 19:43:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:355e4add-2319-4440-8bfd-348ee862c775</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If you use this on a Pico 2, you&lt;span&gt;&amp;nbsp;&lt;/span&gt;should be able to&lt;span&gt;&amp;nbsp;&lt;/span&gt;choose PIO interrupts 4 .. 7 too.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have one, so it&amp;#39;s untested. I tried to imagine what the impact is on the code base, and adapted it.&lt;/p&gt;
&lt;p&gt;available on GitHub, but I didn&amp;#39;t adapt the blog. Impacted code:&lt;/p&gt;
&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:1f8a575a-b483-4cf4-b602-fea4939f0b71:type=c_cpp&amp;text=inline%20uint%20relative_interrupt%28const%20uint32_t%20ir%2C%20const%20uint%20sm%29%20%7B%0D%0A%20%20%20%20%2F%2F%20TODO%20validate%20for%20Pico%202%20interrupts%204%20..%207%0D%0A%20%20%20%20uint32_t%20retval%20%3D%20ir%20%26%200x03%3B%20%2F%2F%20last%202%20bits%0D%0A%20%20%20%20retval%20%2B%3D%20sm%3B%20%2F%2F%20add%20relative%20value%20%28is%20sm%29%0D%0A%20%20%20%20retval%20%3D%20retval%20%25%204%3B%20%2F%2F%20mod%204%0D%0A%20%20%20%20%2F%2F%20TODO%20most%20likely%20I%20have%20to%20restore%20bits%2031..2%20here%20to%20work%20with%20Pico%202%0D%0A%20%20%20%20%2F%2F%20but%20I%20don%27t%20have%20one%20to%20test%20it%0D%0A%20%20%20%20retval%20%7C%3D%20ir%20%26%200xfffffffc%3B%0D%0A%20%20%20%20return%20retval%3B%0D%0A%7D]&lt;/p&gt;
&lt;img src="https://community.element14.com/aggbug?PostID=28831&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>