Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrfx_rtc_init vs drv_rtc_init?

nRF52840, SDK16.0.0, S140v7.0.1

We use SoftDevice (RTC0) and app_timer (RTC1). I'm trying to configure RTC2 and TIMER0 to do PPI-driven crystal timing as described in https://devzone.nordicsemi.com/f/nordic-q-a/64834/softdevice-and-timer3.

Since we use app_timer, I was curious how much RTC initialization I'm required to perform additionally to get RTC2 up and running via "nrfx_rtc.h". I'm looking at this file and seeing functions like nrfx_rtc_init, which lives in "nrfx_rtc.c" and looks like what I want. Then I look in the app_timer2.c file and see that it's calling something totally different: drv_rtc_init() which lives in "drv_rtc.c"

Two separate modules whose names both indicate that they want to control the RTC blocks. Which one should I use for manual RTC2 capture/compare PPI work? If they both ended up calling the same .c file I wouldn't really care but drv_rtc_init and nrfx_rtc_init look similar but have nontrivial differences. Which should I use and why? The docs I see seem to steer me towards nrfx whenever possible, but then I see that app_timer2 does something different?

Parents Reply Children
Related