1 /**
2 * \file
3 *
4 * \brief SAM DSU
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_DSU_COMPONENT_
44 #ifndef _HRI_DSU_L21_H_INCLUDED_
45 #define _HRI_DSU_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_DSU_CRITICAL_SECTIONS)
55 #define DSU_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
56 #define DSU_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
57 #else
58 #define DSU_CRITICAL_SECTION_ENTER()
59 #define DSU_CRITICAL_SECTION_LEAVE()
60 #endif
61
62 typedef uint32_t hri_dsu_addr_reg_t;
63 typedef uint32_t hri_dsu_cid0_reg_t;
64 typedef uint32_t hri_dsu_cid1_reg_t;
65 typedef uint32_t hri_dsu_cid2_reg_t;
66 typedef uint32_t hri_dsu_cid3_reg_t;
67 typedef uint32_t hri_dsu_data_reg_t;
68 typedef uint32_t hri_dsu_dcc_reg_t;
69 typedef uint32_t hri_dsu_dcfg_reg_t;
70 typedef uint32_t hri_dsu_did_reg_t;
71 typedef uint32_t hri_dsu_end_reg_t;
72 typedef uint32_t hri_dsu_entry_reg_t;
73 typedef uint32_t hri_dsu_length_reg_t;
74 typedef uint32_t hri_dsu_memtype_reg_t;
75 typedef uint32_t hri_dsu_pid0_reg_t;
76 typedef uint32_t hri_dsu_pid1_reg_t;
77 typedef uint32_t hri_dsu_pid2_reg_t;
78 typedef uint32_t hri_dsu_pid3_reg_t;
79 typedef uint32_t hri_dsu_pid4_reg_t;
80 typedef uint32_t hri_dsu_pid5_reg_t;
81 typedef uint32_t hri_dsu_pid6_reg_t;
82 typedef uint32_t hri_dsu_pid7_reg_t;
83 typedef uint8_t hri_dsu_ctrl_reg_t;
84 typedef uint8_t hri_dsu_statusa_reg_t;
85 typedef uint8_t hri_dsu_statusb_reg_t;
86
hri_dsu_write_CTRL_reg(const void * const hw,hri_dsu_ctrl_reg_t data)87 static inline void hri_dsu_write_CTRL_reg(const void *const hw, hri_dsu_ctrl_reg_t data)
88 {
89 DSU_CRITICAL_SECTION_ENTER();
90 ((Dsu *)hw)->CTRL.reg = data;
91 DSU_CRITICAL_SECTION_LEAVE();
92 }
93
hri_dsu_set_ADDR_AMOD_bf(const void * const hw,hri_dsu_addr_reg_t mask)94 static inline void hri_dsu_set_ADDR_AMOD_bf(const void *const hw, hri_dsu_addr_reg_t mask)
95 {
96 DSU_CRITICAL_SECTION_ENTER();
97 ((Dsu *)hw)->ADDR.reg |= DSU_ADDR_AMOD(mask);
98 DSU_CRITICAL_SECTION_LEAVE();
99 }
100
hri_dsu_get_ADDR_AMOD_bf(const void * const hw,hri_dsu_addr_reg_t mask)101 static inline hri_dsu_addr_reg_t hri_dsu_get_ADDR_AMOD_bf(const void *const hw, hri_dsu_addr_reg_t mask)
102 {
103 uint32_t tmp;
104 tmp = ((Dsu *)hw)->ADDR.reg;
105 tmp = (tmp & DSU_ADDR_AMOD(mask)) >> DSU_ADDR_AMOD_Pos;
106 return tmp;
107 }
108
hri_dsu_write_ADDR_AMOD_bf(const void * const hw,hri_dsu_addr_reg_t data)109 static inline void hri_dsu_write_ADDR_AMOD_bf(const void *const hw, hri_dsu_addr_reg_t data)
110 {
111 uint32_t tmp;
112 DSU_CRITICAL_SECTION_ENTER();
113 tmp = ((Dsu *)hw)->ADDR.reg;
114 tmp &= ~DSU_ADDR_AMOD_Msk;
115 tmp |= DSU_ADDR_AMOD(data);
116 ((Dsu *)hw)->ADDR.reg = tmp;
117 DSU_CRITICAL_SECTION_LEAVE();
118 }
119
hri_dsu_clear_ADDR_AMOD_bf(const void * const hw,hri_dsu_addr_reg_t mask)120 static inline void hri_dsu_clear_ADDR_AMOD_bf(const void *const hw, hri_dsu_addr_reg_t mask)
121 {
122 DSU_CRITICAL_SECTION_ENTER();
123 ((Dsu *)hw)->ADDR.reg &= ~DSU_ADDR_AMOD(mask);
124 DSU_CRITICAL_SECTION_LEAVE();
125 }
126
hri_dsu_toggle_ADDR_AMOD_bf(const void * const hw,hri_dsu_addr_reg_t mask)127 static inline void hri_dsu_toggle_ADDR_AMOD_bf(const void *const hw, hri_dsu_addr_reg_t mask)
128 {
129 DSU_CRITICAL_SECTION_ENTER();
130 ((Dsu *)hw)->ADDR.reg ^= DSU_ADDR_AMOD(mask);
131 DSU_CRITICAL_SECTION_LEAVE();
132 }
133
hri_dsu_read_ADDR_AMOD_bf(const void * const hw)134 static inline hri_dsu_addr_reg_t hri_dsu_read_ADDR_AMOD_bf(const void *const hw)
135 {
136 uint32_t tmp;
137 tmp = ((Dsu *)hw)->ADDR.reg;
138 tmp = (tmp & DSU_ADDR_AMOD_Msk) >> DSU_ADDR_AMOD_Pos;
139 return tmp;
140 }
141
hri_dsu_set_ADDR_ADDR_bf(const void * const hw,hri_dsu_addr_reg_t mask)142 static inline void hri_dsu_set_ADDR_ADDR_bf(const void *const hw, hri_dsu_addr_reg_t mask)
143 {
144 DSU_CRITICAL_SECTION_ENTER();
145 ((Dsu *)hw)->ADDR.reg |= DSU_ADDR_ADDR(mask);
146 DSU_CRITICAL_SECTION_LEAVE();
147 }
148
hri_dsu_get_ADDR_ADDR_bf(const void * const hw,hri_dsu_addr_reg_t mask)149 static inline hri_dsu_addr_reg_t hri_dsu_get_ADDR_ADDR_bf(const void *const hw, hri_dsu_addr_reg_t mask)
150 {
151 uint32_t tmp;
152 tmp = ((Dsu *)hw)->ADDR.reg;
153 tmp = (tmp & DSU_ADDR_ADDR(mask)) >> DSU_ADDR_ADDR_Pos;
154 return tmp;
155 }
156
hri_dsu_write_ADDR_ADDR_bf(const void * const hw,hri_dsu_addr_reg_t data)157 static inline void hri_dsu_write_ADDR_ADDR_bf(const void *const hw, hri_dsu_addr_reg_t data)
158 {
159 uint32_t tmp;
160 DSU_CRITICAL_SECTION_ENTER();
161 tmp = ((Dsu *)hw)->ADDR.reg;
162 tmp &= ~DSU_ADDR_ADDR_Msk;
163 tmp |= DSU_ADDR_ADDR(data);
164 ((Dsu *)hw)->ADDR.reg = tmp;
165 DSU_CRITICAL_SECTION_LEAVE();
166 }
167
hri_dsu_clear_ADDR_ADDR_bf(const void * const hw,hri_dsu_addr_reg_t mask)168 static inline void hri_dsu_clear_ADDR_ADDR_bf(const void *const hw, hri_dsu_addr_reg_t mask)
169 {
170 DSU_CRITICAL_SECTION_ENTER();
171 ((Dsu *)hw)->ADDR.reg &= ~DSU_ADDR_ADDR(mask);
172 DSU_CRITICAL_SECTION_LEAVE();
173 }
174
hri_dsu_toggle_ADDR_ADDR_bf(const void * const hw,hri_dsu_addr_reg_t mask)175 static inline void hri_dsu_toggle_ADDR_ADDR_bf(const void *const hw, hri_dsu_addr_reg_t mask)
176 {
177 DSU_CRITICAL_SECTION_ENTER();
178 ((Dsu *)hw)->ADDR.reg ^= DSU_ADDR_ADDR(mask);
179 DSU_CRITICAL_SECTION_LEAVE();
180 }
181
hri_dsu_read_ADDR_ADDR_bf(const void * const hw)182 static inline hri_dsu_addr_reg_t hri_dsu_read_ADDR_ADDR_bf(const void *const hw)
183 {
184 uint32_t tmp;
185 tmp = ((Dsu *)hw)->ADDR.reg;
186 tmp = (tmp & DSU_ADDR_ADDR_Msk) >> DSU_ADDR_ADDR_Pos;
187 return tmp;
188 }
189
hri_dsu_set_ADDR_reg(const void * const hw,hri_dsu_addr_reg_t mask)190 static inline void hri_dsu_set_ADDR_reg(const void *const hw, hri_dsu_addr_reg_t mask)
191 {
192 DSU_CRITICAL_SECTION_ENTER();
193 ((Dsu *)hw)->ADDR.reg |= mask;
194 DSU_CRITICAL_SECTION_LEAVE();
195 }
196
hri_dsu_get_ADDR_reg(const void * const hw,hri_dsu_addr_reg_t mask)197 static inline hri_dsu_addr_reg_t hri_dsu_get_ADDR_reg(const void *const hw, hri_dsu_addr_reg_t mask)
198 {
199 uint32_t tmp;
200 tmp = ((Dsu *)hw)->ADDR.reg;
201 tmp &= mask;
202 return tmp;
203 }
204
hri_dsu_write_ADDR_reg(const void * const hw,hri_dsu_addr_reg_t data)205 static inline void hri_dsu_write_ADDR_reg(const void *const hw, hri_dsu_addr_reg_t data)
206 {
207 DSU_CRITICAL_SECTION_ENTER();
208 ((Dsu *)hw)->ADDR.reg = data;
209 DSU_CRITICAL_SECTION_LEAVE();
210 }
211
hri_dsu_clear_ADDR_reg(const void * const hw,hri_dsu_addr_reg_t mask)212 static inline void hri_dsu_clear_ADDR_reg(const void *const hw, hri_dsu_addr_reg_t mask)
213 {
214 DSU_CRITICAL_SECTION_ENTER();
215 ((Dsu *)hw)->ADDR.reg &= ~mask;
216 DSU_CRITICAL_SECTION_LEAVE();
217 }
218
hri_dsu_toggle_ADDR_reg(const void * const hw,hri_dsu_addr_reg_t mask)219 static inline void hri_dsu_toggle_ADDR_reg(const void *const hw, hri_dsu_addr_reg_t mask)
220 {
221 DSU_CRITICAL_SECTION_ENTER();
222 ((Dsu *)hw)->ADDR.reg ^= mask;
223 DSU_CRITICAL_SECTION_LEAVE();
224 }
225
hri_dsu_read_ADDR_reg(const void * const hw)226 static inline hri_dsu_addr_reg_t hri_dsu_read_ADDR_reg(const void *const hw)
227 {
228 return ((Dsu *)hw)->ADDR.reg;
229 }
230
hri_dsu_set_LENGTH_LENGTH_bf(const void * const hw,hri_dsu_length_reg_t mask)231 static inline void hri_dsu_set_LENGTH_LENGTH_bf(const void *const hw, hri_dsu_length_reg_t mask)
232 {
233 DSU_CRITICAL_SECTION_ENTER();
234 ((Dsu *)hw)->LENGTH.reg |= DSU_LENGTH_LENGTH(mask);
235 DSU_CRITICAL_SECTION_LEAVE();
236 }
237
hri_dsu_get_LENGTH_LENGTH_bf(const void * const hw,hri_dsu_length_reg_t mask)238 static inline hri_dsu_length_reg_t hri_dsu_get_LENGTH_LENGTH_bf(const void *const hw, hri_dsu_length_reg_t mask)
239 {
240 uint32_t tmp;
241 tmp = ((Dsu *)hw)->LENGTH.reg;
242 tmp = (tmp & DSU_LENGTH_LENGTH(mask)) >> DSU_LENGTH_LENGTH_Pos;
243 return tmp;
244 }
245
hri_dsu_write_LENGTH_LENGTH_bf(const void * const hw,hri_dsu_length_reg_t data)246 static inline void hri_dsu_write_LENGTH_LENGTH_bf(const void *const hw, hri_dsu_length_reg_t data)
247 {
248 uint32_t tmp;
249 DSU_CRITICAL_SECTION_ENTER();
250 tmp = ((Dsu *)hw)->LENGTH.reg;
251 tmp &= ~DSU_LENGTH_LENGTH_Msk;
252 tmp |= DSU_LENGTH_LENGTH(data);
253 ((Dsu *)hw)->LENGTH.reg = tmp;
254 DSU_CRITICAL_SECTION_LEAVE();
255 }
256
hri_dsu_clear_LENGTH_LENGTH_bf(const void * const hw,hri_dsu_length_reg_t mask)257 static inline void hri_dsu_clear_LENGTH_LENGTH_bf(const void *const hw, hri_dsu_length_reg_t mask)
258 {
259 DSU_CRITICAL_SECTION_ENTER();
260 ((Dsu *)hw)->LENGTH.reg &= ~DSU_LENGTH_LENGTH(mask);
261 DSU_CRITICAL_SECTION_LEAVE();
262 }
263
hri_dsu_toggle_LENGTH_LENGTH_bf(const void * const hw,hri_dsu_length_reg_t mask)264 static inline void hri_dsu_toggle_LENGTH_LENGTH_bf(const void *const hw, hri_dsu_length_reg_t mask)
265 {
266 DSU_CRITICAL_SECTION_ENTER();
267 ((Dsu *)hw)->LENGTH.reg ^= DSU_LENGTH_LENGTH(mask);
268 DSU_CRITICAL_SECTION_LEAVE();
269 }
270
hri_dsu_read_LENGTH_LENGTH_bf(const void * const hw)271 static inline hri_dsu_length_reg_t hri_dsu_read_LENGTH_LENGTH_bf(const void *const hw)
272 {
273 uint32_t tmp;
274 tmp = ((Dsu *)hw)->LENGTH.reg;
275 tmp = (tmp & DSU_LENGTH_LENGTH_Msk) >> DSU_LENGTH_LENGTH_Pos;
276 return tmp;
277 }
278
hri_dsu_set_LENGTH_reg(const void * const hw,hri_dsu_length_reg_t mask)279 static inline void hri_dsu_set_LENGTH_reg(const void *const hw, hri_dsu_length_reg_t mask)
280 {
281 DSU_CRITICAL_SECTION_ENTER();
282 ((Dsu *)hw)->LENGTH.reg |= mask;
283 DSU_CRITICAL_SECTION_LEAVE();
284 }
285
hri_dsu_get_LENGTH_reg(const void * const hw,hri_dsu_length_reg_t mask)286 static inline hri_dsu_length_reg_t hri_dsu_get_LENGTH_reg(const void *const hw, hri_dsu_length_reg_t mask)
287 {
288 uint32_t tmp;
289 tmp = ((Dsu *)hw)->LENGTH.reg;
290 tmp &= mask;
291 return tmp;
292 }
293
hri_dsu_write_LENGTH_reg(const void * const hw,hri_dsu_length_reg_t data)294 static inline void hri_dsu_write_LENGTH_reg(const void *const hw, hri_dsu_length_reg_t data)
295 {
296 DSU_CRITICAL_SECTION_ENTER();
297 ((Dsu *)hw)->LENGTH.reg = data;
298 DSU_CRITICAL_SECTION_LEAVE();
299 }
300
hri_dsu_clear_LENGTH_reg(const void * const hw,hri_dsu_length_reg_t mask)301 static inline void hri_dsu_clear_LENGTH_reg(const void *const hw, hri_dsu_length_reg_t mask)
302 {
303 DSU_CRITICAL_SECTION_ENTER();
304 ((Dsu *)hw)->LENGTH.reg &= ~mask;
305 DSU_CRITICAL_SECTION_LEAVE();
306 }
307
hri_dsu_toggle_LENGTH_reg(const void * const hw,hri_dsu_length_reg_t mask)308 static inline void hri_dsu_toggle_LENGTH_reg(const void *const hw, hri_dsu_length_reg_t mask)
309 {
310 DSU_CRITICAL_SECTION_ENTER();
311 ((Dsu *)hw)->LENGTH.reg ^= mask;
312 DSU_CRITICAL_SECTION_LEAVE();
313 }
314
hri_dsu_read_LENGTH_reg(const void * const hw)315 static inline hri_dsu_length_reg_t hri_dsu_read_LENGTH_reg(const void *const hw)
316 {
317 return ((Dsu *)hw)->LENGTH.reg;
318 }
319
hri_dsu_set_DATA_DATA_bf(const void * const hw,hri_dsu_data_reg_t mask)320 static inline void hri_dsu_set_DATA_DATA_bf(const void *const hw, hri_dsu_data_reg_t mask)
321 {
322 DSU_CRITICAL_SECTION_ENTER();
323 ((Dsu *)hw)->DATA.reg |= DSU_DATA_DATA(mask);
324 DSU_CRITICAL_SECTION_LEAVE();
325 }
326
hri_dsu_get_DATA_DATA_bf(const void * const hw,hri_dsu_data_reg_t mask)327 static inline hri_dsu_data_reg_t hri_dsu_get_DATA_DATA_bf(const void *const hw, hri_dsu_data_reg_t mask)
328 {
329 uint32_t tmp;
330 tmp = ((Dsu *)hw)->DATA.reg;
331 tmp = (tmp & DSU_DATA_DATA(mask)) >> DSU_DATA_DATA_Pos;
332 return tmp;
333 }
334
hri_dsu_write_DATA_DATA_bf(const void * const hw,hri_dsu_data_reg_t data)335 static inline void hri_dsu_write_DATA_DATA_bf(const void *const hw, hri_dsu_data_reg_t data)
336 {
337 uint32_t tmp;
338 DSU_CRITICAL_SECTION_ENTER();
339 tmp = ((Dsu *)hw)->DATA.reg;
340 tmp &= ~DSU_DATA_DATA_Msk;
341 tmp |= DSU_DATA_DATA(data);
342 ((Dsu *)hw)->DATA.reg = tmp;
343 DSU_CRITICAL_SECTION_LEAVE();
344 }
345
hri_dsu_clear_DATA_DATA_bf(const void * const hw,hri_dsu_data_reg_t mask)346 static inline void hri_dsu_clear_DATA_DATA_bf(const void *const hw, hri_dsu_data_reg_t mask)
347 {
348 DSU_CRITICAL_SECTION_ENTER();
349 ((Dsu *)hw)->DATA.reg &= ~DSU_DATA_DATA(mask);
350 DSU_CRITICAL_SECTION_LEAVE();
351 }
352
hri_dsu_toggle_DATA_DATA_bf(const void * const hw,hri_dsu_data_reg_t mask)353 static inline void hri_dsu_toggle_DATA_DATA_bf(const void *const hw, hri_dsu_data_reg_t mask)
354 {
355 DSU_CRITICAL_SECTION_ENTER();
356 ((Dsu *)hw)->DATA.reg ^= DSU_DATA_DATA(mask);
357 DSU_CRITICAL_SECTION_LEAVE();
358 }
359
hri_dsu_read_DATA_DATA_bf(const void * const hw)360 static inline hri_dsu_data_reg_t hri_dsu_read_DATA_DATA_bf(const void *const hw)
361 {
362 uint32_t tmp;
363 tmp = ((Dsu *)hw)->DATA.reg;
364 tmp = (tmp & DSU_DATA_DATA_Msk) >> DSU_DATA_DATA_Pos;
365 return tmp;
366 }
367
hri_dsu_set_DATA_reg(const void * const hw,hri_dsu_data_reg_t mask)368 static inline void hri_dsu_set_DATA_reg(const void *const hw, hri_dsu_data_reg_t mask)
369 {
370 DSU_CRITICAL_SECTION_ENTER();
371 ((Dsu *)hw)->DATA.reg |= mask;
372 DSU_CRITICAL_SECTION_LEAVE();
373 }
374
hri_dsu_get_DATA_reg(const void * const hw,hri_dsu_data_reg_t mask)375 static inline hri_dsu_data_reg_t hri_dsu_get_DATA_reg(const void *const hw, hri_dsu_data_reg_t mask)
376 {
377 uint32_t tmp;
378 tmp = ((Dsu *)hw)->DATA.reg;
379 tmp &= mask;
380 return tmp;
381 }
382
hri_dsu_write_DATA_reg(const void * const hw,hri_dsu_data_reg_t data)383 static inline void hri_dsu_write_DATA_reg(const void *const hw, hri_dsu_data_reg_t data)
384 {
385 DSU_CRITICAL_SECTION_ENTER();
386 ((Dsu *)hw)->DATA.reg = data;
387 DSU_CRITICAL_SECTION_LEAVE();
388 }
389
hri_dsu_clear_DATA_reg(const void * const hw,hri_dsu_data_reg_t mask)390 static inline void hri_dsu_clear_DATA_reg(const void *const hw, hri_dsu_data_reg_t mask)
391 {
392 DSU_CRITICAL_SECTION_ENTER();
393 ((Dsu *)hw)->DATA.reg &= ~mask;
394 DSU_CRITICAL_SECTION_LEAVE();
395 }
396
hri_dsu_toggle_DATA_reg(const void * const hw,hri_dsu_data_reg_t mask)397 static inline void hri_dsu_toggle_DATA_reg(const void *const hw, hri_dsu_data_reg_t mask)
398 {
399 DSU_CRITICAL_SECTION_ENTER();
400 ((Dsu *)hw)->DATA.reg ^= mask;
401 DSU_CRITICAL_SECTION_LEAVE();
402 }
403
hri_dsu_read_DATA_reg(const void * const hw)404 static inline hri_dsu_data_reg_t hri_dsu_read_DATA_reg(const void *const hw)
405 {
406 return ((Dsu *)hw)->DATA.reg;
407 }
408
hri_dsu_set_DCC_DATA_bf(const void * const hw,uint8_t index,hri_dsu_dcc_reg_t mask)409 static inline void hri_dsu_set_DCC_DATA_bf(const void *const hw, uint8_t index, hri_dsu_dcc_reg_t mask)
410 {
411 DSU_CRITICAL_SECTION_ENTER();
412 ((Dsu *)hw)->DCC[index].reg |= DSU_DCC_DATA(mask);
413 DSU_CRITICAL_SECTION_LEAVE();
414 }
415
hri_dsu_get_DCC_DATA_bf(const void * const hw,uint8_t index,hri_dsu_dcc_reg_t mask)416 static inline hri_dsu_dcc_reg_t hri_dsu_get_DCC_DATA_bf(const void *const hw, uint8_t index, hri_dsu_dcc_reg_t mask)
417 {
418 uint32_t tmp;
419 tmp = ((Dsu *)hw)->DCC[index].reg;
420 tmp = (tmp & DSU_DCC_DATA(mask)) >> DSU_DCC_DATA_Pos;
421 return tmp;
422 }
423
hri_dsu_write_DCC_DATA_bf(const void * const hw,uint8_t index,hri_dsu_dcc_reg_t data)424 static inline void hri_dsu_write_DCC_DATA_bf(const void *const hw, uint8_t index, hri_dsu_dcc_reg_t data)
425 {
426 uint32_t tmp;
427 DSU_CRITICAL_SECTION_ENTER();
428 tmp = ((Dsu *)hw)->DCC[index].reg;
429 tmp &= ~DSU_DCC_DATA_Msk;
430 tmp |= DSU_DCC_DATA(data);
431 ((Dsu *)hw)->DCC[index].reg = tmp;
432 DSU_CRITICAL_SECTION_LEAVE();
433 }
434
hri_dsu_clear_DCC_DATA_bf(const void * const hw,uint8_t index,hri_dsu_dcc_reg_t mask)435 static inline void hri_dsu_clear_DCC_DATA_bf(const void *const hw, uint8_t index, hri_dsu_dcc_reg_t mask)
436 {
437 DSU_CRITICAL_SECTION_ENTER();
438 ((Dsu *)hw)->DCC[index].reg &= ~DSU_DCC_DATA(mask);
439 DSU_CRITICAL_SECTION_LEAVE();
440 }
441
hri_dsu_toggle_DCC_DATA_bf(const void * const hw,uint8_t index,hri_dsu_dcc_reg_t mask)442 static inline void hri_dsu_toggle_DCC_DATA_bf(const void *const hw, uint8_t index, hri_dsu_dcc_reg_t mask)
443 {
444 DSU_CRITICAL_SECTION_ENTER();
445 ((Dsu *)hw)->DCC[index].reg ^= DSU_DCC_DATA(mask);
446 DSU_CRITICAL_SECTION_LEAVE();
447 }
448
hri_dsu_read_DCC_DATA_bf(const void * const hw,uint8_t index)449 static inline hri_dsu_dcc_reg_t hri_dsu_read_DCC_DATA_bf(const void *const hw, uint8_t index)
450 {
451 uint32_t tmp;
452 tmp = ((Dsu *)hw)->DCC[index].reg;
453 tmp = (tmp & DSU_DCC_DATA_Msk) >> DSU_DCC_DATA_Pos;
454 return tmp;
455 }
456
hri_dsu_set_DCC_reg(const void * const hw,uint8_t index,hri_dsu_dcc_reg_t mask)457 static inline void hri_dsu_set_DCC_reg(const void *const hw, uint8_t index, hri_dsu_dcc_reg_t mask)
458 {
459 DSU_CRITICAL_SECTION_ENTER();
460 ((Dsu *)hw)->DCC[index].reg |= mask;
461 DSU_CRITICAL_SECTION_LEAVE();
462 }
463
hri_dsu_get_DCC_reg(const void * const hw,uint8_t index,hri_dsu_dcc_reg_t mask)464 static inline hri_dsu_dcc_reg_t hri_dsu_get_DCC_reg(const void *const hw, uint8_t index, hri_dsu_dcc_reg_t mask)
465 {
466 uint32_t tmp;
467 tmp = ((Dsu *)hw)->DCC[index].reg;
468 tmp &= mask;
469 return tmp;
470 }
471
hri_dsu_write_DCC_reg(const void * const hw,uint8_t index,hri_dsu_dcc_reg_t data)472 static inline void hri_dsu_write_DCC_reg(const void *const hw, uint8_t index, hri_dsu_dcc_reg_t data)
473 {
474 DSU_CRITICAL_SECTION_ENTER();
475 ((Dsu *)hw)->DCC[index].reg = data;
476 DSU_CRITICAL_SECTION_LEAVE();
477 }
478
hri_dsu_clear_DCC_reg(const void * const hw,uint8_t index,hri_dsu_dcc_reg_t mask)479 static inline void hri_dsu_clear_DCC_reg(const void *const hw, uint8_t index, hri_dsu_dcc_reg_t mask)
480 {
481 DSU_CRITICAL_SECTION_ENTER();
482 ((Dsu *)hw)->DCC[index].reg &= ~mask;
483 DSU_CRITICAL_SECTION_LEAVE();
484 }
485
hri_dsu_toggle_DCC_reg(const void * const hw,uint8_t index,hri_dsu_dcc_reg_t mask)486 static inline void hri_dsu_toggle_DCC_reg(const void *const hw, uint8_t index, hri_dsu_dcc_reg_t mask)
487 {
488 DSU_CRITICAL_SECTION_ENTER();
489 ((Dsu *)hw)->DCC[index].reg ^= mask;
490 DSU_CRITICAL_SECTION_LEAVE();
491 }
492
hri_dsu_read_DCC_reg(const void * const hw,uint8_t index)493 static inline hri_dsu_dcc_reg_t hri_dsu_read_DCC_reg(const void *const hw, uint8_t index)
494 {
495 return ((Dsu *)hw)->DCC[index].reg;
496 }
497
hri_dsu_set_DCFG_DCFG_bf(const void * const hw,uint8_t index,hri_dsu_dcfg_reg_t mask)498 static inline void hri_dsu_set_DCFG_DCFG_bf(const void *const hw, uint8_t index, hri_dsu_dcfg_reg_t mask)
499 {
500 DSU_CRITICAL_SECTION_ENTER();
501 ((Dsu *)hw)->DCFG[index].reg |= DSU_DCFG_DCFG(mask);
502 DSU_CRITICAL_SECTION_LEAVE();
503 }
504
hri_dsu_get_DCFG_DCFG_bf(const void * const hw,uint8_t index,hri_dsu_dcfg_reg_t mask)505 static inline hri_dsu_dcfg_reg_t hri_dsu_get_DCFG_DCFG_bf(const void *const hw, uint8_t index, hri_dsu_dcfg_reg_t mask)
506 {
507 uint32_t tmp;
508 tmp = ((Dsu *)hw)->DCFG[index].reg;
509 tmp = (tmp & DSU_DCFG_DCFG(mask)) >> DSU_DCFG_DCFG_Pos;
510 return tmp;
511 }
512
hri_dsu_write_DCFG_DCFG_bf(const void * const hw,uint8_t index,hri_dsu_dcfg_reg_t data)513 static inline void hri_dsu_write_DCFG_DCFG_bf(const void *const hw, uint8_t index, hri_dsu_dcfg_reg_t data)
514 {
515 uint32_t tmp;
516 DSU_CRITICAL_SECTION_ENTER();
517 tmp = ((Dsu *)hw)->DCFG[index].reg;
518 tmp &= ~DSU_DCFG_DCFG_Msk;
519 tmp |= DSU_DCFG_DCFG(data);
520 ((Dsu *)hw)->DCFG[index].reg = tmp;
521 DSU_CRITICAL_SECTION_LEAVE();
522 }
523
hri_dsu_clear_DCFG_DCFG_bf(const void * const hw,uint8_t index,hri_dsu_dcfg_reg_t mask)524 static inline void hri_dsu_clear_DCFG_DCFG_bf(const void *const hw, uint8_t index, hri_dsu_dcfg_reg_t mask)
525 {
526 DSU_CRITICAL_SECTION_ENTER();
527 ((Dsu *)hw)->DCFG[index].reg &= ~DSU_DCFG_DCFG(mask);
528 DSU_CRITICAL_SECTION_LEAVE();
529 }
530
hri_dsu_toggle_DCFG_DCFG_bf(const void * const hw,uint8_t index,hri_dsu_dcfg_reg_t mask)531 static inline void hri_dsu_toggle_DCFG_DCFG_bf(const void *const hw, uint8_t index, hri_dsu_dcfg_reg_t mask)
532 {
533 DSU_CRITICAL_SECTION_ENTER();
534 ((Dsu *)hw)->DCFG[index].reg ^= DSU_DCFG_DCFG(mask);
535 DSU_CRITICAL_SECTION_LEAVE();
536 }
537
hri_dsu_read_DCFG_DCFG_bf(const void * const hw,uint8_t index)538 static inline hri_dsu_dcfg_reg_t hri_dsu_read_DCFG_DCFG_bf(const void *const hw, uint8_t index)
539 {
540 uint32_t tmp;
541 tmp = ((Dsu *)hw)->DCFG[index].reg;
542 tmp = (tmp & DSU_DCFG_DCFG_Msk) >> DSU_DCFG_DCFG_Pos;
543 return tmp;
544 }
545
hri_dsu_set_DCFG_reg(const void * const hw,uint8_t index,hri_dsu_dcfg_reg_t mask)546 static inline void hri_dsu_set_DCFG_reg(const void *const hw, uint8_t index, hri_dsu_dcfg_reg_t mask)
547 {
548 DSU_CRITICAL_SECTION_ENTER();
549 ((Dsu *)hw)->DCFG[index].reg |= mask;
550 DSU_CRITICAL_SECTION_LEAVE();
551 }
552
hri_dsu_get_DCFG_reg(const void * const hw,uint8_t index,hri_dsu_dcfg_reg_t mask)553 static inline hri_dsu_dcfg_reg_t hri_dsu_get_DCFG_reg(const void *const hw, uint8_t index, hri_dsu_dcfg_reg_t mask)
554 {
555 uint32_t tmp;
556 tmp = ((Dsu *)hw)->DCFG[index].reg;
557 tmp &= mask;
558 return tmp;
559 }
560
hri_dsu_write_DCFG_reg(const void * const hw,uint8_t index,hri_dsu_dcfg_reg_t data)561 static inline void hri_dsu_write_DCFG_reg(const void *const hw, uint8_t index, hri_dsu_dcfg_reg_t data)
562 {
563 DSU_CRITICAL_SECTION_ENTER();
564 ((Dsu *)hw)->DCFG[index].reg = data;
565 DSU_CRITICAL_SECTION_LEAVE();
566 }
567
hri_dsu_clear_DCFG_reg(const void * const hw,uint8_t index,hri_dsu_dcfg_reg_t mask)568 static inline void hri_dsu_clear_DCFG_reg(const void *const hw, uint8_t index, hri_dsu_dcfg_reg_t mask)
569 {
570 DSU_CRITICAL_SECTION_ENTER();
571 ((Dsu *)hw)->DCFG[index].reg &= ~mask;
572 DSU_CRITICAL_SECTION_LEAVE();
573 }
574
hri_dsu_toggle_DCFG_reg(const void * const hw,uint8_t index,hri_dsu_dcfg_reg_t mask)575 static inline void hri_dsu_toggle_DCFG_reg(const void *const hw, uint8_t index, hri_dsu_dcfg_reg_t mask)
576 {
577 DSU_CRITICAL_SECTION_ENTER();
578 ((Dsu *)hw)->DCFG[index].reg ^= mask;
579 DSU_CRITICAL_SECTION_LEAVE();
580 }
581
hri_dsu_read_DCFG_reg(const void * const hw,uint8_t index)582 static inline hri_dsu_dcfg_reg_t hri_dsu_read_DCFG_reg(const void *const hw, uint8_t index)
583 {
584 return ((Dsu *)hw)->DCFG[index].reg;
585 }
586
hri_dsu_get_STATUSB_PROT_bit(const void * const hw)587 static inline bool hri_dsu_get_STATUSB_PROT_bit(const void *const hw)
588 {
589 return (((Dsu *)hw)->STATUSB.reg & DSU_STATUSB_PROT) >> DSU_STATUSB_PROT_Pos;
590 }
591
hri_dsu_get_STATUSB_DBGPRES_bit(const void * const hw)592 static inline bool hri_dsu_get_STATUSB_DBGPRES_bit(const void *const hw)
593 {
594 return (((Dsu *)hw)->STATUSB.reg & DSU_STATUSB_DBGPRES) >> DSU_STATUSB_DBGPRES_Pos;
595 }
596
hri_dsu_get_STATUSB_DCCD0_bit(const void * const hw)597 static inline bool hri_dsu_get_STATUSB_DCCD0_bit(const void *const hw)
598 {
599 return (((Dsu *)hw)->STATUSB.reg & DSU_STATUSB_DCCD0) >> DSU_STATUSB_DCCD0_Pos;
600 }
601
hri_dsu_get_STATUSB_DCCD1_bit(const void * const hw)602 static inline bool hri_dsu_get_STATUSB_DCCD1_bit(const void *const hw)
603 {
604 return (((Dsu *)hw)->STATUSB.reg & DSU_STATUSB_DCCD1) >> DSU_STATUSB_DCCD1_Pos;
605 }
606
hri_dsu_get_STATUSB_HPE_bit(const void * const hw)607 static inline bool hri_dsu_get_STATUSB_HPE_bit(const void *const hw)
608 {
609 return (((Dsu *)hw)->STATUSB.reg & DSU_STATUSB_HPE) >> DSU_STATUSB_HPE_Pos;
610 }
611
hri_dsu_get_STATUSB_reg(const void * const hw,hri_dsu_statusb_reg_t mask)612 static inline hri_dsu_statusb_reg_t hri_dsu_get_STATUSB_reg(const void *const hw, hri_dsu_statusb_reg_t mask)
613 {
614 uint8_t tmp;
615 tmp = ((Dsu *)hw)->STATUSB.reg;
616 tmp &= mask;
617 return tmp;
618 }
619
hri_dsu_read_STATUSB_reg(const void * const hw)620 static inline hri_dsu_statusb_reg_t hri_dsu_read_STATUSB_reg(const void *const hw)
621 {
622 return ((Dsu *)hw)->STATUSB.reg;
623 }
624
hri_dsu_get_DID_DEVSEL_bf(const void * const hw,hri_dsu_did_reg_t mask)625 static inline hri_dsu_did_reg_t hri_dsu_get_DID_DEVSEL_bf(const void *const hw, hri_dsu_did_reg_t mask)
626 {
627 return (((Dsu *)hw)->DID.reg & DSU_DID_DEVSEL(mask)) >> DSU_DID_DEVSEL_Pos;
628 }
629
hri_dsu_read_DID_DEVSEL_bf(const void * const hw)630 static inline hri_dsu_did_reg_t hri_dsu_read_DID_DEVSEL_bf(const void *const hw)
631 {
632 return (((Dsu *)hw)->DID.reg & DSU_DID_DEVSEL_Msk) >> DSU_DID_DEVSEL_Pos;
633 }
634
hri_dsu_get_DID_REVISION_bf(const void * const hw,hri_dsu_did_reg_t mask)635 static inline hri_dsu_did_reg_t hri_dsu_get_DID_REVISION_bf(const void *const hw, hri_dsu_did_reg_t mask)
636 {
637 return (((Dsu *)hw)->DID.reg & DSU_DID_REVISION(mask)) >> DSU_DID_REVISION_Pos;
638 }
639
hri_dsu_read_DID_REVISION_bf(const void * const hw)640 static inline hri_dsu_did_reg_t hri_dsu_read_DID_REVISION_bf(const void *const hw)
641 {
642 return (((Dsu *)hw)->DID.reg & DSU_DID_REVISION_Msk) >> DSU_DID_REVISION_Pos;
643 }
644
hri_dsu_get_DID_DIE_bf(const void * const hw,hri_dsu_did_reg_t mask)645 static inline hri_dsu_did_reg_t hri_dsu_get_DID_DIE_bf(const void *const hw, hri_dsu_did_reg_t mask)
646 {
647 return (((Dsu *)hw)->DID.reg & DSU_DID_DIE(mask)) >> DSU_DID_DIE_Pos;
648 }
649
hri_dsu_read_DID_DIE_bf(const void * const hw)650 static inline hri_dsu_did_reg_t hri_dsu_read_DID_DIE_bf(const void *const hw)
651 {
652 return (((Dsu *)hw)->DID.reg & DSU_DID_DIE_Msk) >> DSU_DID_DIE_Pos;
653 }
654
hri_dsu_get_DID_SERIES_bf(const void * const hw,hri_dsu_did_reg_t mask)655 static inline hri_dsu_did_reg_t hri_dsu_get_DID_SERIES_bf(const void *const hw, hri_dsu_did_reg_t mask)
656 {
657 return (((Dsu *)hw)->DID.reg & DSU_DID_SERIES(mask)) >> DSU_DID_SERIES_Pos;
658 }
659
hri_dsu_read_DID_SERIES_bf(const void * const hw)660 static inline hri_dsu_did_reg_t hri_dsu_read_DID_SERIES_bf(const void *const hw)
661 {
662 return (((Dsu *)hw)->DID.reg & DSU_DID_SERIES_Msk) >> DSU_DID_SERIES_Pos;
663 }
664
hri_dsu_get_DID_FAMILY_bf(const void * const hw,hri_dsu_did_reg_t mask)665 static inline hri_dsu_did_reg_t hri_dsu_get_DID_FAMILY_bf(const void *const hw, hri_dsu_did_reg_t mask)
666 {
667 return (((Dsu *)hw)->DID.reg & DSU_DID_FAMILY(mask)) >> DSU_DID_FAMILY_Pos;
668 }
669
hri_dsu_read_DID_FAMILY_bf(const void * const hw)670 static inline hri_dsu_did_reg_t hri_dsu_read_DID_FAMILY_bf(const void *const hw)
671 {
672 return (((Dsu *)hw)->DID.reg & DSU_DID_FAMILY_Msk) >> DSU_DID_FAMILY_Pos;
673 }
674
hri_dsu_get_DID_PROCESSOR_bf(const void * const hw,hri_dsu_did_reg_t mask)675 static inline hri_dsu_did_reg_t hri_dsu_get_DID_PROCESSOR_bf(const void *const hw, hri_dsu_did_reg_t mask)
676 {
677 return (((Dsu *)hw)->DID.reg & DSU_DID_PROCESSOR(mask)) >> DSU_DID_PROCESSOR_Pos;
678 }
679
hri_dsu_read_DID_PROCESSOR_bf(const void * const hw)680 static inline hri_dsu_did_reg_t hri_dsu_read_DID_PROCESSOR_bf(const void *const hw)
681 {
682 return (((Dsu *)hw)->DID.reg & DSU_DID_PROCESSOR_Msk) >> DSU_DID_PROCESSOR_Pos;
683 }
684
hri_dsu_get_DID_reg(const void * const hw,hri_dsu_did_reg_t mask)685 static inline hri_dsu_did_reg_t hri_dsu_get_DID_reg(const void *const hw, hri_dsu_did_reg_t mask)
686 {
687 uint32_t tmp;
688 tmp = ((Dsu *)hw)->DID.reg;
689 tmp &= mask;
690 return tmp;
691 }
692
hri_dsu_read_DID_reg(const void * const hw)693 static inline hri_dsu_did_reg_t hri_dsu_read_DID_reg(const void *const hw)
694 {
695 return ((Dsu *)hw)->DID.reg;
696 }
697
hri_dsu_get_ENTRY_EPRES_bit(const void * const hw,uint8_t index)698 static inline bool hri_dsu_get_ENTRY_EPRES_bit(const void *const hw, uint8_t index)
699 {
700 return (((Dsu *)hw)->ENTRY[index].reg & DSU_ENTRY_EPRES) >> DSU_ENTRY_EPRES_Pos;
701 }
702
hri_dsu_get_ENTRY_FMT_bit(const void * const hw,uint8_t index)703 static inline bool hri_dsu_get_ENTRY_FMT_bit(const void *const hw, uint8_t index)
704 {
705 return (((Dsu *)hw)->ENTRY[index].reg & DSU_ENTRY_FMT) >> DSU_ENTRY_FMT_Pos;
706 }
707
hri_dsu_get_ENTRY_ADDOFF_bf(const void * const hw,uint8_t index,hri_dsu_entry_reg_t mask)708 static inline hri_dsu_entry_reg_t hri_dsu_get_ENTRY_ADDOFF_bf(const void *const hw, uint8_t index,
709 hri_dsu_entry_reg_t mask)
710 {
711 return (((Dsu *)hw)->ENTRY[index].reg & DSU_ENTRY_ADDOFF(mask)) >> DSU_ENTRY_ADDOFF_Pos;
712 }
713
hri_dsu_read_ENTRY_ADDOFF_bf(const void * const hw,uint8_t index)714 static inline hri_dsu_entry_reg_t hri_dsu_read_ENTRY_ADDOFF_bf(const void *const hw, uint8_t index)
715 {
716 return (((Dsu *)hw)->ENTRY[index].reg & DSU_ENTRY_ADDOFF_Msk) >> DSU_ENTRY_ADDOFF_Pos;
717 }
718
hri_dsu_get_ENTRY_reg(const void * const hw,uint8_t index,hri_dsu_entry_reg_t mask)719 static inline hri_dsu_entry_reg_t hri_dsu_get_ENTRY_reg(const void *const hw, uint8_t index, hri_dsu_entry_reg_t mask)
720 {
721 uint32_t tmp;
722 tmp = ((Dsu *)hw)->ENTRY[index].reg;
723 tmp &= mask;
724 return tmp;
725 }
726
hri_dsu_read_ENTRY_reg(const void * const hw,uint8_t index)727 static inline hri_dsu_entry_reg_t hri_dsu_read_ENTRY_reg(const void *const hw, uint8_t index)
728 {
729 return ((Dsu *)hw)->ENTRY[index].reg;
730 }
731
hri_dsu_get_END_END_bf(const void * const hw,hri_dsu_end_reg_t mask)732 static inline hri_dsu_end_reg_t hri_dsu_get_END_END_bf(const void *const hw, hri_dsu_end_reg_t mask)
733 {
734 return (((Dsu *)hw)->END.reg & DSU_END_END(mask)) >> DSU_END_END_Pos;
735 }
736
hri_dsu_read_END_END_bf(const void * const hw)737 static inline hri_dsu_end_reg_t hri_dsu_read_END_END_bf(const void *const hw)
738 {
739 return (((Dsu *)hw)->END.reg & DSU_END_END_Msk) >> DSU_END_END_Pos;
740 }
741
hri_dsu_get_END_reg(const void * const hw,hri_dsu_end_reg_t mask)742 static inline hri_dsu_end_reg_t hri_dsu_get_END_reg(const void *const hw, hri_dsu_end_reg_t mask)
743 {
744 uint32_t tmp;
745 tmp = ((Dsu *)hw)->END.reg;
746 tmp &= mask;
747 return tmp;
748 }
749
hri_dsu_read_END_reg(const void * const hw)750 static inline hri_dsu_end_reg_t hri_dsu_read_END_reg(const void *const hw)
751 {
752 return ((Dsu *)hw)->END.reg;
753 }
754
hri_dsu_get_MEMTYPE_SMEMP_bit(const void * const hw)755 static inline bool hri_dsu_get_MEMTYPE_SMEMP_bit(const void *const hw)
756 {
757 return (((Dsu *)hw)->MEMTYPE.reg & DSU_MEMTYPE_SMEMP) >> DSU_MEMTYPE_SMEMP_Pos;
758 }
759
hri_dsu_get_MEMTYPE_reg(const void * const hw,hri_dsu_memtype_reg_t mask)760 static inline hri_dsu_memtype_reg_t hri_dsu_get_MEMTYPE_reg(const void *const hw, hri_dsu_memtype_reg_t mask)
761 {
762 uint32_t tmp;
763 tmp = ((Dsu *)hw)->MEMTYPE.reg;
764 tmp &= mask;
765 return tmp;
766 }
767
hri_dsu_read_MEMTYPE_reg(const void * const hw)768 static inline hri_dsu_memtype_reg_t hri_dsu_read_MEMTYPE_reg(const void *const hw)
769 {
770 return ((Dsu *)hw)->MEMTYPE.reg;
771 }
772
hri_dsu_get_PID4_JEPCC_bf(const void * const hw,hri_dsu_pid4_reg_t mask)773 static inline hri_dsu_pid4_reg_t hri_dsu_get_PID4_JEPCC_bf(const void *const hw, hri_dsu_pid4_reg_t mask)
774 {
775 return (((Dsu *)hw)->PID4.reg & DSU_PID4_JEPCC(mask)) >> DSU_PID4_JEPCC_Pos;
776 }
777
hri_dsu_read_PID4_JEPCC_bf(const void * const hw)778 static inline hri_dsu_pid4_reg_t hri_dsu_read_PID4_JEPCC_bf(const void *const hw)
779 {
780 return (((Dsu *)hw)->PID4.reg & DSU_PID4_JEPCC_Msk) >> DSU_PID4_JEPCC_Pos;
781 }
782
hri_dsu_get_PID4_FKBC_bf(const void * const hw,hri_dsu_pid4_reg_t mask)783 static inline hri_dsu_pid4_reg_t hri_dsu_get_PID4_FKBC_bf(const void *const hw, hri_dsu_pid4_reg_t mask)
784 {
785 return (((Dsu *)hw)->PID4.reg & DSU_PID4_FKBC(mask)) >> DSU_PID4_FKBC_Pos;
786 }
787
hri_dsu_read_PID4_FKBC_bf(const void * const hw)788 static inline hri_dsu_pid4_reg_t hri_dsu_read_PID4_FKBC_bf(const void *const hw)
789 {
790 return (((Dsu *)hw)->PID4.reg & DSU_PID4_FKBC_Msk) >> DSU_PID4_FKBC_Pos;
791 }
792
hri_dsu_get_PID4_reg(const void * const hw,hri_dsu_pid4_reg_t mask)793 static inline hri_dsu_pid4_reg_t hri_dsu_get_PID4_reg(const void *const hw, hri_dsu_pid4_reg_t mask)
794 {
795 uint32_t tmp;
796 tmp = ((Dsu *)hw)->PID4.reg;
797 tmp &= mask;
798 return tmp;
799 }
800
hri_dsu_read_PID4_reg(const void * const hw)801 static inline hri_dsu_pid4_reg_t hri_dsu_read_PID4_reg(const void *const hw)
802 {
803 return ((Dsu *)hw)->PID4.reg;
804 }
805
hri_dsu_get_PID5_reg(const void * const hw,hri_dsu_pid5_reg_t mask)806 static inline hri_dsu_pid5_reg_t hri_dsu_get_PID5_reg(const void *const hw, hri_dsu_pid5_reg_t mask)
807 {
808 uint32_t tmp;
809 tmp = ((Dsu *)hw)->PID5.reg;
810 tmp &= mask;
811 return tmp;
812 }
813
hri_dsu_read_PID5_reg(const void * const hw)814 static inline hri_dsu_pid5_reg_t hri_dsu_read_PID5_reg(const void *const hw)
815 {
816 return ((Dsu *)hw)->PID5.reg;
817 }
818
hri_dsu_get_PID6_reg(const void * const hw,hri_dsu_pid6_reg_t mask)819 static inline hri_dsu_pid6_reg_t hri_dsu_get_PID6_reg(const void *const hw, hri_dsu_pid6_reg_t mask)
820 {
821 uint32_t tmp;
822 tmp = ((Dsu *)hw)->PID6.reg;
823 tmp &= mask;
824 return tmp;
825 }
826
hri_dsu_read_PID6_reg(const void * const hw)827 static inline hri_dsu_pid6_reg_t hri_dsu_read_PID6_reg(const void *const hw)
828 {
829 return ((Dsu *)hw)->PID6.reg;
830 }
831
hri_dsu_get_PID7_reg(const void * const hw,hri_dsu_pid7_reg_t mask)832 static inline hri_dsu_pid7_reg_t hri_dsu_get_PID7_reg(const void *const hw, hri_dsu_pid7_reg_t mask)
833 {
834 uint32_t tmp;
835 tmp = ((Dsu *)hw)->PID7.reg;
836 tmp &= mask;
837 return tmp;
838 }
839
hri_dsu_read_PID7_reg(const void * const hw)840 static inline hri_dsu_pid7_reg_t hri_dsu_read_PID7_reg(const void *const hw)
841 {
842 return ((Dsu *)hw)->PID7.reg;
843 }
844
hri_dsu_get_PID0_PARTNBL_bf(const void * const hw,hri_dsu_pid0_reg_t mask)845 static inline hri_dsu_pid0_reg_t hri_dsu_get_PID0_PARTNBL_bf(const void *const hw, hri_dsu_pid0_reg_t mask)
846 {
847 return (((Dsu *)hw)->PID0.reg & DSU_PID0_PARTNBL(mask)) >> DSU_PID0_PARTNBL_Pos;
848 }
849
hri_dsu_read_PID0_PARTNBL_bf(const void * const hw)850 static inline hri_dsu_pid0_reg_t hri_dsu_read_PID0_PARTNBL_bf(const void *const hw)
851 {
852 return (((Dsu *)hw)->PID0.reg & DSU_PID0_PARTNBL_Msk) >> DSU_PID0_PARTNBL_Pos;
853 }
854
hri_dsu_get_PID0_reg(const void * const hw,hri_dsu_pid0_reg_t mask)855 static inline hri_dsu_pid0_reg_t hri_dsu_get_PID0_reg(const void *const hw, hri_dsu_pid0_reg_t mask)
856 {
857 uint32_t tmp;
858 tmp = ((Dsu *)hw)->PID0.reg;
859 tmp &= mask;
860 return tmp;
861 }
862
hri_dsu_read_PID0_reg(const void * const hw)863 static inline hri_dsu_pid0_reg_t hri_dsu_read_PID0_reg(const void *const hw)
864 {
865 return ((Dsu *)hw)->PID0.reg;
866 }
867
hri_dsu_get_PID1_PARTNBH_bf(const void * const hw,hri_dsu_pid1_reg_t mask)868 static inline hri_dsu_pid1_reg_t hri_dsu_get_PID1_PARTNBH_bf(const void *const hw, hri_dsu_pid1_reg_t mask)
869 {
870 return (((Dsu *)hw)->PID1.reg & DSU_PID1_PARTNBH(mask)) >> DSU_PID1_PARTNBH_Pos;
871 }
872
hri_dsu_read_PID1_PARTNBH_bf(const void * const hw)873 static inline hri_dsu_pid1_reg_t hri_dsu_read_PID1_PARTNBH_bf(const void *const hw)
874 {
875 return (((Dsu *)hw)->PID1.reg & DSU_PID1_PARTNBH_Msk) >> DSU_PID1_PARTNBH_Pos;
876 }
877
hri_dsu_get_PID1_JEPIDCL_bf(const void * const hw,hri_dsu_pid1_reg_t mask)878 static inline hri_dsu_pid1_reg_t hri_dsu_get_PID1_JEPIDCL_bf(const void *const hw, hri_dsu_pid1_reg_t mask)
879 {
880 return (((Dsu *)hw)->PID1.reg & DSU_PID1_JEPIDCL(mask)) >> DSU_PID1_JEPIDCL_Pos;
881 }
882
hri_dsu_read_PID1_JEPIDCL_bf(const void * const hw)883 static inline hri_dsu_pid1_reg_t hri_dsu_read_PID1_JEPIDCL_bf(const void *const hw)
884 {
885 return (((Dsu *)hw)->PID1.reg & DSU_PID1_JEPIDCL_Msk) >> DSU_PID1_JEPIDCL_Pos;
886 }
887
hri_dsu_get_PID1_reg(const void * const hw,hri_dsu_pid1_reg_t mask)888 static inline hri_dsu_pid1_reg_t hri_dsu_get_PID1_reg(const void *const hw, hri_dsu_pid1_reg_t mask)
889 {
890 uint32_t tmp;
891 tmp = ((Dsu *)hw)->PID1.reg;
892 tmp &= mask;
893 return tmp;
894 }
895
hri_dsu_read_PID1_reg(const void * const hw)896 static inline hri_dsu_pid1_reg_t hri_dsu_read_PID1_reg(const void *const hw)
897 {
898 return ((Dsu *)hw)->PID1.reg;
899 }
900
hri_dsu_get_PID2_JEPU_bit(const void * const hw)901 static inline bool hri_dsu_get_PID2_JEPU_bit(const void *const hw)
902 {
903 return (((Dsu *)hw)->PID2.reg & DSU_PID2_JEPU) >> DSU_PID2_JEPU_Pos;
904 }
905
hri_dsu_get_PID2_JEPIDCH_bf(const void * const hw,hri_dsu_pid2_reg_t mask)906 static inline hri_dsu_pid2_reg_t hri_dsu_get_PID2_JEPIDCH_bf(const void *const hw, hri_dsu_pid2_reg_t mask)
907 {
908 return (((Dsu *)hw)->PID2.reg & DSU_PID2_JEPIDCH(mask)) >> DSU_PID2_JEPIDCH_Pos;
909 }
910
hri_dsu_read_PID2_JEPIDCH_bf(const void * const hw)911 static inline hri_dsu_pid2_reg_t hri_dsu_read_PID2_JEPIDCH_bf(const void *const hw)
912 {
913 return (((Dsu *)hw)->PID2.reg & DSU_PID2_JEPIDCH_Msk) >> DSU_PID2_JEPIDCH_Pos;
914 }
915
hri_dsu_get_PID2_REVISION_bf(const void * const hw,hri_dsu_pid2_reg_t mask)916 static inline hri_dsu_pid2_reg_t hri_dsu_get_PID2_REVISION_bf(const void *const hw, hri_dsu_pid2_reg_t mask)
917 {
918 return (((Dsu *)hw)->PID2.reg & DSU_PID2_REVISION(mask)) >> DSU_PID2_REVISION_Pos;
919 }
920
hri_dsu_read_PID2_REVISION_bf(const void * const hw)921 static inline hri_dsu_pid2_reg_t hri_dsu_read_PID2_REVISION_bf(const void *const hw)
922 {
923 return (((Dsu *)hw)->PID2.reg & DSU_PID2_REVISION_Msk) >> DSU_PID2_REVISION_Pos;
924 }
925
hri_dsu_get_PID2_reg(const void * const hw,hri_dsu_pid2_reg_t mask)926 static inline hri_dsu_pid2_reg_t hri_dsu_get_PID2_reg(const void *const hw, hri_dsu_pid2_reg_t mask)
927 {
928 uint32_t tmp;
929 tmp = ((Dsu *)hw)->PID2.reg;
930 tmp &= mask;
931 return tmp;
932 }
933
hri_dsu_read_PID2_reg(const void * const hw)934 static inline hri_dsu_pid2_reg_t hri_dsu_read_PID2_reg(const void *const hw)
935 {
936 return ((Dsu *)hw)->PID2.reg;
937 }
938
hri_dsu_get_PID3_CUSMOD_bf(const void * const hw,hri_dsu_pid3_reg_t mask)939 static inline hri_dsu_pid3_reg_t hri_dsu_get_PID3_CUSMOD_bf(const void *const hw, hri_dsu_pid3_reg_t mask)
940 {
941 return (((Dsu *)hw)->PID3.reg & DSU_PID3_CUSMOD(mask)) >> DSU_PID3_CUSMOD_Pos;
942 }
943
hri_dsu_read_PID3_CUSMOD_bf(const void * const hw)944 static inline hri_dsu_pid3_reg_t hri_dsu_read_PID3_CUSMOD_bf(const void *const hw)
945 {
946 return (((Dsu *)hw)->PID3.reg & DSU_PID3_CUSMOD_Msk) >> DSU_PID3_CUSMOD_Pos;
947 }
948
hri_dsu_get_PID3_REVAND_bf(const void * const hw,hri_dsu_pid3_reg_t mask)949 static inline hri_dsu_pid3_reg_t hri_dsu_get_PID3_REVAND_bf(const void *const hw, hri_dsu_pid3_reg_t mask)
950 {
951 return (((Dsu *)hw)->PID3.reg & DSU_PID3_REVAND(mask)) >> DSU_PID3_REVAND_Pos;
952 }
953
hri_dsu_read_PID3_REVAND_bf(const void * const hw)954 static inline hri_dsu_pid3_reg_t hri_dsu_read_PID3_REVAND_bf(const void *const hw)
955 {
956 return (((Dsu *)hw)->PID3.reg & DSU_PID3_REVAND_Msk) >> DSU_PID3_REVAND_Pos;
957 }
958
hri_dsu_get_PID3_reg(const void * const hw,hri_dsu_pid3_reg_t mask)959 static inline hri_dsu_pid3_reg_t hri_dsu_get_PID3_reg(const void *const hw, hri_dsu_pid3_reg_t mask)
960 {
961 uint32_t tmp;
962 tmp = ((Dsu *)hw)->PID3.reg;
963 tmp &= mask;
964 return tmp;
965 }
966
hri_dsu_read_PID3_reg(const void * const hw)967 static inline hri_dsu_pid3_reg_t hri_dsu_read_PID3_reg(const void *const hw)
968 {
969 return ((Dsu *)hw)->PID3.reg;
970 }
971
hri_dsu_get_CID0_PREAMBLEB0_bf(const void * const hw,hri_dsu_cid0_reg_t mask)972 static inline hri_dsu_cid0_reg_t hri_dsu_get_CID0_PREAMBLEB0_bf(const void *const hw, hri_dsu_cid0_reg_t mask)
973 {
974 return (((Dsu *)hw)->CID0.reg & DSU_CID0_PREAMBLEB0(mask)) >> DSU_CID0_PREAMBLEB0_Pos;
975 }
976
hri_dsu_read_CID0_PREAMBLEB0_bf(const void * const hw)977 static inline hri_dsu_cid0_reg_t hri_dsu_read_CID0_PREAMBLEB0_bf(const void *const hw)
978 {
979 return (((Dsu *)hw)->CID0.reg & DSU_CID0_PREAMBLEB0_Msk) >> DSU_CID0_PREAMBLEB0_Pos;
980 }
981
hri_dsu_get_CID0_reg(const void * const hw,hri_dsu_cid0_reg_t mask)982 static inline hri_dsu_cid0_reg_t hri_dsu_get_CID0_reg(const void *const hw, hri_dsu_cid0_reg_t mask)
983 {
984 uint32_t tmp;
985 tmp = ((Dsu *)hw)->CID0.reg;
986 tmp &= mask;
987 return tmp;
988 }
989
hri_dsu_read_CID0_reg(const void * const hw)990 static inline hri_dsu_cid0_reg_t hri_dsu_read_CID0_reg(const void *const hw)
991 {
992 return ((Dsu *)hw)->CID0.reg;
993 }
994
hri_dsu_get_CID1_PREAMBLE_bf(const void * const hw,hri_dsu_cid1_reg_t mask)995 static inline hri_dsu_cid1_reg_t hri_dsu_get_CID1_PREAMBLE_bf(const void *const hw, hri_dsu_cid1_reg_t mask)
996 {
997 return (((Dsu *)hw)->CID1.reg & DSU_CID1_PREAMBLE(mask)) >> DSU_CID1_PREAMBLE_Pos;
998 }
999
hri_dsu_read_CID1_PREAMBLE_bf(const void * const hw)1000 static inline hri_dsu_cid1_reg_t hri_dsu_read_CID1_PREAMBLE_bf(const void *const hw)
1001 {
1002 return (((Dsu *)hw)->CID1.reg & DSU_CID1_PREAMBLE_Msk) >> DSU_CID1_PREAMBLE_Pos;
1003 }
1004
hri_dsu_get_CID1_CCLASS_bf(const void * const hw,hri_dsu_cid1_reg_t mask)1005 static inline hri_dsu_cid1_reg_t hri_dsu_get_CID1_CCLASS_bf(const void *const hw, hri_dsu_cid1_reg_t mask)
1006 {
1007 return (((Dsu *)hw)->CID1.reg & DSU_CID1_CCLASS(mask)) >> DSU_CID1_CCLASS_Pos;
1008 }
1009
hri_dsu_read_CID1_CCLASS_bf(const void * const hw)1010 static inline hri_dsu_cid1_reg_t hri_dsu_read_CID1_CCLASS_bf(const void *const hw)
1011 {
1012 return (((Dsu *)hw)->CID1.reg & DSU_CID1_CCLASS_Msk) >> DSU_CID1_CCLASS_Pos;
1013 }
1014
hri_dsu_get_CID1_reg(const void * const hw,hri_dsu_cid1_reg_t mask)1015 static inline hri_dsu_cid1_reg_t hri_dsu_get_CID1_reg(const void *const hw, hri_dsu_cid1_reg_t mask)
1016 {
1017 uint32_t tmp;
1018 tmp = ((Dsu *)hw)->CID1.reg;
1019 tmp &= mask;
1020 return tmp;
1021 }
1022
hri_dsu_read_CID1_reg(const void * const hw)1023 static inline hri_dsu_cid1_reg_t hri_dsu_read_CID1_reg(const void *const hw)
1024 {
1025 return ((Dsu *)hw)->CID1.reg;
1026 }
1027
hri_dsu_get_CID2_PREAMBLEB2_bf(const void * const hw,hri_dsu_cid2_reg_t mask)1028 static inline hri_dsu_cid2_reg_t hri_dsu_get_CID2_PREAMBLEB2_bf(const void *const hw, hri_dsu_cid2_reg_t mask)
1029 {
1030 return (((Dsu *)hw)->CID2.reg & DSU_CID2_PREAMBLEB2(mask)) >> DSU_CID2_PREAMBLEB2_Pos;
1031 }
1032
hri_dsu_read_CID2_PREAMBLEB2_bf(const void * const hw)1033 static inline hri_dsu_cid2_reg_t hri_dsu_read_CID2_PREAMBLEB2_bf(const void *const hw)
1034 {
1035 return (((Dsu *)hw)->CID2.reg & DSU_CID2_PREAMBLEB2_Msk) >> DSU_CID2_PREAMBLEB2_Pos;
1036 }
1037
hri_dsu_get_CID2_reg(const void * const hw,hri_dsu_cid2_reg_t mask)1038 static inline hri_dsu_cid2_reg_t hri_dsu_get_CID2_reg(const void *const hw, hri_dsu_cid2_reg_t mask)
1039 {
1040 uint32_t tmp;
1041 tmp = ((Dsu *)hw)->CID2.reg;
1042 tmp &= mask;
1043 return tmp;
1044 }
1045
hri_dsu_read_CID2_reg(const void * const hw)1046 static inline hri_dsu_cid2_reg_t hri_dsu_read_CID2_reg(const void *const hw)
1047 {
1048 return ((Dsu *)hw)->CID2.reg;
1049 }
1050
hri_dsu_get_CID3_PREAMBLEB3_bf(const void * const hw,hri_dsu_cid3_reg_t mask)1051 static inline hri_dsu_cid3_reg_t hri_dsu_get_CID3_PREAMBLEB3_bf(const void *const hw, hri_dsu_cid3_reg_t mask)
1052 {
1053 return (((Dsu *)hw)->CID3.reg & DSU_CID3_PREAMBLEB3(mask)) >> DSU_CID3_PREAMBLEB3_Pos;
1054 }
1055
hri_dsu_read_CID3_PREAMBLEB3_bf(const void * const hw)1056 static inline hri_dsu_cid3_reg_t hri_dsu_read_CID3_PREAMBLEB3_bf(const void *const hw)
1057 {
1058 return (((Dsu *)hw)->CID3.reg & DSU_CID3_PREAMBLEB3_Msk) >> DSU_CID3_PREAMBLEB3_Pos;
1059 }
1060
hri_dsu_get_CID3_reg(const void * const hw,hri_dsu_cid3_reg_t mask)1061 static inline hri_dsu_cid3_reg_t hri_dsu_get_CID3_reg(const void *const hw, hri_dsu_cid3_reg_t mask)
1062 {
1063 uint32_t tmp;
1064 tmp = ((Dsu *)hw)->CID3.reg;
1065 tmp &= mask;
1066 return tmp;
1067 }
1068
hri_dsu_read_CID3_reg(const void * const hw)1069 static inline hri_dsu_cid3_reg_t hri_dsu_read_CID3_reg(const void *const hw)
1070 {
1071 return ((Dsu *)hw)->CID3.reg;
1072 }
1073
hri_dsu_get_STATUSA_DONE_bit(const void * const hw)1074 static inline bool hri_dsu_get_STATUSA_DONE_bit(const void *const hw)
1075 {
1076 return (((Dsu *)hw)->STATUSA.reg & DSU_STATUSA_DONE) >> DSU_STATUSA_DONE_Pos;
1077 }
1078
hri_dsu_clear_STATUSA_DONE_bit(const void * const hw)1079 static inline void hri_dsu_clear_STATUSA_DONE_bit(const void *const hw)
1080 {
1081 DSU_CRITICAL_SECTION_ENTER();
1082 ((Dsu *)hw)->STATUSA.reg = DSU_STATUSA_DONE;
1083 DSU_CRITICAL_SECTION_LEAVE();
1084 }
1085
hri_dsu_get_STATUSA_CRSTEXT_bit(const void * const hw)1086 static inline bool hri_dsu_get_STATUSA_CRSTEXT_bit(const void *const hw)
1087 {
1088 return (((Dsu *)hw)->STATUSA.reg & DSU_STATUSA_CRSTEXT) >> DSU_STATUSA_CRSTEXT_Pos;
1089 }
1090
hri_dsu_clear_STATUSA_CRSTEXT_bit(const void * const hw)1091 static inline void hri_dsu_clear_STATUSA_CRSTEXT_bit(const void *const hw)
1092 {
1093 DSU_CRITICAL_SECTION_ENTER();
1094 ((Dsu *)hw)->STATUSA.reg = DSU_STATUSA_CRSTEXT;
1095 DSU_CRITICAL_SECTION_LEAVE();
1096 }
1097
hri_dsu_get_STATUSA_BERR_bit(const void * const hw)1098 static inline bool hri_dsu_get_STATUSA_BERR_bit(const void *const hw)
1099 {
1100 return (((Dsu *)hw)->STATUSA.reg & DSU_STATUSA_BERR) >> DSU_STATUSA_BERR_Pos;
1101 }
1102
hri_dsu_clear_STATUSA_BERR_bit(const void * const hw)1103 static inline void hri_dsu_clear_STATUSA_BERR_bit(const void *const hw)
1104 {
1105 DSU_CRITICAL_SECTION_ENTER();
1106 ((Dsu *)hw)->STATUSA.reg = DSU_STATUSA_BERR;
1107 DSU_CRITICAL_SECTION_LEAVE();
1108 }
1109
hri_dsu_get_STATUSA_FAIL_bit(const void * const hw)1110 static inline bool hri_dsu_get_STATUSA_FAIL_bit(const void *const hw)
1111 {
1112 return (((Dsu *)hw)->STATUSA.reg & DSU_STATUSA_FAIL) >> DSU_STATUSA_FAIL_Pos;
1113 }
1114
hri_dsu_clear_STATUSA_FAIL_bit(const void * const hw)1115 static inline void hri_dsu_clear_STATUSA_FAIL_bit(const void *const hw)
1116 {
1117 DSU_CRITICAL_SECTION_ENTER();
1118 ((Dsu *)hw)->STATUSA.reg = DSU_STATUSA_FAIL;
1119 DSU_CRITICAL_SECTION_LEAVE();
1120 }
1121
hri_dsu_get_STATUSA_PERR_bit(const void * const hw)1122 static inline bool hri_dsu_get_STATUSA_PERR_bit(const void *const hw)
1123 {
1124 return (((Dsu *)hw)->STATUSA.reg & DSU_STATUSA_PERR) >> DSU_STATUSA_PERR_Pos;
1125 }
1126
hri_dsu_clear_STATUSA_PERR_bit(const void * const hw)1127 static inline void hri_dsu_clear_STATUSA_PERR_bit(const void *const hw)
1128 {
1129 DSU_CRITICAL_SECTION_ENTER();
1130 ((Dsu *)hw)->STATUSA.reg = DSU_STATUSA_PERR;
1131 DSU_CRITICAL_SECTION_LEAVE();
1132 }
1133
hri_dsu_get_STATUSA_reg(const void * const hw,hri_dsu_statusa_reg_t mask)1134 static inline hri_dsu_statusa_reg_t hri_dsu_get_STATUSA_reg(const void *const hw, hri_dsu_statusa_reg_t mask)
1135 {
1136 uint8_t tmp;
1137 tmp = ((Dsu *)hw)->STATUSA.reg;
1138 tmp &= mask;
1139 return tmp;
1140 }
1141
hri_dsu_clear_STATUSA_reg(const void * const hw,hri_dsu_statusa_reg_t mask)1142 static inline void hri_dsu_clear_STATUSA_reg(const void *const hw, hri_dsu_statusa_reg_t mask)
1143 {
1144 DSU_CRITICAL_SECTION_ENTER();
1145 ((Dsu *)hw)->STATUSA.reg = mask;
1146 DSU_CRITICAL_SECTION_LEAVE();
1147 }
1148
hri_dsu_read_STATUSA_reg(const void * const hw)1149 static inline hri_dsu_statusa_reg_t hri_dsu_read_STATUSA_reg(const void *const hw)
1150 {
1151 return ((Dsu *)hw)->STATUSA.reg;
1152 }
1153
1154 #ifdef __cplusplus
1155 }
1156 #endif
1157
1158 #endif /* _HRI_DSU_L21_H_INCLUDED */
1159 #endif /* _SAML21_DSU_COMPONENT_ */
1160