44 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55 */
66
7- #if ! defined(CONFIG_SOC_SERIES_NRF54HX )
7+ #if defined(CONFIG_NRFX_CLOCK )
88#include <hal/nrf_clock.h>
99#endif
1010#include <hal/nrf_uarte.h>
1313#if defined(NRF_RTC0 ) || defined(NRF_RTC1 ) || defined(NRF_RTC2 )
1414 #include <hal/nrf_rtc.h>
1515#endif
16+ #if defined(CONFIG_NRF_GRTC_TIMER )
17+ #include <nrfx_grtc.h>
18+ #endif
1619#if defined(NRF_PPI )
1720 #include <hal/nrf_ppi.h>
1821#endif
@@ -48,6 +51,13 @@ static inline void nrf_cleanup_rtc(NRF_RTC_Type * rtc_reg)
4851}
4952#endif
5053
54+ #if defined(CONFIG_NRF_GRTC_TIMER )
55+ static inline void nrf_cleanup_grtc (void )
56+ {
57+ nrfx_grtc_uninit ();
58+ }
59+ #endif
60+
5161#if defined(NRF_UARTE_CLEANUP )
5262static NRF_UARTE_Type * nrf_uarte_to_clean [] = {
5363#if defined(NRF_UARTE0 )
@@ -62,10 +72,13 @@ static NRF_UARTE_Type *nrf_uarte_to_clean[] = {
6272#if defined(NRF_UARTE30 )
6373 NRF_UARTE30 ,
6474#endif
75+ #if defined(NRF_UARTE136 )
76+ NRF_UARTE136 ,
77+ #endif
6578};
6679#endif
6780
68- #if ! defined(CONFIG_SOC_SERIES_NRF54HX )
81+ #if defined(CONFIG_NRFX_CLOCK )
6982static void nrf_cleanup_clock (void )
7083{
7184 nrf_clock_int_disable (NRF_CLOCK , 0xFFFFFFFF );
@@ -84,6 +97,10 @@ void nrf_cleanup_peripheral(void)
8497 nrf_cleanup_rtc (NRF_RTC2 );
8598#endif
8699
100+ #if defined(CONFIG_NRF_GRTC_TIMER )
101+ nrf_cleanup_grtc ();
102+ #endif
103+
87104#if defined(NRF_UARTE_CLEANUP )
88105 for (int i = 0 ; i < sizeof (nrf_uarte_to_clean ) / sizeof (nrf_uarte_to_clean [0 ]); ++ i ) {
89106 NRF_UARTE_Type * current = nrf_uarte_to_clean [i ];
@@ -137,7 +154,7 @@ void nrf_cleanup_peripheral(void)
137154 nrf_dppi_channels_disable_all (NRF_DPPIC );
138155#endif
139156
140- #if ! defined(CONFIG_SOC_SERIES_NRF54HX )
157+ #if defined(CONFIG_NRFX_CLOCK )
141158 nrf_cleanup_clock ();
142159#endif
143160}
0 commit comments