1 /**
2  * \file
3  *
4  * \brief SAM MTB
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_MTB_COMPONENT_
44 #ifndef _HRI_MTB_L21_H_INCLUDED_
45 #define _HRI_MTB_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_MTB_CRITICAL_SECTIONS)
55 #define MTB_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
56 #define MTB_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
57 #else
58 #define MTB_CRITICAL_SECTION_ENTER()
59 #define MTB_CRITICAL_SECTION_LEAVE()
60 #endif
61 
62 typedef uint32_t hri_mtb_authstatus_reg_t;
63 typedef uint32_t hri_mtb_base_reg_t;
64 typedef uint32_t hri_mtb_cid0_reg_t;
65 typedef uint32_t hri_mtb_cid1_reg_t;
66 typedef uint32_t hri_mtb_cid2_reg_t;
67 typedef uint32_t hri_mtb_cid3_reg_t;
68 typedef uint32_t hri_mtb_claimset_reg_t;
69 typedef uint32_t hri_mtb_devarch_reg_t;
70 typedef uint32_t hri_mtb_devid_reg_t;
71 typedef uint32_t hri_mtb_devtype_reg_t;
72 typedef uint32_t hri_mtb_flow_reg_t;
73 typedef uint32_t hri_mtb_itctrl_reg_t;
74 typedef uint32_t hri_mtb_lockaccess_reg_t;
75 typedef uint32_t hri_mtb_lockstatus_reg_t;
76 typedef uint32_t hri_mtb_master_reg_t;
77 typedef uint32_t hri_mtb_pid0_reg_t;
78 typedef uint32_t hri_mtb_pid1_reg_t;
79 typedef uint32_t hri_mtb_pid2_reg_t;
80 typedef uint32_t hri_mtb_pid3_reg_t;
81 typedef uint32_t hri_mtb_pid4_reg_t;
82 typedef uint32_t hri_mtb_pid5_reg_t;
83 typedef uint32_t hri_mtb_pid6_reg_t;
84 typedef uint32_t hri_mtb_pid7_reg_t;
85 typedef uint32_t hri_mtb_position_reg_t;
86 
hri_mtb_set_CLAIM_reg(const void * const hw,hri_mtb_claimset_reg_t mask)87 static inline void hri_mtb_set_CLAIM_reg(const void *const hw, hri_mtb_claimset_reg_t mask)
88 {
89 	((Mtb *)hw)->CLAIMSET.reg = mask;
90 }
91 
hri_mtb_get_CLAIM_reg(const void * const hw,hri_mtb_claimset_reg_t mask)92 static inline hri_mtb_claimset_reg_t hri_mtb_get_CLAIM_reg(const void *const hw, hri_mtb_claimset_reg_t mask)
93 {
94 	uint32_t tmp;
95 	tmp = ((Mtb *)hw)->CLAIMSET.reg;
96 	tmp &= mask;
97 	return tmp;
98 }
99 
hri_mtb_read_CLAIM_reg(const void * const hw)100 static inline hri_mtb_claimset_reg_t hri_mtb_read_CLAIM_reg(const void *const hw)
101 {
102 	return ((Mtb *)hw)->CLAIMSET.reg;
103 }
104 
hri_mtb_write_CLAIM_reg(const void * const hw,hri_mtb_claimset_reg_t data)105 static inline void hri_mtb_write_CLAIM_reg(const void *const hw, hri_mtb_claimset_reg_t data)
106 {
107 	((Mtb *)hw)->CLAIMSET.reg = data;
108 	((Mtb *)hw)->CLAIMCLR.reg = ~data;
109 }
110 
hri_mtb_clear_CLAIM_reg(const void * const hw,hri_mtb_claimset_reg_t mask)111 static inline void hri_mtb_clear_CLAIM_reg(const void *const hw, hri_mtb_claimset_reg_t mask)
112 {
113 	((Mtb *)hw)->CLAIMCLR.reg = mask;
114 }
115 
hri_mtb_set_POSITION_reg(const void * const hw,hri_mtb_position_reg_t mask)116 static inline void hri_mtb_set_POSITION_reg(const void *const hw, hri_mtb_position_reg_t mask)
117 {
118 	MTB_CRITICAL_SECTION_ENTER();
119 	((Mtb *)hw)->POSITION.reg |= mask;
120 	MTB_CRITICAL_SECTION_LEAVE();
121 }
122 
hri_mtb_get_POSITION_reg(const void * const hw,hri_mtb_position_reg_t mask)123 static inline hri_mtb_position_reg_t hri_mtb_get_POSITION_reg(const void *const hw, hri_mtb_position_reg_t mask)
124 {
125 	uint32_t tmp;
126 	tmp = ((Mtb *)hw)->POSITION.reg;
127 	tmp &= mask;
128 	return tmp;
129 }
130 
hri_mtb_write_POSITION_reg(const void * const hw,hri_mtb_position_reg_t data)131 static inline void hri_mtb_write_POSITION_reg(const void *const hw, hri_mtb_position_reg_t data)
132 {
133 	MTB_CRITICAL_SECTION_ENTER();
134 	((Mtb *)hw)->POSITION.reg = data;
135 	MTB_CRITICAL_SECTION_LEAVE();
136 }
137 
hri_mtb_clear_POSITION_reg(const void * const hw,hri_mtb_position_reg_t mask)138 static inline void hri_mtb_clear_POSITION_reg(const void *const hw, hri_mtb_position_reg_t mask)
139 {
140 	MTB_CRITICAL_SECTION_ENTER();
141 	((Mtb *)hw)->POSITION.reg &= ~mask;
142 	MTB_CRITICAL_SECTION_LEAVE();
143 }
144 
hri_mtb_toggle_POSITION_reg(const void * const hw,hri_mtb_position_reg_t mask)145 static inline void hri_mtb_toggle_POSITION_reg(const void *const hw, hri_mtb_position_reg_t mask)
146 {
147 	MTB_CRITICAL_SECTION_ENTER();
148 	((Mtb *)hw)->POSITION.reg ^= mask;
149 	MTB_CRITICAL_SECTION_LEAVE();
150 }
151 
hri_mtb_read_POSITION_reg(const void * const hw)152 static inline hri_mtb_position_reg_t hri_mtb_read_POSITION_reg(const void *const hw)
153 {
154 	return ((Mtb *)hw)->POSITION.reg;
155 }
156 
hri_mtb_set_MASTER_reg(const void * const hw,hri_mtb_master_reg_t mask)157 static inline void hri_mtb_set_MASTER_reg(const void *const hw, hri_mtb_master_reg_t mask)
158 {
159 	MTB_CRITICAL_SECTION_ENTER();
160 	((Mtb *)hw)->MASTER.reg |= mask;
161 	MTB_CRITICAL_SECTION_LEAVE();
162 }
163 
hri_mtb_get_MASTER_reg(const void * const hw,hri_mtb_master_reg_t mask)164 static inline hri_mtb_master_reg_t hri_mtb_get_MASTER_reg(const void *const hw, hri_mtb_master_reg_t mask)
165 {
166 	uint32_t tmp;
167 	tmp = ((Mtb *)hw)->MASTER.reg;
168 	tmp &= mask;
169 	return tmp;
170 }
171 
hri_mtb_write_MASTER_reg(const void * const hw,hri_mtb_master_reg_t data)172 static inline void hri_mtb_write_MASTER_reg(const void *const hw, hri_mtb_master_reg_t data)
173 {
174 	MTB_CRITICAL_SECTION_ENTER();
175 	((Mtb *)hw)->MASTER.reg = data;
176 	MTB_CRITICAL_SECTION_LEAVE();
177 }
178 
hri_mtb_clear_MASTER_reg(const void * const hw,hri_mtb_master_reg_t mask)179 static inline void hri_mtb_clear_MASTER_reg(const void *const hw, hri_mtb_master_reg_t mask)
180 {
181 	MTB_CRITICAL_SECTION_ENTER();
182 	((Mtb *)hw)->MASTER.reg &= ~mask;
183 	MTB_CRITICAL_SECTION_LEAVE();
184 }
185 
hri_mtb_toggle_MASTER_reg(const void * const hw,hri_mtb_master_reg_t mask)186 static inline void hri_mtb_toggle_MASTER_reg(const void *const hw, hri_mtb_master_reg_t mask)
187 {
188 	MTB_CRITICAL_SECTION_ENTER();
189 	((Mtb *)hw)->MASTER.reg ^= mask;
190 	MTB_CRITICAL_SECTION_LEAVE();
191 }
192 
hri_mtb_read_MASTER_reg(const void * const hw)193 static inline hri_mtb_master_reg_t hri_mtb_read_MASTER_reg(const void *const hw)
194 {
195 	return ((Mtb *)hw)->MASTER.reg;
196 }
197 
hri_mtb_set_FLOW_reg(const void * const hw,hri_mtb_flow_reg_t mask)198 static inline void hri_mtb_set_FLOW_reg(const void *const hw, hri_mtb_flow_reg_t mask)
199 {
200 	MTB_CRITICAL_SECTION_ENTER();
201 	((Mtb *)hw)->FLOW.reg |= mask;
202 	MTB_CRITICAL_SECTION_LEAVE();
203 }
204 
hri_mtb_get_FLOW_reg(const void * const hw,hri_mtb_flow_reg_t mask)205 static inline hri_mtb_flow_reg_t hri_mtb_get_FLOW_reg(const void *const hw, hri_mtb_flow_reg_t mask)
206 {
207 	uint32_t tmp;
208 	tmp = ((Mtb *)hw)->FLOW.reg;
209 	tmp &= mask;
210 	return tmp;
211 }
212 
hri_mtb_write_FLOW_reg(const void * const hw,hri_mtb_flow_reg_t data)213 static inline void hri_mtb_write_FLOW_reg(const void *const hw, hri_mtb_flow_reg_t data)
214 {
215 	MTB_CRITICAL_SECTION_ENTER();
216 	((Mtb *)hw)->FLOW.reg = data;
217 	MTB_CRITICAL_SECTION_LEAVE();
218 }
219 
hri_mtb_clear_FLOW_reg(const void * const hw,hri_mtb_flow_reg_t mask)220 static inline void hri_mtb_clear_FLOW_reg(const void *const hw, hri_mtb_flow_reg_t mask)
221 {
222 	MTB_CRITICAL_SECTION_ENTER();
223 	((Mtb *)hw)->FLOW.reg &= ~mask;
224 	MTB_CRITICAL_SECTION_LEAVE();
225 }
226 
hri_mtb_toggle_FLOW_reg(const void * const hw,hri_mtb_flow_reg_t mask)227 static inline void hri_mtb_toggle_FLOW_reg(const void *const hw, hri_mtb_flow_reg_t mask)
228 {
229 	MTB_CRITICAL_SECTION_ENTER();
230 	((Mtb *)hw)->FLOW.reg ^= mask;
231 	MTB_CRITICAL_SECTION_LEAVE();
232 }
233 
hri_mtb_read_FLOW_reg(const void * const hw)234 static inline hri_mtb_flow_reg_t hri_mtb_read_FLOW_reg(const void *const hw)
235 {
236 	return ((Mtb *)hw)->FLOW.reg;
237 }
238 
hri_mtb_set_ITCTRL_reg(const void * const hw,hri_mtb_itctrl_reg_t mask)239 static inline void hri_mtb_set_ITCTRL_reg(const void *const hw, hri_mtb_itctrl_reg_t mask)
240 {
241 	MTB_CRITICAL_SECTION_ENTER();
242 	((Mtb *)hw)->ITCTRL.reg |= mask;
243 	MTB_CRITICAL_SECTION_LEAVE();
244 }
245 
hri_mtb_get_ITCTRL_reg(const void * const hw,hri_mtb_itctrl_reg_t mask)246 static inline hri_mtb_itctrl_reg_t hri_mtb_get_ITCTRL_reg(const void *const hw, hri_mtb_itctrl_reg_t mask)
247 {
248 	uint32_t tmp;
249 	tmp = ((Mtb *)hw)->ITCTRL.reg;
250 	tmp &= mask;
251 	return tmp;
252 }
253 
hri_mtb_write_ITCTRL_reg(const void * const hw,hri_mtb_itctrl_reg_t data)254 static inline void hri_mtb_write_ITCTRL_reg(const void *const hw, hri_mtb_itctrl_reg_t data)
255 {
256 	MTB_CRITICAL_SECTION_ENTER();
257 	((Mtb *)hw)->ITCTRL.reg = data;
258 	MTB_CRITICAL_SECTION_LEAVE();
259 }
260 
hri_mtb_clear_ITCTRL_reg(const void * const hw,hri_mtb_itctrl_reg_t mask)261 static inline void hri_mtb_clear_ITCTRL_reg(const void *const hw, hri_mtb_itctrl_reg_t mask)
262 {
263 	MTB_CRITICAL_SECTION_ENTER();
264 	((Mtb *)hw)->ITCTRL.reg &= ~mask;
265 	MTB_CRITICAL_SECTION_LEAVE();
266 }
267 
hri_mtb_toggle_ITCTRL_reg(const void * const hw,hri_mtb_itctrl_reg_t mask)268 static inline void hri_mtb_toggle_ITCTRL_reg(const void *const hw, hri_mtb_itctrl_reg_t mask)
269 {
270 	MTB_CRITICAL_SECTION_ENTER();
271 	((Mtb *)hw)->ITCTRL.reg ^= mask;
272 	MTB_CRITICAL_SECTION_LEAVE();
273 }
274 
hri_mtb_read_ITCTRL_reg(const void * const hw)275 static inline hri_mtb_itctrl_reg_t hri_mtb_read_ITCTRL_reg(const void *const hw)
276 {
277 	return ((Mtb *)hw)->ITCTRL.reg;
278 }
279 
hri_mtb_set_LOCKACCESS_reg(const void * const hw,hri_mtb_lockaccess_reg_t mask)280 static inline void hri_mtb_set_LOCKACCESS_reg(const void *const hw, hri_mtb_lockaccess_reg_t mask)
281 {
282 	MTB_CRITICAL_SECTION_ENTER();
283 	((Mtb *)hw)->LOCKACCESS.reg |= mask;
284 	MTB_CRITICAL_SECTION_LEAVE();
285 }
286 
hri_mtb_get_LOCKACCESS_reg(const void * const hw,hri_mtb_lockaccess_reg_t mask)287 static inline hri_mtb_lockaccess_reg_t hri_mtb_get_LOCKACCESS_reg(const void *const hw, hri_mtb_lockaccess_reg_t mask)
288 {
289 	uint32_t tmp;
290 	tmp = ((Mtb *)hw)->LOCKACCESS.reg;
291 	tmp &= mask;
292 	return tmp;
293 }
294 
hri_mtb_write_LOCKACCESS_reg(const void * const hw,hri_mtb_lockaccess_reg_t data)295 static inline void hri_mtb_write_LOCKACCESS_reg(const void *const hw, hri_mtb_lockaccess_reg_t data)
296 {
297 	MTB_CRITICAL_SECTION_ENTER();
298 	((Mtb *)hw)->LOCKACCESS.reg = data;
299 	MTB_CRITICAL_SECTION_LEAVE();
300 }
301 
hri_mtb_clear_LOCKACCESS_reg(const void * const hw,hri_mtb_lockaccess_reg_t mask)302 static inline void hri_mtb_clear_LOCKACCESS_reg(const void *const hw, hri_mtb_lockaccess_reg_t mask)
303 {
304 	MTB_CRITICAL_SECTION_ENTER();
305 	((Mtb *)hw)->LOCKACCESS.reg &= ~mask;
306 	MTB_CRITICAL_SECTION_LEAVE();
307 }
308 
hri_mtb_toggle_LOCKACCESS_reg(const void * const hw,hri_mtb_lockaccess_reg_t mask)309 static inline void hri_mtb_toggle_LOCKACCESS_reg(const void *const hw, hri_mtb_lockaccess_reg_t mask)
310 {
311 	MTB_CRITICAL_SECTION_ENTER();
312 	((Mtb *)hw)->LOCKACCESS.reg ^= mask;
313 	MTB_CRITICAL_SECTION_LEAVE();
314 }
315 
hri_mtb_read_LOCKACCESS_reg(const void * const hw)316 static inline hri_mtb_lockaccess_reg_t hri_mtb_read_LOCKACCESS_reg(const void *const hw)
317 {
318 	return ((Mtb *)hw)->LOCKACCESS.reg;
319 }
320 
hri_mtb_get_BASE_reg(const void * const hw,hri_mtb_base_reg_t mask)321 static inline hri_mtb_base_reg_t hri_mtb_get_BASE_reg(const void *const hw, hri_mtb_base_reg_t mask)
322 {
323 	uint32_t tmp;
324 	tmp = ((Mtb *)hw)->BASE.reg;
325 	tmp &= mask;
326 	return tmp;
327 }
328 
hri_mtb_read_BASE_reg(const void * const hw)329 static inline hri_mtb_base_reg_t hri_mtb_read_BASE_reg(const void *const hw)
330 {
331 	return ((Mtb *)hw)->BASE.reg;
332 }
333 
hri_mtb_get_LOCKSTATUS_reg(const void * const hw,hri_mtb_lockstatus_reg_t mask)334 static inline hri_mtb_lockstatus_reg_t hri_mtb_get_LOCKSTATUS_reg(const void *const hw, hri_mtb_lockstatus_reg_t mask)
335 {
336 	uint32_t tmp;
337 	tmp = ((Mtb *)hw)->LOCKSTATUS.reg;
338 	tmp &= mask;
339 	return tmp;
340 }
341 
hri_mtb_read_LOCKSTATUS_reg(const void * const hw)342 static inline hri_mtb_lockstatus_reg_t hri_mtb_read_LOCKSTATUS_reg(const void *const hw)
343 {
344 	return ((Mtb *)hw)->LOCKSTATUS.reg;
345 }
346 
hri_mtb_get_AUTHSTATUS_reg(const void * const hw,hri_mtb_authstatus_reg_t mask)347 static inline hri_mtb_authstatus_reg_t hri_mtb_get_AUTHSTATUS_reg(const void *const hw, hri_mtb_authstatus_reg_t mask)
348 {
349 	uint32_t tmp;
350 	tmp = ((Mtb *)hw)->AUTHSTATUS.reg;
351 	tmp &= mask;
352 	return tmp;
353 }
354 
hri_mtb_read_AUTHSTATUS_reg(const void * const hw)355 static inline hri_mtb_authstatus_reg_t hri_mtb_read_AUTHSTATUS_reg(const void *const hw)
356 {
357 	return ((Mtb *)hw)->AUTHSTATUS.reg;
358 }
359 
hri_mtb_get_DEVARCH_reg(const void * const hw,hri_mtb_devarch_reg_t mask)360 static inline hri_mtb_devarch_reg_t hri_mtb_get_DEVARCH_reg(const void *const hw, hri_mtb_devarch_reg_t mask)
361 {
362 	uint32_t tmp;
363 	tmp = ((Mtb *)hw)->DEVARCH.reg;
364 	tmp &= mask;
365 	return tmp;
366 }
367 
hri_mtb_read_DEVARCH_reg(const void * const hw)368 static inline hri_mtb_devarch_reg_t hri_mtb_read_DEVARCH_reg(const void *const hw)
369 {
370 	return ((Mtb *)hw)->DEVARCH.reg;
371 }
372 
hri_mtb_get_DEVID_reg(const void * const hw,hri_mtb_devid_reg_t mask)373 static inline hri_mtb_devid_reg_t hri_mtb_get_DEVID_reg(const void *const hw, hri_mtb_devid_reg_t mask)
374 {
375 	uint32_t tmp;
376 	tmp = ((Mtb *)hw)->DEVID.reg;
377 	tmp &= mask;
378 	return tmp;
379 }
380 
hri_mtb_read_DEVID_reg(const void * const hw)381 static inline hri_mtb_devid_reg_t hri_mtb_read_DEVID_reg(const void *const hw)
382 {
383 	return ((Mtb *)hw)->DEVID.reg;
384 }
385 
hri_mtb_get_DEVTYPE_reg(const void * const hw,hri_mtb_devtype_reg_t mask)386 static inline hri_mtb_devtype_reg_t hri_mtb_get_DEVTYPE_reg(const void *const hw, hri_mtb_devtype_reg_t mask)
387 {
388 	uint32_t tmp;
389 	tmp = ((Mtb *)hw)->DEVTYPE.reg;
390 	tmp &= mask;
391 	return tmp;
392 }
393 
hri_mtb_read_DEVTYPE_reg(const void * const hw)394 static inline hri_mtb_devtype_reg_t hri_mtb_read_DEVTYPE_reg(const void *const hw)
395 {
396 	return ((Mtb *)hw)->DEVTYPE.reg;
397 }
398 
hri_mtb_get_PID4_reg(const void * const hw,hri_mtb_pid4_reg_t mask)399 static inline hri_mtb_pid4_reg_t hri_mtb_get_PID4_reg(const void *const hw, hri_mtb_pid4_reg_t mask)
400 {
401 	uint32_t tmp;
402 	tmp = ((Mtb *)hw)->PID4.reg;
403 	tmp &= mask;
404 	return tmp;
405 }
406 
hri_mtb_read_PID4_reg(const void * const hw)407 static inline hri_mtb_pid4_reg_t hri_mtb_read_PID4_reg(const void *const hw)
408 {
409 	return ((Mtb *)hw)->PID4.reg;
410 }
411 
hri_mtb_get_PID5_reg(const void * const hw,hri_mtb_pid5_reg_t mask)412 static inline hri_mtb_pid5_reg_t hri_mtb_get_PID5_reg(const void *const hw, hri_mtb_pid5_reg_t mask)
413 {
414 	uint32_t tmp;
415 	tmp = ((Mtb *)hw)->PID5.reg;
416 	tmp &= mask;
417 	return tmp;
418 }
419 
hri_mtb_read_PID5_reg(const void * const hw)420 static inline hri_mtb_pid5_reg_t hri_mtb_read_PID5_reg(const void *const hw)
421 {
422 	return ((Mtb *)hw)->PID5.reg;
423 }
424 
hri_mtb_get_PID6_reg(const void * const hw,hri_mtb_pid6_reg_t mask)425 static inline hri_mtb_pid6_reg_t hri_mtb_get_PID6_reg(const void *const hw, hri_mtb_pid6_reg_t mask)
426 {
427 	uint32_t tmp;
428 	tmp = ((Mtb *)hw)->PID6.reg;
429 	tmp &= mask;
430 	return tmp;
431 }
432 
hri_mtb_read_PID6_reg(const void * const hw)433 static inline hri_mtb_pid6_reg_t hri_mtb_read_PID6_reg(const void *const hw)
434 {
435 	return ((Mtb *)hw)->PID6.reg;
436 }
437 
hri_mtb_get_PID7_reg(const void * const hw,hri_mtb_pid7_reg_t mask)438 static inline hri_mtb_pid7_reg_t hri_mtb_get_PID7_reg(const void *const hw, hri_mtb_pid7_reg_t mask)
439 {
440 	uint32_t tmp;
441 	tmp = ((Mtb *)hw)->PID7.reg;
442 	tmp &= mask;
443 	return tmp;
444 }
445 
hri_mtb_read_PID7_reg(const void * const hw)446 static inline hri_mtb_pid7_reg_t hri_mtb_read_PID7_reg(const void *const hw)
447 {
448 	return ((Mtb *)hw)->PID7.reg;
449 }
450 
hri_mtb_get_PID0_reg(const void * const hw,hri_mtb_pid0_reg_t mask)451 static inline hri_mtb_pid0_reg_t hri_mtb_get_PID0_reg(const void *const hw, hri_mtb_pid0_reg_t mask)
452 {
453 	uint32_t tmp;
454 	tmp = ((Mtb *)hw)->PID0.reg;
455 	tmp &= mask;
456 	return tmp;
457 }
458 
hri_mtb_read_PID0_reg(const void * const hw)459 static inline hri_mtb_pid0_reg_t hri_mtb_read_PID0_reg(const void *const hw)
460 {
461 	return ((Mtb *)hw)->PID0.reg;
462 }
463 
hri_mtb_get_PID1_reg(const void * const hw,hri_mtb_pid1_reg_t mask)464 static inline hri_mtb_pid1_reg_t hri_mtb_get_PID1_reg(const void *const hw, hri_mtb_pid1_reg_t mask)
465 {
466 	uint32_t tmp;
467 	tmp = ((Mtb *)hw)->PID1.reg;
468 	tmp &= mask;
469 	return tmp;
470 }
471 
hri_mtb_read_PID1_reg(const void * const hw)472 static inline hri_mtb_pid1_reg_t hri_mtb_read_PID1_reg(const void *const hw)
473 {
474 	return ((Mtb *)hw)->PID1.reg;
475 }
476 
hri_mtb_get_PID2_reg(const void * const hw,hri_mtb_pid2_reg_t mask)477 static inline hri_mtb_pid2_reg_t hri_mtb_get_PID2_reg(const void *const hw, hri_mtb_pid2_reg_t mask)
478 {
479 	uint32_t tmp;
480 	tmp = ((Mtb *)hw)->PID2.reg;
481 	tmp &= mask;
482 	return tmp;
483 }
484 
hri_mtb_read_PID2_reg(const void * const hw)485 static inline hri_mtb_pid2_reg_t hri_mtb_read_PID2_reg(const void *const hw)
486 {
487 	return ((Mtb *)hw)->PID2.reg;
488 }
489 
hri_mtb_get_PID3_reg(const void * const hw,hri_mtb_pid3_reg_t mask)490 static inline hri_mtb_pid3_reg_t hri_mtb_get_PID3_reg(const void *const hw, hri_mtb_pid3_reg_t mask)
491 {
492 	uint32_t tmp;
493 	tmp = ((Mtb *)hw)->PID3.reg;
494 	tmp &= mask;
495 	return tmp;
496 }
497 
hri_mtb_read_PID3_reg(const void * const hw)498 static inline hri_mtb_pid3_reg_t hri_mtb_read_PID3_reg(const void *const hw)
499 {
500 	return ((Mtb *)hw)->PID3.reg;
501 }
502 
hri_mtb_get_CID0_reg(const void * const hw,hri_mtb_cid0_reg_t mask)503 static inline hri_mtb_cid0_reg_t hri_mtb_get_CID0_reg(const void *const hw, hri_mtb_cid0_reg_t mask)
504 {
505 	uint32_t tmp;
506 	tmp = ((Mtb *)hw)->CID0.reg;
507 	tmp &= mask;
508 	return tmp;
509 }
510 
hri_mtb_read_CID0_reg(const void * const hw)511 static inline hri_mtb_cid0_reg_t hri_mtb_read_CID0_reg(const void *const hw)
512 {
513 	return ((Mtb *)hw)->CID0.reg;
514 }
515 
hri_mtb_get_CID1_reg(const void * const hw,hri_mtb_cid1_reg_t mask)516 static inline hri_mtb_cid1_reg_t hri_mtb_get_CID1_reg(const void *const hw, hri_mtb_cid1_reg_t mask)
517 {
518 	uint32_t tmp;
519 	tmp = ((Mtb *)hw)->CID1.reg;
520 	tmp &= mask;
521 	return tmp;
522 }
523 
hri_mtb_read_CID1_reg(const void * const hw)524 static inline hri_mtb_cid1_reg_t hri_mtb_read_CID1_reg(const void *const hw)
525 {
526 	return ((Mtb *)hw)->CID1.reg;
527 }
528 
hri_mtb_get_CID2_reg(const void * const hw,hri_mtb_cid2_reg_t mask)529 static inline hri_mtb_cid2_reg_t hri_mtb_get_CID2_reg(const void *const hw, hri_mtb_cid2_reg_t mask)
530 {
531 	uint32_t tmp;
532 	tmp = ((Mtb *)hw)->CID2.reg;
533 	tmp &= mask;
534 	return tmp;
535 }
536 
hri_mtb_read_CID2_reg(const void * const hw)537 static inline hri_mtb_cid2_reg_t hri_mtb_read_CID2_reg(const void *const hw)
538 {
539 	return ((Mtb *)hw)->CID2.reg;
540 }
541 
hri_mtb_get_CID3_reg(const void * const hw,hri_mtb_cid3_reg_t mask)542 static inline hri_mtb_cid3_reg_t hri_mtb_get_CID3_reg(const void *const hw, hri_mtb_cid3_reg_t mask)
543 {
544 	uint32_t tmp;
545 	tmp = ((Mtb *)hw)->CID3.reg;
546 	tmp &= mask;
547 	return tmp;
548 }
549 
hri_mtb_read_CID3_reg(const void * const hw)550 static inline hri_mtb_cid3_reg_t hri_mtb_read_CID3_reg(const void *const hw)
551 {
552 	return ((Mtb *)hw)->CID3.reg;
553 }
554 
555 #ifdef __cplusplus
556 }
557 #endif
558 
559 #endif /* _HRI_MTB_L21_H_INCLUDED */
560 #endif /* _SAML21_MTB_COMPONENT_ */
561