tests: drivers: counter: nrf_rtc: Add nrf52_bsim overlay and adapt test

Add overlay for nrf52_bsim to the fixed_top test.
For bsim board RTC register address has to be translated.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruściński 2024-04-12 07:45:14 +02:00 committed by Carles Cufí
commit d0224ab19f
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,8 @@
&rtc0 {
status = "okay";
fixed-top;
};
&rtc2 {
status = "okay";
fixed-top;
};

View file

@ -100,6 +100,12 @@ static void test_top_handler_on_instance(int idx)
.callback = top_handler,
.flags = 0
};
#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
/* For simulated devices we need to convert the hardcoded DT address from the real
* peripheral into the correct one for simulation
*/
reg = nhw_convert_periph_base_addr(reg);
#endif
top_cfg.ticks = counter_get_max_top_value(dev);