4
4
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5
5
*/
6
6
7
- #if ! defined(CONFIG_SOC_SERIES_NRF54HX )
7
+ #if defined(CONFIG_NRFX_CLOCK )
8
8
#include <hal/nrf_clock.h>
9
9
#endif
10
10
#include <hal/nrf_uarte.h>
13
13
#if defined(NRF_RTC0 ) || defined(NRF_RTC1 ) || defined(NRF_RTC2 )
14
14
#include <hal/nrf_rtc.h>
15
15
#endif
16
+ #if defined(CONFIG_NRF_GRTC_TIMER )
17
+ #include <nrfx_grtc.h>
18
+ #endif
16
19
#if defined(NRF_PPI )
17
20
#include <hal/nrf_ppi.h>
18
21
#endif
@@ -48,6 +51,13 @@ static inline void nrf_cleanup_rtc(NRF_RTC_Type * rtc_reg)
48
51
}
49
52
#endif
50
53
54
+ #if defined(CONFIG_NRF_GRTC_TIMER )
55
+ static inline void nrf_cleanup_grtc (void )
56
+ {
57
+ nrfx_grtc_uninit ();
58
+ }
59
+ #endif
60
+
51
61
#if defined(NRF_UARTE_CLEANUP )
52
62
static NRF_UARTE_Type * nrf_uarte_to_clean [] = {
53
63
#if defined(NRF_UARTE0 )
@@ -62,10 +72,13 @@ static NRF_UARTE_Type *nrf_uarte_to_clean[] = {
62
72
#if defined(NRF_UARTE30 )
63
73
NRF_UARTE30 ,
64
74
#endif
75
+ #if defined(NRF_UARTE136 )
76
+ NRF_UARTE136 ,
77
+ #endif
65
78
};
66
79
#endif
67
80
68
- #if ! defined(CONFIG_SOC_SERIES_NRF54HX )
81
+ #if defined(CONFIG_NRFX_CLOCK )
69
82
static void nrf_cleanup_clock (void )
70
83
{
71
84
nrf_clock_int_disable (NRF_CLOCK , 0xFFFFFFFF );
@@ -84,6 +97,10 @@ void nrf_cleanup_peripheral(void)
84
97
nrf_cleanup_rtc (NRF_RTC2 );
85
98
#endif
86
99
100
+ #if defined(CONFIG_NRF_GRTC_TIMER )
101
+ nrf_cleanup_grtc ();
102
+ #endif
103
+
87
104
#if defined(NRF_UARTE_CLEANUP )
88
105
for (int i = 0 ; i < sizeof (nrf_uarte_to_clean ) / sizeof (nrf_uarte_to_clean [0 ]); ++ i ) {
89
106
NRF_UARTE_Type * current = nrf_uarte_to_clean [i ];
@@ -137,7 +154,7 @@ void nrf_cleanup_peripheral(void)
137
154
nrf_dppi_channels_disable_all (NRF_DPPIC );
138
155
#endif
139
156
140
- #if ! defined(CONFIG_SOC_SERIES_NRF54HX )
157
+ #if defined(CONFIG_NRFX_CLOCK )
141
158
nrf_cleanup_clock ();
142
159
#endif
143
160
}
0 commit comments