<?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>Events vs. interrupts?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66204/events-vs-interrupts</link><description>In Nordic parlance, what is event and what is interrupt? To my understanding, in ARM parlance, events are signals that can be routed to NVIC to cause interrupts. 
 Basically, SW can&amp;#39;t see events if they are not causing interrupts (except by using WFE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 25 Sep 2020 13:33:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66204/events-vs-interrupts" /><item><title>RE: Events vs. interrupts?</title><link>https://devzone.nordicsemi.com/thread/271554?ContentTypeID=1</link><pubDate>Fri, 25 Sep 2020 13:33:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c84798a-ae1b-492c-98cd-323f3038426d</guid><dc:creator>turboscrew</dc:creator><description>&lt;p&gt;Actually the first part of your answer was what I was looking for.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Events vs. interrupts?</title><link>https://devzone.nordicsemi.com/thread/271340?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 12:35:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:943d48c6-06fa-4768-b7cf-10b2fb6a457b</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes,&amp;nbsp;&lt;span&gt;are all interrupts checked in the interrupt context, and the requested ones are put forward as events. For&amp;nbsp;&lt;/span&gt;the peripheral drivers in the SDK, the handlers are mostly called from the IRQ_handler of the hardware peripheral and will run in the interrupt context.&amp;nbsp;&lt;span&gt;The handlers will be called when there are relevant events to be passed to the application. This is very specific to each peripheral/driver. I would recommend that you check out the event type in the struct that is passed to the handler in most drivers. This will provide details on the relevant events you can expect.&lt;/span&gt;&lt;/p&gt;
[quote user="turboscrew"]when do I need interrupts for events in SW? And why only some interrupts are offered?[/quote]
&lt;p&gt;&amp;nbsp;Do you mean &lt;a title="Software Development Kit" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/hardware_driver_swi.html?resultof=%22%73%6f%66%74%77%61%72%65%22%20%22%73%6f%66%74%77%61%72%22%20%22%69%6e%74%65%72%72%75%70%74%73%22%20%22%69%6e%74%65%72%72%75%70%74%22%20"&gt;software interrupts (SWI)&lt;/a&gt;?&amp;nbsp;You can refer to&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/57022/software-interrupt-handler-nrf52832/231105#231105"&gt;this post&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;to see how you can use the EGU as a form of a software interrupt source. This is not really software interrupt (SWI) though, since the EGU is an actual HW peripheral, and it excelled when you want to trigger interrupts via PPI.&amp;nbsp;If you want to use normal SWI in a user-friendly way, then you could look at the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/hardware_driver_swi.html"&gt;SWI driver&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Events vs. interrupts?</title><link>https://devzone.nordicsemi.com/thread/271157?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2020 15:27:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9689ae04-7854-4f94-933a-28d83af685eb</guid><dc:creator>turboscrew</dc:creator><description>&lt;p&gt;I mean, are all interrupts checked in the (I think) bootloader, and the requested ones are put forward as events? I&amp;#39;m not talking about SW handling of them, but processor cycles. Note that there are HW events (as described in the Peripheral Interface) and there are SW events, that the event handlers handle. Not the same thing - not even(t) close.&lt;/p&gt;
&lt;p&gt;And when do I need interrupts for events in SW? And why only some interrupts are offered?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Events vs. interrupts?</title><link>https://devzone.nordicsemi.com/thread/270976?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2020 06:34:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e513bbe2-8f6f-4426-bca6-156a1dafbb0a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
[quote user=""]In Nordic parlance, what is event and what is interrupt?[/quote]
&lt;p&gt;&lt;span&gt;I would suggest you take a look at the&amp;nbsp;&lt;/span&gt;&lt;a title="nRF52 Series" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/peripheral_interface.html?resultof=%22%70%65%72%69%70%68%65%72%61%6c%5f%69%6e%74%65%72%66%61%63%65%22%20"&gt;Peripheral interface&lt;/a&gt;&amp;nbsp;documentation for&amp;nbsp;&lt;span&gt;event and interrupt.&lt;/span&gt;&lt;/p&gt;
[quote user=""]I was wondering about event handlers, and especially that you don&amp;#39;t configure which events are generated. Are all events handled as interrupts in the abyss of the SDK? [/quote]
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;The event handlers run in&amp;nbsp;interrupt context, but you can run the event handlers in main&amp;#39;s context by using the&amp;nbsp;&lt;a title="Schedule handling library" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_scheduler.html?cp=5_1_3_38"&gt;Schedule handling library&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With the app_scheduler you call&amp;nbsp;&lt;a title="Function for scheduling an event." href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__app__scheduler.html#ga65ba3e30627bb62882d15cde87b610f0"&gt;app_sched_event_put()&lt;/a&gt;&amp;nbsp;from an event handler, and then the scheduler will execute the given event handler from main&amp;#39;s context after you&amp;#39;ve returned from the interrupt context.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote user=""]when do you need calls, like nrfx_timer_compare_int_enable()?[/quote]
&lt;p&gt;&amp;nbsp;When you need the interrupt for the event in the driver. Like&amp;nbsp;&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__nrfx__timer.html#gacc01062de756f2491f835d31bccc4936"&gt;nrfx_timer_compare_int_enable&lt;/a&gt;&amp;nbsp;is&amp;nbsp;Function for enabling timer compare interrupt for the&amp;nbsp;compare event.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>