<?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>How can i get the state of radio?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8221/how-can-i-get-the-state-of-radio</link><description>Hi,
I am using nrf51822 with s110 softdevice version 8.0. 
 Is there any way i can know the state of my radio at some point in the code execution?
In short I want to access NRF_RADIO-&amp;gt;STATE register using softdevice. Are there any softdevice calls</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Jul 2015 09:39:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8221/how-can-i-get-the-state-of-radio" /><item><title>RE: How can i get the state of radio?</title><link>https://devzone.nordicsemi.com/thread/29593?ContentTypeID=1</link><pubDate>Mon, 20 Jul 2015 09:39:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c079e70-09b0-4f89-97df-ed020f845e5a</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;As described in section 11.3 of the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.pdf.sds/S110_SDS_v2.0.pdf"&gt;SoftDevice specification&lt;/a&gt; access to the RADIO is blocked when the SoftDevice is active.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can i get the state of radio?</title><link>https://devzone.nordicsemi.com/thread/29592?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2015 14:57:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2058a80-48c4-4742-99ca-775b7646a824</guid><dc:creator>chirag</dc:creator><description>&lt;p&gt;Thanks Øyvind for the answer but will i be able to access NRF_RADIO register when softdevice is enabled. What i know from the experience is if i try to access this register it gives a hardfault.
Please help me with this now..&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can i get the state of radio?</title><link>https://devzone.nordicsemi.com/thread/29591?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2015 11:45:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d87f54a-eebc-46e8-a7ba-f7f38363daa8</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;While it should be possible to read the info out of the register, I think it is a better idea to set up the programmable peripheral interface(PPI) to listen to the radio events and then do something based on that.&lt;/p&gt;
&lt;p&gt;As an example the following code toggles pin 24 on the event NRF_RADIO-&amp;gt;EVENTS_READY&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void blinkyradio_ppi_init(void)
{
    uint32_t err_code = NRF_SUCCESS;
    
    if(!nrf_drv_gpiote_is_init())
    {
        err_code = nrf_drv_gpiote_init();
        APP_ERROR_CHECK(err_code);
    }
    
    NRF_GPIO-&amp;gt;DIRSET = 0xFFFF0000UL;
    NRF_GPIO-&amp;gt;OUTSET = 0xFFFF0000UL;
    NRF_GPIO-&amp;gt;OUTCLR = 0xFFFF0000UL;
    
    //Configure GPIO on pin 24
    NRF_GPIOTE-&amp;gt;CONFIG[0] = (GPIOTE_CONFIG_POLARITY_Toggle &amp;lt;&amp;lt; GPIOTE_CONFIG_POLARITY_Pos)
                            |((24) &amp;lt;&amp;lt; GPIOTE_CONFIG_PSEL_Pos)
                            | (GPIOTE_CONFIG_MODE_Task &amp;lt;&amp;lt; GPIOTE_CONFIG_MODE_Pos);
    
    
    NRF_PPI-&amp;gt;CH[12].EEP = (uint32_t)(&amp;amp;NRF_RADIO-&amp;gt;EVENTS_READY);
    NRF_PPI-&amp;gt;CH[12].TEP = (uint32_t)(&amp;amp;NRF_GPIOTE-&amp;gt;TASKS_OUT[0]);    //Toggle pin 24
    
    NRF_PPI-&amp;gt;CHENSET |= (1 &amp;lt;&amp;lt; 12);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Does this answer your question?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>