<?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>Software Interrupt Handler nRF52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57022/software-interrupt-handler-nrf52832</link><description>Hi, 
 Good day! 
 Statement of porblem: We are developing appliction using nrf52832. In our application we have Capacitive touch button and capacitive wheel sensor for user input and other pheripheral LED, TEMP.. interrupts are available. At the moment</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Jan 2020 13:25:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57022/software-interrupt-handler-nrf52832" /><item><title>RE: Software Interrupt Handler nRF52832</title><link>https://devzone.nordicsemi.com/thread/231663?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 13:25:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:696d1967-3ed4-4710-830d-3a4d573d15c8</guid><dc:creator>bjorn-spockeli</dc:creator><description>[quote user="AimHigh"]Do you have any specific examples available in the SDK 16 or lower?[/quote]
&lt;p&gt;&amp;nbsp;No, there is no dedicated EGU example in the SDKm but there are several threads on it here on DevZone&lt;/p&gt;
[quote user="AimHigh"]Does this EGU have got any API&amp;#39;s?[/quote]
&lt;p&gt;&amp;nbsp;No, the register interface itself is very straight forward so we have not opted for an Hardware abstraction layar on top.&amp;nbsp;&lt;/p&gt;
[quote user="AimHigh"]Is there any restriction on using EGU with softdevice?[/quote]
&lt;p&gt;&amp;nbsp;Yes, see&amp;nbsp;&lt;a title="Hardware peripherals" href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/sd_resource_reqs/hw_block_interrupt_vector.html?cp=4_5_2_0_6_0"&gt;Hardware peripherals&lt;/a&gt;&amp;nbsp;under&amp;nbsp;&lt;span&gt;&lt;a title="System on Chip resource requirements" href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/sd_resource_reqs/sd_resource_reqs.html?cp=4_5_2_0_6"&gt;System on Chip resource requirements&lt;/a&gt;&amp;nbsp;in the S132 SoftDevice specification.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="AimHigh"]Is EGU any different from SWI?[/quote]
&lt;p&gt;&amp;nbsp;No, not really. The EGU allows you to trigger a interrupt from software, i.e. a Software Interrupt.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Software Interrupt Handler nRF52832</title><link>https://devzone.nordicsemi.com/thread/231632?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 12:18:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f746214-31e5-4657-921f-33a4f9b651e7</guid><dc:creator>AimHigh</dc:creator><description>&lt;p&gt;Hi Bjorn,&lt;/p&gt;
&lt;p&gt;Thank you for that code snippet.&lt;/p&gt;
&lt;p&gt;Do you have any specific examples available in the SDK 16 or lower?&lt;/p&gt;
&lt;p&gt;Does this EGU have got any API&amp;#39;s?&lt;/p&gt;
&lt;p&gt;Is there any restriction on using EGU with softdevice?&lt;/p&gt;
&lt;p&gt;Is EGU any different from SWI?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Aim High&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Software Interrupt Handler nRF52832</title><link>https://devzone.nordicsemi.com/thread/231105?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 11:53:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:246e3890-ceef-423d-8737-f38ebd16bb88</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;HI Aim High,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;the nRF52832 has a&amp;nbsp;&lt;span class="item"&gt;&lt;a class="" title="EGU &amp;mdash; Event generator unit" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/egu.html?cp=4_2_0_45#concept_x4j_fx1_lr"&gt;EGU &amp;mdash; Event generator unit&lt;/a&gt;&amp;nbsp;( i.e. Software interrupt unit) that you can use to trigger SW interrupts, see snippet below.&lt;/span&gt;&lt;/p&gt;
&lt;div class="group"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
void SWI3_EGU3_IRQHandler(void)
{   
    // Clear SWI Event. 
    NRF_EGU3-&amp;gt;EVENTS_TRIGGERED[0] = 0;
             
    // Place code here

}

static void init_egu()
{  
    // Enable TRIGGERED0 interrupt
    NRF_EGU3-&amp;gt;INTENSET = EGU_INTENSET_TRIGGERED0_Enabled &amp;lt;&amp;lt; EGU_INTENSET_TRIGGERED0_Pos;
    
    // Set EGU3 Interrupt pririty to 6.
    NVIC_SetPriority(SWI3_EGU3_IRQn,6);
    
    //Enable SWI3_EGU3 interrupt. 
    NVIC_EnableIRQ(SWI3_EGU3_IRQn);
}


int main(void)
{
    bool erase_bonds;
    uint32_t err_code;
    
    // Initialize.
    log_init();
    timers_init();
    buttons_leds_init(&amp;amp;erase_bonds);
    ble_stack_init();
    gap_params_init();
    gatt_init();
    advertising_init();
    services_init();
    conn_params_init();
    egu_init();
    
    // Trigger event
    NRF_EGU3-&amp;gt;TASKS_TRIGGER[0] = 1;
    
    // Enter main loop.
    for (;;)
    {
        if (NRF_LOG_PROCESS() == false)
        {
            power_manage();
        }
    }
}&lt;/pre&gt;&lt;/div&gt;
&lt;div class="group"&gt;Best regards&lt;/div&gt;
&lt;div class="group"&gt;Bj&amp;oslash;rn&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>