1 /**
2  * \file
3  *
4  * \brief SAM GCLK
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_GCLK_COMPONENT_
44 #ifndef _HRI_GCLK_L21_H_INCLUDED_
45 #define _HRI_GCLK_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_GCLK_CRITICAL_SECTIONS)
55 #define GCLK_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
56 #define GCLK_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
57 #else
58 #define GCLK_CRITICAL_SECTION_ENTER()
59 #define GCLK_CRITICAL_SECTION_LEAVE()
60 #endif
61 
62 typedef uint32_t hri_gclk_genctrl_reg_t;
63 typedef uint32_t hri_gclk_pchctrl_reg_t;
64 typedef uint32_t hri_gclk_syncbusy_reg_t;
65 typedef uint8_t  hri_gclk_ctrla_reg_t;
66 
hri_gclk_wait_for_sync(const void * const hw,hri_gclk_syncbusy_reg_t reg)67 static inline void hri_gclk_wait_for_sync(const void *const hw, hri_gclk_syncbusy_reg_t reg)
68 {
69 	while (((Gclk *)hw)->SYNCBUSY.reg & reg) {
70 	};
71 }
72 
hri_gclk_is_syncing(const void * const hw,hri_gclk_syncbusy_reg_t reg)73 static inline bool hri_gclk_is_syncing(const void *const hw, hri_gclk_syncbusy_reg_t reg)
74 {
75 	return ((Gclk *)hw)->SYNCBUSY.reg & reg;
76 }
77 
hri_gclk_set_CTRLA_SWRST_bit(const void * const hw)78 static inline void hri_gclk_set_CTRLA_SWRST_bit(const void *const hw)
79 {
80 	GCLK_CRITICAL_SECTION_ENTER();
81 	hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_SWRST);
82 	((Gclk *)hw)->CTRLA.reg |= GCLK_CTRLA_SWRST;
83 	GCLK_CRITICAL_SECTION_LEAVE();
84 }
85 
hri_gclk_get_CTRLA_SWRST_bit(const void * const hw)86 static inline bool hri_gclk_get_CTRLA_SWRST_bit(const void *const hw)
87 {
88 	uint8_t tmp;
89 	hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_SWRST);
90 	tmp = ((Gclk *)hw)->CTRLA.reg;
91 	tmp = (tmp & GCLK_CTRLA_SWRST) >> GCLK_CTRLA_SWRST_Pos;
92 	return (bool)tmp;
93 }
94 
hri_gclk_set_CTRLA_reg(const void * const hw,hri_gclk_ctrla_reg_t mask)95 static inline void hri_gclk_set_CTRLA_reg(const void *const hw, hri_gclk_ctrla_reg_t mask)
96 {
97 	GCLK_CRITICAL_SECTION_ENTER();
98 	((Gclk *)hw)->CTRLA.reg |= mask;
99 	GCLK_CRITICAL_SECTION_LEAVE();
100 }
101 
hri_gclk_get_CTRLA_reg(const void * const hw,hri_gclk_ctrla_reg_t mask)102 static inline hri_gclk_ctrla_reg_t hri_gclk_get_CTRLA_reg(const void *const hw, hri_gclk_ctrla_reg_t mask)
103 {
104 	uint8_t tmp;
105 	tmp = ((Gclk *)hw)->CTRLA.reg;
106 	tmp &= mask;
107 	return tmp;
108 }
109 
hri_gclk_write_CTRLA_reg(const void * const hw,hri_gclk_ctrla_reg_t data)110 static inline void hri_gclk_write_CTRLA_reg(const void *const hw, hri_gclk_ctrla_reg_t data)
111 {
112 	GCLK_CRITICAL_SECTION_ENTER();
113 	((Gclk *)hw)->CTRLA.reg = data;
114 	GCLK_CRITICAL_SECTION_LEAVE();
115 }
116 
hri_gclk_clear_CTRLA_reg(const void * const hw,hri_gclk_ctrla_reg_t mask)117 static inline void hri_gclk_clear_CTRLA_reg(const void *const hw, hri_gclk_ctrla_reg_t mask)
118 {
119 	GCLK_CRITICAL_SECTION_ENTER();
120 	((Gclk *)hw)->CTRLA.reg &= ~mask;
121 	GCLK_CRITICAL_SECTION_LEAVE();
122 }
123 
hri_gclk_toggle_CTRLA_reg(const void * const hw,hri_gclk_ctrla_reg_t mask)124 static inline void hri_gclk_toggle_CTRLA_reg(const void *const hw, hri_gclk_ctrla_reg_t mask)
125 {
126 	GCLK_CRITICAL_SECTION_ENTER();
127 	((Gclk *)hw)->CTRLA.reg ^= mask;
128 	GCLK_CRITICAL_SECTION_LEAVE();
129 }
130 
hri_gclk_read_CTRLA_reg(const void * const hw)131 static inline hri_gclk_ctrla_reg_t hri_gclk_read_CTRLA_reg(const void *const hw)
132 {
133 	return ((Gclk *)hw)->CTRLA.reg;
134 }
135 
hri_gclk_set_GENCTRL_GENEN_bit(const void * const hw,uint8_t index)136 static inline void hri_gclk_set_GENCTRL_GENEN_bit(const void *const hw, uint8_t index)
137 {
138 	GCLK_CRITICAL_SECTION_ENTER();
139 	((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_GENEN;
140 	GCLK_CRITICAL_SECTION_LEAVE();
141 }
142 
hri_gclk_get_GENCTRL_GENEN_bit(const void * const hw,uint8_t index)143 static inline bool hri_gclk_get_GENCTRL_GENEN_bit(const void *const hw, uint8_t index)
144 {
145 	uint32_t tmp;
146 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
147 	tmp = (tmp & GCLK_GENCTRL_GENEN) >> GCLK_GENCTRL_GENEN_Pos;
148 	return (bool)tmp;
149 }
150 
hri_gclk_write_GENCTRL_GENEN_bit(const void * const hw,uint8_t index,bool value)151 static inline void hri_gclk_write_GENCTRL_GENEN_bit(const void *const hw, uint8_t index, bool value)
152 {
153 	uint32_t tmp;
154 	GCLK_CRITICAL_SECTION_ENTER();
155 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
156 	tmp &= ~GCLK_GENCTRL_GENEN;
157 	tmp |= value << GCLK_GENCTRL_GENEN_Pos;
158 	((Gclk *)hw)->GENCTRL[index].reg = tmp;
159 	GCLK_CRITICAL_SECTION_LEAVE();
160 }
161 
hri_gclk_clear_GENCTRL_GENEN_bit(const void * const hw,uint8_t index)162 static inline void hri_gclk_clear_GENCTRL_GENEN_bit(const void *const hw, uint8_t index)
163 {
164 	GCLK_CRITICAL_SECTION_ENTER();
165 	((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_GENEN;
166 	GCLK_CRITICAL_SECTION_LEAVE();
167 }
168 
hri_gclk_toggle_GENCTRL_GENEN_bit(const void * const hw,uint8_t index)169 static inline void hri_gclk_toggle_GENCTRL_GENEN_bit(const void *const hw, uint8_t index)
170 {
171 	GCLK_CRITICAL_SECTION_ENTER();
172 	((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_GENEN;
173 	GCLK_CRITICAL_SECTION_LEAVE();
174 }
175 
hri_gclk_set_GENCTRL_IDC_bit(const void * const hw,uint8_t index)176 static inline void hri_gclk_set_GENCTRL_IDC_bit(const void *const hw, uint8_t index)
177 {
178 	GCLK_CRITICAL_SECTION_ENTER();
179 	((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_IDC;
180 	GCLK_CRITICAL_SECTION_LEAVE();
181 }
182 
hri_gclk_get_GENCTRL_IDC_bit(const void * const hw,uint8_t index)183 static inline bool hri_gclk_get_GENCTRL_IDC_bit(const void *const hw, uint8_t index)
184 {
185 	uint32_t tmp;
186 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
187 	tmp = (tmp & GCLK_GENCTRL_IDC) >> GCLK_GENCTRL_IDC_Pos;
188 	return (bool)tmp;
189 }
190 
hri_gclk_write_GENCTRL_IDC_bit(const void * const hw,uint8_t index,bool value)191 static inline void hri_gclk_write_GENCTRL_IDC_bit(const void *const hw, uint8_t index, bool value)
192 {
193 	uint32_t tmp;
194 	GCLK_CRITICAL_SECTION_ENTER();
195 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
196 	tmp &= ~GCLK_GENCTRL_IDC;
197 	tmp |= value << GCLK_GENCTRL_IDC_Pos;
198 	((Gclk *)hw)->GENCTRL[index].reg = tmp;
199 	GCLK_CRITICAL_SECTION_LEAVE();
200 }
201 
hri_gclk_clear_GENCTRL_IDC_bit(const void * const hw,uint8_t index)202 static inline void hri_gclk_clear_GENCTRL_IDC_bit(const void *const hw, uint8_t index)
203 {
204 	GCLK_CRITICAL_SECTION_ENTER();
205 	((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_IDC;
206 	GCLK_CRITICAL_SECTION_LEAVE();
207 }
208 
hri_gclk_toggle_GENCTRL_IDC_bit(const void * const hw,uint8_t index)209 static inline void hri_gclk_toggle_GENCTRL_IDC_bit(const void *const hw, uint8_t index)
210 {
211 	GCLK_CRITICAL_SECTION_ENTER();
212 	((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_IDC;
213 	GCLK_CRITICAL_SECTION_LEAVE();
214 }
215 
hri_gclk_set_GENCTRL_OOV_bit(const void * const hw,uint8_t index)216 static inline void hri_gclk_set_GENCTRL_OOV_bit(const void *const hw, uint8_t index)
217 {
218 	GCLK_CRITICAL_SECTION_ENTER();
219 	((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_OOV;
220 	GCLK_CRITICAL_SECTION_LEAVE();
221 }
222 
hri_gclk_get_GENCTRL_OOV_bit(const void * const hw,uint8_t index)223 static inline bool hri_gclk_get_GENCTRL_OOV_bit(const void *const hw, uint8_t index)
224 {
225 	uint32_t tmp;
226 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
227 	tmp = (tmp & GCLK_GENCTRL_OOV) >> GCLK_GENCTRL_OOV_Pos;
228 	return (bool)tmp;
229 }
230 
hri_gclk_write_GENCTRL_OOV_bit(const void * const hw,uint8_t index,bool value)231 static inline void hri_gclk_write_GENCTRL_OOV_bit(const void *const hw, uint8_t index, bool value)
232 {
233 	uint32_t tmp;
234 	GCLK_CRITICAL_SECTION_ENTER();
235 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
236 	tmp &= ~GCLK_GENCTRL_OOV;
237 	tmp |= value << GCLK_GENCTRL_OOV_Pos;
238 	((Gclk *)hw)->GENCTRL[index].reg = tmp;
239 	GCLK_CRITICAL_SECTION_LEAVE();
240 }
241 
hri_gclk_clear_GENCTRL_OOV_bit(const void * const hw,uint8_t index)242 static inline void hri_gclk_clear_GENCTRL_OOV_bit(const void *const hw, uint8_t index)
243 {
244 	GCLK_CRITICAL_SECTION_ENTER();
245 	((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_OOV;
246 	GCLK_CRITICAL_SECTION_LEAVE();
247 }
248 
hri_gclk_toggle_GENCTRL_OOV_bit(const void * const hw,uint8_t index)249 static inline void hri_gclk_toggle_GENCTRL_OOV_bit(const void *const hw, uint8_t index)
250 {
251 	GCLK_CRITICAL_SECTION_ENTER();
252 	((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_OOV;
253 	GCLK_CRITICAL_SECTION_LEAVE();
254 }
255 
hri_gclk_set_GENCTRL_OE_bit(const void * const hw,uint8_t index)256 static inline void hri_gclk_set_GENCTRL_OE_bit(const void *const hw, uint8_t index)
257 {
258 	GCLK_CRITICAL_SECTION_ENTER();
259 	((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_OE;
260 	GCLK_CRITICAL_SECTION_LEAVE();
261 }
262 
hri_gclk_get_GENCTRL_OE_bit(const void * const hw,uint8_t index)263 static inline bool hri_gclk_get_GENCTRL_OE_bit(const void *const hw, uint8_t index)
264 {
265 	uint32_t tmp;
266 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
267 	tmp = (tmp & GCLK_GENCTRL_OE) >> GCLK_GENCTRL_OE_Pos;
268 	return (bool)tmp;
269 }
270 
hri_gclk_write_GENCTRL_OE_bit(const void * const hw,uint8_t index,bool value)271 static inline void hri_gclk_write_GENCTRL_OE_bit(const void *const hw, uint8_t index, bool value)
272 {
273 	uint32_t tmp;
274 	GCLK_CRITICAL_SECTION_ENTER();
275 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
276 	tmp &= ~GCLK_GENCTRL_OE;
277 	tmp |= value << GCLK_GENCTRL_OE_Pos;
278 	((Gclk *)hw)->GENCTRL[index].reg = tmp;
279 	GCLK_CRITICAL_SECTION_LEAVE();
280 }
281 
hri_gclk_clear_GENCTRL_OE_bit(const void * const hw,uint8_t index)282 static inline void hri_gclk_clear_GENCTRL_OE_bit(const void *const hw, uint8_t index)
283 {
284 	GCLK_CRITICAL_SECTION_ENTER();
285 	((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_OE;
286 	GCLK_CRITICAL_SECTION_LEAVE();
287 }
288 
hri_gclk_toggle_GENCTRL_OE_bit(const void * const hw,uint8_t index)289 static inline void hri_gclk_toggle_GENCTRL_OE_bit(const void *const hw, uint8_t index)
290 {
291 	GCLK_CRITICAL_SECTION_ENTER();
292 	((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_OE;
293 	GCLK_CRITICAL_SECTION_LEAVE();
294 }
295 
hri_gclk_set_GENCTRL_DIVSEL_bit(const void * const hw,uint8_t index)296 static inline void hri_gclk_set_GENCTRL_DIVSEL_bit(const void *const hw, uint8_t index)
297 {
298 	GCLK_CRITICAL_SECTION_ENTER();
299 	((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_DIVSEL;
300 	GCLK_CRITICAL_SECTION_LEAVE();
301 }
302 
hri_gclk_get_GENCTRL_DIVSEL_bit(const void * const hw,uint8_t index)303 static inline bool hri_gclk_get_GENCTRL_DIVSEL_bit(const void *const hw, uint8_t index)
304 {
305 	uint32_t tmp;
306 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
307 	tmp = (tmp & GCLK_GENCTRL_DIVSEL) >> GCLK_GENCTRL_DIVSEL_Pos;
308 	return (bool)tmp;
309 }
310 
hri_gclk_write_GENCTRL_DIVSEL_bit(const void * const hw,uint8_t index,bool value)311 static inline void hri_gclk_write_GENCTRL_DIVSEL_bit(const void *const hw, uint8_t index, bool value)
312 {
313 	uint32_t tmp;
314 	GCLK_CRITICAL_SECTION_ENTER();
315 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
316 	tmp &= ~GCLK_GENCTRL_DIVSEL;
317 	tmp |= value << GCLK_GENCTRL_DIVSEL_Pos;
318 	((Gclk *)hw)->GENCTRL[index].reg = tmp;
319 	GCLK_CRITICAL_SECTION_LEAVE();
320 }
321 
hri_gclk_clear_GENCTRL_DIVSEL_bit(const void * const hw,uint8_t index)322 static inline void hri_gclk_clear_GENCTRL_DIVSEL_bit(const void *const hw, uint8_t index)
323 {
324 	GCLK_CRITICAL_SECTION_ENTER();
325 	((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_DIVSEL;
326 	GCLK_CRITICAL_SECTION_LEAVE();
327 }
328 
hri_gclk_toggle_GENCTRL_DIVSEL_bit(const void * const hw,uint8_t index)329 static inline void hri_gclk_toggle_GENCTRL_DIVSEL_bit(const void *const hw, uint8_t index)
330 {
331 	GCLK_CRITICAL_SECTION_ENTER();
332 	((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_DIVSEL;
333 	GCLK_CRITICAL_SECTION_LEAVE();
334 }
335 
hri_gclk_set_GENCTRL_RUNSTDBY_bit(const void * const hw,uint8_t index)336 static inline void hri_gclk_set_GENCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
337 {
338 	GCLK_CRITICAL_SECTION_ENTER();
339 	((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_RUNSTDBY;
340 	GCLK_CRITICAL_SECTION_LEAVE();
341 }
342 
hri_gclk_get_GENCTRL_RUNSTDBY_bit(const void * const hw,uint8_t index)343 static inline bool hri_gclk_get_GENCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
344 {
345 	uint32_t tmp;
346 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
347 	tmp = (tmp & GCLK_GENCTRL_RUNSTDBY) >> GCLK_GENCTRL_RUNSTDBY_Pos;
348 	return (bool)tmp;
349 }
350 
hri_gclk_write_GENCTRL_RUNSTDBY_bit(const void * const hw,uint8_t index,bool value)351 static inline void hri_gclk_write_GENCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index, bool value)
352 {
353 	uint32_t tmp;
354 	GCLK_CRITICAL_SECTION_ENTER();
355 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
356 	tmp &= ~GCLK_GENCTRL_RUNSTDBY;
357 	tmp |= value << GCLK_GENCTRL_RUNSTDBY_Pos;
358 	((Gclk *)hw)->GENCTRL[index].reg = tmp;
359 	GCLK_CRITICAL_SECTION_LEAVE();
360 }
361 
hri_gclk_clear_GENCTRL_RUNSTDBY_bit(const void * const hw,uint8_t index)362 static inline void hri_gclk_clear_GENCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
363 {
364 	GCLK_CRITICAL_SECTION_ENTER();
365 	((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_RUNSTDBY;
366 	GCLK_CRITICAL_SECTION_LEAVE();
367 }
368 
hri_gclk_toggle_GENCTRL_RUNSTDBY_bit(const void * const hw,uint8_t index)369 static inline void hri_gclk_toggle_GENCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
370 {
371 	GCLK_CRITICAL_SECTION_ENTER();
372 	((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_RUNSTDBY;
373 	GCLK_CRITICAL_SECTION_LEAVE();
374 }
375 
hri_gclk_set_GENCTRL_SRC_bf(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)376 static inline void hri_gclk_set_GENCTRL_SRC_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
377 {
378 	GCLK_CRITICAL_SECTION_ENTER();
379 	((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_SRC(mask);
380 	GCLK_CRITICAL_SECTION_LEAVE();
381 }
382 
hri_gclk_get_GENCTRL_SRC_bf(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)383 static inline hri_gclk_genctrl_reg_t hri_gclk_get_GENCTRL_SRC_bf(const void *const hw, uint8_t index,
384                                                                  hri_gclk_genctrl_reg_t mask)
385 {
386 	uint32_t tmp;
387 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
388 	tmp = (tmp & GCLK_GENCTRL_SRC(mask)) >> GCLK_GENCTRL_SRC_Pos;
389 	return tmp;
390 }
391 
hri_gclk_write_GENCTRL_SRC_bf(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t data)392 static inline void hri_gclk_write_GENCTRL_SRC_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t data)
393 {
394 	uint32_t tmp;
395 	GCLK_CRITICAL_SECTION_ENTER();
396 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
397 	tmp &= ~GCLK_GENCTRL_SRC_Msk;
398 	tmp |= GCLK_GENCTRL_SRC(data);
399 	((Gclk *)hw)->GENCTRL[index].reg = tmp;
400 	GCLK_CRITICAL_SECTION_LEAVE();
401 }
402 
hri_gclk_clear_GENCTRL_SRC_bf(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)403 static inline void hri_gclk_clear_GENCTRL_SRC_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
404 {
405 	GCLK_CRITICAL_SECTION_ENTER();
406 	((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_SRC(mask);
407 	GCLK_CRITICAL_SECTION_LEAVE();
408 }
409 
hri_gclk_toggle_GENCTRL_SRC_bf(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)410 static inline void hri_gclk_toggle_GENCTRL_SRC_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
411 {
412 	GCLK_CRITICAL_SECTION_ENTER();
413 	((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_SRC(mask);
414 	GCLK_CRITICAL_SECTION_LEAVE();
415 }
416 
hri_gclk_read_GENCTRL_SRC_bf(const void * const hw,uint8_t index)417 static inline hri_gclk_genctrl_reg_t hri_gclk_read_GENCTRL_SRC_bf(const void *const hw, uint8_t index)
418 {
419 	uint32_t tmp;
420 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
421 	tmp = (tmp & GCLK_GENCTRL_SRC_Msk) >> GCLK_GENCTRL_SRC_Pos;
422 	return tmp;
423 }
424 
hri_gclk_set_GENCTRL_DIV_bf(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)425 static inline void hri_gclk_set_GENCTRL_DIV_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
426 {
427 	GCLK_CRITICAL_SECTION_ENTER();
428 	((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_DIV(mask);
429 	GCLK_CRITICAL_SECTION_LEAVE();
430 }
431 
hri_gclk_get_GENCTRL_DIV_bf(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)432 static inline hri_gclk_genctrl_reg_t hri_gclk_get_GENCTRL_DIV_bf(const void *const hw, uint8_t index,
433                                                                  hri_gclk_genctrl_reg_t mask)
434 {
435 	uint32_t tmp;
436 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
437 	tmp = (tmp & GCLK_GENCTRL_DIV(mask)) >> GCLK_GENCTRL_DIV_Pos;
438 	return tmp;
439 }
440 
hri_gclk_write_GENCTRL_DIV_bf(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t data)441 static inline void hri_gclk_write_GENCTRL_DIV_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t data)
442 {
443 	uint32_t tmp;
444 	GCLK_CRITICAL_SECTION_ENTER();
445 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
446 	tmp &= ~GCLK_GENCTRL_DIV_Msk;
447 	tmp |= GCLK_GENCTRL_DIV(data);
448 	((Gclk *)hw)->GENCTRL[index].reg = tmp;
449 	GCLK_CRITICAL_SECTION_LEAVE();
450 }
451 
hri_gclk_clear_GENCTRL_DIV_bf(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)452 static inline void hri_gclk_clear_GENCTRL_DIV_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
453 {
454 	GCLK_CRITICAL_SECTION_ENTER();
455 	((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_DIV(mask);
456 	GCLK_CRITICAL_SECTION_LEAVE();
457 }
458 
hri_gclk_toggle_GENCTRL_DIV_bf(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)459 static inline void hri_gclk_toggle_GENCTRL_DIV_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
460 {
461 	GCLK_CRITICAL_SECTION_ENTER();
462 	((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_DIV(mask);
463 	GCLK_CRITICAL_SECTION_LEAVE();
464 }
465 
hri_gclk_read_GENCTRL_DIV_bf(const void * const hw,uint8_t index)466 static inline hri_gclk_genctrl_reg_t hri_gclk_read_GENCTRL_DIV_bf(const void *const hw, uint8_t index)
467 {
468 	uint32_t tmp;
469 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
470 	tmp = (tmp & GCLK_GENCTRL_DIV_Msk) >> GCLK_GENCTRL_DIV_Pos;
471 	return tmp;
472 }
473 
hri_gclk_set_GENCTRL_reg(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)474 static inline void hri_gclk_set_GENCTRL_reg(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
475 {
476 	GCLK_CRITICAL_SECTION_ENTER();
477 	((Gclk *)hw)->GENCTRL[index].reg |= mask;
478 	GCLK_CRITICAL_SECTION_LEAVE();
479 }
480 
hri_gclk_get_GENCTRL_reg(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)481 static inline hri_gclk_genctrl_reg_t hri_gclk_get_GENCTRL_reg(const void *const hw, uint8_t index,
482                                                               hri_gclk_genctrl_reg_t mask)
483 {
484 	uint32_t tmp;
485 	tmp = ((Gclk *)hw)->GENCTRL[index].reg;
486 	tmp &= mask;
487 	return tmp;
488 }
489 
hri_gclk_write_GENCTRL_reg(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t data)490 static inline void hri_gclk_write_GENCTRL_reg(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t data)
491 {
492 	GCLK_CRITICAL_SECTION_ENTER();
493 	((Gclk *)hw)->GENCTRL[index].reg = data;
494 	GCLK_CRITICAL_SECTION_LEAVE();
495 }
496 
hri_gclk_clear_GENCTRL_reg(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)497 static inline void hri_gclk_clear_GENCTRL_reg(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
498 {
499 	GCLK_CRITICAL_SECTION_ENTER();
500 	((Gclk *)hw)->GENCTRL[index].reg &= ~mask;
501 	GCLK_CRITICAL_SECTION_LEAVE();
502 }
503 
hri_gclk_toggle_GENCTRL_reg(const void * const hw,uint8_t index,hri_gclk_genctrl_reg_t mask)504 static inline void hri_gclk_toggle_GENCTRL_reg(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
505 {
506 	GCLK_CRITICAL_SECTION_ENTER();
507 	((Gclk *)hw)->GENCTRL[index].reg ^= mask;
508 	GCLK_CRITICAL_SECTION_LEAVE();
509 }
510 
hri_gclk_read_GENCTRL_reg(const void * const hw,uint8_t index)511 static inline hri_gclk_genctrl_reg_t hri_gclk_read_GENCTRL_reg(const void *const hw, uint8_t index)
512 {
513 	return ((Gclk *)hw)->GENCTRL[index].reg;
514 }
515 
hri_gclk_set_PCHCTRL_CHEN_bit(const void * const hw,uint8_t index)516 static inline void hri_gclk_set_PCHCTRL_CHEN_bit(const void *const hw, uint8_t index)
517 {
518 	GCLK_CRITICAL_SECTION_ENTER();
519 	((Gclk *)hw)->PCHCTRL[index].reg |= GCLK_PCHCTRL_CHEN;
520 	GCLK_CRITICAL_SECTION_LEAVE();
521 }
522 
hri_gclk_get_PCHCTRL_CHEN_bit(const void * const hw,uint8_t index)523 static inline bool hri_gclk_get_PCHCTRL_CHEN_bit(const void *const hw, uint8_t index)
524 {
525 	uint32_t tmp;
526 	tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
527 	tmp = (tmp & GCLK_PCHCTRL_CHEN) >> GCLK_PCHCTRL_CHEN_Pos;
528 	return (bool)tmp;
529 }
530 
hri_gclk_write_PCHCTRL_CHEN_bit(const void * const hw,uint8_t index,bool value)531 static inline void hri_gclk_write_PCHCTRL_CHEN_bit(const void *const hw, uint8_t index, bool value)
532 {
533 	uint32_t tmp;
534 	GCLK_CRITICAL_SECTION_ENTER();
535 	tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
536 	tmp &= ~GCLK_PCHCTRL_CHEN;
537 	tmp |= value << GCLK_PCHCTRL_CHEN_Pos;
538 	((Gclk *)hw)->PCHCTRL[index].reg = tmp;
539 	GCLK_CRITICAL_SECTION_LEAVE();
540 }
541 
hri_gclk_clear_PCHCTRL_CHEN_bit(const void * const hw,uint8_t index)542 static inline void hri_gclk_clear_PCHCTRL_CHEN_bit(const void *const hw, uint8_t index)
543 {
544 	GCLK_CRITICAL_SECTION_ENTER();
545 	((Gclk *)hw)->PCHCTRL[index].reg &= ~GCLK_PCHCTRL_CHEN;
546 	GCLK_CRITICAL_SECTION_LEAVE();
547 }
548 
hri_gclk_toggle_PCHCTRL_CHEN_bit(const void * const hw,uint8_t index)549 static inline void hri_gclk_toggle_PCHCTRL_CHEN_bit(const void *const hw, uint8_t index)
550 {
551 	GCLK_CRITICAL_SECTION_ENTER();
552 	((Gclk *)hw)->PCHCTRL[index].reg ^= GCLK_PCHCTRL_CHEN;
553 	GCLK_CRITICAL_SECTION_LEAVE();
554 }
555 
hri_gclk_set_PCHCTRL_WRTLOCK_bit(const void * const hw,uint8_t index)556 static inline void hri_gclk_set_PCHCTRL_WRTLOCK_bit(const void *const hw, uint8_t index)
557 {
558 	GCLK_CRITICAL_SECTION_ENTER();
559 	((Gclk *)hw)->PCHCTRL[index].reg |= GCLK_PCHCTRL_WRTLOCK;
560 	GCLK_CRITICAL_SECTION_LEAVE();
561 }
562 
hri_gclk_get_PCHCTRL_WRTLOCK_bit(const void * const hw,uint8_t index)563 static inline bool hri_gclk_get_PCHCTRL_WRTLOCK_bit(const void *const hw, uint8_t index)
564 {
565 	uint32_t tmp;
566 	tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
567 	tmp = (tmp & GCLK_PCHCTRL_WRTLOCK) >> GCLK_PCHCTRL_WRTLOCK_Pos;
568 	return (bool)tmp;
569 }
570 
hri_gclk_write_PCHCTRL_WRTLOCK_bit(const void * const hw,uint8_t index,bool value)571 static inline void hri_gclk_write_PCHCTRL_WRTLOCK_bit(const void *const hw, uint8_t index, bool value)
572 {
573 	uint32_t tmp;
574 	GCLK_CRITICAL_SECTION_ENTER();
575 	tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
576 	tmp &= ~GCLK_PCHCTRL_WRTLOCK;
577 	tmp |= value << GCLK_PCHCTRL_WRTLOCK_Pos;
578 	((Gclk *)hw)->PCHCTRL[index].reg = tmp;
579 	GCLK_CRITICAL_SECTION_LEAVE();
580 }
581 
hri_gclk_clear_PCHCTRL_WRTLOCK_bit(const void * const hw,uint8_t index)582 static inline void hri_gclk_clear_PCHCTRL_WRTLOCK_bit(const void *const hw, uint8_t index)
583 {
584 	GCLK_CRITICAL_SECTION_ENTER();
585 	((Gclk *)hw)->PCHCTRL[index].reg &= ~GCLK_PCHCTRL_WRTLOCK;
586 	GCLK_CRITICAL_SECTION_LEAVE();
587 }
588 
hri_gclk_toggle_PCHCTRL_WRTLOCK_bit(const void * const hw,uint8_t index)589 static inline void hri_gclk_toggle_PCHCTRL_WRTLOCK_bit(const void *const hw, uint8_t index)
590 {
591 	GCLK_CRITICAL_SECTION_ENTER();
592 	((Gclk *)hw)->PCHCTRL[index].reg ^= GCLK_PCHCTRL_WRTLOCK;
593 	GCLK_CRITICAL_SECTION_LEAVE();
594 }
595 
hri_gclk_set_PCHCTRL_GEN_bf(const void * const hw,uint8_t index,hri_gclk_pchctrl_reg_t mask)596 static inline void hri_gclk_set_PCHCTRL_GEN_bf(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
597 {
598 	GCLK_CRITICAL_SECTION_ENTER();
599 	((Gclk *)hw)->PCHCTRL[index].reg |= GCLK_PCHCTRL_GEN(mask);
600 	GCLK_CRITICAL_SECTION_LEAVE();
601 }
602 
hri_gclk_get_PCHCTRL_GEN_bf(const void * const hw,uint8_t index,hri_gclk_pchctrl_reg_t mask)603 static inline hri_gclk_pchctrl_reg_t hri_gclk_get_PCHCTRL_GEN_bf(const void *const hw, uint8_t index,
604                                                                  hri_gclk_pchctrl_reg_t mask)
605 {
606 	uint32_t tmp;
607 	tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
608 	tmp = (tmp & GCLK_PCHCTRL_GEN(mask)) >> GCLK_PCHCTRL_GEN_Pos;
609 	return tmp;
610 }
611 
hri_gclk_write_PCHCTRL_GEN_bf(const void * const hw,uint8_t index,hri_gclk_pchctrl_reg_t data)612 static inline void hri_gclk_write_PCHCTRL_GEN_bf(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t data)
613 {
614 	uint32_t tmp;
615 	GCLK_CRITICAL_SECTION_ENTER();
616 	tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
617 	tmp &= ~GCLK_PCHCTRL_GEN_Msk;
618 	tmp |= GCLK_PCHCTRL_GEN(data);
619 	((Gclk *)hw)->PCHCTRL[index].reg = tmp;
620 	GCLK_CRITICAL_SECTION_LEAVE();
621 }
622 
hri_gclk_clear_PCHCTRL_GEN_bf(const void * const hw,uint8_t index,hri_gclk_pchctrl_reg_t mask)623 static inline void hri_gclk_clear_PCHCTRL_GEN_bf(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
624 {
625 	GCLK_CRITICAL_SECTION_ENTER();
626 	((Gclk *)hw)->PCHCTRL[index].reg &= ~GCLK_PCHCTRL_GEN(mask);
627 	GCLK_CRITICAL_SECTION_LEAVE();
628 }
629 
hri_gclk_toggle_PCHCTRL_GEN_bf(const void * const hw,uint8_t index,hri_gclk_pchctrl_reg_t mask)630 static inline void hri_gclk_toggle_PCHCTRL_GEN_bf(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
631 {
632 	GCLK_CRITICAL_SECTION_ENTER();
633 	((Gclk *)hw)->PCHCTRL[index].reg ^= GCLK_PCHCTRL_GEN(mask);
634 	GCLK_CRITICAL_SECTION_LEAVE();
635 }
636 
hri_gclk_read_PCHCTRL_GEN_bf(const void * const hw,uint8_t index)637 static inline hri_gclk_pchctrl_reg_t hri_gclk_read_PCHCTRL_GEN_bf(const void *const hw, uint8_t index)
638 {
639 	uint32_t tmp;
640 	tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
641 	tmp = (tmp & GCLK_PCHCTRL_GEN_Msk) >> GCLK_PCHCTRL_GEN_Pos;
642 	return tmp;
643 }
644 
hri_gclk_set_PCHCTRL_reg(const void * const hw,uint8_t index,hri_gclk_pchctrl_reg_t mask)645 static inline void hri_gclk_set_PCHCTRL_reg(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
646 {
647 	GCLK_CRITICAL_SECTION_ENTER();
648 	((Gclk *)hw)->PCHCTRL[index].reg |= mask;
649 	GCLK_CRITICAL_SECTION_LEAVE();
650 }
651 
hri_gclk_get_PCHCTRL_reg(const void * const hw,uint8_t index,hri_gclk_pchctrl_reg_t mask)652 static inline hri_gclk_pchctrl_reg_t hri_gclk_get_PCHCTRL_reg(const void *const hw, uint8_t index,
653                                                               hri_gclk_pchctrl_reg_t mask)
654 {
655 	uint32_t tmp;
656 	tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
657 	tmp &= mask;
658 	return tmp;
659 }
660 
hri_gclk_write_PCHCTRL_reg(const void * const hw,uint8_t index,hri_gclk_pchctrl_reg_t data)661 static inline void hri_gclk_write_PCHCTRL_reg(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t data)
662 {
663 	GCLK_CRITICAL_SECTION_ENTER();
664 	((Gclk *)hw)->PCHCTRL[index].reg = data;
665 	GCLK_CRITICAL_SECTION_LEAVE();
666 }
667 
hri_gclk_clear_PCHCTRL_reg(const void * const hw,uint8_t index,hri_gclk_pchctrl_reg_t mask)668 static inline void hri_gclk_clear_PCHCTRL_reg(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
669 {
670 	GCLK_CRITICAL_SECTION_ENTER();
671 	((Gclk *)hw)->PCHCTRL[index].reg &= ~mask;
672 	GCLK_CRITICAL_SECTION_LEAVE();
673 }
674 
hri_gclk_toggle_PCHCTRL_reg(const void * const hw,uint8_t index,hri_gclk_pchctrl_reg_t mask)675 static inline void hri_gclk_toggle_PCHCTRL_reg(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
676 {
677 	GCLK_CRITICAL_SECTION_ENTER();
678 	((Gclk *)hw)->PCHCTRL[index].reg ^= mask;
679 	GCLK_CRITICAL_SECTION_LEAVE();
680 }
681 
hri_gclk_read_PCHCTRL_reg(const void * const hw,uint8_t index)682 static inline hri_gclk_pchctrl_reg_t hri_gclk_read_PCHCTRL_reg(const void *const hw, uint8_t index)
683 {
684 	return ((Gclk *)hw)->PCHCTRL[index].reg;
685 }
686 
hri_gclk_get_SYNCBUSY_SWRST_bit(const void * const hw)687 static inline bool hri_gclk_get_SYNCBUSY_SWRST_bit(const void *const hw)
688 {
689 	return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_SWRST) >> GCLK_SYNCBUSY_SWRST_Pos;
690 }
691 
hri_gclk_get_SYNCBUSY_GENCTRL0_bit(const void * const hw)692 static inline bool hri_gclk_get_SYNCBUSY_GENCTRL0_bit(const void *const hw)
693 {
694 	return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL0) >> GCLK_SYNCBUSY_GENCTRL0_Pos;
695 }
696 
hri_gclk_get_SYNCBUSY_GENCTRL1_bit(const void * const hw)697 static inline bool hri_gclk_get_SYNCBUSY_GENCTRL1_bit(const void *const hw)
698 {
699 	return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL1) >> GCLK_SYNCBUSY_GENCTRL1_Pos;
700 }
701 
hri_gclk_get_SYNCBUSY_GENCTRL2_bit(const void * const hw)702 static inline bool hri_gclk_get_SYNCBUSY_GENCTRL2_bit(const void *const hw)
703 {
704 	return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL2) >> GCLK_SYNCBUSY_GENCTRL2_Pos;
705 }
706 
hri_gclk_get_SYNCBUSY_GENCTRL3_bit(const void * const hw)707 static inline bool hri_gclk_get_SYNCBUSY_GENCTRL3_bit(const void *const hw)
708 {
709 	return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL3) >> GCLK_SYNCBUSY_GENCTRL3_Pos;
710 }
711 
hri_gclk_get_SYNCBUSY_GENCTRL4_bit(const void * const hw)712 static inline bool hri_gclk_get_SYNCBUSY_GENCTRL4_bit(const void *const hw)
713 {
714 	return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL4) >> GCLK_SYNCBUSY_GENCTRL4_Pos;
715 }
716 
hri_gclk_get_SYNCBUSY_GENCTRL5_bit(const void * const hw)717 static inline bool hri_gclk_get_SYNCBUSY_GENCTRL5_bit(const void *const hw)
718 {
719 	return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL5) >> GCLK_SYNCBUSY_GENCTRL5_Pos;
720 }
721 
hri_gclk_get_SYNCBUSY_GENCTRL6_bit(const void * const hw)722 static inline bool hri_gclk_get_SYNCBUSY_GENCTRL6_bit(const void *const hw)
723 {
724 	return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL6) >> GCLK_SYNCBUSY_GENCTRL6_Pos;
725 }
726 
hri_gclk_get_SYNCBUSY_GENCTRL7_bit(const void * const hw)727 static inline bool hri_gclk_get_SYNCBUSY_GENCTRL7_bit(const void *const hw)
728 {
729 	return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL7) >> GCLK_SYNCBUSY_GENCTRL7_Pos;
730 }
731 
hri_gclk_get_SYNCBUSY_GENCTRL8_bit(const void * const hw)732 static inline bool hri_gclk_get_SYNCBUSY_GENCTRL8_bit(const void *const hw)
733 {
734 	return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL8) >> GCLK_SYNCBUSY_GENCTRL8_Pos;
735 }
736 
hri_gclk_get_SYNCBUSY_reg(const void * const hw,hri_gclk_syncbusy_reg_t mask)737 static inline hri_gclk_syncbusy_reg_t hri_gclk_get_SYNCBUSY_reg(const void *const hw, hri_gclk_syncbusy_reg_t mask)
738 {
739 	uint32_t tmp;
740 	tmp = ((Gclk *)hw)->SYNCBUSY.reg;
741 	tmp &= mask;
742 	return tmp;
743 }
744 
hri_gclk_read_SYNCBUSY_reg(const void * const hw)745 static inline hri_gclk_syncbusy_reg_t hri_gclk_read_SYNCBUSY_reg(const void *const hw)
746 {
747 	return ((Gclk *)hw)->SYNCBUSY.reg;
748 }
749 
750 #ifdef __cplusplus
751 }
752 #endif
753 
754 #endif /* _HRI_GCLK_L21_H_INCLUDED */
755 #endif /* _SAML21_GCLK_COMPONENT_ */
756