1 /**
2 * \file
3 *
4 * \brief SAM OSC32KCTRL
5 *
6 * Copyright (C) 2016 Atmel Corporation. All rights reserved.
7 *
8 * \asf_license_start
9 *
10 * \page License
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions are met:
14 *
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 *
18 * 2. Redistributions in binary form must reproduce the above copyright notice,
19 * this list of conditions and the following disclaimer in the documentation
20 * and/or other materials provided with the distribution.
21 *
22 * 3. The name of Atmel may not be used to endorse or promote products derived
23 * from this software without specific prior written permission.
24 *
25 * 4. This software may only be redistributed and used in connection with an
26 * Atmel microcontroller product.
27 *
28 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 * POSSIBILITY OF SUCH DAMAGE.
39 *
40 * \asf_license_stop
41 */
42
43 #ifdef _SAML21_OSC32KCTRL_COMPONENT_
44 #ifndef _HRI_OSC32KCTRL_L21_H_INCLUDED_
45 #define _HRI_OSC32KCTRL_L21_H_INCLUDED_
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 #include <stdbool.h>
52 #include <hal_atomic.h>
53
54 #if defined(ENABLE_OSC32KCTRL_CRITICAL_SECTIONS)
55 #define OSC32KCTRL_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
56 #define OSC32KCTRL_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
57 #else
58 #define OSC32KCTRL_CRITICAL_SECTION_ENTER()
59 #define OSC32KCTRL_CRITICAL_SECTION_LEAVE()
60 #endif
61
62 typedef uint32_t hri_osc32kctrl_intenset_reg_t;
63 typedef uint32_t hri_osc32kctrl_intflag_reg_t;
64 typedef uint32_t hri_osc32kctrl_osc32k_reg_t;
65 typedef uint32_t hri_osc32kctrl_osculp32k_reg_t;
66 typedef uint32_t hri_osc32kctrl_rtcctrl_reg_t;
67 typedef uint32_t hri_osc32kctrl_status_reg_t;
68 typedef uint32_t hri_osc32kctrl_xosc32k_reg_t;
69
hri_osc32kctrl_set_INTEN_XOSC32KRDY_bit(const void * const hw)70 static inline void hri_osc32kctrl_set_INTEN_XOSC32KRDY_bit(const void *const hw)
71 {
72 ((Osc32kctrl *)hw)->INTENSET.reg = OSC32KCTRL_INTENSET_XOSC32KRDY;
73 }
74
hri_osc32kctrl_get_INTEN_XOSC32KRDY_bit(const void * const hw)75 static inline bool hri_osc32kctrl_get_INTEN_XOSC32KRDY_bit(const void *const hw)
76 {
77 return (((Osc32kctrl *)hw)->INTENSET.reg & OSC32KCTRL_INTENSET_XOSC32KRDY) >> OSC32KCTRL_INTENSET_XOSC32KRDY_Pos;
78 }
79
hri_osc32kctrl_write_INTEN_XOSC32KRDY_bit(const void * const hw,bool value)80 static inline void hri_osc32kctrl_write_INTEN_XOSC32KRDY_bit(const void *const hw, bool value)
81 {
82 if (value == 0x0) {
83 ((Osc32kctrl *)hw)->INTENCLR.reg = OSC32KCTRL_INTENSET_XOSC32KRDY;
84 } else {
85 ((Osc32kctrl *)hw)->INTENSET.reg = OSC32KCTRL_INTENSET_XOSC32KRDY;
86 }
87 }
88
hri_osc32kctrl_clear_INTEN_XOSC32KRDY_bit(const void * const hw)89 static inline void hri_osc32kctrl_clear_INTEN_XOSC32KRDY_bit(const void *const hw)
90 {
91 ((Osc32kctrl *)hw)->INTENCLR.reg = OSC32KCTRL_INTENSET_XOSC32KRDY;
92 }
93
hri_osc32kctrl_set_INTEN_OSC32KRDY_bit(const void * const hw)94 static inline void hri_osc32kctrl_set_INTEN_OSC32KRDY_bit(const void *const hw)
95 {
96 ((Osc32kctrl *)hw)->INTENSET.reg = OSC32KCTRL_INTENSET_OSC32KRDY;
97 }
98
hri_osc32kctrl_get_INTEN_OSC32KRDY_bit(const void * const hw)99 static inline bool hri_osc32kctrl_get_INTEN_OSC32KRDY_bit(const void *const hw)
100 {
101 return (((Osc32kctrl *)hw)->INTENSET.reg & OSC32KCTRL_INTENSET_OSC32KRDY) >> OSC32KCTRL_INTENSET_OSC32KRDY_Pos;
102 }
103
hri_osc32kctrl_write_INTEN_OSC32KRDY_bit(const void * const hw,bool value)104 static inline void hri_osc32kctrl_write_INTEN_OSC32KRDY_bit(const void *const hw, bool value)
105 {
106 if (value == 0x0) {
107 ((Osc32kctrl *)hw)->INTENCLR.reg = OSC32KCTRL_INTENSET_OSC32KRDY;
108 } else {
109 ((Osc32kctrl *)hw)->INTENSET.reg = OSC32KCTRL_INTENSET_OSC32KRDY;
110 }
111 }
112
hri_osc32kctrl_clear_INTEN_OSC32KRDY_bit(const void * const hw)113 static inline void hri_osc32kctrl_clear_INTEN_OSC32KRDY_bit(const void *const hw)
114 {
115 ((Osc32kctrl *)hw)->INTENCLR.reg = OSC32KCTRL_INTENSET_OSC32KRDY;
116 }
117
hri_osc32kctrl_set_INTEN_reg(const void * const hw,hri_osc32kctrl_intenset_reg_t mask)118 static inline void hri_osc32kctrl_set_INTEN_reg(const void *const hw, hri_osc32kctrl_intenset_reg_t mask)
119 {
120 ((Osc32kctrl *)hw)->INTENSET.reg = mask;
121 }
122
hri_osc32kctrl_get_INTEN_reg(const void * const hw,hri_osc32kctrl_intenset_reg_t mask)123 static inline hri_osc32kctrl_intenset_reg_t hri_osc32kctrl_get_INTEN_reg(const void *const hw,
124 hri_osc32kctrl_intenset_reg_t mask)
125 {
126 uint32_t tmp;
127 tmp = ((Osc32kctrl *)hw)->INTENSET.reg;
128 tmp &= mask;
129 return tmp;
130 }
131
hri_osc32kctrl_read_INTEN_reg(const void * const hw)132 static inline hri_osc32kctrl_intenset_reg_t hri_osc32kctrl_read_INTEN_reg(const void *const hw)
133 {
134 return ((Osc32kctrl *)hw)->INTENSET.reg;
135 }
136
hri_osc32kctrl_write_INTEN_reg(const void * const hw,hri_osc32kctrl_intenset_reg_t data)137 static inline void hri_osc32kctrl_write_INTEN_reg(const void *const hw, hri_osc32kctrl_intenset_reg_t data)
138 {
139 ((Osc32kctrl *)hw)->INTENSET.reg = data;
140 ((Osc32kctrl *)hw)->INTENCLR.reg = ~data;
141 }
142
hri_osc32kctrl_clear_INTEN_reg(const void * const hw,hri_osc32kctrl_intenset_reg_t mask)143 static inline void hri_osc32kctrl_clear_INTEN_reg(const void *const hw, hri_osc32kctrl_intenset_reg_t mask)
144 {
145 ((Osc32kctrl *)hw)->INTENCLR.reg = mask;
146 }
147
hri_osc32kctrl_get_INTFLAG_XOSC32KRDY_bit(const void * const hw)148 static inline bool hri_osc32kctrl_get_INTFLAG_XOSC32KRDY_bit(const void *const hw)
149 {
150 return (((Osc32kctrl *)hw)->INTFLAG.reg & OSC32KCTRL_INTFLAG_XOSC32KRDY) >> OSC32KCTRL_INTFLAG_XOSC32KRDY_Pos;
151 }
152
hri_osc32kctrl_clear_INTFLAG_XOSC32KRDY_bit(const void * const hw)153 static inline void hri_osc32kctrl_clear_INTFLAG_XOSC32KRDY_bit(const void *const hw)
154 {
155 ((Osc32kctrl *)hw)->INTFLAG.reg = OSC32KCTRL_INTFLAG_XOSC32KRDY;
156 }
157
hri_osc32kctrl_get_INTFLAG_OSC32KRDY_bit(const void * const hw)158 static inline bool hri_osc32kctrl_get_INTFLAG_OSC32KRDY_bit(const void *const hw)
159 {
160 return (((Osc32kctrl *)hw)->INTFLAG.reg & OSC32KCTRL_INTFLAG_OSC32KRDY) >> OSC32KCTRL_INTFLAG_OSC32KRDY_Pos;
161 }
162
hri_osc32kctrl_clear_INTFLAG_OSC32KRDY_bit(const void * const hw)163 static inline void hri_osc32kctrl_clear_INTFLAG_OSC32KRDY_bit(const void *const hw)
164 {
165 ((Osc32kctrl *)hw)->INTFLAG.reg = OSC32KCTRL_INTFLAG_OSC32KRDY;
166 }
167
hri_osc32kctrl_get_interrupt_XOSC32KRDY_bit(const void * const hw)168 static inline bool hri_osc32kctrl_get_interrupt_XOSC32KRDY_bit(const void *const hw)
169 {
170 return (((Osc32kctrl *)hw)->INTFLAG.reg & OSC32KCTRL_INTFLAG_XOSC32KRDY) >> OSC32KCTRL_INTFLAG_XOSC32KRDY_Pos;
171 }
172
hri_osc32kctrl_clear_interrupt_XOSC32KRDY_bit(const void * const hw)173 static inline void hri_osc32kctrl_clear_interrupt_XOSC32KRDY_bit(const void *const hw)
174 {
175 ((Osc32kctrl *)hw)->INTFLAG.reg = OSC32KCTRL_INTFLAG_XOSC32KRDY;
176 }
177
hri_osc32kctrl_get_interrupt_OSC32KRDY_bit(const void * const hw)178 static inline bool hri_osc32kctrl_get_interrupt_OSC32KRDY_bit(const void *const hw)
179 {
180 return (((Osc32kctrl *)hw)->INTFLAG.reg & OSC32KCTRL_INTFLAG_OSC32KRDY) >> OSC32KCTRL_INTFLAG_OSC32KRDY_Pos;
181 }
182
hri_osc32kctrl_clear_interrupt_OSC32KRDY_bit(const void * const hw)183 static inline void hri_osc32kctrl_clear_interrupt_OSC32KRDY_bit(const void *const hw)
184 {
185 ((Osc32kctrl *)hw)->INTFLAG.reg = OSC32KCTRL_INTFLAG_OSC32KRDY;
186 }
187
hri_osc32kctrl_get_INTFLAG_reg(const void * const hw,hri_osc32kctrl_intflag_reg_t mask)188 static inline hri_osc32kctrl_intflag_reg_t hri_osc32kctrl_get_INTFLAG_reg(const void *const hw,
189 hri_osc32kctrl_intflag_reg_t mask)
190 {
191 uint32_t tmp;
192 tmp = ((Osc32kctrl *)hw)->INTFLAG.reg;
193 tmp &= mask;
194 return tmp;
195 }
196
hri_osc32kctrl_read_INTFLAG_reg(const void * const hw)197 static inline hri_osc32kctrl_intflag_reg_t hri_osc32kctrl_read_INTFLAG_reg(const void *const hw)
198 {
199 return ((Osc32kctrl *)hw)->INTFLAG.reg;
200 }
201
hri_osc32kctrl_clear_INTFLAG_reg(const void * const hw,hri_osc32kctrl_intflag_reg_t mask)202 static inline void hri_osc32kctrl_clear_INTFLAG_reg(const void *const hw, hri_osc32kctrl_intflag_reg_t mask)
203 {
204 ((Osc32kctrl *)hw)->INTFLAG.reg = mask;
205 }
206
hri_osc32kctrl_set_RTCCTRL_RTCSEL_bf(const void * const hw,hri_osc32kctrl_rtcctrl_reg_t mask)207 static inline void hri_osc32kctrl_set_RTCCTRL_RTCSEL_bf(const void *const hw, hri_osc32kctrl_rtcctrl_reg_t mask)
208 {
209 OSC32KCTRL_CRITICAL_SECTION_ENTER();
210 ((Osc32kctrl *)hw)->RTCCTRL.reg |= OSC32KCTRL_RTCCTRL_RTCSEL(mask);
211 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
212 }
213
hri_osc32kctrl_get_RTCCTRL_RTCSEL_bf(const void * const hw,hri_osc32kctrl_rtcctrl_reg_t mask)214 static inline hri_osc32kctrl_rtcctrl_reg_t hri_osc32kctrl_get_RTCCTRL_RTCSEL_bf(const void *const hw,
215 hri_osc32kctrl_rtcctrl_reg_t mask)
216 {
217 uint32_t tmp;
218 tmp = ((Osc32kctrl *)hw)->RTCCTRL.reg;
219 tmp = (tmp & OSC32KCTRL_RTCCTRL_RTCSEL(mask)) >> OSC32KCTRL_RTCCTRL_RTCSEL_Pos;
220 return tmp;
221 }
222
hri_osc32kctrl_write_RTCCTRL_RTCSEL_bf(const void * const hw,hri_osc32kctrl_rtcctrl_reg_t data)223 static inline void hri_osc32kctrl_write_RTCCTRL_RTCSEL_bf(const void *const hw, hri_osc32kctrl_rtcctrl_reg_t data)
224 {
225 uint32_t tmp;
226 OSC32KCTRL_CRITICAL_SECTION_ENTER();
227 tmp = ((Osc32kctrl *)hw)->RTCCTRL.reg;
228 tmp &= ~OSC32KCTRL_RTCCTRL_RTCSEL_Msk;
229 tmp |= OSC32KCTRL_RTCCTRL_RTCSEL(data);
230 ((Osc32kctrl *)hw)->RTCCTRL.reg = tmp;
231 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
232 }
233
hri_osc32kctrl_clear_RTCCTRL_RTCSEL_bf(const void * const hw,hri_osc32kctrl_rtcctrl_reg_t mask)234 static inline void hri_osc32kctrl_clear_RTCCTRL_RTCSEL_bf(const void *const hw, hri_osc32kctrl_rtcctrl_reg_t mask)
235 {
236 OSC32KCTRL_CRITICAL_SECTION_ENTER();
237 ((Osc32kctrl *)hw)->RTCCTRL.reg &= ~OSC32KCTRL_RTCCTRL_RTCSEL(mask);
238 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
239 }
240
hri_osc32kctrl_toggle_RTCCTRL_RTCSEL_bf(const void * const hw,hri_osc32kctrl_rtcctrl_reg_t mask)241 static inline void hri_osc32kctrl_toggle_RTCCTRL_RTCSEL_bf(const void *const hw, hri_osc32kctrl_rtcctrl_reg_t mask)
242 {
243 OSC32KCTRL_CRITICAL_SECTION_ENTER();
244 ((Osc32kctrl *)hw)->RTCCTRL.reg ^= OSC32KCTRL_RTCCTRL_RTCSEL(mask);
245 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
246 }
247
hri_osc32kctrl_read_RTCCTRL_RTCSEL_bf(const void * const hw)248 static inline hri_osc32kctrl_rtcctrl_reg_t hri_osc32kctrl_read_RTCCTRL_RTCSEL_bf(const void *const hw)
249 {
250 uint32_t tmp;
251 tmp = ((Osc32kctrl *)hw)->RTCCTRL.reg;
252 tmp = (tmp & OSC32KCTRL_RTCCTRL_RTCSEL_Msk) >> OSC32KCTRL_RTCCTRL_RTCSEL_Pos;
253 return tmp;
254 }
255
hri_osc32kctrl_set_RTCCTRL_reg(const void * const hw,hri_osc32kctrl_rtcctrl_reg_t mask)256 static inline void hri_osc32kctrl_set_RTCCTRL_reg(const void *const hw, hri_osc32kctrl_rtcctrl_reg_t mask)
257 {
258 OSC32KCTRL_CRITICAL_SECTION_ENTER();
259 ((Osc32kctrl *)hw)->RTCCTRL.reg |= mask;
260 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
261 }
262
hri_osc32kctrl_get_RTCCTRL_reg(const void * const hw,hri_osc32kctrl_rtcctrl_reg_t mask)263 static inline hri_osc32kctrl_rtcctrl_reg_t hri_osc32kctrl_get_RTCCTRL_reg(const void *const hw,
264 hri_osc32kctrl_rtcctrl_reg_t mask)
265 {
266 uint32_t tmp;
267 tmp = ((Osc32kctrl *)hw)->RTCCTRL.reg;
268 tmp &= mask;
269 return tmp;
270 }
271
hri_osc32kctrl_write_RTCCTRL_reg(const void * const hw,hri_osc32kctrl_rtcctrl_reg_t data)272 static inline void hri_osc32kctrl_write_RTCCTRL_reg(const void *const hw, hri_osc32kctrl_rtcctrl_reg_t data)
273 {
274 OSC32KCTRL_CRITICAL_SECTION_ENTER();
275 ((Osc32kctrl *)hw)->RTCCTRL.reg = data;
276 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
277 }
278
hri_osc32kctrl_clear_RTCCTRL_reg(const void * const hw,hri_osc32kctrl_rtcctrl_reg_t mask)279 static inline void hri_osc32kctrl_clear_RTCCTRL_reg(const void *const hw, hri_osc32kctrl_rtcctrl_reg_t mask)
280 {
281 OSC32KCTRL_CRITICAL_SECTION_ENTER();
282 ((Osc32kctrl *)hw)->RTCCTRL.reg &= ~mask;
283 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
284 }
285
hri_osc32kctrl_toggle_RTCCTRL_reg(const void * const hw,hri_osc32kctrl_rtcctrl_reg_t mask)286 static inline void hri_osc32kctrl_toggle_RTCCTRL_reg(const void *const hw, hri_osc32kctrl_rtcctrl_reg_t mask)
287 {
288 OSC32KCTRL_CRITICAL_SECTION_ENTER();
289 ((Osc32kctrl *)hw)->RTCCTRL.reg ^= mask;
290 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
291 }
292
hri_osc32kctrl_read_RTCCTRL_reg(const void * const hw)293 static inline hri_osc32kctrl_rtcctrl_reg_t hri_osc32kctrl_read_RTCCTRL_reg(const void *const hw)
294 {
295 return ((Osc32kctrl *)hw)->RTCCTRL.reg;
296 }
297
hri_osc32kctrl_set_XOSC32K_ENABLE_bit(const void * const hw)298 static inline void hri_osc32kctrl_set_XOSC32K_ENABLE_bit(const void *const hw)
299 {
300 OSC32KCTRL_CRITICAL_SECTION_ENTER();
301 ((Osc32kctrl *)hw)->XOSC32K.reg |= OSC32KCTRL_XOSC32K_ENABLE;
302 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
303 }
304
hri_osc32kctrl_get_XOSC32K_ENABLE_bit(const void * const hw)305 static inline bool hri_osc32kctrl_get_XOSC32K_ENABLE_bit(const void *const hw)
306 {
307 uint32_t tmp;
308 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
309 tmp = (tmp & OSC32KCTRL_XOSC32K_ENABLE) >> OSC32KCTRL_XOSC32K_ENABLE_Pos;
310 return (bool)tmp;
311 }
312
hri_osc32kctrl_write_XOSC32K_ENABLE_bit(const void * const hw,bool value)313 static inline void hri_osc32kctrl_write_XOSC32K_ENABLE_bit(const void *const hw, bool value)
314 {
315 uint32_t tmp;
316 OSC32KCTRL_CRITICAL_SECTION_ENTER();
317 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
318 tmp &= ~OSC32KCTRL_XOSC32K_ENABLE;
319 tmp |= value << OSC32KCTRL_XOSC32K_ENABLE_Pos;
320 ((Osc32kctrl *)hw)->XOSC32K.reg = tmp;
321 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
322 }
323
hri_osc32kctrl_clear_XOSC32K_ENABLE_bit(const void * const hw)324 static inline void hri_osc32kctrl_clear_XOSC32K_ENABLE_bit(const void *const hw)
325 {
326 OSC32KCTRL_CRITICAL_SECTION_ENTER();
327 ((Osc32kctrl *)hw)->XOSC32K.reg &= ~OSC32KCTRL_XOSC32K_ENABLE;
328 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
329 }
330
hri_osc32kctrl_toggle_XOSC32K_ENABLE_bit(const void * const hw)331 static inline void hri_osc32kctrl_toggle_XOSC32K_ENABLE_bit(const void *const hw)
332 {
333 OSC32KCTRL_CRITICAL_SECTION_ENTER();
334 ((Osc32kctrl *)hw)->XOSC32K.reg ^= OSC32KCTRL_XOSC32K_ENABLE;
335 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
336 }
337
hri_osc32kctrl_set_XOSC32K_XTALEN_bit(const void * const hw)338 static inline void hri_osc32kctrl_set_XOSC32K_XTALEN_bit(const void *const hw)
339 {
340 OSC32KCTRL_CRITICAL_SECTION_ENTER();
341 ((Osc32kctrl *)hw)->XOSC32K.reg |= OSC32KCTRL_XOSC32K_XTALEN;
342 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
343 }
344
hri_osc32kctrl_get_XOSC32K_XTALEN_bit(const void * const hw)345 static inline bool hri_osc32kctrl_get_XOSC32K_XTALEN_bit(const void *const hw)
346 {
347 uint32_t tmp;
348 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
349 tmp = (tmp & OSC32KCTRL_XOSC32K_XTALEN) >> OSC32KCTRL_XOSC32K_XTALEN_Pos;
350 return (bool)tmp;
351 }
352
hri_osc32kctrl_write_XOSC32K_XTALEN_bit(const void * const hw,bool value)353 static inline void hri_osc32kctrl_write_XOSC32K_XTALEN_bit(const void *const hw, bool value)
354 {
355 uint32_t tmp;
356 OSC32KCTRL_CRITICAL_SECTION_ENTER();
357 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
358 tmp &= ~OSC32KCTRL_XOSC32K_XTALEN;
359 tmp |= value << OSC32KCTRL_XOSC32K_XTALEN_Pos;
360 ((Osc32kctrl *)hw)->XOSC32K.reg = tmp;
361 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
362 }
363
hri_osc32kctrl_clear_XOSC32K_XTALEN_bit(const void * const hw)364 static inline void hri_osc32kctrl_clear_XOSC32K_XTALEN_bit(const void *const hw)
365 {
366 OSC32KCTRL_CRITICAL_SECTION_ENTER();
367 ((Osc32kctrl *)hw)->XOSC32K.reg &= ~OSC32KCTRL_XOSC32K_XTALEN;
368 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
369 }
370
hri_osc32kctrl_toggle_XOSC32K_XTALEN_bit(const void * const hw)371 static inline void hri_osc32kctrl_toggle_XOSC32K_XTALEN_bit(const void *const hw)
372 {
373 OSC32KCTRL_CRITICAL_SECTION_ENTER();
374 ((Osc32kctrl *)hw)->XOSC32K.reg ^= OSC32KCTRL_XOSC32K_XTALEN;
375 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
376 }
377
hri_osc32kctrl_set_XOSC32K_EN32K_bit(const void * const hw)378 static inline void hri_osc32kctrl_set_XOSC32K_EN32K_bit(const void *const hw)
379 {
380 OSC32KCTRL_CRITICAL_SECTION_ENTER();
381 ((Osc32kctrl *)hw)->XOSC32K.reg |= OSC32KCTRL_XOSC32K_EN32K;
382 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
383 }
384
hri_osc32kctrl_get_XOSC32K_EN32K_bit(const void * const hw)385 static inline bool hri_osc32kctrl_get_XOSC32K_EN32K_bit(const void *const hw)
386 {
387 uint32_t tmp;
388 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
389 tmp = (tmp & OSC32KCTRL_XOSC32K_EN32K) >> OSC32KCTRL_XOSC32K_EN32K_Pos;
390 return (bool)tmp;
391 }
392
hri_osc32kctrl_write_XOSC32K_EN32K_bit(const void * const hw,bool value)393 static inline void hri_osc32kctrl_write_XOSC32K_EN32K_bit(const void *const hw, bool value)
394 {
395 uint32_t tmp;
396 OSC32KCTRL_CRITICAL_SECTION_ENTER();
397 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
398 tmp &= ~OSC32KCTRL_XOSC32K_EN32K;
399 tmp |= value << OSC32KCTRL_XOSC32K_EN32K_Pos;
400 ((Osc32kctrl *)hw)->XOSC32K.reg = tmp;
401 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
402 }
403
hri_osc32kctrl_clear_XOSC32K_EN32K_bit(const void * const hw)404 static inline void hri_osc32kctrl_clear_XOSC32K_EN32K_bit(const void *const hw)
405 {
406 OSC32KCTRL_CRITICAL_SECTION_ENTER();
407 ((Osc32kctrl *)hw)->XOSC32K.reg &= ~OSC32KCTRL_XOSC32K_EN32K;
408 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
409 }
410
hri_osc32kctrl_toggle_XOSC32K_EN32K_bit(const void * const hw)411 static inline void hri_osc32kctrl_toggle_XOSC32K_EN32K_bit(const void *const hw)
412 {
413 OSC32KCTRL_CRITICAL_SECTION_ENTER();
414 ((Osc32kctrl *)hw)->XOSC32K.reg ^= OSC32KCTRL_XOSC32K_EN32K;
415 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
416 }
417
hri_osc32kctrl_set_XOSC32K_EN1K_bit(const void * const hw)418 static inline void hri_osc32kctrl_set_XOSC32K_EN1K_bit(const void *const hw)
419 {
420 OSC32KCTRL_CRITICAL_SECTION_ENTER();
421 ((Osc32kctrl *)hw)->XOSC32K.reg |= OSC32KCTRL_XOSC32K_EN1K;
422 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
423 }
424
hri_osc32kctrl_get_XOSC32K_EN1K_bit(const void * const hw)425 static inline bool hri_osc32kctrl_get_XOSC32K_EN1K_bit(const void *const hw)
426 {
427 uint32_t tmp;
428 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
429 tmp = (tmp & OSC32KCTRL_XOSC32K_EN1K) >> OSC32KCTRL_XOSC32K_EN1K_Pos;
430 return (bool)tmp;
431 }
432
hri_osc32kctrl_write_XOSC32K_EN1K_bit(const void * const hw,bool value)433 static inline void hri_osc32kctrl_write_XOSC32K_EN1K_bit(const void *const hw, bool value)
434 {
435 uint32_t tmp;
436 OSC32KCTRL_CRITICAL_SECTION_ENTER();
437 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
438 tmp &= ~OSC32KCTRL_XOSC32K_EN1K;
439 tmp |= value << OSC32KCTRL_XOSC32K_EN1K_Pos;
440 ((Osc32kctrl *)hw)->XOSC32K.reg = tmp;
441 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
442 }
443
hri_osc32kctrl_clear_XOSC32K_EN1K_bit(const void * const hw)444 static inline void hri_osc32kctrl_clear_XOSC32K_EN1K_bit(const void *const hw)
445 {
446 OSC32KCTRL_CRITICAL_SECTION_ENTER();
447 ((Osc32kctrl *)hw)->XOSC32K.reg &= ~OSC32KCTRL_XOSC32K_EN1K;
448 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
449 }
450
hri_osc32kctrl_toggle_XOSC32K_EN1K_bit(const void * const hw)451 static inline void hri_osc32kctrl_toggle_XOSC32K_EN1K_bit(const void *const hw)
452 {
453 OSC32KCTRL_CRITICAL_SECTION_ENTER();
454 ((Osc32kctrl *)hw)->XOSC32K.reg ^= OSC32KCTRL_XOSC32K_EN1K;
455 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
456 }
457
hri_osc32kctrl_set_XOSC32K_RUNSTDBY_bit(const void * const hw)458 static inline void hri_osc32kctrl_set_XOSC32K_RUNSTDBY_bit(const void *const hw)
459 {
460 OSC32KCTRL_CRITICAL_SECTION_ENTER();
461 ((Osc32kctrl *)hw)->XOSC32K.reg |= OSC32KCTRL_XOSC32K_RUNSTDBY;
462 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
463 }
464
hri_osc32kctrl_get_XOSC32K_RUNSTDBY_bit(const void * const hw)465 static inline bool hri_osc32kctrl_get_XOSC32K_RUNSTDBY_bit(const void *const hw)
466 {
467 uint32_t tmp;
468 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
469 tmp = (tmp & OSC32KCTRL_XOSC32K_RUNSTDBY) >> OSC32KCTRL_XOSC32K_RUNSTDBY_Pos;
470 return (bool)tmp;
471 }
472
hri_osc32kctrl_write_XOSC32K_RUNSTDBY_bit(const void * const hw,bool value)473 static inline void hri_osc32kctrl_write_XOSC32K_RUNSTDBY_bit(const void *const hw, bool value)
474 {
475 uint32_t tmp;
476 OSC32KCTRL_CRITICAL_SECTION_ENTER();
477 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
478 tmp &= ~OSC32KCTRL_XOSC32K_RUNSTDBY;
479 tmp |= value << OSC32KCTRL_XOSC32K_RUNSTDBY_Pos;
480 ((Osc32kctrl *)hw)->XOSC32K.reg = tmp;
481 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
482 }
483
hri_osc32kctrl_clear_XOSC32K_RUNSTDBY_bit(const void * const hw)484 static inline void hri_osc32kctrl_clear_XOSC32K_RUNSTDBY_bit(const void *const hw)
485 {
486 OSC32KCTRL_CRITICAL_SECTION_ENTER();
487 ((Osc32kctrl *)hw)->XOSC32K.reg &= ~OSC32KCTRL_XOSC32K_RUNSTDBY;
488 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
489 }
490
hri_osc32kctrl_toggle_XOSC32K_RUNSTDBY_bit(const void * const hw)491 static inline void hri_osc32kctrl_toggle_XOSC32K_RUNSTDBY_bit(const void *const hw)
492 {
493 OSC32KCTRL_CRITICAL_SECTION_ENTER();
494 ((Osc32kctrl *)hw)->XOSC32K.reg ^= OSC32KCTRL_XOSC32K_RUNSTDBY;
495 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
496 }
497
hri_osc32kctrl_set_XOSC32K_ONDEMAND_bit(const void * const hw)498 static inline void hri_osc32kctrl_set_XOSC32K_ONDEMAND_bit(const void *const hw)
499 {
500 OSC32KCTRL_CRITICAL_SECTION_ENTER();
501 ((Osc32kctrl *)hw)->XOSC32K.reg |= OSC32KCTRL_XOSC32K_ONDEMAND;
502 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
503 }
504
hri_osc32kctrl_get_XOSC32K_ONDEMAND_bit(const void * const hw)505 static inline bool hri_osc32kctrl_get_XOSC32K_ONDEMAND_bit(const void *const hw)
506 {
507 uint32_t tmp;
508 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
509 tmp = (tmp & OSC32KCTRL_XOSC32K_ONDEMAND) >> OSC32KCTRL_XOSC32K_ONDEMAND_Pos;
510 return (bool)tmp;
511 }
512
hri_osc32kctrl_write_XOSC32K_ONDEMAND_bit(const void * const hw,bool value)513 static inline void hri_osc32kctrl_write_XOSC32K_ONDEMAND_bit(const void *const hw, bool value)
514 {
515 uint32_t tmp;
516 OSC32KCTRL_CRITICAL_SECTION_ENTER();
517 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
518 tmp &= ~OSC32KCTRL_XOSC32K_ONDEMAND;
519 tmp |= value << OSC32KCTRL_XOSC32K_ONDEMAND_Pos;
520 ((Osc32kctrl *)hw)->XOSC32K.reg = tmp;
521 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
522 }
523
hri_osc32kctrl_clear_XOSC32K_ONDEMAND_bit(const void * const hw)524 static inline void hri_osc32kctrl_clear_XOSC32K_ONDEMAND_bit(const void *const hw)
525 {
526 OSC32KCTRL_CRITICAL_SECTION_ENTER();
527 ((Osc32kctrl *)hw)->XOSC32K.reg &= ~OSC32KCTRL_XOSC32K_ONDEMAND;
528 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
529 }
530
hri_osc32kctrl_toggle_XOSC32K_ONDEMAND_bit(const void * const hw)531 static inline void hri_osc32kctrl_toggle_XOSC32K_ONDEMAND_bit(const void *const hw)
532 {
533 OSC32KCTRL_CRITICAL_SECTION_ENTER();
534 ((Osc32kctrl *)hw)->XOSC32K.reg ^= OSC32KCTRL_XOSC32K_ONDEMAND;
535 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
536 }
537
hri_osc32kctrl_set_XOSC32K_WRTLOCK_bit(const void * const hw)538 static inline void hri_osc32kctrl_set_XOSC32K_WRTLOCK_bit(const void *const hw)
539 {
540 OSC32KCTRL_CRITICAL_SECTION_ENTER();
541 ((Osc32kctrl *)hw)->XOSC32K.reg |= OSC32KCTRL_XOSC32K_WRTLOCK;
542 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
543 }
544
hri_osc32kctrl_get_XOSC32K_WRTLOCK_bit(const void * const hw)545 static inline bool hri_osc32kctrl_get_XOSC32K_WRTLOCK_bit(const void *const hw)
546 {
547 uint32_t tmp;
548 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
549 tmp = (tmp & OSC32KCTRL_XOSC32K_WRTLOCK) >> OSC32KCTRL_XOSC32K_WRTLOCK_Pos;
550 return (bool)tmp;
551 }
552
hri_osc32kctrl_write_XOSC32K_WRTLOCK_bit(const void * const hw,bool value)553 static inline void hri_osc32kctrl_write_XOSC32K_WRTLOCK_bit(const void *const hw, bool value)
554 {
555 uint32_t tmp;
556 OSC32KCTRL_CRITICAL_SECTION_ENTER();
557 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
558 tmp &= ~OSC32KCTRL_XOSC32K_WRTLOCK;
559 tmp |= value << OSC32KCTRL_XOSC32K_WRTLOCK_Pos;
560 ((Osc32kctrl *)hw)->XOSC32K.reg = tmp;
561 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
562 }
563
hri_osc32kctrl_clear_XOSC32K_WRTLOCK_bit(const void * const hw)564 static inline void hri_osc32kctrl_clear_XOSC32K_WRTLOCK_bit(const void *const hw)
565 {
566 OSC32KCTRL_CRITICAL_SECTION_ENTER();
567 ((Osc32kctrl *)hw)->XOSC32K.reg &= ~OSC32KCTRL_XOSC32K_WRTLOCK;
568 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
569 }
570
hri_osc32kctrl_toggle_XOSC32K_WRTLOCK_bit(const void * const hw)571 static inline void hri_osc32kctrl_toggle_XOSC32K_WRTLOCK_bit(const void *const hw)
572 {
573 OSC32KCTRL_CRITICAL_SECTION_ENTER();
574 ((Osc32kctrl *)hw)->XOSC32K.reg ^= OSC32KCTRL_XOSC32K_WRTLOCK;
575 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
576 }
577
hri_osc32kctrl_set_XOSC32K_STARTUP_bf(const void * const hw,hri_osc32kctrl_xosc32k_reg_t mask)578 static inline void hri_osc32kctrl_set_XOSC32K_STARTUP_bf(const void *const hw, hri_osc32kctrl_xosc32k_reg_t mask)
579 {
580 OSC32KCTRL_CRITICAL_SECTION_ENTER();
581 ((Osc32kctrl *)hw)->XOSC32K.reg |= OSC32KCTRL_XOSC32K_STARTUP(mask);
582 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
583 }
584
hri_osc32kctrl_get_XOSC32K_STARTUP_bf(const void * const hw,hri_osc32kctrl_xosc32k_reg_t mask)585 static inline hri_osc32kctrl_xosc32k_reg_t hri_osc32kctrl_get_XOSC32K_STARTUP_bf(const void *const hw,
586 hri_osc32kctrl_xosc32k_reg_t mask)
587 {
588 uint32_t tmp;
589 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
590 tmp = (tmp & OSC32KCTRL_XOSC32K_STARTUP(mask)) >> OSC32KCTRL_XOSC32K_STARTUP_Pos;
591 return tmp;
592 }
593
hri_osc32kctrl_write_XOSC32K_STARTUP_bf(const void * const hw,hri_osc32kctrl_xosc32k_reg_t data)594 static inline void hri_osc32kctrl_write_XOSC32K_STARTUP_bf(const void *const hw, hri_osc32kctrl_xosc32k_reg_t data)
595 {
596 uint32_t tmp;
597 OSC32KCTRL_CRITICAL_SECTION_ENTER();
598 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
599 tmp &= ~OSC32KCTRL_XOSC32K_STARTUP_Msk;
600 tmp |= OSC32KCTRL_XOSC32K_STARTUP(data);
601 ((Osc32kctrl *)hw)->XOSC32K.reg = tmp;
602 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
603 }
604
hri_osc32kctrl_clear_XOSC32K_STARTUP_bf(const void * const hw,hri_osc32kctrl_xosc32k_reg_t mask)605 static inline void hri_osc32kctrl_clear_XOSC32K_STARTUP_bf(const void *const hw, hri_osc32kctrl_xosc32k_reg_t mask)
606 {
607 OSC32KCTRL_CRITICAL_SECTION_ENTER();
608 ((Osc32kctrl *)hw)->XOSC32K.reg &= ~OSC32KCTRL_XOSC32K_STARTUP(mask);
609 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
610 }
611
hri_osc32kctrl_toggle_XOSC32K_STARTUP_bf(const void * const hw,hri_osc32kctrl_xosc32k_reg_t mask)612 static inline void hri_osc32kctrl_toggle_XOSC32K_STARTUP_bf(const void *const hw, hri_osc32kctrl_xosc32k_reg_t mask)
613 {
614 OSC32KCTRL_CRITICAL_SECTION_ENTER();
615 ((Osc32kctrl *)hw)->XOSC32K.reg ^= OSC32KCTRL_XOSC32K_STARTUP(mask);
616 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
617 }
618
hri_osc32kctrl_read_XOSC32K_STARTUP_bf(const void * const hw)619 static inline hri_osc32kctrl_xosc32k_reg_t hri_osc32kctrl_read_XOSC32K_STARTUP_bf(const void *const hw)
620 {
621 uint32_t tmp;
622 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
623 tmp = (tmp & OSC32KCTRL_XOSC32K_STARTUP_Msk) >> OSC32KCTRL_XOSC32K_STARTUP_Pos;
624 return tmp;
625 }
626
hri_osc32kctrl_set_XOSC32K_reg(const void * const hw,hri_osc32kctrl_xosc32k_reg_t mask)627 static inline void hri_osc32kctrl_set_XOSC32K_reg(const void *const hw, hri_osc32kctrl_xosc32k_reg_t mask)
628 {
629 OSC32KCTRL_CRITICAL_SECTION_ENTER();
630 ((Osc32kctrl *)hw)->XOSC32K.reg |= mask;
631 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
632 }
633
hri_osc32kctrl_get_XOSC32K_reg(const void * const hw,hri_osc32kctrl_xosc32k_reg_t mask)634 static inline hri_osc32kctrl_xosc32k_reg_t hri_osc32kctrl_get_XOSC32K_reg(const void *const hw,
635 hri_osc32kctrl_xosc32k_reg_t mask)
636 {
637 uint32_t tmp;
638 tmp = ((Osc32kctrl *)hw)->XOSC32K.reg;
639 tmp &= mask;
640 return tmp;
641 }
642
hri_osc32kctrl_write_XOSC32K_reg(const void * const hw,hri_osc32kctrl_xosc32k_reg_t data)643 static inline void hri_osc32kctrl_write_XOSC32K_reg(const void *const hw, hri_osc32kctrl_xosc32k_reg_t data)
644 {
645 OSC32KCTRL_CRITICAL_SECTION_ENTER();
646 ((Osc32kctrl *)hw)->XOSC32K.reg = data;
647 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
648 }
649
hri_osc32kctrl_clear_XOSC32K_reg(const void * const hw,hri_osc32kctrl_xosc32k_reg_t mask)650 static inline void hri_osc32kctrl_clear_XOSC32K_reg(const void *const hw, hri_osc32kctrl_xosc32k_reg_t mask)
651 {
652 OSC32KCTRL_CRITICAL_SECTION_ENTER();
653 ((Osc32kctrl *)hw)->XOSC32K.reg &= ~mask;
654 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
655 }
656
hri_osc32kctrl_toggle_XOSC32K_reg(const void * const hw,hri_osc32kctrl_xosc32k_reg_t mask)657 static inline void hri_osc32kctrl_toggle_XOSC32K_reg(const void *const hw, hri_osc32kctrl_xosc32k_reg_t mask)
658 {
659 OSC32KCTRL_CRITICAL_SECTION_ENTER();
660 ((Osc32kctrl *)hw)->XOSC32K.reg ^= mask;
661 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
662 }
663
hri_osc32kctrl_read_XOSC32K_reg(const void * const hw)664 static inline hri_osc32kctrl_xosc32k_reg_t hri_osc32kctrl_read_XOSC32K_reg(const void *const hw)
665 {
666 return ((Osc32kctrl *)hw)->XOSC32K.reg;
667 }
668
hri_osc32kctrl_set_OSC32K_ENABLE_bit(const void * const hw)669 static inline void hri_osc32kctrl_set_OSC32K_ENABLE_bit(const void *const hw)
670 {
671 OSC32KCTRL_CRITICAL_SECTION_ENTER();
672 ((Osc32kctrl *)hw)->OSC32K.reg |= OSC32KCTRL_OSC32K_ENABLE;
673 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
674 }
675
hri_osc32kctrl_get_OSC32K_ENABLE_bit(const void * const hw)676 static inline bool hri_osc32kctrl_get_OSC32K_ENABLE_bit(const void *const hw)
677 {
678 uint32_t tmp;
679 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
680 tmp = (tmp & OSC32KCTRL_OSC32K_ENABLE) >> OSC32KCTRL_OSC32K_ENABLE_Pos;
681 return (bool)tmp;
682 }
683
hri_osc32kctrl_write_OSC32K_ENABLE_bit(const void * const hw,bool value)684 static inline void hri_osc32kctrl_write_OSC32K_ENABLE_bit(const void *const hw, bool value)
685 {
686 uint32_t tmp;
687 OSC32KCTRL_CRITICAL_SECTION_ENTER();
688 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
689 tmp &= ~OSC32KCTRL_OSC32K_ENABLE;
690 tmp |= value << OSC32KCTRL_OSC32K_ENABLE_Pos;
691 ((Osc32kctrl *)hw)->OSC32K.reg = tmp;
692 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
693 }
694
hri_osc32kctrl_clear_OSC32K_ENABLE_bit(const void * const hw)695 static inline void hri_osc32kctrl_clear_OSC32K_ENABLE_bit(const void *const hw)
696 {
697 OSC32KCTRL_CRITICAL_SECTION_ENTER();
698 ((Osc32kctrl *)hw)->OSC32K.reg &= ~OSC32KCTRL_OSC32K_ENABLE;
699 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
700 }
701
hri_osc32kctrl_toggle_OSC32K_ENABLE_bit(const void * const hw)702 static inline void hri_osc32kctrl_toggle_OSC32K_ENABLE_bit(const void *const hw)
703 {
704 OSC32KCTRL_CRITICAL_SECTION_ENTER();
705 ((Osc32kctrl *)hw)->OSC32K.reg ^= OSC32KCTRL_OSC32K_ENABLE;
706 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
707 }
708
hri_osc32kctrl_set_OSC32K_EN32K_bit(const void * const hw)709 static inline void hri_osc32kctrl_set_OSC32K_EN32K_bit(const void *const hw)
710 {
711 OSC32KCTRL_CRITICAL_SECTION_ENTER();
712 ((Osc32kctrl *)hw)->OSC32K.reg |= OSC32KCTRL_OSC32K_EN32K;
713 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
714 }
715
hri_osc32kctrl_get_OSC32K_EN32K_bit(const void * const hw)716 static inline bool hri_osc32kctrl_get_OSC32K_EN32K_bit(const void *const hw)
717 {
718 uint32_t tmp;
719 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
720 tmp = (tmp & OSC32KCTRL_OSC32K_EN32K) >> OSC32KCTRL_OSC32K_EN32K_Pos;
721 return (bool)tmp;
722 }
723
hri_osc32kctrl_write_OSC32K_EN32K_bit(const void * const hw,bool value)724 static inline void hri_osc32kctrl_write_OSC32K_EN32K_bit(const void *const hw, bool value)
725 {
726 uint32_t tmp;
727 OSC32KCTRL_CRITICAL_SECTION_ENTER();
728 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
729 tmp &= ~OSC32KCTRL_OSC32K_EN32K;
730 tmp |= value << OSC32KCTRL_OSC32K_EN32K_Pos;
731 ((Osc32kctrl *)hw)->OSC32K.reg = tmp;
732 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
733 }
734
hri_osc32kctrl_clear_OSC32K_EN32K_bit(const void * const hw)735 static inline void hri_osc32kctrl_clear_OSC32K_EN32K_bit(const void *const hw)
736 {
737 OSC32KCTRL_CRITICAL_SECTION_ENTER();
738 ((Osc32kctrl *)hw)->OSC32K.reg &= ~OSC32KCTRL_OSC32K_EN32K;
739 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
740 }
741
hri_osc32kctrl_toggle_OSC32K_EN32K_bit(const void * const hw)742 static inline void hri_osc32kctrl_toggle_OSC32K_EN32K_bit(const void *const hw)
743 {
744 OSC32KCTRL_CRITICAL_SECTION_ENTER();
745 ((Osc32kctrl *)hw)->OSC32K.reg ^= OSC32KCTRL_OSC32K_EN32K;
746 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
747 }
748
hri_osc32kctrl_set_OSC32K_EN1K_bit(const void * const hw)749 static inline void hri_osc32kctrl_set_OSC32K_EN1K_bit(const void *const hw)
750 {
751 OSC32KCTRL_CRITICAL_SECTION_ENTER();
752 ((Osc32kctrl *)hw)->OSC32K.reg |= OSC32KCTRL_OSC32K_EN1K;
753 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
754 }
755
hri_osc32kctrl_get_OSC32K_EN1K_bit(const void * const hw)756 static inline bool hri_osc32kctrl_get_OSC32K_EN1K_bit(const void *const hw)
757 {
758 uint32_t tmp;
759 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
760 tmp = (tmp & OSC32KCTRL_OSC32K_EN1K) >> OSC32KCTRL_OSC32K_EN1K_Pos;
761 return (bool)tmp;
762 }
763
hri_osc32kctrl_write_OSC32K_EN1K_bit(const void * const hw,bool value)764 static inline void hri_osc32kctrl_write_OSC32K_EN1K_bit(const void *const hw, bool value)
765 {
766 uint32_t tmp;
767 OSC32KCTRL_CRITICAL_SECTION_ENTER();
768 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
769 tmp &= ~OSC32KCTRL_OSC32K_EN1K;
770 tmp |= value << OSC32KCTRL_OSC32K_EN1K_Pos;
771 ((Osc32kctrl *)hw)->OSC32K.reg = tmp;
772 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
773 }
774
hri_osc32kctrl_clear_OSC32K_EN1K_bit(const void * const hw)775 static inline void hri_osc32kctrl_clear_OSC32K_EN1K_bit(const void *const hw)
776 {
777 OSC32KCTRL_CRITICAL_SECTION_ENTER();
778 ((Osc32kctrl *)hw)->OSC32K.reg &= ~OSC32KCTRL_OSC32K_EN1K;
779 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
780 }
781
hri_osc32kctrl_toggle_OSC32K_EN1K_bit(const void * const hw)782 static inline void hri_osc32kctrl_toggle_OSC32K_EN1K_bit(const void *const hw)
783 {
784 OSC32KCTRL_CRITICAL_SECTION_ENTER();
785 ((Osc32kctrl *)hw)->OSC32K.reg ^= OSC32KCTRL_OSC32K_EN1K;
786 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
787 }
788
hri_osc32kctrl_set_OSC32K_RUNSTDBY_bit(const void * const hw)789 static inline void hri_osc32kctrl_set_OSC32K_RUNSTDBY_bit(const void *const hw)
790 {
791 OSC32KCTRL_CRITICAL_SECTION_ENTER();
792 ((Osc32kctrl *)hw)->OSC32K.reg |= OSC32KCTRL_OSC32K_RUNSTDBY;
793 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
794 }
795
hri_osc32kctrl_get_OSC32K_RUNSTDBY_bit(const void * const hw)796 static inline bool hri_osc32kctrl_get_OSC32K_RUNSTDBY_bit(const void *const hw)
797 {
798 uint32_t tmp;
799 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
800 tmp = (tmp & OSC32KCTRL_OSC32K_RUNSTDBY) >> OSC32KCTRL_OSC32K_RUNSTDBY_Pos;
801 return (bool)tmp;
802 }
803
hri_osc32kctrl_write_OSC32K_RUNSTDBY_bit(const void * const hw,bool value)804 static inline void hri_osc32kctrl_write_OSC32K_RUNSTDBY_bit(const void *const hw, bool value)
805 {
806 uint32_t tmp;
807 OSC32KCTRL_CRITICAL_SECTION_ENTER();
808 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
809 tmp &= ~OSC32KCTRL_OSC32K_RUNSTDBY;
810 tmp |= value << OSC32KCTRL_OSC32K_RUNSTDBY_Pos;
811 ((Osc32kctrl *)hw)->OSC32K.reg = tmp;
812 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
813 }
814
hri_osc32kctrl_clear_OSC32K_RUNSTDBY_bit(const void * const hw)815 static inline void hri_osc32kctrl_clear_OSC32K_RUNSTDBY_bit(const void *const hw)
816 {
817 OSC32KCTRL_CRITICAL_SECTION_ENTER();
818 ((Osc32kctrl *)hw)->OSC32K.reg &= ~OSC32KCTRL_OSC32K_RUNSTDBY;
819 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
820 }
821
hri_osc32kctrl_toggle_OSC32K_RUNSTDBY_bit(const void * const hw)822 static inline void hri_osc32kctrl_toggle_OSC32K_RUNSTDBY_bit(const void *const hw)
823 {
824 OSC32KCTRL_CRITICAL_SECTION_ENTER();
825 ((Osc32kctrl *)hw)->OSC32K.reg ^= OSC32KCTRL_OSC32K_RUNSTDBY;
826 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
827 }
828
hri_osc32kctrl_set_OSC32K_ONDEMAND_bit(const void * const hw)829 static inline void hri_osc32kctrl_set_OSC32K_ONDEMAND_bit(const void *const hw)
830 {
831 OSC32KCTRL_CRITICAL_SECTION_ENTER();
832 ((Osc32kctrl *)hw)->OSC32K.reg |= OSC32KCTRL_OSC32K_ONDEMAND;
833 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
834 }
835
hri_osc32kctrl_get_OSC32K_ONDEMAND_bit(const void * const hw)836 static inline bool hri_osc32kctrl_get_OSC32K_ONDEMAND_bit(const void *const hw)
837 {
838 uint32_t tmp;
839 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
840 tmp = (tmp & OSC32KCTRL_OSC32K_ONDEMAND) >> OSC32KCTRL_OSC32K_ONDEMAND_Pos;
841 return (bool)tmp;
842 }
843
hri_osc32kctrl_write_OSC32K_ONDEMAND_bit(const void * const hw,bool value)844 static inline void hri_osc32kctrl_write_OSC32K_ONDEMAND_bit(const void *const hw, bool value)
845 {
846 uint32_t tmp;
847 OSC32KCTRL_CRITICAL_SECTION_ENTER();
848 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
849 tmp &= ~OSC32KCTRL_OSC32K_ONDEMAND;
850 tmp |= value << OSC32KCTRL_OSC32K_ONDEMAND_Pos;
851 ((Osc32kctrl *)hw)->OSC32K.reg = tmp;
852 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
853 }
854
hri_osc32kctrl_clear_OSC32K_ONDEMAND_bit(const void * const hw)855 static inline void hri_osc32kctrl_clear_OSC32K_ONDEMAND_bit(const void *const hw)
856 {
857 OSC32KCTRL_CRITICAL_SECTION_ENTER();
858 ((Osc32kctrl *)hw)->OSC32K.reg &= ~OSC32KCTRL_OSC32K_ONDEMAND;
859 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
860 }
861
hri_osc32kctrl_toggle_OSC32K_ONDEMAND_bit(const void * const hw)862 static inline void hri_osc32kctrl_toggle_OSC32K_ONDEMAND_bit(const void *const hw)
863 {
864 OSC32KCTRL_CRITICAL_SECTION_ENTER();
865 ((Osc32kctrl *)hw)->OSC32K.reg ^= OSC32KCTRL_OSC32K_ONDEMAND;
866 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
867 }
868
hri_osc32kctrl_set_OSC32K_WRTLOCK_bit(const void * const hw)869 static inline void hri_osc32kctrl_set_OSC32K_WRTLOCK_bit(const void *const hw)
870 {
871 OSC32KCTRL_CRITICAL_SECTION_ENTER();
872 ((Osc32kctrl *)hw)->OSC32K.reg |= OSC32KCTRL_OSC32K_WRTLOCK;
873 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
874 }
875
hri_osc32kctrl_get_OSC32K_WRTLOCK_bit(const void * const hw)876 static inline bool hri_osc32kctrl_get_OSC32K_WRTLOCK_bit(const void *const hw)
877 {
878 uint32_t tmp;
879 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
880 tmp = (tmp & OSC32KCTRL_OSC32K_WRTLOCK) >> OSC32KCTRL_OSC32K_WRTLOCK_Pos;
881 return (bool)tmp;
882 }
883
hri_osc32kctrl_write_OSC32K_WRTLOCK_bit(const void * const hw,bool value)884 static inline void hri_osc32kctrl_write_OSC32K_WRTLOCK_bit(const void *const hw, bool value)
885 {
886 uint32_t tmp;
887 OSC32KCTRL_CRITICAL_SECTION_ENTER();
888 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
889 tmp &= ~OSC32KCTRL_OSC32K_WRTLOCK;
890 tmp |= value << OSC32KCTRL_OSC32K_WRTLOCK_Pos;
891 ((Osc32kctrl *)hw)->OSC32K.reg = tmp;
892 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
893 }
894
hri_osc32kctrl_clear_OSC32K_WRTLOCK_bit(const void * const hw)895 static inline void hri_osc32kctrl_clear_OSC32K_WRTLOCK_bit(const void *const hw)
896 {
897 OSC32KCTRL_CRITICAL_SECTION_ENTER();
898 ((Osc32kctrl *)hw)->OSC32K.reg &= ~OSC32KCTRL_OSC32K_WRTLOCK;
899 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
900 }
901
hri_osc32kctrl_toggle_OSC32K_WRTLOCK_bit(const void * const hw)902 static inline void hri_osc32kctrl_toggle_OSC32K_WRTLOCK_bit(const void *const hw)
903 {
904 OSC32KCTRL_CRITICAL_SECTION_ENTER();
905 ((Osc32kctrl *)hw)->OSC32K.reg ^= OSC32KCTRL_OSC32K_WRTLOCK;
906 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
907 }
908
hri_osc32kctrl_set_OSC32K_STARTUP_bf(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)909 static inline void hri_osc32kctrl_set_OSC32K_STARTUP_bf(const void *const hw, hri_osc32kctrl_osc32k_reg_t mask)
910 {
911 OSC32KCTRL_CRITICAL_SECTION_ENTER();
912 ((Osc32kctrl *)hw)->OSC32K.reg |= OSC32KCTRL_OSC32K_STARTUP(mask);
913 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
914 }
915
hri_osc32kctrl_get_OSC32K_STARTUP_bf(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)916 static inline hri_osc32kctrl_osc32k_reg_t hri_osc32kctrl_get_OSC32K_STARTUP_bf(const void *const hw,
917 hri_osc32kctrl_osc32k_reg_t mask)
918 {
919 uint32_t tmp;
920 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
921 tmp = (tmp & OSC32KCTRL_OSC32K_STARTUP(mask)) >> OSC32KCTRL_OSC32K_STARTUP_Pos;
922 return tmp;
923 }
924
hri_osc32kctrl_write_OSC32K_STARTUP_bf(const void * const hw,hri_osc32kctrl_osc32k_reg_t data)925 static inline void hri_osc32kctrl_write_OSC32K_STARTUP_bf(const void *const hw, hri_osc32kctrl_osc32k_reg_t data)
926 {
927 uint32_t tmp;
928 OSC32KCTRL_CRITICAL_SECTION_ENTER();
929 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
930 tmp &= ~OSC32KCTRL_OSC32K_STARTUP_Msk;
931 tmp |= OSC32KCTRL_OSC32K_STARTUP(data);
932 ((Osc32kctrl *)hw)->OSC32K.reg = tmp;
933 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
934 }
935
hri_osc32kctrl_clear_OSC32K_STARTUP_bf(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)936 static inline void hri_osc32kctrl_clear_OSC32K_STARTUP_bf(const void *const hw, hri_osc32kctrl_osc32k_reg_t mask)
937 {
938 OSC32KCTRL_CRITICAL_SECTION_ENTER();
939 ((Osc32kctrl *)hw)->OSC32K.reg &= ~OSC32KCTRL_OSC32K_STARTUP(mask);
940 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
941 }
942
hri_osc32kctrl_toggle_OSC32K_STARTUP_bf(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)943 static inline void hri_osc32kctrl_toggle_OSC32K_STARTUP_bf(const void *const hw, hri_osc32kctrl_osc32k_reg_t mask)
944 {
945 OSC32KCTRL_CRITICAL_SECTION_ENTER();
946 ((Osc32kctrl *)hw)->OSC32K.reg ^= OSC32KCTRL_OSC32K_STARTUP(mask);
947 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
948 }
949
hri_osc32kctrl_read_OSC32K_STARTUP_bf(const void * const hw)950 static inline hri_osc32kctrl_osc32k_reg_t hri_osc32kctrl_read_OSC32K_STARTUP_bf(const void *const hw)
951 {
952 uint32_t tmp;
953 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
954 tmp = (tmp & OSC32KCTRL_OSC32K_STARTUP_Msk) >> OSC32KCTRL_OSC32K_STARTUP_Pos;
955 return tmp;
956 }
957
hri_osc32kctrl_set_OSC32K_CALIB_bf(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)958 static inline void hri_osc32kctrl_set_OSC32K_CALIB_bf(const void *const hw, hri_osc32kctrl_osc32k_reg_t mask)
959 {
960 OSC32KCTRL_CRITICAL_SECTION_ENTER();
961 ((Osc32kctrl *)hw)->OSC32K.reg |= OSC32KCTRL_OSC32K_CALIB(mask);
962 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
963 }
964
hri_osc32kctrl_get_OSC32K_CALIB_bf(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)965 static inline hri_osc32kctrl_osc32k_reg_t hri_osc32kctrl_get_OSC32K_CALIB_bf(const void *const hw,
966 hri_osc32kctrl_osc32k_reg_t mask)
967 {
968 uint32_t tmp;
969 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
970 tmp = (tmp & OSC32KCTRL_OSC32K_CALIB(mask)) >> OSC32KCTRL_OSC32K_CALIB_Pos;
971 return tmp;
972 }
973
hri_osc32kctrl_write_OSC32K_CALIB_bf(const void * const hw,hri_osc32kctrl_osc32k_reg_t data)974 static inline void hri_osc32kctrl_write_OSC32K_CALIB_bf(const void *const hw, hri_osc32kctrl_osc32k_reg_t data)
975 {
976 uint32_t tmp;
977 OSC32KCTRL_CRITICAL_SECTION_ENTER();
978 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
979 tmp &= ~OSC32KCTRL_OSC32K_CALIB_Msk;
980 tmp |= OSC32KCTRL_OSC32K_CALIB(data);
981 ((Osc32kctrl *)hw)->OSC32K.reg = tmp;
982 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
983 }
984
hri_osc32kctrl_clear_OSC32K_CALIB_bf(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)985 static inline void hri_osc32kctrl_clear_OSC32K_CALIB_bf(const void *const hw, hri_osc32kctrl_osc32k_reg_t mask)
986 {
987 OSC32KCTRL_CRITICAL_SECTION_ENTER();
988 ((Osc32kctrl *)hw)->OSC32K.reg &= ~OSC32KCTRL_OSC32K_CALIB(mask);
989 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
990 }
991
hri_osc32kctrl_toggle_OSC32K_CALIB_bf(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)992 static inline void hri_osc32kctrl_toggle_OSC32K_CALIB_bf(const void *const hw, hri_osc32kctrl_osc32k_reg_t mask)
993 {
994 OSC32KCTRL_CRITICAL_SECTION_ENTER();
995 ((Osc32kctrl *)hw)->OSC32K.reg ^= OSC32KCTRL_OSC32K_CALIB(mask);
996 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
997 }
998
hri_osc32kctrl_read_OSC32K_CALIB_bf(const void * const hw)999 static inline hri_osc32kctrl_osc32k_reg_t hri_osc32kctrl_read_OSC32K_CALIB_bf(const void *const hw)
1000 {
1001 uint32_t tmp;
1002 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
1003 tmp = (tmp & OSC32KCTRL_OSC32K_CALIB_Msk) >> OSC32KCTRL_OSC32K_CALIB_Pos;
1004 return tmp;
1005 }
1006
hri_osc32kctrl_set_OSC32K_reg(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)1007 static inline void hri_osc32kctrl_set_OSC32K_reg(const void *const hw, hri_osc32kctrl_osc32k_reg_t mask)
1008 {
1009 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1010 ((Osc32kctrl *)hw)->OSC32K.reg |= mask;
1011 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1012 }
1013
hri_osc32kctrl_get_OSC32K_reg(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)1014 static inline hri_osc32kctrl_osc32k_reg_t hri_osc32kctrl_get_OSC32K_reg(const void *const hw,
1015 hri_osc32kctrl_osc32k_reg_t mask)
1016 {
1017 uint32_t tmp;
1018 tmp = ((Osc32kctrl *)hw)->OSC32K.reg;
1019 tmp &= mask;
1020 return tmp;
1021 }
1022
hri_osc32kctrl_write_OSC32K_reg(const void * const hw,hri_osc32kctrl_osc32k_reg_t data)1023 static inline void hri_osc32kctrl_write_OSC32K_reg(const void *const hw, hri_osc32kctrl_osc32k_reg_t data)
1024 {
1025 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1026 ((Osc32kctrl *)hw)->OSC32K.reg = data;
1027 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1028 }
1029
hri_osc32kctrl_clear_OSC32K_reg(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)1030 static inline void hri_osc32kctrl_clear_OSC32K_reg(const void *const hw, hri_osc32kctrl_osc32k_reg_t mask)
1031 {
1032 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1033 ((Osc32kctrl *)hw)->OSC32K.reg &= ~mask;
1034 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1035 }
1036
hri_osc32kctrl_toggle_OSC32K_reg(const void * const hw,hri_osc32kctrl_osc32k_reg_t mask)1037 static inline void hri_osc32kctrl_toggle_OSC32K_reg(const void *const hw, hri_osc32kctrl_osc32k_reg_t mask)
1038 {
1039 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1040 ((Osc32kctrl *)hw)->OSC32K.reg ^= mask;
1041 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1042 }
1043
hri_osc32kctrl_read_OSC32K_reg(const void * const hw)1044 static inline hri_osc32kctrl_osc32k_reg_t hri_osc32kctrl_read_OSC32K_reg(const void *const hw)
1045 {
1046 return ((Osc32kctrl *)hw)->OSC32K.reg;
1047 }
1048
hri_osc32kctrl_set_OSCULP32K_WRTLOCK_bit(const void * const hw)1049 static inline void hri_osc32kctrl_set_OSCULP32K_WRTLOCK_bit(const void *const hw)
1050 {
1051 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1052 ((Osc32kctrl *)hw)->OSCULP32K.reg |= OSC32KCTRL_OSCULP32K_WRTLOCK;
1053 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1054 }
1055
hri_osc32kctrl_get_OSCULP32K_WRTLOCK_bit(const void * const hw)1056 static inline bool hri_osc32kctrl_get_OSCULP32K_WRTLOCK_bit(const void *const hw)
1057 {
1058 uint32_t tmp;
1059 tmp = ((Osc32kctrl *)hw)->OSCULP32K.reg;
1060 tmp = (tmp & OSC32KCTRL_OSCULP32K_WRTLOCK) >> OSC32KCTRL_OSCULP32K_WRTLOCK_Pos;
1061 return (bool)tmp;
1062 }
1063
hri_osc32kctrl_write_OSCULP32K_WRTLOCK_bit(const void * const hw,bool value)1064 static inline void hri_osc32kctrl_write_OSCULP32K_WRTLOCK_bit(const void *const hw, bool value)
1065 {
1066 uint32_t tmp;
1067 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1068 tmp = ((Osc32kctrl *)hw)->OSCULP32K.reg;
1069 tmp &= ~OSC32KCTRL_OSCULP32K_WRTLOCK;
1070 tmp |= value << OSC32KCTRL_OSCULP32K_WRTLOCK_Pos;
1071 ((Osc32kctrl *)hw)->OSCULP32K.reg = tmp;
1072 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1073 }
1074
hri_osc32kctrl_clear_OSCULP32K_WRTLOCK_bit(const void * const hw)1075 static inline void hri_osc32kctrl_clear_OSCULP32K_WRTLOCK_bit(const void *const hw)
1076 {
1077 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1078 ((Osc32kctrl *)hw)->OSCULP32K.reg &= ~OSC32KCTRL_OSCULP32K_WRTLOCK;
1079 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1080 }
1081
hri_osc32kctrl_toggle_OSCULP32K_WRTLOCK_bit(const void * const hw)1082 static inline void hri_osc32kctrl_toggle_OSCULP32K_WRTLOCK_bit(const void *const hw)
1083 {
1084 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1085 ((Osc32kctrl *)hw)->OSCULP32K.reg ^= OSC32KCTRL_OSCULP32K_WRTLOCK;
1086 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1087 }
1088
hri_osc32kctrl_set_OSCULP32K_CALIB_bf(const void * const hw,hri_osc32kctrl_osculp32k_reg_t mask)1089 static inline void hri_osc32kctrl_set_OSCULP32K_CALIB_bf(const void *const hw, hri_osc32kctrl_osculp32k_reg_t mask)
1090 {
1091 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1092 ((Osc32kctrl *)hw)->OSCULP32K.reg |= OSC32KCTRL_OSCULP32K_CALIB(mask);
1093 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1094 }
1095
hri_osc32kctrl_get_OSCULP32K_CALIB_bf(const void * const hw,hri_osc32kctrl_osculp32k_reg_t mask)1096 static inline hri_osc32kctrl_osculp32k_reg_t hri_osc32kctrl_get_OSCULP32K_CALIB_bf(const void *const hw,
1097 hri_osc32kctrl_osculp32k_reg_t mask)
1098 {
1099 uint32_t tmp;
1100 tmp = ((Osc32kctrl *)hw)->OSCULP32K.reg;
1101 tmp = (tmp & OSC32KCTRL_OSCULP32K_CALIB(mask)) >> OSC32KCTRL_OSCULP32K_CALIB_Pos;
1102 return tmp;
1103 }
1104
hri_osc32kctrl_write_OSCULP32K_CALIB_bf(const void * const hw,hri_osc32kctrl_osculp32k_reg_t data)1105 static inline void hri_osc32kctrl_write_OSCULP32K_CALIB_bf(const void *const hw, hri_osc32kctrl_osculp32k_reg_t data)
1106 {
1107 uint32_t tmp;
1108 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1109 tmp = ((Osc32kctrl *)hw)->OSCULP32K.reg;
1110 tmp &= ~OSC32KCTRL_OSCULP32K_CALIB_Msk;
1111 tmp |= OSC32KCTRL_OSCULP32K_CALIB(data);
1112 ((Osc32kctrl *)hw)->OSCULP32K.reg = tmp;
1113 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1114 }
1115
hri_osc32kctrl_clear_OSCULP32K_CALIB_bf(const void * const hw,hri_osc32kctrl_osculp32k_reg_t mask)1116 static inline void hri_osc32kctrl_clear_OSCULP32K_CALIB_bf(const void *const hw, hri_osc32kctrl_osculp32k_reg_t mask)
1117 {
1118 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1119 ((Osc32kctrl *)hw)->OSCULP32K.reg &= ~OSC32KCTRL_OSCULP32K_CALIB(mask);
1120 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1121 }
1122
hri_osc32kctrl_toggle_OSCULP32K_CALIB_bf(const void * const hw,hri_osc32kctrl_osculp32k_reg_t mask)1123 static inline void hri_osc32kctrl_toggle_OSCULP32K_CALIB_bf(const void *const hw, hri_osc32kctrl_osculp32k_reg_t mask)
1124 {
1125 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1126 ((Osc32kctrl *)hw)->OSCULP32K.reg ^= OSC32KCTRL_OSCULP32K_CALIB(mask);
1127 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1128 }
1129
hri_osc32kctrl_read_OSCULP32K_CALIB_bf(const void * const hw)1130 static inline hri_osc32kctrl_osculp32k_reg_t hri_osc32kctrl_read_OSCULP32K_CALIB_bf(const void *const hw)
1131 {
1132 uint32_t tmp;
1133 tmp = ((Osc32kctrl *)hw)->OSCULP32K.reg;
1134 tmp = (tmp & OSC32KCTRL_OSCULP32K_CALIB_Msk) >> OSC32KCTRL_OSCULP32K_CALIB_Pos;
1135 return tmp;
1136 }
1137
hri_osc32kctrl_set_OSCULP32K_reg(const void * const hw,hri_osc32kctrl_osculp32k_reg_t mask)1138 static inline void hri_osc32kctrl_set_OSCULP32K_reg(const void *const hw, hri_osc32kctrl_osculp32k_reg_t mask)
1139 {
1140 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1141 ((Osc32kctrl *)hw)->OSCULP32K.reg |= mask;
1142 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1143 }
1144
hri_osc32kctrl_get_OSCULP32K_reg(const void * const hw,hri_osc32kctrl_osculp32k_reg_t mask)1145 static inline hri_osc32kctrl_osculp32k_reg_t hri_osc32kctrl_get_OSCULP32K_reg(const void *const hw,
1146 hri_osc32kctrl_osculp32k_reg_t mask)
1147 {
1148 uint32_t tmp;
1149 tmp = ((Osc32kctrl *)hw)->OSCULP32K.reg;
1150 tmp &= mask;
1151 return tmp;
1152 }
1153
hri_osc32kctrl_write_OSCULP32K_reg(const void * const hw,hri_osc32kctrl_osculp32k_reg_t data)1154 static inline void hri_osc32kctrl_write_OSCULP32K_reg(const void *const hw, hri_osc32kctrl_osculp32k_reg_t data)
1155 {
1156 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1157 ((Osc32kctrl *)hw)->OSCULP32K.reg = data;
1158 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1159 }
1160
hri_osc32kctrl_clear_OSCULP32K_reg(const void * const hw,hri_osc32kctrl_osculp32k_reg_t mask)1161 static inline void hri_osc32kctrl_clear_OSCULP32K_reg(const void *const hw, hri_osc32kctrl_osculp32k_reg_t mask)
1162 {
1163 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1164 ((Osc32kctrl *)hw)->OSCULP32K.reg &= ~mask;
1165 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1166 }
1167
hri_osc32kctrl_toggle_OSCULP32K_reg(const void * const hw,hri_osc32kctrl_osculp32k_reg_t mask)1168 static inline void hri_osc32kctrl_toggle_OSCULP32K_reg(const void *const hw, hri_osc32kctrl_osculp32k_reg_t mask)
1169 {
1170 OSC32KCTRL_CRITICAL_SECTION_ENTER();
1171 ((Osc32kctrl *)hw)->OSCULP32K.reg ^= mask;
1172 OSC32KCTRL_CRITICAL_SECTION_LEAVE();
1173 }
1174
hri_osc32kctrl_read_OSCULP32K_reg(const void * const hw)1175 static inline hri_osc32kctrl_osculp32k_reg_t hri_osc32kctrl_read_OSCULP32K_reg(const void *const hw)
1176 {
1177 return ((Osc32kctrl *)hw)->OSCULP32K.reg;
1178 }
1179
hri_osc32kctrl_get_STATUS_XOSC32KRDY_bit(const void * const hw)1180 static inline bool hri_osc32kctrl_get_STATUS_XOSC32KRDY_bit(const void *const hw)
1181 {
1182 return (((Osc32kctrl *)hw)->STATUS.reg & OSC32KCTRL_STATUS_XOSC32KRDY) >> OSC32KCTRL_STATUS_XOSC32KRDY_Pos;
1183 }
1184
hri_osc32kctrl_get_STATUS_OSC32KRDY_bit(const void * const hw)1185 static inline bool hri_osc32kctrl_get_STATUS_OSC32KRDY_bit(const void *const hw)
1186 {
1187 return (((Osc32kctrl *)hw)->STATUS.reg & OSC32KCTRL_STATUS_OSC32KRDY) >> OSC32KCTRL_STATUS_OSC32KRDY_Pos;
1188 }
1189
hri_osc32kctrl_get_STATUS_reg(const void * const hw,hri_osc32kctrl_status_reg_t mask)1190 static inline hri_osc32kctrl_status_reg_t hri_osc32kctrl_get_STATUS_reg(const void *const hw,
1191 hri_osc32kctrl_status_reg_t mask)
1192 {
1193 uint32_t tmp;
1194 tmp = ((Osc32kctrl *)hw)->STATUS.reg;
1195 tmp &= mask;
1196 return tmp;
1197 }
1198
hri_osc32kctrl_read_STATUS_reg(const void * const hw)1199 static inline hri_osc32kctrl_status_reg_t hri_osc32kctrl_read_STATUS_reg(const void *const hw)
1200 {
1201 return ((Osc32kctrl *)hw)->STATUS.reg;
1202 }
1203
1204 #ifdef __cplusplus
1205 }
1206 #endif
1207
1208 #endif /* _HRI_OSC32KCTRL_L21_H_INCLUDED */
1209 #endif /* _SAML21_OSC32KCTRL_COMPONENT_ */
1210