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

Which SDK SAADC drivers for nRF52840?

I'm a newbie to nRF stuff so please forgive me if I have missed the obvious...

nRF52840, SDK 17.0.2

The Nordic infocentre lists 4 options
- SAADC driver - legacy layer (nrf_drv_saadc.h)
- SAADC legacy driver (nrfx_saadc.h)
- SAADC V2 driver (nrfx_saadc_v2.h)
- SAADC HAL

https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__nrf__saadc.html

The SDK example code (\examples\peripheral\saadc) uses legacy layer nrf_drv_saadc.h, looks old

I guess I should use the latest V2 drivers but can find very little documentation or example code

HAL looks interesting, I use HAL on STM32s (but prefer LL), but on this device it looks like a steep learning curve.

Maybe nrfx_saadc.h?

I'm doing very simple stuff with the ADC, just reading the battery voltage once in a blue moon, just want a simple example.

Actually this question applies to most peripherals - which drivers?

Thanks

Parents
  • Hi,

    If you're new to the nRF family then I would just suggest following what is used in the examples, namely the legacy driver. The advantage with this is that you will have a reference to follow when you make your own project by using the examples in the SDK. Note that the legacy drivers are using the nrfx driver in the backend, this is done by using macros for forwarding the nrfx implementation. See the nrf_drv_saadc.h file for an example of the macro forwarding.

    best regards

    Jared 

Reply
  • Hi,

    If you're new to the nRF family then I would just suggest following what is used in the examples, namely the legacy driver. The advantage with this is that you will have a reference to follow when you make your own project by using the examples in the SDK. Note that the legacy drivers are using the nrfx driver in the backend, this is done by using macros for forwarding the nrfx implementation. See the nrf_drv_saadc.h file for an example of the macro forwarding.

    best regards

    Jared 

Children
Related