I could not find a way, where I can get the nrfx_rtc_t const *p_instance for the nrfx_rtc_init function. There is no example where it is shown where to get this struct from.
I could not find a way, where I can get the nrfx_rtc_t const *p_instance for the nrfx_rtc_init function. There is no example where it is shown where to get this struct from.
Hi,
The nrfx_rtc_t must be defined in your application. This is normally done like this:
#define RTC_INSTANCE_NUMBER 0
const nrfx_rtc_t rtc = NRFX_RTC_INSTANCE(RTC_INSTANCE_NUMBER);
Where RTC_INSTANCE_NUMBER represents the RTC instance you want to use (in this case RTC0).
You can then pass this instance to nrfx_rtc_init() like this:
nrfx_rtc_init(&rtc, .., ..);
This is shown in the RTC peripheral example in nRF5 SDK (with nrf_drv_rtc APIs, but this is a simple replacement to nrfx).
Best regards,
Jørgen
Thanks for your reply.
I think it will work, but the compiler tells me it is missing NRFX_RTC0_INST_IDX. I think, i have to activate the rtc0 in a config file. Can you tell me where?
Best regards
Jones
Thanks for your reply.
I think it will work, but the compiler tells me it is missing NRFX_RTC0_INST_IDX. I think, i have to activate the rtc0 in a config file. Can you tell me where?
Best regards
Jones