atsame70q21/usbhs/
usbhs_devept.rs1#[doc = "Register `USBHS_DEVEPT` reader"]
2pub struct R(crate::R<USBHS_DEVEPT_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<USBHS_DEVEPT_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<USBHS_DEVEPT_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<USBHS_DEVEPT_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `USBHS_DEVEPT` writer"]
17pub struct W(crate::W<USBHS_DEVEPT_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<USBHS_DEVEPT_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<USBHS_DEVEPT_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<USBHS_DEVEPT_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `EPEN0` reader - Endpoint 0 Enable"]
38pub struct EPEN0_R(crate::FieldReader<bool, bool>);
39impl EPEN0_R {
40 #[inline(always)]
41 pub(crate) fn new(bits: bool) -> Self {
42 EPEN0_R(crate::FieldReader::new(bits))
43 }
44}
45impl core::ops::Deref for EPEN0_R {
46 type Target = crate::FieldReader<bool, bool>;
47 #[inline(always)]
48 fn deref(&self) -> &Self::Target {
49 &self.0
50 }
51}
52#[doc = "Field `EPEN0` writer - Endpoint 0 Enable"]
53pub struct EPEN0_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> EPEN0_W<'a> {
57 #[doc = r"Sets the field bit"]
58 #[inline(always)]
59 pub fn set_bit(self) -> &'a mut W {
60 self.bit(true)
61 }
62 #[doc = r"Clears the field bit"]
63 #[inline(always)]
64 pub fn clear_bit(self) -> &'a mut W {
65 self.bit(false)
66 }
67 #[doc = r"Writes raw bits to the field"]
68 #[inline(always)]
69 pub fn bit(self, value: bool) -> &'a mut W {
70 self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
71 self.w
72 }
73}
74#[doc = "Field `EPEN1` reader - Endpoint 1 Enable"]
75pub struct EPEN1_R(crate::FieldReader<bool, bool>);
76impl EPEN1_R {
77 #[inline(always)]
78 pub(crate) fn new(bits: bool) -> Self {
79 EPEN1_R(crate::FieldReader::new(bits))
80 }
81}
82impl core::ops::Deref for EPEN1_R {
83 type Target = crate::FieldReader<bool, bool>;
84 #[inline(always)]
85 fn deref(&self) -> &Self::Target {
86 &self.0
87 }
88}
89#[doc = "Field `EPEN1` writer - Endpoint 1 Enable"]
90pub struct EPEN1_W<'a> {
91 w: &'a mut W,
92}
93impl<'a> EPEN1_W<'a> {
94 #[doc = r"Sets the field bit"]
95 #[inline(always)]
96 pub fn set_bit(self) -> &'a mut W {
97 self.bit(true)
98 }
99 #[doc = r"Clears the field bit"]
100 #[inline(always)]
101 pub fn clear_bit(self) -> &'a mut W {
102 self.bit(false)
103 }
104 #[doc = r"Writes raw bits to the field"]
105 #[inline(always)]
106 pub fn bit(self, value: bool) -> &'a mut W {
107 self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
108 self.w
109 }
110}
111#[doc = "Field `EPEN2` reader - Endpoint 2 Enable"]
112pub struct EPEN2_R(crate::FieldReader<bool, bool>);
113impl EPEN2_R {
114 #[inline(always)]
115 pub(crate) fn new(bits: bool) -> Self {
116 EPEN2_R(crate::FieldReader::new(bits))
117 }
118}
119impl core::ops::Deref for EPEN2_R {
120 type Target = crate::FieldReader<bool, bool>;
121 #[inline(always)]
122 fn deref(&self) -> &Self::Target {
123 &self.0
124 }
125}
126#[doc = "Field `EPEN2` writer - Endpoint 2 Enable"]
127pub struct EPEN2_W<'a> {
128 w: &'a mut W,
129}
130impl<'a> EPEN2_W<'a> {
131 #[doc = r"Sets the field bit"]
132 #[inline(always)]
133 pub fn set_bit(self) -> &'a mut W {
134 self.bit(true)
135 }
136 #[doc = r"Clears the field bit"]
137 #[inline(always)]
138 pub fn clear_bit(self) -> &'a mut W {
139 self.bit(false)
140 }
141 #[doc = r"Writes raw bits to the field"]
142 #[inline(always)]
143 pub fn bit(self, value: bool) -> &'a mut W {
144 self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
145 self.w
146 }
147}
148#[doc = "Field `EPEN3` reader - Endpoint 3 Enable"]
149pub struct EPEN3_R(crate::FieldReader<bool, bool>);
150impl EPEN3_R {
151 #[inline(always)]
152 pub(crate) fn new(bits: bool) -> Self {
153 EPEN3_R(crate::FieldReader::new(bits))
154 }
155}
156impl core::ops::Deref for EPEN3_R {
157 type Target = crate::FieldReader<bool, bool>;
158 #[inline(always)]
159 fn deref(&self) -> &Self::Target {
160 &self.0
161 }
162}
163#[doc = "Field `EPEN3` writer - Endpoint 3 Enable"]
164pub struct EPEN3_W<'a> {
165 w: &'a mut W,
166}
167impl<'a> EPEN3_W<'a> {
168 #[doc = r"Sets the field bit"]
169 #[inline(always)]
170 pub fn set_bit(self) -> &'a mut W {
171 self.bit(true)
172 }
173 #[doc = r"Clears the field bit"]
174 #[inline(always)]
175 pub fn clear_bit(self) -> &'a mut W {
176 self.bit(false)
177 }
178 #[doc = r"Writes raw bits to the field"]
179 #[inline(always)]
180 pub fn bit(self, value: bool) -> &'a mut W {
181 self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
182 self.w
183 }
184}
185#[doc = "Field `EPEN4` reader - Endpoint 4 Enable"]
186pub struct EPEN4_R(crate::FieldReader<bool, bool>);
187impl EPEN4_R {
188 #[inline(always)]
189 pub(crate) fn new(bits: bool) -> Self {
190 EPEN4_R(crate::FieldReader::new(bits))
191 }
192}
193impl core::ops::Deref for EPEN4_R {
194 type Target = crate::FieldReader<bool, bool>;
195 #[inline(always)]
196 fn deref(&self) -> &Self::Target {
197 &self.0
198 }
199}
200#[doc = "Field `EPEN4` writer - Endpoint 4 Enable"]
201pub struct EPEN4_W<'a> {
202 w: &'a mut W,
203}
204impl<'a> EPEN4_W<'a> {
205 #[doc = r"Sets the field bit"]
206 #[inline(always)]
207 pub fn set_bit(self) -> &'a mut W {
208 self.bit(true)
209 }
210 #[doc = r"Clears the field bit"]
211 #[inline(always)]
212 pub fn clear_bit(self) -> &'a mut W {
213 self.bit(false)
214 }
215 #[doc = r"Writes raw bits to the field"]
216 #[inline(always)]
217 pub fn bit(self, value: bool) -> &'a mut W {
218 self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
219 self.w
220 }
221}
222#[doc = "Field `EPEN5` reader - Endpoint 5 Enable"]
223pub struct EPEN5_R(crate::FieldReader<bool, bool>);
224impl EPEN5_R {
225 #[inline(always)]
226 pub(crate) fn new(bits: bool) -> Self {
227 EPEN5_R(crate::FieldReader::new(bits))
228 }
229}
230impl core::ops::Deref for EPEN5_R {
231 type Target = crate::FieldReader<bool, bool>;
232 #[inline(always)]
233 fn deref(&self) -> &Self::Target {
234 &self.0
235 }
236}
237#[doc = "Field `EPEN5` writer - Endpoint 5 Enable"]
238pub struct EPEN5_W<'a> {
239 w: &'a mut W,
240}
241impl<'a> EPEN5_W<'a> {
242 #[doc = r"Sets the field bit"]
243 #[inline(always)]
244 pub fn set_bit(self) -> &'a mut W {
245 self.bit(true)
246 }
247 #[doc = r"Clears the field bit"]
248 #[inline(always)]
249 pub fn clear_bit(self) -> &'a mut W {
250 self.bit(false)
251 }
252 #[doc = r"Writes raw bits to the field"]
253 #[inline(always)]
254 pub fn bit(self, value: bool) -> &'a mut W {
255 self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
256 self.w
257 }
258}
259#[doc = "Field `EPEN6` reader - Endpoint 6 Enable"]
260pub struct EPEN6_R(crate::FieldReader<bool, bool>);
261impl EPEN6_R {
262 #[inline(always)]
263 pub(crate) fn new(bits: bool) -> Self {
264 EPEN6_R(crate::FieldReader::new(bits))
265 }
266}
267impl core::ops::Deref for EPEN6_R {
268 type Target = crate::FieldReader<bool, bool>;
269 #[inline(always)]
270 fn deref(&self) -> &Self::Target {
271 &self.0
272 }
273}
274#[doc = "Field `EPEN6` writer - Endpoint 6 Enable"]
275pub struct EPEN6_W<'a> {
276 w: &'a mut W,
277}
278impl<'a> EPEN6_W<'a> {
279 #[doc = r"Sets the field bit"]
280 #[inline(always)]
281 pub fn set_bit(self) -> &'a mut W {
282 self.bit(true)
283 }
284 #[doc = r"Clears the field bit"]
285 #[inline(always)]
286 pub fn clear_bit(self) -> &'a mut W {
287 self.bit(false)
288 }
289 #[doc = r"Writes raw bits to the field"]
290 #[inline(always)]
291 pub fn bit(self, value: bool) -> &'a mut W {
292 self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
293 self.w
294 }
295}
296#[doc = "Field `EPEN7` reader - Endpoint 7 Enable"]
297pub struct EPEN7_R(crate::FieldReader<bool, bool>);
298impl EPEN7_R {
299 #[inline(always)]
300 pub(crate) fn new(bits: bool) -> Self {
301 EPEN7_R(crate::FieldReader::new(bits))
302 }
303}
304impl core::ops::Deref for EPEN7_R {
305 type Target = crate::FieldReader<bool, bool>;
306 #[inline(always)]
307 fn deref(&self) -> &Self::Target {
308 &self.0
309 }
310}
311#[doc = "Field `EPEN7` writer - Endpoint 7 Enable"]
312pub struct EPEN7_W<'a> {
313 w: &'a mut W,
314}
315impl<'a> EPEN7_W<'a> {
316 #[doc = r"Sets the field bit"]
317 #[inline(always)]
318 pub fn set_bit(self) -> &'a mut W {
319 self.bit(true)
320 }
321 #[doc = r"Clears the field bit"]
322 #[inline(always)]
323 pub fn clear_bit(self) -> &'a mut W {
324 self.bit(false)
325 }
326 #[doc = r"Writes raw bits to the field"]
327 #[inline(always)]
328 pub fn bit(self, value: bool) -> &'a mut W {
329 self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
330 self.w
331 }
332}
333#[doc = "Field `EPEN8` reader - Endpoint 8 Enable"]
334pub struct EPEN8_R(crate::FieldReader<bool, bool>);
335impl EPEN8_R {
336 #[inline(always)]
337 pub(crate) fn new(bits: bool) -> Self {
338 EPEN8_R(crate::FieldReader::new(bits))
339 }
340}
341impl core::ops::Deref for EPEN8_R {
342 type Target = crate::FieldReader<bool, bool>;
343 #[inline(always)]
344 fn deref(&self) -> &Self::Target {
345 &self.0
346 }
347}
348#[doc = "Field `EPEN8` writer - Endpoint 8 Enable"]
349pub struct EPEN8_W<'a> {
350 w: &'a mut W,
351}
352impl<'a> EPEN8_W<'a> {
353 #[doc = r"Sets the field bit"]
354 #[inline(always)]
355 pub fn set_bit(self) -> &'a mut W {
356 self.bit(true)
357 }
358 #[doc = r"Clears the field bit"]
359 #[inline(always)]
360 pub fn clear_bit(self) -> &'a mut W {
361 self.bit(false)
362 }
363 #[doc = r"Writes raw bits to the field"]
364 #[inline(always)]
365 pub fn bit(self, value: bool) -> &'a mut W {
366 self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
367 self.w
368 }
369}
370#[doc = "Field `EPEN9` reader - Endpoint 9 Enable"]
371pub struct EPEN9_R(crate::FieldReader<bool, bool>);
372impl EPEN9_R {
373 #[inline(always)]
374 pub(crate) fn new(bits: bool) -> Self {
375 EPEN9_R(crate::FieldReader::new(bits))
376 }
377}
378impl core::ops::Deref for EPEN9_R {
379 type Target = crate::FieldReader<bool, bool>;
380 #[inline(always)]
381 fn deref(&self) -> &Self::Target {
382 &self.0
383 }
384}
385#[doc = "Field `EPEN9` writer - Endpoint 9 Enable"]
386pub struct EPEN9_W<'a> {
387 w: &'a mut W,
388}
389impl<'a> EPEN9_W<'a> {
390 #[doc = r"Sets the field bit"]
391 #[inline(always)]
392 pub fn set_bit(self) -> &'a mut W {
393 self.bit(true)
394 }
395 #[doc = r"Clears the field bit"]
396 #[inline(always)]
397 pub fn clear_bit(self) -> &'a mut W {
398 self.bit(false)
399 }
400 #[doc = r"Writes raw bits to the field"]
401 #[inline(always)]
402 pub fn bit(self, value: bool) -> &'a mut W {
403 self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9);
404 self.w
405 }
406}
407#[doc = "Field `EPRST0` reader - Endpoint 0 Reset"]
408pub struct EPRST0_R(crate::FieldReader<bool, bool>);
409impl EPRST0_R {
410 #[inline(always)]
411 pub(crate) fn new(bits: bool) -> Self {
412 EPRST0_R(crate::FieldReader::new(bits))
413 }
414}
415impl core::ops::Deref for EPRST0_R {
416 type Target = crate::FieldReader<bool, bool>;
417 #[inline(always)]
418 fn deref(&self) -> &Self::Target {
419 &self.0
420 }
421}
422#[doc = "Field `EPRST0` writer - Endpoint 0 Reset"]
423pub struct EPRST0_W<'a> {
424 w: &'a mut W,
425}
426impl<'a> EPRST0_W<'a> {
427 #[doc = r"Sets the field bit"]
428 #[inline(always)]
429 pub fn set_bit(self) -> &'a mut W {
430 self.bit(true)
431 }
432 #[doc = r"Clears the field bit"]
433 #[inline(always)]
434 pub fn clear_bit(self) -> &'a mut W {
435 self.bit(false)
436 }
437 #[doc = r"Writes raw bits to the field"]
438 #[inline(always)]
439 pub fn bit(self, value: bool) -> &'a mut W {
440 self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16);
441 self.w
442 }
443}
444#[doc = "Field `EPRST1` reader - Endpoint 1 Reset"]
445pub struct EPRST1_R(crate::FieldReader<bool, bool>);
446impl EPRST1_R {
447 #[inline(always)]
448 pub(crate) fn new(bits: bool) -> Self {
449 EPRST1_R(crate::FieldReader::new(bits))
450 }
451}
452impl core::ops::Deref for EPRST1_R {
453 type Target = crate::FieldReader<bool, bool>;
454 #[inline(always)]
455 fn deref(&self) -> &Self::Target {
456 &self.0
457 }
458}
459#[doc = "Field `EPRST1` writer - Endpoint 1 Reset"]
460pub struct EPRST1_W<'a> {
461 w: &'a mut W,
462}
463impl<'a> EPRST1_W<'a> {
464 #[doc = r"Sets the field bit"]
465 #[inline(always)]
466 pub fn set_bit(self) -> &'a mut W {
467 self.bit(true)
468 }
469 #[doc = r"Clears the field bit"]
470 #[inline(always)]
471 pub fn clear_bit(self) -> &'a mut W {
472 self.bit(false)
473 }
474 #[doc = r"Writes raw bits to the field"]
475 #[inline(always)]
476 pub fn bit(self, value: bool) -> &'a mut W {
477 self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17);
478 self.w
479 }
480}
481#[doc = "Field `EPRST2` reader - Endpoint 2 Reset"]
482pub struct EPRST2_R(crate::FieldReader<bool, bool>);
483impl EPRST2_R {
484 #[inline(always)]
485 pub(crate) fn new(bits: bool) -> Self {
486 EPRST2_R(crate::FieldReader::new(bits))
487 }
488}
489impl core::ops::Deref for EPRST2_R {
490 type Target = crate::FieldReader<bool, bool>;
491 #[inline(always)]
492 fn deref(&self) -> &Self::Target {
493 &self.0
494 }
495}
496#[doc = "Field `EPRST2` writer - Endpoint 2 Reset"]
497pub struct EPRST2_W<'a> {
498 w: &'a mut W,
499}
500impl<'a> EPRST2_W<'a> {
501 #[doc = r"Sets the field bit"]
502 #[inline(always)]
503 pub fn set_bit(self) -> &'a mut W {
504 self.bit(true)
505 }
506 #[doc = r"Clears the field bit"]
507 #[inline(always)]
508 pub fn clear_bit(self) -> &'a mut W {
509 self.bit(false)
510 }
511 #[doc = r"Writes raw bits to the field"]
512 #[inline(always)]
513 pub fn bit(self, value: bool) -> &'a mut W {
514 self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18);
515 self.w
516 }
517}
518#[doc = "Field `EPRST3` reader - Endpoint 3 Reset"]
519pub struct EPRST3_R(crate::FieldReader<bool, bool>);
520impl EPRST3_R {
521 #[inline(always)]
522 pub(crate) fn new(bits: bool) -> Self {
523 EPRST3_R(crate::FieldReader::new(bits))
524 }
525}
526impl core::ops::Deref for EPRST3_R {
527 type Target = crate::FieldReader<bool, bool>;
528 #[inline(always)]
529 fn deref(&self) -> &Self::Target {
530 &self.0
531 }
532}
533#[doc = "Field `EPRST3` writer - Endpoint 3 Reset"]
534pub struct EPRST3_W<'a> {
535 w: &'a mut W,
536}
537impl<'a> EPRST3_W<'a> {
538 #[doc = r"Sets the field bit"]
539 #[inline(always)]
540 pub fn set_bit(self) -> &'a mut W {
541 self.bit(true)
542 }
543 #[doc = r"Clears the field bit"]
544 #[inline(always)]
545 pub fn clear_bit(self) -> &'a mut W {
546 self.bit(false)
547 }
548 #[doc = r"Writes raw bits to the field"]
549 #[inline(always)]
550 pub fn bit(self, value: bool) -> &'a mut W {
551 self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19);
552 self.w
553 }
554}
555#[doc = "Field `EPRST4` reader - Endpoint 4 Reset"]
556pub struct EPRST4_R(crate::FieldReader<bool, bool>);
557impl EPRST4_R {
558 #[inline(always)]
559 pub(crate) fn new(bits: bool) -> Self {
560 EPRST4_R(crate::FieldReader::new(bits))
561 }
562}
563impl core::ops::Deref for EPRST4_R {
564 type Target = crate::FieldReader<bool, bool>;
565 #[inline(always)]
566 fn deref(&self) -> &Self::Target {
567 &self.0
568 }
569}
570#[doc = "Field `EPRST4` writer - Endpoint 4 Reset"]
571pub struct EPRST4_W<'a> {
572 w: &'a mut W,
573}
574impl<'a> EPRST4_W<'a> {
575 #[doc = r"Sets the field bit"]
576 #[inline(always)]
577 pub fn set_bit(self) -> &'a mut W {
578 self.bit(true)
579 }
580 #[doc = r"Clears the field bit"]
581 #[inline(always)]
582 pub fn clear_bit(self) -> &'a mut W {
583 self.bit(false)
584 }
585 #[doc = r"Writes raw bits to the field"]
586 #[inline(always)]
587 pub fn bit(self, value: bool) -> &'a mut W {
588 self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20);
589 self.w
590 }
591}
592#[doc = "Field `EPRST5` reader - Endpoint 5 Reset"]
593pub struct EPRST5_R(crate::FieldReader<bool, bool>);
594impl EPRST5_R {
595 #[inline(always)]
596 pub(crate) fn new(bits: bool) -> Self {
597 EPRST5_R(crate::FieldReader::new(bits))
598 }
599}
600impl core::ops::Deref for EPRST5_R {
601 type Target = crate::FieldReader<bool, bool>;
602 #[inline(always)]
603 fn deref(&self) -> &Self::Target {
604 &self.0
605 }
606}
607#[doc = "Field `EPRST5` writer - Endpoint 5 Reset"]
608pub struct EPRST5_W<'a> {
609 w: &'a mut W,
610}
611impl<'a> EPRST5_W<'a> {
612 #[doc = r"Sets the field bit"]
613 #[inline(always)]
614 pub fn set_bit(self) -> &'a mut W {
615 self.bit(true)
616 }
617 #[doc = r"Clears the field bit"]
618 #[inline(always)]
619 pub fn clear_bit(self) -> &'a mut W {
620 self.bit(false)
621 }
622 #[doc = r"Writes raw bits to the field"]
623 #[inline(always)]
624 pub fn bit(self, value: bool) -> &'a mut W {
625 self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21);
626 self.w
627 }
628}
629#[doc = "Field `EPRST6` reader - Endpoint 6 Reset"]
630pub struct EPRST6_R(crate::FieldReader<bool, bool>);
631impl EPRST6_R {
632 #[inline(always)]
633 pub(crate) fn new(bits: bool) -> Self {
634 EPRST6_R(crate::FieldReader::new(bits))
635 }
636}
637impl core::ops::Deref for EPRST6_R {
638 type Target = crate::FieldReader<bool, bool>;
639 #[inline(always)]
640 fn deref(&self) -> &Self::Target {
641 &self.0
642 }
643}
644#[doc = "Field `EPRST6` writer - Endpoint 6 Reset"]
645pub struct EPRST6_W<'a> {
646 w: &'a mut W,
647}
648impl<'a> EPRST6_W<'a> {
649 #[doc = r"Sets the field bit"]
650 #[inline(always)]
651 pub fn set_bit(self) -> &'a mut W {
652 self.bit(true)
653 }
654 #[doc = r"Clears the field bit"]
655 #[inline(always)]
656 pub fn clear_bit(self) -> &'a mut W {
657 self.bit(false)
658 }
659 #[doc = r"Writes raw bits to the field"]
660 #[inline(always)]
661 pub fn bit(self, value: bool) -> &'a mut W {
662 self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22);
663 self.w
664 }
665}
666#[doc = "Field `EPRST7` reader - Endpoint 7 Reset"]
667pub struct EPRST7_R(crate::FieldReader<bool, bool>);
668impl EPRST7_R {
669 #[inline(always)]
670 pub(crate) fn new(bits: bool) -> Self {
671 EPRST7_R(crate::FieldReader::new(bits))
672 }
673}
674impl core::ops::Deref for EPRST7_R {
675 type Target = crate::FieldReader<bool, bool>;
676 #[inline(always)]
677 fn deref(&self) -> &Self::Target {
678 &self.0
679 }
680}
681#[doc = "Field `EPRST7` writer - Endpoint 7 Reset"]
682pub struct EPRST7_W<'a> {
683 w: &'a mut W,
684}
685impl<'a> EPRST7_W<'a> {
686 #[doc = r"Sets the field bit"]
687 #[inline(always)]
688 pub fn set_bit(self) -> &'a mut W {
689 self.bit(true)
690 }
691 #[doc = r"Clears the field bit"]
692 #[inline(always)]
693 pub fn clear_bit(self) -> &'a mut W {
694 self.bit(false)
695 }
696 #[doc = r"Writes raw bits to the field"]
697 #[inline(always)]
698 pub fn bit(self, value: bool) -> &'a mut W {
699 self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23);
700 self.w
701 }
702}
703#[doc = "Field `EPRST8` reader - Endpoint 8 Reset"]
704pub struct EPRST8_R(crate::FieldReader<bool, bool>);
705impl EPRST8_R {
706 #[inline(always)]
707 pub(crate) fn new(bits: bool) -> Self {
708 EPRST8_R(crate::FieldReader::new(bits))
709 }
710}
711impl core::ops::Deref for EPRST8_R {
712 type Target = crate::FieldReader<bool, bool>;
713 #[inline(always)]
714 fn deref(&self) -> &Self::Target {
715 &self.0
716 }
717}
718#[doc = "Field `EPRST8` writer - Endpoint 8 Reset"]
719pub struct EPRST8_W<'a> {
720 w: &'a mut W,
721}
722impl<'a> EPRST8_W<'a> {
723 #[doc = r"Sets the field bit"]
724 #[inline(always)]
725 pub fn set_bit(self) -> &'a mut W {
726 self.bit(true)
727 }
728 #[doc = r"Clears the field bit"]
729 #[inline(always)]
730 pub fn clear_bit(self) -> &'a mut W {
731 self.bit(false)
732 }
733 #[doc = r"Writes raw bits to the field"]
734 #[inline(always)]
735 pub fn bit(self, value: bool) -> &'a mut W {
736 self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24);
737 self.w
738 }
739}
740#[doc = "Field `EPRST9` reader - Endpoint 9 Reset"]
741pub struct EPRST9_R(crate::FieldReader<bool, bool>);
742impl EPRST9_R {
743 #[inline(always)]
744 pub(crate) fn new(bits: bool) -> Self {
745 EPRST9_R(crate::FieldReader::new(bits))
746 }
747}
748impl core::ops::Deref for EPRST9_R {
749 type Target = crate::FieldReader<bool, bool>;
750 #[inline(always)]
751 fn deref(&self) -> &Self::Target {
752 &self.0
753 }
754}
755#[doc = "Field `EPRST9` writer - Endpoint 9 Reset"]
756pub struct EPRST9_W<'a> {
757 w: &'a mut W,
758}
759impl<'a> EPRST9_W<'a> {
760 #[doc = r"Sets the field bit"]
761 #[inline(always)]
762 pub fn set_bit(self) -> &'a mut W {
763 self.bit(true)
764 }
765 #[doc = r"Clears the field bit"]
766 #[inline(always)]
767 pub fn clear_bit(self) -> &'a mut W {
768 self.bit(false)
769 }
770 #[doc = r"Writes raw bits to the field"]
771 #[inline(always)]
772 pub fn bit(self, value: bool) -> &'a mut W {
773 self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25);
774 self.w
775 }
776}
777impl R {
778 #[doc = "Bit 0 - Endpoint 0 Enable"]
779 #[inline(always)]
780 pub fn epen0(&self) -> EPEN0_R {
781 EPEN0_R::new((self.bits & 0x01) != 0)
782 }
783 #[doc = "Bit 1 - Endpoint 1 Enable"]
784 #[inline(always)]
785 pub fn epen1(&self) -> EPEN1_R {
786 EPEN1_R::new(((self.bits >> 1) & 0x01) != 0)
787 }
788 #[doc = "Bit 2 - Endpoint 2 Enable"]
789 #[inline(always)]
790 pub fn epen2(&self) -> EPEN2_R {
791 EPEN2_R::new(((self.bits >> 2) & 0x01) != 0)
792 }
793 #[doc = "Bit 3 - Endpoint 3 Enable"]
794 #[inline(always)]
795 pub fn epen3(&self) -> EPEN3_R {
796 EPEN3_R::new(((self.bits >> 3) & 0x01) != 0)
797 }
798 #[doc = "Bit 4 - Endpoint 4 Enable"]
799 #[inline(always)]
800 pub fn epen4(&self) -> EPEN4_R {
801 EPEN4_R::new(((self.bits >> 4) & 0x01) != 0)
802 }
803 #[doc = "Bit 5 - Endpoint 5 Enable"]
804 #[inline(always)]
805 pub fn epen5(&self) -> EPEN5_R {
806 EPEN5_R::new(((self.bits >> 5) & 0x01) != 0)
807 }
808 #[doc = "Bit 6 - Endpoint 6 Enable"]
809 #[inline(always)]
810 pub fn epen6(&self) -> EPEN6_R {
811 EPEN6_R::new(((self.bits >> 6) & 0x01) != 0)
812 }
813 #[doc = "Bit 7 - Endpoint 7 Enable"]
814 #[inline(always)]
815 pub fn epen7(&self) -> EPEN7_R {
816 EPEN7_R::new(((self.bits >> 7) & 0x01) != 0)
817 }
818 #[doc = "Bit 8 - Endpoint 8 Enable"]
819 #[inline(always)]
820 pub fn epen8(&self) -> EPEN8_R {
821 EPEN8_R::new(((self.bits >> 8) & 0x01) != 0)
822 }
823 #[doc = "Bit 9 - Endpoint 9 Enable"]
824 #[inline(always)]
825 pub fn epen9(&self) -> EPEN9_R {
826 EPEN9_R::new(((self.bits >> 9) & 0x01) != 0)
827 }
828 #[doc = "Bit 16 - Endpoint 0 Reset"]
829 #[inline(always)]
830 pub fn eprst0(&self) -> EPRST0_R {
831 EPRST0_R::new(((self.bits >> 16) & 0x01) != 0)
832 }
833 #[doc = "Bit 17 - Endpoint 1 Reset"]
834 #[inline(always)]
835 pub fn eprst1(&self) -> EPRST1_R {
836 EPRST1_R::new(((self.bits >> 17) & 0x01) != 0)
837 }
838 #[doc = "Bit 18 - Endpoint 2 Reset"]
839 #[inline(always)]
840 pub fn eprst2(&self) -> EPRST2_R {
841 EPRST2_R::new(((self.bits >> 18) & 0x01) != 0)
842 }
843 #[doc = "Bit 19 - Endpoint 3 Reset"]
844 #[inline(always)]
845 pub fn eprst3(&self) -> EPRST3_R {
846 EPRST3_R::new(((self.bits >> 19) & 0x01) != 0)
847 }
848 #[doc = "Bit 20 - Endpoint 4 Reset"]
849 #[inline(always)]
850 pub fn eprst4(&self) -> EPRST4_R {
851 EPRST4_R::new(((self.bits >> 20) & 0x01) != 0)
852 }
853 #[doc = "Bit 21 - Endpoint 5 Reset"]
854 #[inline(always)]
855 pub fn eprst5(&self) -> EPRST5_R {
856 EPRST5_R::new(((self.bits >> 21) & 0x01) != 0)
857 }
858 #[doc = "Bit 22 - Endpoint 6 Reset"]
859 #[inline(always)]
860 pub fn eprst6(&self) -> EPRST6_R {
861 EPRST6_R::new(((self.bits >> 22) & 0x01) != 0)
862 }
863 #[doc = "Bit 23 - Endpoint 7 Reset"]
864 #[inline(always)]
865 pub fn eprst7(&self) -> EPRST7_R {
866 EPRST7_R::new(((self.bits >> 23) & 0x01) != 0)
867 }
868 #[doc = "Bit 24 - Endpoint 8 Reset"]
869 #[inline(always)]
870 pub fn eprst8(&self) -> EPRST8_R {
871 EPRST8_R::new(((self.bits >> 24) & 0x01) != 0)
872 }
873 #[doc = "Bit 25 - Endpoint 9 Reset"]
874 #[inline(always)]
875 pub fn eprst9(&self) -> EPRST9_R {
876 EPRST9_R::new(((self.bits >> 25) & 0x01) != 0)
877 }
878}
879impl W {
880 #[doc = "Bit 0 - Endpoint 0 Enable"]
881 #[inline(always)]
882 pub fn epen0(&mut self) -> EPEN0_W {
883 EPEN0_W { w: self }
884 }
885 #[doc = "Bit 1 - Endpoint 1 Enable"]
886 #[inline(always)]
887 pub fn epen1(&mut self) -> EPEN1_W {
888 EPEN1_W { w: self }
889 }
890 #[doc = "Bit 2 - Endpoint 2 Enable"]
891 #[inline(always)]
892 pub fn epen2(&mut self) -> EPEN2_W {
893 EPEN2_W { w: self }
894 }
895 #[doc = "Bit 3 - Endpoint 3 Enable"]
896 #[inline(always)]
897 pub fn epen3(&mut self) -> EPEN3_W {
898 EPEN3_W { w: self }
899 }
900 #[doc = "Bit 4 - Endpoint 4 Enable"]
901 #[inline(always)]
902 pub fn epen4(&mut self) -> EPEN4_W {
903 EPEN4_W { w: self }
904 }
905 #[doc = "Bit 5 - Endpoint 5 Enable"]
906 #[inline(always)]
907 pub fn epen5(&mut self) -> EPEN5_W {
908 EPEN5_W { w: self }
909 }
910 #[doc = "Bit 6 - Endpoint 6 Enable"]
911 #[inline(always)]
912 pub fn epen6(&mut self) -> EPEN6_W {
913 EPEN6_W { w: self }
914 }
915 #[doc = "Bit 7 - Endpoint 7 Enable"]
916 #[inline(always)]
917 pub fn epen7(&mut self) -> EPEN7_W {
918 EPEN7_W { w: self }
919 }
920 #[doc = "Bit 8 - Endpoint 8 Enable"]
921 #[inline(always)]
922 pub fn epen8(&mut self) -> EPEN8_W {
923 EPEN8_W { w: self }
924 }
925 #[doc = "Bit 9 - Endpoint 9 Enable"]
926 #[inline(always)]
927 pub fn epen9(&mut self) -> EPEN9_W {
928 EPEN9_W { w: self }
929 }
930 #[doc = "Bit 16 - Endpoint 0 Reset"]
931 #[inline(always)]
932 pub fn eprst0(&mut self) -> EPRST0_W {
933 EPRST0_W { w: self }
934 }
935 #[doc = "Bit 17 - Endpoint 1 Reset"]
936 #[inline(always)]
937 pub fn eprst1(&mut self) -> EPRST1_W {
938 EPRST1_W { w: self }
939 }
940 #[doc = "Bit 18 - Endpoint 2 Reset"]
941 #[inline(always)]
942 pub fn eprst2(&mut self) -> EPRST2_W {
943 EPRST2_W { w: self }
944 }
945 #[doc = "Bit 19 - Endpoint 3 Reset"]
946 #[inline(always)]
947 pub fn eprst3(&mut self) -> EPRST3_W {
948 EPRST3_W { w: self }
949 }
950 #[doc = "Bit 20 - Endpoint 4 Reset"]
951 #[inline(always)]
952 pub fn eprst4(&mut self) -> EPRST4_W {
953 EPRST4_W { w: self }
954 }
955 #[doc = "Bit 21 - Endpoint 5 Reset"]
956 #[inline(always)]
957 pub fn eprst5(&mut self) -> EPRST5_W {
958 EPRST5_W { w: self }
959 }
960 #[doc = "Bit 22 - Endpoint 6 Reset"]
961 #[inline(always)]
962 pub fn eprst6(&mut self) -> EPRST6_W {
963 EPRST6_W { w: self }
964 }
965 #[doc = "Bit 23 - Endpoint 7 Reset"]
966 #[inline(always)]
967 pub fn eprst7(&mut self) -> EPRST7_W {
968 EPRST7_W { w: self }
969 }
970 #[doc = "Bit 24 - Endpoint 8 Reset"]
971 #[inline(always)]
972 pub fn eprst8(&mut self) -> EPRST8_W {
973 EPRST8_W { w: self }
974 }
975 #[doc = "Bit 25 - Endpoint 9 Reset"]
976 #[inline(always)]
977 pub fn eprst9(&mut self) -> EPRST9_W {
978 EPRST9_W { w: self }
979 }
980 #[doc = "Writes raw bits to the register."]
981 #[inline(always)]
982 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
983 self.0.bits(bits);
984 self
985 }
986}
987#[doc = "Device Endpoint Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [usbhs_devept](index.html) module"]
988pub struct USBHS_DEVEPT_SPEC;
989impl crate::RegisterSpec for USBHS_DEVEPT_SPEC {
990 type Ux = u32;
991}
992#[doc = "`read()` method returns [usbhs_devept::R](R) reader structure"]
993impl crate::Readable for USBHS_DEVEPT_SPEC {
994 type Reader = R;
995}
996#[doc = "`write(|w| ..)` method takes [usbhs_devept::W](W) writer structure"]
997impl crate::Writable for USBHS_DEVEPT_SPEC {
998 type Writer = W;
999}
1000#[doc = "`reset()` method sets USBHS_DEVEPT to value 0"]
1001impl crate::Resettable for USBHS_DEVEPT_SPEC {
1002 #[inline(always)]
1003 fn reset_value() -> Self::Ux {
1004 0
1005 }
1006}