This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52.h vs nrf52840.h?

Hello, I'm using the nrf52840 SoC, and nrf52840.h appears to be a more "localized" and "specialized" version of nrf52.h for nrf52840. So quite reasonably I should use nrf52840.h.

But the thing is, I'm doing a migration from nrf51 devices, can I just include nrf52.h instead? The only thing that made me ask this question is that I want to utilize nrf52840's BLE 5.x capability, so I think that may not exactly be a good idea?

Parents
  • Just include nrf.h and make sure you have the correct defines. nrf.h will (as it always has done) include the right things, which in this case is nrf352840.h.

  • Well the thing is, the original project kind of had all those specific includes, but instead they were about nrf51.

    So when migrating to the nrf52 platform, I simply changed them to nrf52/nrf52840 etc.

    I'm not exactly sure including nrf.h can get things done, since I've already done it. Either way, inside nrf.h, all you see is macros that dictate inclusion of nrf52.h, nrf52840.h etc.

    Anyhow, in nrf.h, there's this line:

    #elif defined (NRF52840_XXAA)
    

    "definted" isn't exactly a C99 standard keyword, so I suppose it has something to do with the MDK-ARM, how do I properly activate this line? By putting down "NRF52840_XXAA" in the magic-wand -> C/C++ tab -> define inputbox?

Reply
  • Well the thing is, the original project kind of had all those specific includes, but instead they were about nrf51.

    So when migrating to the nrf52 platform, I simply changed them to nrf52/nrf52840 etc.

    I'm not exactly sure including nrf.h can get things done, since I've already done it. Either way, inside nrf.h, all you see is macros that dictate inclusion of nrf52.h, nrf52840.h etc.

    Anyhow, in nrf.h, there's this line:

    #elif defined (NRF52840_XXAA)
    

    "definted" isn't exactly a C99 standard keyword, so I suppose it has something to do with the MDK-ARM, how do I properly activate this line? By putting down "NRF52840_XXAA" in the magic-wand -> C/C++ tab -> define inputbox?

Children
No Data
Related