1 /**
2  * \file
3  *
4  * \brief SAM NVMCTRL
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_NVMCTRL_COMPONENT_
44 #ifndef _HRI_NVMCTRL_L21_H_INCLUDED_
45 #define _HRI_NVMCTRL_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_NVMCTRL_CRITICAL_SECTIONS)
55 #define NVMCTRL_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
56 #define NVMCTRL_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
57 #else
58 #define NVMCTRL_CRITICAL_SECTION_ENTER()
59 #define NVMCTRL_CRITICAL_SECTION_LEAVE()
60 #endif
61 
62 typedef uint16_t hri_nvmctrl_ctrla_reg_t;
63 typedef uint16_t hri_nvmctrl_lock_reg_t;
64 typedef uint16_t hri_nvmctrl_status_reg_t;
65 typedef uint32_t hri_nvmctrl_addr_reg_t;
66 typedef uint32_t hri_nvmctrl_ctrlb_reg_t;
67 typedef uint32_t hri_nvmctrl_param_reg_t;
68 typedef uint8_t  hri_nvmctrl_intenset_reg_t;
69 typedef uint8_t  hri_nvmctrl_intflag_reg_t;
70 
hri_nvmctrl_set_INTEN_READY_bit(const void * const hw)71 static inline void hri_nvmctrl_set_INTEN_READY_bit(const void *const hw)
72 {
73 	((Nvmctrl *)hw)->INTENSET.reg = NVMCTRL_INTENSET_READY;
74 }
75 
hri_nvmctrl_get_INTEN_READY_bit(const void * const hw)76 static inline bool hri_nvmctrl_get_INTEN_READY_bit(const void *const hw)
77 {
78 	return (((Nvmctrl *)hw)->INTENSET.reg & NVMCTRL_INTENSET_READY) >> NVMCTRL_INTENSET_READY_Pos;
79 }
80 
hri_nvmctrl_write_INTEN_READY_bit(const void * const hw,bool value)81 static inline void hri_nvmctrl_write_INTEN_READY_bit(const void *const hw, bool value)
82 {
83 	if (value == 0x0) {
84 		((Nvmctrl *)hw)->INTENCLR.reg = NVMCTRL_INTENSET_READY;
85 	} else {
86 		((Nvmctrl *)hw)->INTENSET.reg = NVMCTRL_INTENSET_READY;
87 	}
88 }
89 
hri_nvmctrl_clear_INTEN_READY_bit(const void * const hw)90 static inline void hri_nvmctrl_clear_INTEN_READY_bit(const void *const hw)
91 {
92 	((Nvmctrl *)hw)->INTENCLR.reg = NVMCTRL_INTENSET_READY;
93 }
94 
hri_nvmctrl_set_INTEN_ERROR_bit(const void * const hw)95 static inline void hri_nvmctrl_set_INTEN_ERROR_bit(const void *const hw)
96 {
97 	((Nvmctrl *)hw)->INTENSET.reg = NVMCTRL_INTENSET_ERROR;
98 }
99 
hri_nvmctrl_get_INTEN_ERROR_bit(const void * const hw)100 static inline bool hri_nvmctrl_get_INTEN_ERROR_bit(const void *const hw)
101 {
102 	return (((Nvmctrl *)hw)->INTENSET.reg & NVMCTRL_INTENSET_ERROR) >> NVMCTRL_INTENSET_ERROR_Pos;
103 }
104 
hri_nvmctrl_write_INTEN_ERROR_bit(const void * const hw,bool value)105 static inline void hri_nvmctrl_write_INTEN_ERROR_bit(const void *const hw, bool value)
106 {
107 	if (value == 0x0) {
108 		((Nvmctrl *)hw)->INTENCLR.reg = NVMCTRL_INTENSET_ERROR;
109 	} else {
110 		((Nvmctrl *)hw)->INTENSET.reg = NVMCTRL_INTENSET_ERROR;
111 	}
112 }
113 
hri_nvmctrl_clear_INTEN_ERROR_bit(const void * const hw)114 static inline void hri_nvmctrl_clear_INTEN_ERROR_bit(const void *const hw)
115 {
116 	((Nvmctrl *)hw)->INTENCLR.reg = NVMCTRL_INTENSET_ERROR;
117 }
118 
hri_nvmctrl_set_INTEN_reg(const void * const hw,hri_nvmctrl_intenset_reg_t mask)119 static inline void hri_nvmctrl_set_INTEN_reg(const void *const hw, hri_nvmctrl_intenset_reg_t mask)
120 {
121 	((Nvmctrl *)hw)->INTENSET.reg = mask;
122 }
123 
hri_nvmctrl_get_INTEN_reg(const void * const hw,hri_nvmctrl_intenset_reg_t mask)124 static inline hri_nvmctrl_intenset_reg_t hri_nvmctrl_get_INTEN_reg(const void *const          hw,
125                                                                    hri_nvmctrl_intenset_reg_t mask)
126 {
127 	uint8_t tmp;
128 	tmp = ((Nvmctrl *)hw)->INTENSET.reg;
129 	tmp &= mask;
130 	return tmp;
131 }
132 
hri_nvmctrl_read_INTEN_reg(const void * const hw)133 static inline hri_nvmctrl_intenset_reg_t hri_nvmctrl_read_INTEN_reg(const void *const hw)
134 {
135 	return ((Nvmctrl *)hw)->INTENSET.reg;
136 }
137 
hri_nvmctrl_write_INTEN_reg(const void * const hw,hri_nvmctrl_intenset_reg_t data)138 static inline void hri_nvmctrl_write_INTEN_reg(const void *const hw, hri_nvmctrl_intenset_reg_t data)
139 {
140 	((Nvmctrl *)hw)->INTENSET.reg = data;
141 	((Nvmctrl *)hw)->INTENCLR.reg = ~data;
142 }
143 
hri_nvmctrl_clear_INTEN_reg(const void * const hw,hri_nvmctrl_intenset_reg_t mask)144 static inline void hri_nvmctrl_clear_INTEN_reg(const void *const hw, hri_nvmctrl_intenset_reg_t mask)
145 {
146 	((Nvmctrl *)hw)->INTENCLR.reg = mask;
147 }
148 
hri_nvmctrl_get_INTFLAG_READY_bit(const void * const hw)149 static inline bool hri_nvmctrl_get_INTFLAG_READY_bit(const void *const hw)
150 {
151 	return (((Nvmctrl *)hw)->INTFLAG.reg & NVMCTRL_INTFLAG_READY) >> NVMCTRL_INTFLAG_READY_Pos;
152 }
153 
hri_nvmctrl_clear_INTFLAG_READY_bit(const void * const hw)154 static inline void hri_nvmctrl_clear_INTFLAG_READY_bit(const void *const hw)
155 {
156 	((Nvmctrl *)hw)->INTFLAG.reg = NVMCTRL_INTFLAG_READY;
157 }
158 
hri_nvmctrl_get_INTFLAG_ERROR_bit(const void * const hw)159 static inline bool hri_nvmctrl_get_INTFLAG_ERROR_bit(const void *const hw)
160 {
161 	return (((Nvmctrl *)hw)->INTFLAG.reg & NVMCTRL_INTFLAG_ERROR) >> NVMCTRL_INTFLAG_ERROR_Pos;
162 }
163 
hri_nvmctrl_clear_INTFLAG_ERROR_bit(const void * const hw)164 static inline void hri_nvmctrl_clear_INTFLAG_ERROR_bit(const void *const hw)
165 {
166 	((Nvmctrl *)hw)->INTFLAG.reg = NVMCTRL_INTFLAG_ERROR;
167 }
168 
hri_nvmctrl_get_interrupt_READY_bit(const void * const hw)169 static inline bool hri_nvmctrl_get_interrupt_READY_bit(const void *const hw)
170 {
171 	return (((Nvmctrl *)hw)->INTFLAG.reg & NVMCTRL_INTFLAG_READY) >> NVMCTRL_INTFLAG_READY_Pos;
172 }
173 
hri_nvmctrl_clear_interrupt_READY_bit(const void * const hw)174 static inline void hri_nvmctrl_clear_interrupt_READY_bit(const void *const hw)
175 {
176 	((Nvmctrl *)hw)->INTFLAG.reg = NVMCTRL_INTFLAG_READY;
177 }
178 
hri_nvmctrl_get_interrupt_ERROR_bit(const void * const hw)179 static inline bool hri_nvmctrl_get_interrupt_ERROR_bit(const void *const hw)
180 {
181 	return (((Nvmctrl *)hw)->INTFLAG.reg & NVMCTRL_INTFLAG_ERROR) >> NVMCTRL_INTFLAG_ERROR_Pos;
182 }
183 
hri_nvmctrl_clear_interrupt_ERROR_bit(const void * const hw)184 static inline void hri_nvmctrl_clear_interrupt_ERROR_bit(const void *const hw)
185 {
186 	((Nvmctrl *)hw)->INTFLAG.reg = NVMCTRL_INTFLAG_ERROR;
187 }
188 
hri_nvmctrl_get_INTFLAG_reg(const void * const hw,hri_nvmctrl_intflag_reg_t mask)189 static inline hri_nvmctrl_intflag_reg_t hri_nvmctrl_get_INTFLAG_reg(const void *const         hw,
190                                                                     hri_nvmctrl_intflag_reg_t mask)
191 {
192 	uint8_t tmp;
193 	tmp = ((Nvmctrl *)hw)->INTFLAG.reg;
194 	tmp &= mask;
195 	return tmp;
196 }
197 
hri_nvmctrl_read_INTFLAG_reg(const void * const hw)198 static inline hri_nvmctrl_intflag_reg_t hri_nvmctrl_read_INTFLAG_reg(const void *const hw)
199 {
200 	return ((Nvmctrl *)hw)->INTFLAG.reg;
201 }
202 
hri_nvmctrl_clear_INTFLAG_reg(const void * const hw,hri_nvmctrl_intflag_reg_t mask)203 static inline void hri_nvmctrl_clear_INTFLAG_reg(const void *const hw, hri_nvmctrl_intflag_reg_t mask)
204 {
205 	((Nvmctrl *)hw)->INTFLAG.reg = mask;
206 }
207 
hri_nvmctrl_set_CTRLA_CMD_bf(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)208 static inline void hri_nvmctrl_set_CTRLA_CMD_bf(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
209 {
210 	NVMCTRL_CRITICAL_SECTION_ENTER();
211 	((Nvmctrl *)hw)->CTRLA.reg |= NVMCTRL_CTRLA_CMD(mask);
212 	NVMCTRL_CRITICAL_SECTION_LEAVE();
213 }
214 
hri_nvmctrl_get_CTRLA_CMD_bf(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)215 static inline hri_nvmctrl_ctrla_reg_t hri_nvmctrl_get_CTRLA_CMD_bf(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
216 {
217 	uint16_t tmp;
218 	tmp = ((Nvmctrl *)hw)->CTRLA.reg;
219 	tmp = (tmp & NVMCTRL_CTRLA_CMD(mask)) >> NVMCTRL_CTRLA_CMD_Pos;
220 	return tmp;
221 }
222 
hri_nvmctrl_write_CTRLA_CMD_bf(const void * const hw,hri_nvmctrl_ctrla_reg_t data)223 static inline void hri_nvmctrl_write_CTRLA_CMD_bf(const void *const hw, hri_nvmctrl_ctrla_reg_t data)
224 {
225 	uint16_t tmp;
226 	NVMCTRL_CRITICAL_SECTION_ENTER();
227 	tmp = ((Nvmctrl *)hw)->CTRLA.reg;
228 	tmp &= ~NVMCTRL_CTRLA_CMD_Msk;
229 	tmp |= NVMCTRL_CTRLA_CMD(data);
230 	((Nvmctrl *)hw)->CTRLA.reg = tmp;
231 	NVMCTRL_CRITICAL_SECTION_LEAVE();
232 }
233 
hri_nvmctrl_clear_CTRLA_CMD_bf(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)234 static inline void hri_nvmctrl_clear_CTRLA_CMD_bf(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
235 {
236 	NVMCTRL_CRITICAL_SECTION_ENTER();
237 	((Nvmctrl *)hw)->CTRLA.reg &= ~NVMCTRL_CTRLA_CMD(mask);
238 	NVMCTRL_CRITICAL_SECTION_LEAVE();
239 }
240 
hri_nvmctrl_toggle_CTRLA_CMD_bf(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)241 static inline void hri_nvmctrl_toggle_CTRLA_CMD_bf(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
242 {
243 	NVMCTRL_CRITICAL_SECTION_ENTER();
244 	((Nvmctrl *)hw)->CTRLA.reg ^= NVMCTRL_CTRLA_CMD(mask);
245 	NVMCTRL_CRITICAL_SECTION_LEAVE();
246 }
247 
hri_nvmctrl_read_CTRLA_CMD_bf(const void * const hw)248 static inline hri_nvmctrl_ctrla_reg_t hri_nvmctrl_read_CTRLA_CMD_bf(const void *const hw)
249 {
250 	uint16_t tmp;
251 	tmp = ((Nvmctrl *)hw)->CTRLA.reg;
252 	tmp = (tmp & NVMCTRL_CTRLA_CMD_Msk) >> NVMCTRL_CTRLA_CMD_Pos;
253 	return tmp;
254 }
255 
hri_nvmctrl_set_CTRLA_CMDEX_bf(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)256 static inline void hri_nvmctrl_set_CTRLA_CMDEX_bf(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
257 {
258 	NVMCTRL_CRITICAL_SECTION_ENTER();
259 	((Nvmctrl *)hw)->CTRLA.reg |= NVMCTRL_CTRLA_CMDEX(mask);
260 	NVMCTRL_CRITICAL_SECTION_LEAVE();
261 }
262 
hri_nvmctrl_get_CTRLA_CMDEX_bf(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)263 static inline hri_nvmctrl_ctrla_reg_t hri_nvmctrl_get_CTRLA_CMDEX_bf(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
264 {
265 	uint16_t tmp;
266 	tmp = ((Nvmctrl *)hw)->CTRLA.reg;
267 	tmp = (tmp & NVMCTRL_CTRLA_CMDEX(mask)) >> NVMCTRL_CTRLA_CMDEX_Pos;
268 	return tmp;
269 }
270 
hri_nvmctrl_write_CTRLA_CMDEX_bf(const void * const hw,hri_nvmctrl_ctrla_reg_t data)271 static inline void hri_nvmctrl_write_CTRLA_CMDEX_bf(const void *const hw, hri_nvmctrl_ctrla_reg_t data)
272 {
273 	uint16_t tmp;
274 	NVMCTRL_CRITICAL_SECTION_ENTER();
275 	tmp = ((Nvmctrl *)hw)->CTRLA.reg;
276 	tmp &= ~NVMCTRL_CTRLA_CMDEX_Msk;
277 	tmp |= NVMCTRL_CTRLA_CMDEX(data);
278 	((Nvmctrl *)hw)->CTRLA.reg = tmp;
279 	NVMCTRL_CRITICAL_SECTION_LEAVE();
280 }
281 
hri_nvmctrl_clear_CTRLA_CMDEX_bf(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)282 static inline void hri_nvmctrl_clear_CTRLA_CMDEX_bf(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
283 {
284 	NVMCTRL_CRITICAL_SECTION_ENTER();
285 	((Nvmctrl *)hw)->CTRLA.reg &= ~NVMCTRL_CTRLA_CMDEX(mask);
286 	NVMCTRL_CRITICAL_SECTION_LEAVE();
287 }
288 
hri_nvmctrl_toggle_CTRLA_CMDEX_bf(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)289 static inline void hri_nvmctrl_toggle_CTRLA_CMDEX_bf(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
290 {
291 	NVMCTRL_CRITICAL_SECTION_ENTER();
292 	((Nvmctrl *)hw)->CTRLA.reg ^= NVMCTRL_CTRLA_CMDEX(mask);
293 	NVMCTRL_CRITICAL_SECTION_LEAVE();
294 }
295 
hri_nvmctrl_read_CTRLA_CMDEX_bf(const void * const hw)296 static inline hri_nvmctrl_ctrla_reg_t hri_nvmctrl_read_CTRLA_CMDEX_bf(const void *const hw)
297 {
298 	uint16_t tmp;
299 	tmp = ((Nvmctrl *)hw)->CTRLA.reg;
300 	tmp = (tmp & NVMCTRL_CTRLA_CMDEX_Msk) >> NVMCTRL_CTRLA_CMDEX_Pos;
301 	return tmp;
302 }
303 
hri_nvmctrl_set_CTRLA_reg(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)304 static inline void hri_nvmctrl_set_CTRLA_reg(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
305 {
306 	NVMCTRL_CRITICAL_SECTION_ENTER();
307 	((Nvmctrl *)hw)->CTRLA.reg |= mask;
308 	NVMCTRL_CRITICAL_SECTION_LEAVE();
309 }
310 
hri_nvmctrl_get_CTRLA_reg(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)311 static inline hri_nvmctrl_ctrla_reg_t hri_nvmctrl_get_CTRLA_reg(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
312 {
313 	uint16_t tmp;
314 	tmp = ((Nvmctrl *)hw)->CTRLA.reg;
315 	tmp &= mask;
316 	return tmp;
317 }
318 
hri_nvmctrl_write_CTRLA_reg(const void * const hw,hri_nvmctrl_ctrla_reg_t data)319 static inline void hri_nvmctrl_write_CTRLA_reg(const void *const hw, hri_nvmctrl_ctrla_reg_t data)
320 {
321 	NVMCTRL_CRITICAL_SECTION_ENTER();
322 	((Nvmctrl *)hw)->CTRLA.reg = data;
323 	NVMCTRL_CRITICAL_SECTION_LEAVE();
324 }
325 
hri_nvmctrl_clear_CTRLA_reg(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)326 static inline void hri_nvmctrl_clear_CTRLA_reg(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
327 {
328 	NVMCTRL_CRITICAL_SECTION_ENTER();
329 	((Nvmctrl *)hw)->CTRLA.reg &= ~mask;
330 	NVMCTRL_CRITICAL_SECTION_LEAVE();
331 }
332 
hri_nvmctrl_toggle_CTRLA_reg(const void * const hw,hri_nvmctrl_ctrla_reg_t mask)333 static inline void hri_nvmctrl_toggle_CTRLA_reg(const void *const hw, hri_nvmctrl_ctrla_reg_t mask)
334 {
335 	NVMCTRL_CRITICAL_SECTION_ENTER();
336 	((Nvmctrl *)hw)->CTRLA.reg ^= mask;
337 	NVMCTRL_CRITICAL_SECTION_LEAVE();
338 }
339 
hri_nvmctrl_read_CTRLA_reg(const void * const hw)340 static inline hri_nvmctrl_ctrla_reg_t hri_nvmctrl_read_CTRLA_reg(const void *const hw)
341 {
342 	return ((Nvmctrl *)hw)->CTRLA.reg;
343 }
344 
hri_nvmctrl_set_CTRLB_MANW_bit(const void * const hw)345 static inline void hri_nvmctrl_set_CTRLB_MANW_bit(const void *const hw)
346 {
347 	NVMCTRL_CRITICAL_SECTION_ENTER();
348 	((Nvmctrl *)hw)->CTRLB.reg |= NVMCTRL_CTRLB_MANW;
349 	NVMCTRL_CRITICAL_SECTION_LEAVE();
350 }
351 
hri_nvmctrl_get_CTRLB_MANW_bit(const void * const hw)352 static inline bool hri_nvmctrl_get_CTRLB_MANW_bit(const void *const hw)
353 {
354 	uint32_t tmp;
355 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
356 	tmp = (tmp & NVMCTRL_CTRLB_MANW) >> NVMCTRL_CTRLB_MANW_Pos;
357 	return (bool)tmp;
358 }
359 
hri_nvmctrl_write_CTRLB_MANW_bit(const void * const hw,bool value)360 static inline void hri_nvmctrl_write_CTRLB_MANW_bit(const void *const hw, bool value)
361 {
362 	uint32_t tmp;
363 	NVMCTRL_CRITICAL_SECTION_ENTER();
364 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
365 	tmp &= ~NVMCTRL_CTRLB_MANW;
366 	tmp |= value << NVMCTRL_CTRLB_MANW_Pos;
367 	((Nvmctrl *)hw)->CTRLB.reg = tmp;
368 	NVMCTRL_CRITICAL_SECTION_LEAVE();
369 }
370 
hri_nvmctrl_clear_CTRLB_MANW_bit(const void * const hw)371 static inline void hri_nvmctrl_clear_CTRLB_MANW_bit(const void *const hw)
372 {
373 	NVMCTRL_CRITICAL_SECTION_ENTER();
374 	((Nvmctrl *)hw)->CTRLB.reg &= ~NVMCTRL_CTRLB_MANW;
375 	NVMCTRL_CRITICAL_SECTION_LEAVE();
376 }
377 
hri_nvmctrl_toggle_CTRLB_MANW_bit(const void * const hw)378 static inline void hri_nvmctrl_toggle_CTRLB_MANW_bit(const void *const hw)
379 {
380 	NVMCTRL_CRITICAL_SECTION_ENTER();
381 	((Nvmctrl *)hw)->CTRLB.reg ^= NVMCTRL_CTRLB_MANW;
382 	NVMCTRL_CRITICAL_SECTION_LEAVE();
383 }
384 
hri_nvmctrl_set_CTRLB_FWUP_bit(const void * const hw)385 static inline void hri_nvmctrl_set_CTRLB_FWUP_bit(const void *const hw)
386 {
387 	NVMCTRL_CRITICAL_SECTION_ENTER();
388 	((Nvmctrl *)hw)->CTRLB.reg |= NVMCTRL_CTRLB_FWUP;
389 	NVMCTRL_CRITICAL_SECTION_LEAVE();
390 }
391 
hri_nvmctrl_get_CTRLB_FWUP_bit(const void * const hw)392 static inline bool hri_nvmctrl_get_CTRLB_FWUP_bit(const void *const hw)
393 {
394 	uint32_t tmp;
395 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
396 	tmp = (tmp & NVMCTRL_CTRLB_FWUP) >> NVMCTRL_CTRLB_FWUP_Pos;
397 	return (bool)tmp;
398 }
399 
hri_nvmctrl_write_CTRLB_FWUP_bit(const void * const hw,bool value)400 static inline void hri_nvmctrl_write_CTRLB_FWUP_bit(const void *const hw, bool value)
401 {
402 	uint32_t tmp;
403 	NVMCTRL_CRITICAL_SECTION_ENTER();
404 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
405 	tmp &= ~NVMCTRL_CTRLB_FWUP;
406 	tmp |= value << NVMCTRL_CTRLB_FWUP_Pos;
407 	((Nvmctrl *)hw)->CTRLB.reg = tmp;
408 	NVMCTRL_CRITICAL_SECTION_LEAVE();
409 }
410 
hri_nvmctrl_clear_CTRLB_FWUP_bit(const void * const hw)411 static inline void hri_nvmctrl_clear_CTRLB_FWUP_bit(const void *const hw)
412 {
413 	NVMCTRL_CRITICAL_SECTION_ENTER();
414 	((Nvmctrl *)hw)->CTRLB.reg &= ~NVMCTRL_CTRLB_FWUP;
415 	NVMCTRL_CRITICAL_SECTION_LEAVE();
416 }
417 
hri_nvmctrl_toggle_CTRLB_FWUP_bit(const void * const hw)418 static inline void hri_nvmctrl_toggle_CTRLB_FWUP_bit(const void *const hw)
419 {
420 	NVMCTRL_CRITICAL_SECTION_ENTER();
421 	((Nvmctrl *)hw)->CTRLB.reg ^= NVMCTRL_CTRLB_FWUP;
422 	NVMCTRL_CRITICAL_SECTION_LEAVE();
423 }
424 
hri_nvmctrl_set_CTRLB_CACHEDIS_bit(const void * const hw)425 static inline void hri_nvmctrl_set_CTRLB_CACHEDIS_bit(const void *const hw)
426 {
427 	NVMCTRL_CRITICAL_SECTION_ENTER();
428 	((Nvmctrl *)hw)->CTRLB.reg |= NVMCTRL_CTRLB_CACHEDIS;
429 	NVMCTRL_CRITICAL_SECTION_LEAVE();
430 }
431 
hri_nvmctrl_get_CTRLB_CACHEDIS_bit(const void * const hw)432 static inline bool hri_nvmctrl_get_CTRLB_CACHEDIS_bit(const void *const hw)
433 {
434 	uint32_t tmp;
435 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
436 	tmp = (tmp & NVMCTRL_CTRLB_CACHEDIS) >> NVMCTRL_CTRLB_CACHEDIS_Pos;
437 	return (bool)tmp;
438 }
439 
hri_nvmctrl_write_CTRLB_CACHEDIS_bit(const void * const hw,bool value)440 static inline void hri_nvmctrl_write_CTRLB_CACHEDIS_bit(const void *const hw, bool value)
441 {
442 	uint32_t tmp;
443 	NVMCTRL_CRITICAL_SECTION_ENTER();
444 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
445 	tmp &= ~NVMCTRL_CTRLB_CACHEDIS;
446 	tmp |= value << NVMCTRL_CTRLB_CACHEDIS_Pos;
447 	((Nvmctrl *)hw)->CTRLB.reg = tmp;
448 	NVMCTRL_CRITICAL_SECTION_LEAVE();
449 }
450 
hri_nvmctrl_clear_CTRLB_CACHEDIS_bit(const void * const hw)451 static inline void hri_nvmctrl_clear_CTRLB_CACHEDIS_bit(const void *const hw)
452 {
453 	NVMCTRL_CRITICAL_SECTION_ENTER();
454 	((Nvmctrl *)hw)->CTRLB.reg &= ~NVMCTRL_CTRLB_CACHEDIS;
455 	NVMCTRL_CRITICAL_SECTION_LEAVE();
456 }
457 
hri_nvmctrl_toggle_CTRLB_CACHEDIS_bit(const void * const hw)458 static inline void hri_nvmctrl_toggle_CTRLB_CACHEDIS_bit(const void *const hw)
459 {
460 	NVMCTRL_CRITICAL_SECTION_ENTER();
461 	((Nvmctrl *)hw)->CTRLB.reg ^= NVMCTRL_CTRLB_CACHEDIS;
462 	NVMCTRL_CRITICAL_SECTION_LEAVE();
463 }
464 
hri_nvmctrl_set_CTRLB_RWS_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)465 static inline void hri_nvmctrl_set_CTRLB_RWS_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
466 {
467 	NVMCTRL_CRITICAL_SECTION_ENTER();
468 	((Nvmctrl *)hw)->CTRLB.reg |= NVMCTRL_CTRLB_RWS(mask);
469 	NVMCTRL_CRITICAL_SECTION_LEAVE();
470 }
471 
hri_nvmctrl_get_CTRLB_RWS_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)472 static inline hri_nvmctrl_ctrlb_reg_t hri_nvmctrl_get_CTRLB_RWS_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
473 {
474 	uint32_t tmp;
475 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
476 	tmp = (tmp & NVMCTRL_CTRLB_RWS(mask)) >> NVMCTRL_CTRLB_RWS_Pos;
477 	return tmp;
478 }
479 
hri_nvmctrl_write_CTRLB_RWS_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t data)480 static inline void hri_nvmctrl_write_CTRLB_RWS_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t data)
481 {
482 	uint32_t tmp;
483 	NVMCTRL_CRITICAL_SECTION_ENTER();
484 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
485 	tmp &= ~NVMCTRL_CTRLB_RWS_Msk;
486 	tmp |= NVMCTRL_CTRLB_RWS(data);
487 	((Nvmctrl *)hw)->CTRLB.reg = tmp;
488 	NVMCTRL_CRITICAL_SECTION_LEAVE();
489 }
490 
hri_nvmctrl_clear_CTRLB_RWS_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)491 static inline void hri_nvmctrl_clear_CTRLB_RWS_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
492 {
493 	NVMCTRL_CRITICAL_SECTION_ENTER();
494 	((Nvmctrl *)hw)->CTRLB.reg &= ~NVMCTRL_CTRLB_RWS(mask);
495 	NVMCTRL_CRITICAL_SECTION_LEAVE();
496 }
497 
hri_nvmctrl_toggle_CTRLB_RWS_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)498 static inline void hri_nvmctrl_toggle_CTRLB_RWS_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
499 {
500 	NVMCTRL_CRITICAL_SECTION_ENTER();
501 	((Nvmctrl *)hw)->CTRLB.reg ^= NVMCTRL_CTRLB_RWS(mask);
502 	NVMCTRL_CRITICAL_SECTION_LEAVE();
503 }
504 
hri_nvmctrl_read_CTRLB_RWS_bf(const void * const hw)505 static inline hri_nvmctrl_ctrlb_reg_t hri_nvmctrl_read_CTRLB_RWS_bf(const void *const hw)
506 {
507 	uint32_t tmp;
508 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
509 	tmp = (tmp & NVMCTRL_CTRLB_RWS_Msk) >> NVMCTRL_CTRLB_RWS_Pos;
510 	return tmp;
511 }
512 
hri_nvmctrl_set_CTRLB_SLEEPPRM_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)513 static inline void hri_nvmctrl_set_CTRLB_SLEEPPRM_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
514 {
515 	NVMCTRL_CRITICAL_SECTION_ENTER();
516 	((Nvmctrl *)hw)->CTRLB.reg |= NVMCTRL_CTRLB_SLEEPPRM(mask);
517 	NVMCTRL_CRITICAL_SECTION_LEAVE();
518 }
519 
hri_nvmctrl_get_CTRLB_SLEEPPRM_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)520 static inline hri_nvmctrl_ctrlb_reg_t hri_nvmctrl_get_CTRLB_SLEEPPRM_bf(const void *const       hw,
521                                                                         hri_nvmctrl_ctrlb_reg_t mask)
522 {
523 	uint32_t tmp;
524 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
525 	tmp = (tmp & NVMCTRL_CTRLB_SLEEPPRM(mask)) >> NVMCTRL_CTRLB_SLEEPPRM_Pos;
526 	return tmp;
527 }
528 
hri_nvmctrl_write_CTRLB_SLEEPPRM_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t data)529 static inline void hri_nvmctrl_write_CTRLB_SLEEPPRM_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t data)
530 {
531 	uint32_t tmp;
532 	NVMCTRL_CRITICAL_SECTION_ENTER();
533 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
534 	tmp &= ~NVMCTRL_CTRLB_SLEEPPRM_Msk;
535 	tmp |= NVMCTRL_CTRLB_SLEEPPRM(data);
536 	((Nvmctrl *)hw)->CTRLB.reg = tmp;
537 	NVMCTRL_CRITICAL_SECTION_LEAVE();
538 }
539 
hri_nvmctrl_clear_CTRLB_SLEEPPRM_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)540 static inline void hri_nvmctrl_clear_CTRLB_SLEEPPRM_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
541 {
542 	NVMCTRL_CRITICAL_SECTION_ENTER();
543 	((Nvmctrl *)hw)->CTRLB.reg &= ~NVMCTRL_CTRLB_SLEEPPRM(mask);
544 	NVMCTRL_CRITICAL_SECTION_LEAVE();
545 }
546 
hri_nvmctrl_toggle_CTRLB_SLEEPPRM_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)547 static inline void hri_nvmctrl_toggle_CTRLB_SLEEPPRM_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
548 {
549 	NVMCTRL_CRITICAL_SECTION_ENTER();
550 	((Nvmctrl *)hw)->CTRLB.reg ^= NVMCTRL_CTRLB_SLEEPPRM(mask);
551 	NVMCTRL_CRITICAL_SECTION_LEAVE();
552 }
553 
hri_nvmctrl_read_CTRLB_SLEEPPRM_bf(const void * const hw)554 static inline hri_nvmctrl_ctrlb_reg_t hri_nvmctrl_read_CTRLB_SLEEPPRM_bf(const void *const hw)
555 {
556 	uint32_t tmp;
557 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
558 	tmp = (tmp & NVMCTRL_CTRLB_SLEEPPRM_Msk) >> NVMCTRL_CTRLB_SLEEPPRM_Pos;
559 	return tmp;
560 }
561 
hri_nvmctrl_set_CTRLB_READMODE_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)562 static inline void hri_nvmctrl_set_CTRLB_READMODE_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
563 {
564 	NVMCTRL_CRITICAL_SECTION_ENTER();
565 	((Nvmctrl *)hw)->CTRLB.reg |= NVMCTRL_CTRLB_READMODE(mask);
566 	NVMCTRL_CRITICAL_SECTION_LEAVE();
567 }
568 
hri_nvmctrl_get_CTRLB_READMODE_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)569 static inline hri_nvmctrl_ctrlb_reg_t hri_nvmctrl_get_CTRLB_READMODE_bf(const void *const       hw,
570                                                                         hri_nvmctrl_ctrlb_reg_t mask)
571 {
572 	uint32_t tmp;
573 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
574 	tmp = (tmp & NVMCTRL_CTRLB_READMODE(mask)) >> NVMCTRL_CTRLB_READMODE_Pos;
575 	return tmp;
576 }
577 
hri_nvmctrl_write_CTRLB_READMODE_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t data)578 static inline void hri_nvmctrl_write_CTRLB_READMODE_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t data)
579 {
580 	uint32_t tmp;
581 	NVMCTRL_CRITICAL_SECTION_ENTER();
582 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
583 	tmp &= ~NVMCTRL_CTRLB_READMODE_Msk;
584 	tmp |= NVMCTRL_CTRLB_READMODE(data);
585 	((Nvmctrl *)hw)->CTRLB.reg = tmp;
586 	NVMCTRL_CRITICAL_SECTION_LEAVE();
587 }
588 
hri_nvmctrl_clear_CTRLB_READMODE_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)589 static inline void hri_nvmctrl_clear_CTRLB_READMODE_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
590 {
591 	NVMCTRL_CRITICAL_SECTION_ENTER();
592 	((Nvmctrl *)hw)->CTRLB.reg &= ~NVMCTRL_CTRLB_READMODE(mask);
593 	NVMCTRL_CRITICAL_SECTION_LEAVE();
594 }
595 
hri_nvmctrl_toggle_CTRLB_READMODE_bf(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)596 static inline void hri_nvmctrl_toggle_CTRLB_READMODE_bf(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
597 {
598 	NVMCTRL_CRITICAL_SECTION_ENTER();
599 	((Nvmctrl *)hw)->CTRLB.reg ^= NVMCTRL_CTRLB_READMODE(mask);
600 	NVMCTRL_CRITICAL_SECTION_LEAVE();
601 }
602 
hri_nvmctrl_read_CTRLB_READMODE_bf(const void * const hw)603 static inline hri_nvmctrl_ctrlb_reg_t hri_nvmctrl_read_CTRLB_READMODE_bf(const void *const hw)
604 {
605 	uint32_t tmp;
606 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
607 	tmp = (tmp & NVMCTRL_CTRLB_READMODE_Msk) >> NVMCTRL_CTRLB_READMODE_Pos;
608 	return tmp;
609 }
610 
hri_nvmctrl_set_CTRLB_reg(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)611 static inline void hri_nvmctrl_set_CTRLB_reg(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
612 {
613 	NVMCTRL_CRITICAL_SECTION_ENTER();
614 	((Nvmctrl *)hw)->CTRLB.reg |= mask;
615 	NVMCTRL_CRITICAL_SECTION_LEAVE();
616 }
617 
hri_nvmctrl_get_CTRLB_reg(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)618 static inline hri_nvmctrl_ctrlb_reg_t hri_nvmctrl_get_CTRLB_reg(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
619 {
620 	uint32_t tmp;
621 	tmp = ((Nvmctrl *)hw)->CTRLB.reg;
622 	tmp &= mask;
623 	return tmp;
624 }
625 
hri_nvmctrl_write_CTRLB_reg(const void * const hw,hri_nvmctrl_ctrlb_reg_t data)626 static inline void hri_nvmctrl_write_CTRLB_reg(const void *const hw, hri_nvmctrl_ctrlb_reg_t data)
627 {
628 	NVMCTRL_CRITICAL_SECTION_ENTER();
629 	((Nvmctrl *)hw)->CTRLB.reg = data;
630 	NVMCTRL_CRITICAL_SECTION_LEAVE();
631 }
632 
hri_nvmctrl_clear_CTRLB_reg(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)633 static inline void hri_nvmctrl_clear_CTRLB_reg(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
634 {
635 	NVMCTRL_CRITICAL_SECTION_ENTER();
636 	((Nvmctrl *)hw)->CTRLB.reg &= ~mask;
637 	NVMCTRL_CRITICAL_SECTION_LEAVE();
638 }
639 
hri_nvmctrl_toggle_CTRLB_reg(const void * const hw,hri_nvmctrl_ctrlb_reg_t mask)640 static inline void hri_nvmctrl_toggle_CTRLB_reg(const void *const hw, hri_nvmctrl_ctrlb_reg_t mask)
641 {
642 	NVMCTRL_CRITICAL_SECTION_ENTER();
643 	((Nvmctrl *)hw)->CTRLB.reg ^= mask;
644 	NVMCTRL_CRITICAL_SECTION_LEAVE();
645 }
646 
hri_nvmctrl_read_CTRLB_reg(const void * const hw)647 static inline hri_nvmctrl_ctrlb_reg_t hri_nvmctrl_read_CTRLB_reg(const void *const hw)
648 {
649 	return ((Nvmctrl *)hw)->CTRLB.reg;
650 }
651 
hri_nvmctrl_set_PARAM_NVMP_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)652 static inline void hri_nvmctrl_set_PARAM_NVMP_bf(const void *const hw, hri_nvmctrl_param_reg_t mask)
653 {
654 	NVMCTRL_CRITICAL_SECTION_ENTER();
655 	((Nvmctrl *)hw)->PARAM.reg |= NVMCTRL_PARAM_NVMP(mask);
656 	NVMCTRL_CRITICAL_SECTION_LEAVE();
657 }
658 
hri_nvmctrl_get_PARAM_NVMP_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)659 static inline hri_nvmctrl_param_reg_t hri_nvmctrl_get_PARAM_NVMP_bf(const void *const hw, hri_nvmctrl_param_reg_t mask)
660 {
661 	uint32_t tmp;
662 	tmp = ((Nvmctrl *)hw)->PARAM.reg;
663 	tmp = (tmp & NVMCTRL_PARAM_NVMP(mask)) >> NVMCTRL_PARAM_NVMP_Pos;
664 	return tmp;
665 }
666 
hri_nvmctrl_write_PARAM_NVMP_bf(const void * const hw,hri_nvmctrl_param_reg_t data)667 static inline void hri_nvmctrl_write_PARAM_NVMP_bf(const void *const hw, hri_nvmctrl_param_reg_t data)
668 {
669 	uint32_t tmp;
670 	NVMCTRL_CRITICAL_SECTION_ENTER();
671 	tmp = ((Nvmctrl *)hw)->PARAM.reg;
672 	tmp &= ~NVMCTRL_PARAM_NVMP_Msk;
673 	tmp |= NVMCTRL_PARAM_NVMP(data);
674 	((Nvmctrl *)hw)->PARAM.reg = tmp;
675 	NVMCTRL_CRITICAL_SECTION_LEAVE();
676 }
677 
hri_nvmctrl_clear_PARAM_NVMP_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)678 static inline void hri_nvmctrl_clear_PARAM_NVMP_bf(const void *const hw, hri_nvmctrl_param_reg_t mask)
679 {
680 	NVMCTRL_CRITICAL_SECTION_ENTER();
681 	((Nvmctrl *)hw)->PARAM.reg &= ~NVMCTRL_PARAM_NVMP(mask);
682 	NVMCTRL_CRITICAL_SECTION_LEAVE();
683 }
684 
hri_nvmctrl_toggle_PARAM_NVMP_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)685 static inline void hri_nvmctrl_toggle_PARAM_NVMP_bf(const void *const hw, hri_nvmctrl_param_reg_t mask)
686 {
687 	NVMCTRL_CRITICAL_SECTION_ENTER();
688 	((Nvmctrl *)hw)->PARAM.reg ^= NVMCTRL_PARAM_NVMP(mask);
689 	NVMCTRL_CRITICAL_SECTION_LEAVE();
690 }
691 
hri_nvmctrl_read_PARAM_NVMP_bf(const void * const hw)692 static inline hri_nvmctrl_param_reg_t hri_nvmctrl_read_PARAM_NVMP_bf(const void *const hw)
693 {
694 	uint32_t tmp;
695 	tmp = ((Nvmctrl *)hw)->PARAM.reg;
696 	tmp = (tmp & NVMCTRL_PARAM_NVMP_Msk) >> NVMCTRL_PARAM_NVMP_Pos;
697 	return tmp;
698 }
699 
hri_nvmctrl_set_PARAM_PSZ_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)700 static inline void hri_nvmctrl_set_PARAM_PSZ_bf(const void *const hw, hri_nvmctrl_param_reg_t mask)
701 {
702 	NVMCTRL_CRITICAL_SECTION_ENTER();
703 	((Nvmctrl *)hw)->PARAM.reg |= NVMCTRL_PARAM_PSZ(mask);
704 	NVMCTRL_CRITICAL_SECTION_LEAVE();
705 }
706 
hri_nvmctrl_get_PARAM_PSZ_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)707 static inline hri_nvmctrl_param_reg_t hri_nvmctrl_get_PARAM_PSZ_bf(const void *const hw, hri_nvmctrl_param_reg_t mask)
708 {
709 	uint32_t tmp;
710 	tmp = ((Nvmctrl *)hw)->PARAM.reg;
711 	tmp = (tmp & NVMCTRL_PARAM_PSZ(mask)) >> NVMCTRL_PARAM_PSZ_Pos;
712 	return tmp;
713 }
714 
hri_nvmctrl_write_PARAM_PSZ_bf(const void * const hw,hri_nvmctrl_param_reg_t data)715 static inline void hri_nvmctrl_write_PARAM_PSZ_bf(const void *const hw, hri_nvmctrl_param_reg_t data)
716 {
717 	uint32_t tmp;
718 	NVMCTRL_CRITICAL_SECTION_ENTER();
719 	tmp = ((Nvmctrl *)hw)->PARAM.reg;
720 	tmp &= ~NVMCTRL_PARAM_PSZ_Msk;
721 	tmp |= NVMCTRL_PARAM_PSZ(data);
722 	((Nvmctrl *)hw)->PARAM.reg = tmp;
723 	NVMCTRL_CRITICAL_SECTION_LEAVE();
724 }
725 
hri_nvmctrl_clear_PARAM_PSZ_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)726 static inline void hri_nvmctrl_clear_PARAM_PSZ_bf(const void *const hw, hri_nvmctrl_param_reg_t mask)
727 {
728 	NVMCTRL_CRITICAL_SECTION_ENTER();
729 	((Nvmctrl *)hw)->PARAM.reg &= ~NVMCTRL_PARAM_PSZ(mask);
730 	NVMCTRL_CRITICAL_SECTION_LEAVE();
731 }
732 
hri_nvmctrl_toggle_PARAM_PSZ_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)733 static inline void hri_nvmctrl_toggle_PARAM_PSZ_bf(const void *const hw, hri_nvmctrl_param_reg_t mask)
734 {
735 	NVMCTRL_CRITICAL_SECTION_ENTER();
736 	((Nvmctrl *)hw)->PARAM.reg ^= NVMCTRL_PARAM_PSZ(mask);
737 	NVMCTRL_CRITICAL_SECTION_LEAVE();
738 }
739 
hri_nvmctrl_read_PARAM_PSZ_bf(const void * const hw)740 static inline hri_nvmctrl_param_reg_t hri_nvmctrl_read_PARAM_PSZ_bf(const void *const hw)
741 {
742 	uint32_t tmp;
743 	tmp = ((Nvmctrl *)hw)->PARAM.reg;
744 	tmp = (tmp & NVMCTRL_PARAM_PSZ_Msk) >> NVMCTRL_PARAM_PSZ_Pos;
745 	return tmp;
746 }
747 
hri_nvmctrl_set_PARAM_RWWEEP_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)748 static inline void hri_nvmctrl_set_PARAM_RWWEEP_bf(const void *const hw, hri_nvmctrl_param_reg_t mask)
749 {
750 	NVMCTRL_CRITICAL_SECTION_ENTER();
751 	((Nvmctrl *)hw)->PARAM.reg |= NVMCTRL_PARAM_RWWEEP(mask);
752 	NVMCTRL_CRITICAL_SECTION_LEAVE();
753 }
754 
hri_nvmctrl_get_PARAM_RWWEEP_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)755 static inline hri_nvmctrl_param_reg_t hri_nvmctrl_get_PARAM_RWWEEP_bf(const void *const       hw,
756                                                                       hri_nvmctrl_param_reg_t mask)
757 {
758 	uint32_t tmp;
759 	tmp = ((Nvmctrl *)hw)->PARAM.reg;
760 	tmp = (tmp & NVMCTRL_PARAM_RWWEEP(mask)) >> NVMCTRL_PARAM_RWWEEP_Pos;
761 	return tmp;
762 }
763 
hri_nvmctrl_write_PARAM_RWWEEP_bf(const void * const hw,hri_nvmctrl_param_reg_t data)764 static inline void hri_nvmctrl_write_PARAM_RWWEEP_bf(const void *const hw, hri_nvmctrl_param_reg_t data)
765 {
766 	uint32_t tmp;
767 	NVMCTRL_CRITICAL_SECTION_ENTER();
768 	tmp = ((Nvmctrl *)hw)->PARAM.reg;
769 	tmp &= ~NVMCTRL_PARAM_RWWEEP_Msk;
770 	tmp |= NVMCTRL_PARAM_RWWEEP(data);
771 	((Nvmctrl *)hw)->PARAM.reg = tmp;
772 	NVMCTRL_CRITICAL_SECTION_LEAVE();
773 }
774 
hri_nvmctrl_clear_PARAM_RWWEEP_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)775 static inline void hri_nvmctrl_clear_PARAM_RWWEEP_bf(const void *const hw, hri_nvmctrl_param_reg_t mask)
776 {
777 	NVMCTRL_CRITICAL_SECTION_ENTER();
778 	((Nvmctrl *)hw)->PARAM.reg &= ~NVMCTRL_PARAM_RWWEEP(mask);
779 	NVMCTRL_CRITICAL_SECTION_LEAVE();
780 }
781 
hri_nvmctrl_toggle_PARAM_RWWEEP_bf(const void * const hw,hri_nvmctrl_param_reg_t mask)782 static inline void hri_nvmctrl_toggle_PARAM_RWWEEP_bf(const void *const hw, hri_nvmctrl_param_reg_t mask)
783 {
784 	NVMCTRL_CRITICAL_SECTION_ENTER();
785 	((Nvmctrl *)hw)->PARAM.reg ^= NVMCTRL_PARAM_RWWEEP(mask);
786 	NVMCTRL_CRITICAL_SECTION_LEAVE();
787 }
788 
hri_nvmctrl_read_PARAM_RWWEEP_bf(const void * const hw)789 static inline hri_nvmctrl_param_reg_t hri_nvmctrl_read_PARAM_RWWEEP_bf(const void *const hw)
790 {
791 	uint32_t tmp;
792 	tmp = ((Nvmctrl *)hw)->PARAM.reg;
793 	tmp = (tmp & NVMCTRL_PARAM_RWWEEP_Msk) >> NVMCTRL_PARAM_RWWEEP_Pos;
794 	return tmp;
795 }
796 
hri_nvmctrl_set_PARAM_reg(const void * const hw,hri_nvmctrl_param_reg_t mask)797 static inline void hri_nvmctrl_set_PARAM_reg(const void *const hw, hri_nvmctrl_param_reg_t mask)
798 {
799 	NVMCTRL_CRITICAL_SECTION_ENTER();
800 	((Nvmctrl *)hw)->PARAM.reg |= mask;
801 	NVMCTRL_CRITICAL_SECTION_LEAVE();
802 }
803 
hri_nvmctrl_get_PARAM_reg(const void * const hw,hri_nvmctrl_param_reg_t mask)804 static inline hri_nvmctrl_param_reg_t hri_nvmctrl_get_PARAM_reg(const void *const hw, hri_nvmctrl_param_reg_t mask)
805 {
806 	uint32_t tmp;
807 	tmp = ((Nvmctrl *)hw)->PARAM.reg;
808 	tmp &= mask;
809 	return tmp;
810 }
811 
hri_nvmctrl_write_PARAM_reg(const void * const hw,hri_nvmctrl_param_reg_t data)812 static inline void hri_nvmctrl_write_PARAM_reg(const void *const hw, hri_nvmctrl_param_reg_t data)
813 {
814 	NVMCTRL_CRITICAL_SECTION_ENTER();
815 	((Nvmctrl *)hw)->PARAM.reg = data;
816 	NVMCTRL_CRITICAL_SECTION_LEAVE();
817 }
818 
hri_nvmctrl_clear_PARAM_reg(const void * const hw,hri_nvmctrl_param_reg_t mask)819 static inline void hri_nvmctrl_clear_PARAM_reg(const void *const hw, hri_nvmctrl_param_reg_t mask)
820 {
821 	NVMCTRL_CRITICAL_SECTION_ENTER();
822 	((Nvmctrl *)hw)->PARAM.reg &= ~mask;
823 	NVMCTRL_CRITICAL_SECTION_LEAVE();
824 }
825 
hri_nvmctrl_toggle_PARAM_reg(const void * const hw,hri_nvmctrl_param_reg_t mask)826 static inline void hri_nvmctrl_toggle_PARAM_reg(const void *const hw, hri_nvmctrl_param_reg_t mask)
827 {
828 	NVMCTRL_CRITICAL_SECTION_ENTER();
829 	((Nvmctrl *)hw)->PARAM.reg ^= mask;
830 	NVMCTRL_CRITICAL_SECTION_LEAVE();
831 }
832 
hri_nvmctrl_read_PARAM_reg(const void * const hw)833 static inline hri_nvmctrl_param_reg_t hri_nvmctrl_read_PARAM_reg(const void *const hw)
834 {
835 	return ((Nvmctrl *)hw)->PARAM.reg;
836 }
837 
hri_nvmctrl_set_ADDR_ADDR_bf(const void * const hw,hri_nvmctrl_addr_reg_t mask)838 static inline void hri_nvmctrl_set_ADDR_ADDR_bf(const void *const hw, hri_nvmctrl_addr_reg_t mask)
839 {
840 	NVMCTRL_CRITICAL_SECTION_ENTER();
841 	((Nvmctrl *)hw)->ADDR.reg |= NVMCTRL_ADDR_ADDR(mask);
842 	NVMCTRL_CRITICAL_SECTION_LEAVE();
843 }
844 
hri_nvmctrl_get_ADDR_ADDR_bf(const void * const hw,hri_nvmctrl_addr_reg_t mask)845 static inline hri_nvmctrl_addr_reg_t hri_nvmctrl_get_ADDR_ADDR_bf(const void *const hw, hri_nvmctrl_addr_reg_t mask)
846 {
847 	uint32_t tmp;
848 	tmp = ((Nvmctrl *)hw)->ADDR.reg;
849 	tmp = (tmp & NVMCTRL_ADDR_ADDR(mask)) >> NVMCTRL_ADDR_ADDR_Pos;
850 	return tmp;
851 }
852 
hri_nvmctrl_write_ADDR_ADDR_bf(const void * const hw,hri_nvmctrl_addr_reg_t data)853 static inline void hri_nvmctrl_write_ADDR_ADDR_bf(const void *const hw, hri_nvmctrl_addr_reg_t data)
854 {
855 	uint32_t tmp;
856 	NVMCTRL_CRITICAL_SECTION_ENTER();
857 	tmp = ((Nvmctrl *)hw)->ADDR.reg;
858 	tmp &= ~NVMCTRL_ADDR_ADDR_Msk;
859 	tmp |= NVMCTRL_ADDR_ADDR(data);
860 	((Nvmctrl *)hw)->ADDR.reg = tmp;
861 	NVMCTRL_CRITICAL_SECTION_LEAVE();
862 }
863 
hri_nvmctrl_clear_ADDR_ADDR_bf(const void * const hw,hri_nvmctrl_addr_reg_t mask)864 static inline void hri_nvmctrl_clear_ADDR_ADDR_bf(const void *const hw, hri_nvmctrl_addr_reg_t mask)
865 {
866 	NVMCTRL_CRITICAL_SECTION_ENTER();
867 	((Nvmctrl *)hw)->ADDR.reg &= ~NVMCTRL_ADDR_ADDR(mask);
868 	NVMCTRL_CRITICAL_SECTION_LEAVE();
869 }
870 
hri_nvmctrl_toggle_ADDR_ADDR_bf(const void * const hw,hri_nvmctrl_addr_reg_t mask)871 static inline void hri_nvmctrl_toggle_ADDR_ADDR_bf(const void *const hw, hri_nvmctrl_addr_reg_t mask)
872 {
873 	NVMCTRL_CRITICAL_SECTION_ENTER();
874 	((Nvmctrl *)hw)->ADDR.reg ^= NVMCTRL_ADDR_ADDR(mask);
875 	NVMCTRL_CRITICAL_SECTION_LEAVE();
876 }
877 
hri_nvmctrl_read_ADDR_ADDR_bf(const void * const hw)878 static inline hri_nvmctrl_addr_reg_t hri_nvmctrl_read_ADDR_ADDR_bf(const void *const hw)
879 {
880 	uint32_t tmp;
881 	tmp = ((Nvmctrl *)hw)->ADDR.reg;
882 	tmp = (tmp & NVMCTRL_ADDR_ADDR_Msk) >> NVMCTRL_ADDR_ADDR_Pos;
883 	return tmp;
884 }
885 
hri_nvmctrl_set_ADDR_reg(const void * const hw,hri_nvmctrl_addr_reg_t mask)886 static inline void hri_nvmctrl_set_ADDR_reg(const void *const hw, hri_nvmctrl_addr_reg_t mask)
887 {
888 	NVMCTRL_CRITICAL_SECTION_ENTER();
889 	((Nvmctrl *)hw)->ADDR.reg |= mask;
890 	NVMCTRL_CRITICAL_SECTION_LEAVE();
891 }
892 
hri_nvmctrl_get_ADDR_reg(const void * const hw,hri_nvmctrl_addr_reg_t mask)893 static inline hri_nvmctrl_addr_reg_t hri_nvmctrl_get_ADDR_reg(const void *const hw, hri_nvmctrl_addr_reg_t mask)
894 {
895 	uint32_t tmp;
896 	tmp = ((Nvmctrl *)hw)->ADDR.reg;
897 	tmp &= mask;
898 	return tmp;
899 }
900 
hri_nvmctrl_write_ADDR_reg(const void * const hw,hri_nvmctrl_addr_reg_t data)901 static inline void hri_nvmctrl_write_ADDR_reg(const void *const hw, hri_nvmctrl_addr_reg_t data)
902 {
903 	NVMCTRL_CRITICAL_SECTION_ENTER();
904 	((Nvmctrl *)hw)->ADDR.reg = data;
905 	NVMCTRL_CRITICAL_SECTION_LEAVE();
906 }
907 
hri_nvmctrl_clear_ADDR_reg(const void * const hw,hri_nvmctrl_addr_reg_t mask)908 static inline void hri_nvmctrl_clear_ADDR_reg(const void *const hw, hri_nvmctrl_addr_reg_t mask)
909 {
910 	NVMCTRL_CRITICAL_SECTION_ENTER();
911 	((Nvmctrl *)hw)->ADDR.reg &= ~mask;
912 	NVMCTRL_CRITICAL_SECTION_LEAVE();
913 }
914 
hri_nvmctrl_toggle_ADDR_reg(const void * const hw,hri_nvmctrl_addr_reg_t mask)915 static inline void hri_nvmctrl_toggle_ADDR_reg(const void *const hw, hri_nvmctrl_addr_reg_t mask)
916 {
917 	NVMCTRL_CRITICAL_SECTION_ENTER();
918 	((Nvmctrl *)hw)->ADDR.reg ^= mask;
919 	NVMCTRL_CRITICAL_SECTION_LEAVE();
920 }
921 
hri_nvmctrl_read_ADDR_reg(const void * const hw)922 static inline hri_nvmctrl_addr_reg_t hri_nvmctrl_read_ADDR_reg(const void *const hw)
923 {
924 	return ((Nvmctrl *)hw)->ADDR.reg;
925 }
926 
hri_nvmctrl_set_LOCK_LOCK_bf(const void * const hw,hri_nvmctrl_lock_reg_t mask)927 static inline void hri_nvmctrl_set_LOCK_LOCK_bf(const void *const hw, hri_nvmctrl_lock_reg_t mask)
928 {
929 	NVMCTRL_CRITICAL_SECTION_ENTER();
930 	((Nvmctrl *)hw)->LOCK.reg |= NVMCTRL_LOCK_LOCK(mask);
931 	NVMCTRL_CRITICAL_SECTION_LEAVE();
932 }
933 
hri_nvmctrl_get_LOCK_LOCK_bf(const void * const hw,hri_nvmctrl_lock_reg_t mask)934 static inline hri_nvmctrl_lock_reg_t hri_nvmctrl_get_LOCK_LOCK_bf(const void *const hw, hri_nvmctrl_lock_reg_t mask)
935 {
936 	uint16_t tmp;
937 	tmp = ((Nvmctrl *)hw)->LOCK.reg;
938 	tmp = (tmp & NVMCTRL_LOCK_LOCK(mask)) >> NVMCTRL_LOCK_LOCK_Pos;
939 	return tmp;
940 }
941 
hri_nvmctrl_write_LOCK_LOCK_bf(const void * const hw,hri_nvmctrl_lock_reg_t data)942 static inline void hri_nvmctrl_write_LOCK_LOCK_bf(const void *const hw, hri_nvmctrl_lock_reg_t data)
943 {
944 	uint16_t tmp;
945 	NVMCTRL_CRITICAL_SECTION_ENTER();
946 	tmp = ((Nvmctrl *)hw)->LOCK.reg;
947 	tmp &= ~NVMCTRL_LOCK_LOCK_Msk;
948 	tmp |= NVMCTRL_LOCK_LOCK(data);
949 	((Nvmctrl *)hw)->LOCK.reg = tmp;
950 	NVMCTRL_CRITICAL_SECTION_LEAVE();
951 }
952 
hri_nvmctrl_clear_LOCK_LOCK_bf(const void * const hw,hri_nvmctrl_lock_reg_t mask)953 static inline void hri_nvmctrl_clear_LOCK_LOCK_bf(const void *const hw, hri_nvmctrl_lock_reg_t mask)
954 {
955 	NVMCTRL_CRITICAL_SECTION_ENTER();
956 	((Nvmctrl *)hw)->LOCK.reg &= ~NVMCTRL_LOCK_LOCK(mask);
957 	NVMCTRL_CRITICAL_SECTION_LEAVE();
958 }
959 
hri_nvmctrl_toggle_LOCK_LOCK_bf(const void * const hw,hri_nvmctrl_lock_reg_t mask)960 static inline void hri_nvmctrl_toggle_LOCK_LOCK_bf(const void *const hw, hri_nvmctrl_lock_reg_t mask)
961 {
962 	NVMCTRL_CRITICAL_SECTION_ENTER();
963 	((Nvmctrl *)hw)->LOCK.reg ^= NVMCTRL_LOCK_LOCK(mask);
964 	NVMCTRL_CRITICAL_SECTION_LEAVE();
965 }
966 
hri_nvmctrl_read_LOCK_LOCK_bf(const void * const hw)967 static inline hri_nvmctrl_lock_reg_t hri_nvmctrl_read_LOCK_LOCK_bf(const void *const hw)
968 {
969 	uint16_t tmp;
970 	tmp = ((Nvmctrl *)hw)->LOCK.reg;
971 	tmp = (tmp & NVMCTRL_LOCK_LOCK_Msk) >> NVMCTRL_LOCK_LOCK_Pos;
972 	return tmp;
973 }
974 
hri_nvmctrl_set_LOCK_reg(const void * const hw,hri_nvmctrl_lock_reg_t mask)975 static inline void hri_nvmctrl_set_LOCK_reg(const void *const hw, hri_nvmctrl_lock_reg_t mask)
976 {
977 	NVMCTRL_CRITICAL_SECTION_ENTER();
978 	((Nvmctrl *)hw)->LOCK.reg |= mask;
979 	NVMCTRL_CRITICAL_SECTION_LEAVE();
980 }
981 
hri_nvmctrl_get_LOCK_reg(const void * const hw,hri_nvmctrl_lock_reg_t mask)982 static inline hri_nvmctrl_lock_reg_t hri_nvmctrl_get_LOCK_reg(const void *const hw, hri_nvmctrl_lock_reg_t mask)
983 {
984 	uint16_t tmp;
985 	tmp = ((Nvmctrl *)hw)->LOCK.reg;
986 	tmp &= mask;
987 	return tmp;
988 }
989 
hri_nvmctrl_write_LOCK_reg(const void * const hw,hri_nvmctrl_lock_reg_t data)990 static inline void hri_nvmctrl_write_LOCK_reg(const void *const hw, hri_nvmctrl_lock_reg_t data)
991 {
992 	NVMCTRL_CRITICAL_SECTION_ENTER();
993 	((Nvmctrl *)hw)->LOCK.reg = data;
994 	NVMCTRL_CRITICAL_SECTION_LEAVE();
995 }
996 
hri_nvmctrl_clear_LOCK_reg(const void * const hw,hri_nvmctrl_lock_reg_t mask)997 static inline void hri_nvmctrl_clear_LOCK_reg(const void *const hw, hri_nvmctrl_lock_reg_t mask)
998 {
999 	NVMCTRL_CRITICAL_SECTION_ENTER();
1000 	((Nvmctrl *)hw)->LOCK.reg &= ~mask;
1001 	NVMCTRL_CRITICAL_SECTION_LEAVE();
1002 }
1003 
hri_nvmctrl_toggle_LOCK_reg(const void * const hw,hri_nvmctrl_lock_reg_t mask)1004 static inline void hri_nvmctrl_toggle_LOCK_reg(const void *const hw, hri_nvmctrl_lock_reg_t mask)
1005 {
1006 	NVMCTRL_CRITICAL_SECTION_ENTER();
1007 	((Nvmctrl *)hw)->LOCK.reg ^= mask;
1008 	NVMCTRL_CRITICAL_SECTION_LEAVE();
1009 }
1010 
hri_nvmctrl_read_LOCK_reg(const void * const hw)1011 static inline hri_nvmctrl_lock_reg_t hri_nvmctrl_read_LOCK_reg(const void *const hw)
1012 {
1013 	return ((Nvmctrl *)hw)->LOCK.reg;
1014 }
1015 
hri_nvmctrl_get_STATUS_PRM_bit(const void * const hw)1016 static inline bool hri_nvmctrl_get_STATUS_PRM_bit(const void *const hw)
1017 {
1018 	return (((Nvmctrl *)hw)->STATUS.reg & NVMCTRL_STATUS_PRM) >> NVMCTRL_STATUS_PRM_Pos;
1019 }
1020 
hri_nvmctrl_clear_STATUS_PRM_bit(const void * const hw)1021 static inline void hri_nvmctrl_clear_STATUS_PRM_bit(const void *const hw)
1022 {
1023 	NVMCTRL_CRITICAL_SECTION_ENTER();
1024 	((Nvmctrl *)hw)->STATUS.reg = NVMCTRL_STATUS_PRM;
1025 	NVMCTRL_CRITICAL_SECTION_LEAVE();
1026 }
1027 
hri_nvmctrl_get_STATUS_LOAD_bit(const void * const hw)1028 static inline bool hri_nvmctrl_get_STATUS_LOAD_bit(const void *const hw)
1029 {
1030 	return (((Nvmctrl *)hw)->STATUS.reg & NVMCTRL_STATUS_LOAD) >> NVMCTRL_STATUS_LOAD_Pos;
1031 }
1032 
hri_nvmctrl_clear_STATUS_LOAD_bit(const void * const hw)1033 static inline void hri_nvmctrl_clear_STATUS_LOAD_bit(const void *const hw)
1034 {
1035 	NVMCTRL_CRITICAL_SECTION_ENTER();
1036 	((Nvmctrl *)hw)->STATUS.reg = NVMCTRL_STATUS_LOAD;
1037 	NVMCTRL_CRITICAL_SECTION_LEAVE();
1038 }
1039 
hri_nvmctrl_get_STATUS_PROGE_bit(const void * const hw)1040 static inline bool hri_nvmctrl_get_STATUS_PROGE_bit(const void *const hw)
1041 {
1042 	return (((Nvmctrl *)hw)->STATUS.reg & NVMCTRL_STATUS_PROGE) >> NVMCTRL_STATUS_PROGE_Pos;
1043 }
1044 
hri_nvmctrl_clear_STATUS_PROGE_bit(const void * const hw)1045 static inline void hri_nvmctrl_clear_STATUS_PROGE_bit(const void *const hw)
1046 {
1047 	NVMCTRL_CRITICAL_SECTION_ENTER();
1048 	((Nvmctrl *)hw)->STATUS.reg = NVMCTRL_STATUS_PROGE;
1049 	NVMCTRL_CRITICAL_SECTION_LEAVE();
1050 }
1051 
hri_nvmctrl_get_STATUS_LOCKE_bit(const void * const hw)1052 static inline bool hri_nvmctrl_get_STATUS_LOCKE_bit(const void *const hw)
1053 {
1054 	return (((Nvmctrl *)hw)->STATUS.reg & NVMCTRL_STATUS_LOCKE) >> NVMCTRL_STATUS_LOCKE_Pos;
1055 }
1056 
hri_nvmctrl_clear_STATUS_LOCKE_bit(const void * const hw)1057 static inline void hri_nvmctrl_clear_STATUS_LOCKE_bit(const void *const hw)
1058 {
1059 	NVMCTRL_CRITICAL_SECTION_ENTER();
1060 	((Nvmctrl *)hw)->STATUS.reg = NVMCTRL_STATUS_LOCKE;
1061 	NVMCTRL_CRITICAL_SECTION_LEAVE();
1062 }
1063 
hri_nvmctrl_get_STATUS_NVME_bit(const void * const hw)1064 static inline bool hri_nvmctrl_get_STATUS_NVME_bit(const void *const hw)
1065 {
1066 	return (((Nvmctrl *)hw)->STATUS.reg & NVMCTRL_STATUS_NVME) >> NVMCTRL_STATUS_NVME_Pos;
1067 }
1068 
hri_nvmctrl_clear_STATUS_NVME_bit(const void * const hw)1069 static inline void hri_nvmctrl_clear_STATUS_NVME_bit(const void *const hw)
1070 {
1071 	NVMCTRL_CRITICAL_SECTION_ENTER();
1072 	((Nvmctrl *)hw)->STATUS.reg = NVMCTRL_STATUS_NVME;
1073 	NVMCTRL_CRITICAL_SECTION_LEAVE();
1074 }
1075 
hri_nvmctrl_get_STATUS_SB_bit(const void * const hw)1076 static inline bool hri_nvmctrl_get_STATUS_SB_bit(const void *const hw)
1077 {
1078 	return (((Nvmctrl *)hw)->STATUS.reg & NVMCTRL_STATUS_SB) >> NVMCTRL_STATUS_SB_Pos;
1079 }
1080 
hri_nvmctrl_clear_STATUS_SB_bit(const void * const hw)1081 static inline void hri_nvmctrl_clear_STATUS_SB_bit(const void *const hw)
1082 {
1083 	NVMCTRL_CRITICAL_SECTION_ENTER();
1084 	((Nvmctrl *)hw)->STATUS.reg = NVMCTRL_STATUS_SB;
1085 	NVMCTRL_CRITICAL_SECTION_LEAVE();
1086 }
1087 
hri_nvmctrl_get_STATUS_reg(const void * const hw,hri_nvmctrl_status_reg_t mask)1088 static inline hri_nvmctrl_status_reg_t hri_nvmctrl_get_STATUS_reg(const void *const hw, hri_nvmctrl_status_reg_t mask)
1089 {
1090 	uint16_t tmp;
1091 	tmp = ((Nvmctrl *)hw)->STATUS.reg;
1092 	tmp &= mask;
1093 	return tmp;
1094 }
1095 
hri_nvmctrl_clear_STATUS_reg(const void * const hw,hri_nvmctrl_status_reg_t mask)1096 static inline void hri_nvmctrl_clear_STATUS_reg(const void *const hw, hri_nvmctrl_status_reg_t mask)
1097 {
1098 	NVMCTRL_CRITICAL_SECTION_ENTER();
1099 	((Nvmctrl *)hw)->STATUS.reg = mask;
1100 	NVMCTRL_CRITICAL_SECTION_LEAVE();
1101 }
1102 
hri_nvmctrl_read_STATUS_reg(const void * const hw)1103 static inline hri_nvmctrl_status_reg_t hri_nvmctrl_read_STATUS_reg(const void *const hw)
1104 {
1105 	return ((Nvmctrl *)hw)->STATUS.reg;
1106 }
1107 
1108 #ifdef __cplusplus
1109 }
1110 #endif
1111 
1112 #endif /* _HRI_NVMCTRL_L21_H_INCLUDED */
1113 #endif /* _SAML21_NVMCTRL_COMPONENT_ */
1114