<?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>Can I use nRF24L01+ with pic? is there any library?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/320/can-i-use-nrf24l01-with-pic-is-there-any-library</link><description>Hi there.
We are developing an IoT device (we are planning to use nRF24L01+) we would like to implement with microchip uC, the question is if there is a library available for CCS or MPIDE, or any other C compiler. If not I will writing it...
The big</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Aug 2013 12:20:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/320/can-i-use-nrf24l01-with-pic-is-there-any-library" /><item><title>RE: Can I use nRF24L01+ with pic? is there any library?</title><link>https://devzone.nordicsemi.com/thread/1663?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2013 12:20:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4534c587-9bf8-4e58-8de7-5815a7b9dccc</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;We do not have any libraries that are directly usable with PIC uC&amp;#39;s, but we have a nrf_hal library which is included in the nRFgo SDK:
..\Nordic Semiconductor\nRFgo SDK 2.3.0.10040\source_code\hal\nrf24l01p
..\Nordic Semiconductor\nRFgo SDK 2.3.0.10040\source_code\hal\nrf24le1&lt;/p&gt;
&lt;p&gt;The files you are interested in are:
hal_nrf.c
hal_nrf.h
hal_nrf_reg.h&lt;/p&gt;
&lt;p&gt;Files that needs porting:
hal_nrf_hw.c
hal_nrf_hw.h&lt;/p&gt;
&lt;p&gt;Notes on hal_nrf.c:
Functions &amp;quot;hal_nrf_read_multibyte_reg&amp;quot; and &amp;quot;hal_nrf_write_multibyte_reg&amp;quot; must be modified as they include 8051 memory type pointers.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  if (memtype == 0x00U)
  {
    const uint8_t data *buf = (const uint8_t data *)pbuf;
    NRF_WRITE_MULTIBYTE_REG_COMMON_BODY
  }
  else if (memtype == 0x01U)
  {
    const uint8_t xdata *buf = (const uint8_t xdata *)pbuf;
    NRF_WRITE_MULTIBYTE_REG_COMMON_BODY
  }
  else if (memtype == 0xFEU)
  {
    const uint8_t pdata *buf = (const uint8_t pdata *)pbuf;
    NRF_WRITE_MULTIBYTE_REG_COMMON_BODY
  }
  else
  {
    const uint8_t *buf = (const uint8_t *)pbuf;
    NRF_WRITE_MULTIBYTE_REG_COMMON_BODY
  }

&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;  
if (memtype == 0x00U)
  {
    uint8_t data *buf = (uint8_t data *)pbuf;
    NRF_READ_MULTIBYTE_REG_COMMON_BODY
  }
  else if (memtype == 0x01U)
  {
    uint8_t xdata *buf = (uint8_t xdata *)pbuf;
    NRF_READ_MULTIBYTE_REG_COMMON_BODY
  }
  else if (memtype == 0xFEU)
  {
    uint8_t pdata *buf = (uint8_t pdata *)pbuf;
    NRF_READ_MULTIBYTE_REG_COMMON_BODY
  }
  else
  {
    uint8_t *buf = (uint8_t *)pbuf;
    NRF_READ_MULTIBYTE_REG_COMMON_BODY
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Basically, you want the last &amp;quot;else&amp;quot; to be executed.&lt;/p&gt;
&lt;p&gt;When these files are copied/ported you should also be able to run projects like &amp;quot;enhanched_shockburst&amp;quot; with some porting.&lt;/p&gt;
&lt;p&gt;This SDK can be found here:
&lt;a href="https://www.nordicsemi.com/eng/Products/2.4GHz-RF/nRFgo-SDK"&gt;www.nordicsemi.com/.../nRFgo-SDK&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>