1#[doc = r" Value read from the register"]
2pub struct R {
3 bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7 bits: u32,
8}
9impl super::CNTR {
10 #[doc = r" Modifies the contents of the register"]
11 #[inline]
12 pub fn modify<F>(&self, f: F)
13 where
14 for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15 {
16 let bits = self.register.get();
17 let r = R { bits: bits };
18 let mut w = W { bits: bits };
19 f(&r, &mut w);
20 self.register.set(w.bits);
21 }
22 #[doc = r" Reads the contents of the register"]
23 #[inline]
24 pub fn read(&self) -> R {
25 R {
26 bits: self.register.get(),
27 }
28 }
29 #[doc = r" Writes to the register"]
30 #[inline]
31 pub fn write<F>(&self, f: F)
32 where
33 F: FnOnce(&mut W) -> &mut W,
34 {
35 let mut w = W::reset_value();
36 f(&mut w);
37 self.register.set(w.bits);
38 }
39 #[doc = r" Writes the reset value to the register"]
40 #[inline]
41 pub fn reset(&self) {
42 self.write(|w| w)
43 }
44}
45#[doc = "Possible values of the field `FRES`"]
46#[derive(Clone, Copy, Debug, PartialEq)]
47pub enum FRESR {
48 #[doc = "Clear USB reset"]
49 NORESET,
50 #[doc = "Force a reset of the USB peripheral, exactly like a RESET signaling on the USB"]
51 RESET,
52}
53impl FRESR {
54 #[doc = r" Returns `true` if the bit is clear (0)"]
55 #[inline]
56 pub fn bit_is_clear(&self) -> bool {
57 !self.bit()
58 }
59 #[doc = r" Returns `true` if the bit is set (1)"]
60 #[inline]
61 pub fn bit_is_set(&self) -> bool {
62 self.bit()
63 }
64 #[doc = r" Value of the field as raw bits"]
65 #[inline]
66 pub fn bit(&self) -> bool {
67 match *self {
68 FRESR::NORESET => false,
69 FRESR::RESET => true,
70 }
71 }
72 #[allow(missing_docs)]
73 #[doc(hidden)]
74 #[inline]
75 pub fn _from(value: bool) -> FRESR {
76 match value {
77 false => FRESR::NORESET,
78 true => FRESR::RESET,
79 }
80 }
81 #[doc = "Checks if the value of the field is `NORESET`"]
82 #[inline]
83 pub fn is_no_reset(&self) -> bool {
84 *self == FRESR::NORESET
85 }
86 #[doc = "Checks if the value of the field is `RESET`"]
87 #[inline]
88 pub fn is_reset(&self) -> bool {
89 *self == FRESR::RESET
90 }
91}
92#[doc = "Possible values of the field `PDWN`"]
93#[derive(Clone, Copy, Debug, PartialEq)]
94pub enum PDWNR {
95 #[doc = "No power down"]
96 DISABLED,
97 #[doc = "Enter power down mode"]
98 ENABLED,
99}
100impl PDWNR {
101 #[doc = r" Returns `true` if the bit is clear (0)"]
102 #[inline]
103 pub fn bit_is_clear(&self) -> bool {
104 !self.bit()
105 }
106 #[doc = r" Returns `true` if the bit is set (1)"]
107 #[inline]
108 pub fn bit_is_set(&self) -> bool {
109 self.bit()
110 }
111 #[doc = r" Value of the field as raw bits"]
112 #[inline]
113 pub fn bit(&self) -> bool {
114 match *self {
115 PDWNR::DISABLED => false,
116 PDWNR::ENABLED => true,
117 }
118 }
119 #[allow(missing_docs)]
120 #[doc(hidden)]
121 #[inline]
122 pub fn _from(value: bool) -> PDWNR {
123 match value {
124 false => PDWNR::DISABLED,
125 true => PDWNR::ENABLED,
126 }
127 }
128 #[doc = "Checks if the value of the field is `DISABLED`"]
129 #[inline]
130 pub fn is_disabled(&self) -> bool {
131 *self == PDWNR::DISABLED
132 }
133 #[doc = "Checks if the value of the field is `ENABLED`"]
134 #[inline]
135 pub fn is_enabled(&self) -> bool {
136 *self == PDWNR::ENABLED
137 }
138}
139#[doc = "Possible values of the field `LPMODE`"]
140#[derive(Clone, Copy, Debug, PartialEq)]
141pub enum LPMODER {
142 #[doc = "No low-power mode"]
143 DISABLED,
144 #[doc = "Enter low-power mode"]
145 ENABLED,
146}
147impl LPMODER {
148 #[doc = r" Returns `true` if the bit is clear (0)"]
149 #[inline]
150 pub fn bit_is_clear(&self) -> bool {
151 !self.bit()
152 }
153 #[doc = r" Returns `true` if the bit is set (1)"]
154 #[inline]
155 pub fn bit_is_set(&self) -> bool {
156 self.bit()
157 }
158 #[doc = r" Value of the field as raw bits"]
159 #[inline]
160 pub fn bit(&self) -> bool {
161 match *self {
162 LPMODER::DISABLED => false,
163 LPMODER::ENABLED => true,
164 }
165 }
166 #[allow(missing_docs)]
167 #[doc(hidden)]
168 #[inline]
169 pub fn _from(value: bool) -> LPMODER {
170 match value {
171 false => LPMODER::DISABLED,
172 true => LPMODER::ENABLED,
173 }
174 }
175 #[doc = "Checks if the value of the field is `DISABLED`"]
176 #[inline]
177 pub fn is_disabled(&self) -> bool {
178 *self == LPMODER::DISABLED
179 }
180 #[doc = "Checks if the value of the field is `ENABLED`"]
181 #[inline]
182 pub fn is_enabled(&self) -> bool {
183 *self == LPMODER::ENABLED
184 }
185}
186#[doc = "Possible values of the field `FSUSP`"]
187#[derive(Clone, Copy, Debug, PartialEq)]
188pub enum FSUSPR {
189 #[doc = "No effect"]
190 NOEFFECT,
191 #[doc = "Enter suspend mode. Clocks and static power dissipation in the analog transceiver are left unaffected"]
192 SUSPEND,
193}
194impl FSUSPR {
195 #[doc = r" Returns `true` if the bit is clear (0)"]
196 #[inline]
197 pub fn bit_is_clear(&self) -> bool {
198 !self.bit()
199 }
200 #[doc = r" Returns `true` if the bit is set (1)"]
201 #[inline]
202 pub fn bit_is_set(&self) -> bool {
203 self.bit()
204 }
205 #[doc = r" Value of the field as raw bits"]
206 #[inline]
207 pub fn bit(&self) -> bool {
208 match *self {
209 FSUSPR::NOEFFECT => false,
210 FSUSPR::SUSPEND => true,
211 }
212 }
213 #[allow(missing_docs)]
214 #[doc(hidden)]
215 #[inline]
216 pub fn _from(value: bool) -> FSUSPR {
217 match value {
218 false => FSUSPR::NOEFFECT,
219 true => FSUSPR::SUSPEND,
220 }
221 }
222 #[doc = "Checks if the value of the field is `NOEFFECT`"]
223 #[inline]
224 pub fn is_no_effect(&self) -> bool {
225 *self == FSUSPR::NOEFFECT
226 }
227 #[doc = "Checks if the value of the field is `SUSPEND`"]
228 #[inline]
229 pub fn is_suspend(&self) -> bool {
230 *self == FSUSPR::SUSPEND
231 }
232}
233#[doc = "Possible values of the field `RESUME`"]
234#[derive(Clone, Copy, Debug, PartialEq)]
235pub enum RESUMER {
236 #[doc = "Resume requested"]
237 REQUESTED,
238 #[doc = r" Reserved"]
239 _Reserved(bool),
240}
241impl RESUMER {
242 #[doc = r" Returns `true` if the bit is clear (0)"]
243 #[inline]
244 pub fn bit_is_clear(&self) -> bool {
245 !self.bit()
246 }
247 #[doc = r" Returns `true` if the bit is set (1)"]
248 #[inline]
249 pub fn bit_is_set(&self) -> bool {
250 self.bit()
251 }
252 #[doc = r" Value of the field as raw bits"]
253 #[inline]
254 pub fn bit(&self) -> bool {
255 match *self {
256 RESUMER::REQUESTED => true,
257 RESUMER::_Reserved(bits) => bits,
258 }
259 }
260 #[allow(missing_docs)]
261 #[doc(hidden)]
262 #[inline]
263 pub fn _from(value: bool) -> RESUMER {
264 match value {
265 true => RESUMER::REQUESTED,
266 i => RESUMER::_Reserved(i),
267 }
268 }
269 #[doc = "Checks if the value of the field is `REQUESTED`"]
270 #[inline]
271 pub fn is_requested(&self) -> bool {
272 *self == RESUMER::REQUESTED
273 }
274}
275#[doc = "Possible values of the field `L1RESUME`"]
276#[derive(Clone, Copy, Debug, PartialEq)]
277pub enum L1RESUMER {
278 #[doc = "LPM L1 request requested"]
279 REQUESTED,
280 #[doc = r" Reserved"]
281 _Reserved(bool),
282}
283impl L1RESUMER {
284 #[doc = r" Returns `true` if the bit is clear (0)"]
285 #[inline]
286 pub fn bit_is_clear(&self) -> bool {
287 !self.bit()
288 }
289 #[doc = r" Returns `true` if the bit is set (1)"]
290 #[inline]
291 pub fn bit_is_set(&self) -> bool {
292 self.bit()
293 }
294 #[doc = r" Value of the field as raw bits"]
295 #[inline]
296 pub fn bit(&self) -> bool {
297 match *self {
298 L1RESUMER::REQUESTED => true,
299 L1RESUMER::_Reserved(bits) => bits,
300 }
301 }
302 #[allow(missing_docs)]
303 #[doc(hidden)]
304 #[inline]
305 pub fn _from(value: bool) -> L1RESUMER {
306 match value {
307 true => L1RESUMER::REQUESTED,
308 i => L1RESUMER::_Reserved(i),
309 }
310 }
311 #[doc = "Checks if the value of the field is `REQUESTED`"]
312 #[inline]
313 pub fn is_requested(&self) -> bool {
314 *self == L1RESUMER::REQUESTED
315 }
316}
317#[doc = "Possible values of the field `L1REQM`"]
318#[derive(Clone, Copy, Debug, PartialEq)]
319pub enum L1REQMR {
320 #[doc = "L1REQ Interrupt disabled"]
321 DISABLED,
322 #[doc = "L1REQ Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
323 ENABLED,
324}
325impl L1REQMR {
326 #[doc = r" Returns `true` if the bit is clear (0)"]
327 #[inline]
328 pub fn bit_is_clear(&self) -> bool {
329 !self.bit()
330 }
331 #[doc = r" Returns `true` if the bit is set (1)"]
332 #[inline]
333 pub fn bit_is_set(&self) -> bool {
334 self.bit()
335 }
336 #[doc = r" Value of the field as raw bits"]
337 #[inline]
338 pub fn bit(&self) -> bool {
339 match *self {
340 L1REQMR::DISABLED => false,
341 L1REQMR::ENABLED => true,
342 }
343 }
344 #[allow(missing_docs)]
345 #[doc(hidden)]
346 #[inline]
347 pub fn _from(value: bool) -> L1REQMR {
348 match value {
349 false => L1REQMR::DISABLED,
350 true => L1REQMR::ENABLED,
351 }
352 }
353 #[doc = "Checks if the value of the field is `DISABLED`"]
354 #[inline]
355 pub fn is_disabled(&self) -> bool {
356 *self == L1REQMR::DISABLED
357 }
358 #[doc = "Checks if the value of the field is `ENABLED`"]
359 #[inline]
360 pub fn is_enabled(&self) -> bool {
361 *self == L1REQMR::ENABLED
362 }
363}
364#[doc = "Possible values of the field `ESOFM`"]
365#[derive(Clone, Copy, Debug, PartialEq)]
366pub enum ESOFMR {
367 #[doc = "ESOF Interrupt disabled"]
368 DISABLED,
369 #[doc = "ESOF Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
370 ENABLED,
371}
372impl ESOFMR {
373 #[doc = r" Returns `true` if the bit is clear (0)"]
374 #[inline]
375 pub fn bit_is_clear(&self) -> bool {
376 !self.bit()
377 }
378 #[doc = r" Returns `true` if the bit is set (1)"]
379 #[inline]
380 pub fn bit_is_set(&self) -> bool {
381 self.bit()
382 }
383 #[doc = r" Value of the field as raw bits"]
384 #[inline]
385 pub fn bit(&self) -> bool {
386 match *self {
387 ESOFMR::DISABLED => false,
388 ESOFMR::ENABLED => true,
389 }
390 }
391 #[allow(missing_docs)]
392 #[doc(hidden)]
393 #[inline]
394 pub fn _from(value: bool) -> ESOFMR {
395 match value {
396 false => ESOFMR::DISABLED,
397 true => ESOFMR::ENABLED,
398 }
399 }
400 #[doc = "Checks if the value of the field is `DISABLED`"]
401 #[inline]
402 pub fn is_disabled(&self) -> bool {
403 *self == ESOFMR::DISABLED
404 }
405 #[doc = "Checks if the value of the field is `ENABLED`"]
406 #[inline]
407 pub fn is_enabled(&self) -> bool {
408 *self == ESOFMR::ENABLED
409 }
410}
411#[doc = "Possible values of the field `SOFM`"]
412#[derive(Clone, Copy, Debug, PartialEq)]
413pub enum SOFMR {
414 #[doc = "SOF Interrupt disabled"]
415 DISABLED,
416 #[doc = "SOF Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
417 ENABLED,
418}
419impl SOFMR {
420 #[doc = r" Returns `true` if the bit is clear (0)"]
421 #[inline]
422 pub fn bit_is_clear(&self) -> bool {
423 !self.bit()
424 }
425 #[doc = r" Returns `true` if the bit is set (1)"]
426 #[inline]
427 pub fn bit_is_set(&self) -> bool {
428 self.bit()
429 }
430 #[doc = r" Value of the field as raw bits"]
431 #[inline]
432 pub fn bit(&self) -> bool {
433 match *self {
434 SOFMR::DISABLED => false,
435 SOFMR::ENABLED => true,
436 }
437 }
438 #[allow(missing_docs)]
439 #[doc(hidden)]
440 #[inline]
441 pub fn _from(value: bool) -> SOFMR {
442 match value {
443 false => SOFMR::DISABLED,
444 true => SOFMR::ENABLED,
445 }
446 }
447 #[doc = "Checks if the value of the field is `DISABLED`"]
448 #[inline]
449 pub fn is_disabled(&self) -> bool {
450 *self == SOFMR::DISABLED
451 }
452 #[doc = "Checks if the value of the field is `ENABLED`"]
453 #[inline]
454 pub fn is_enabled(&self) -> bool {
455 *self == SOFMR::ENABLED
456 }
457}
458#[doc = "Possible values of the field `RESETM`"]
459#[derive(Clone, Copy, Debug, PartialEq)]
460pub enum RESETMR {
461 #[doc = "RESET Interrupt disabled"]
462 DISABLED,
463 #[doc = "RESET Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
464 ENABLED,
465}
466impl RESETMR {
467 #[doc = r" Returns `true` if the bit is clear (0)"]
468 #[inline]
469 pub fn bit_is_clear(&self) -> bool {
470 !self.bit()
471 }
472 #[doc = r" Returns `true` if the bit is set (1)"]
473 #[inline]
474 pub fn bit_is_set(&self) -> bool {
475 self.bit()
476 }
477 #[doc = r" Value of the field as raw bits"]
478 #[inline]
479 pub fn bit(&self) -> bool {
480 match *self {
481 RESETMR::DISABLED => false,
482 RESETMR::ENABLED => true,
483 }
484 }
485 #[allow(missing_docs)]
486 #[doc(hidden)]
487 #[inline]
488 pub fn _from(value: bool) -> RESETMR {
489 match value {
490 false => RESETMR::DISABLED,
491 true => RESETMR::ENABLED,
492 }
493 }
494 #[doc = "Checks if the value of the field is `DISABLED`"]
495 #[inline]
496 pub fn is_disabled(&self) -> bool {
497 *self == RESETMR::DISABLED
498 }
499 #[doc = "Checks if the value of the field is `ENABLED`"]
500 #[inline]
501 pub fn is_enabled(&self) -> bool {
502 *self == RESETMR::ENABLED
503 }
504}
505#[doc = "Possible values of the field `SUSPM`"]
506#[derive(Clone, Copy, Debug, PartialEq)]
507pub enum SUSPMR {
508 #[doc = "Suspend Mode Request SUSP Interrupt disabled"]
509 DISABLED,
510 #[doc = "SUSP Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
511 ENABLED,
512}
513impl SUSPMR {
514 #[doc = r" Returns `true` if the bit is clear (0)"]
515 #[inline]
516 pub fn bit_is_clear(&self) -> bool {
517 !self.bit()
518 }
519 #[doc = r" Returns `true` if the bit is set (1)"]
520 #[inline]
521 pub fn bit_is_set(&self) -> bool {
522 self.bit()
523 }
524 #[doc = r" Value of the field as raw bits"]
525 #[inline]
526 pub fn bit(&self) -> bool {
527 match *self {
528 SUSPMR::DISABLED => false,
529 SUSPMR::ENABLED => true,
530 }
531 }
532 #[allow(missing_docs)]
533 #[doc(hidden)]
534 #[inline]
535 pub fn _from(value: bool) -> SUSPMR {
536 match value {
537 false => SUSPMR::DISABLED,
538 true => SUSPMR::ENABLED,
539 }
540 }
541 #[doc = "Checks if the value of the field is `DISABLED`"]
542 #[inline]
543 pub fn is_disabled(&self) -> bool {
544 *self == SUSPMR::DISABLED
545 }
546 #[doc = "Checks if the value of the field is `ENABLED`"]
547 #[inline]
548 pub fn is_enabled(&self) -> bool {
549 *self == SUSPMR::ENABLED
550 }
551}
552#[doc = "Possible values of the field `WKUPM`"]
553#[derive(Clone, Copy, Debug, PartialEq)]
554pub enum WKUPMR {
555 #[doc = "WKUP Interrupt disabled"]
556 DISABLED,
557 #[doc = "WKUP Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
558 ENABLED,
559}
560impl WKUPMR {
561 #[doc = r" Returns `true` if the bit is clear (0)"]
562 #[inline]
563 pub fn bit_is_clear(&self) -> bool {
564 !self.bit()
565 }
566 #[doc = r" Returns `true` if the bit is set (1)"]
567 #[inline]
568 pub fn bit_is_set(&self) -> bool {
569 self.bit()
570 }
571 #[doc = r" Value of the field as raw bits"]
572 #[inline]
573 pub fn bit(&self) -> bool {
574 match *self {
575 WKUPMR::DISABLED => false,
576 WKUPMR::ENABLED => true,
577 }
578 }
579 #[allow(missing_docs)]
580 #[doc(hidden)]
581 #[inline]
582 pub fn _from(value: bool) -> WKUPMR {
583 match value {
584 false => WKUPMR::DISABLED,
585 true => WKUPMR::ENABLED,
586 }
587 }
588 #[doc = "Checks if the value of the field is `DISABLED`"]
589 #[inline]
590 pub fn is_disabled(&self) -> bool {
591 *self == WKUPMR::DISABLED
592 }
593 #[doc = "Checks if the value of the field is `ENABLED`"]
594 #[inline]
595 pub fn is_enabled(&self) -> bool {
596 *self == WKUPMR::ENABLED
597 }
598}
599#[doc = "Possible values of the field `ERRM`"]
600#[derive(Clone, Copy, Debug, PartialEq)]
601pub enum ERRMR {
602 #[doc = "ERR Interrupt disabled"]
603 DISABLED,
604 #[doc = "ERR Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
605 ENABLED,
606}
607impl ERRMR {
608 #[doc = r" Returns `true` if the bit is clear (0)"]
609 #[inline]
610 pub fn bit_is_clear(&self) -> bool {
611 !self.bit()
612 }
613 #[doc = r" Returns `true` if the bit is set (1)"]
614 #[inline]
615 pub fn bit_is_set(&self) -> bool {
616 self.bit()
617 }
618 #[doc = r" Value of the field as raw bits"]
619 #[inline]
620 pub fn bit(&self) -> bool {
621 match *self {
622 ERRMR::DISABLED => false,
623 ERRMR::ENABLED => true,
624 }
625 }
626 #[allow(missing_docs)]
627 #[doc(hidden)]
628 #[inline]
629 pub fn _from(value: bool) -> ERRMR {
630 match value {
631 false => ERRMR::DISABLED,
632 true => ERRMR::ENABLED,
633 }
634 }
635 #[doc = "Checks if the value of the field is `DISABLED`"]
636 #[inline]
637 pub fn is_disabled(&self) -> bool {
638 *self == ERRMR::DISABLED
639 }
640 #[doc = "Checks if the value of the field is `ENABLED`"]
641 #[inline]
642 pub fn is_enabled(&self) -> bool {
643 *self == ERRMR::ENABLED
644 }
645}
646#[doc = "Possible values of the field `PMAOVRM`"]
647#[derive(Clone, Copy, Debug, PartialEq)]
648pub enum PMAOVRMR {
649 #[doc = "PMAOVR Interrupt disabled"]
650 DISABLED,
651 #[doc = "PMAOVR Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
652 ENABLED,
653}
654impl PMAOVRMR {
655 #[doc = r" Returns `true` if the bit is clear (0)"]
656 #[inline]
657 pub fn bit_is_clear(&self) -> bool {
658 !self.bit()
659 }
660 #[doc = r" Returns `true` if the bit is set (1)"]
661 #[inline]
662 pub fn bit_is_set(&self) -> bool {
663 self.bit()
664 }
665 #[doc = r" Value of the field as raw bits"]
666 #[inline]
667 pub fn bit(&self) -> bool {
668 match *self {
669 PMAOVRMR::DISABLED => false,
670 PMAOVRMR::ENABLED => true,
671 }
672 }
673 #[allow(missing_docs)]
674 #[doc(hidden)]
675 #[inline]
676 pub fn _from(value: bool) -> PMAOVRMR {
677 match value {
678 false => PMAOVRMR::DISABLED,
679 true => PMAOVRMR::ENABLED,
680 }
681 }
682 #[doc = "Checks if the value of the field is `DISABLED`"]
683 #[inline]
684 pub fn is_disabled(&self) -> bool {
685 *self == PMAOVRMR::DISABLED
686 }
687 #[doc = "Checks if the value of the field is `ENABLED`"]
688 #[inline]
689 pub fn is_enabled(&self) -> bool {
690 *self == PMAOVRMR::ENABLED
691 }
692}
693#[doc = "Possible values of the field `CTRM`"]
694#[derive(Clone, Copy, Debug, PartialEq)]
695pub enum CTRMR {
696 #[doc = "Correct Transfer (CTR) Interrupt disabled"]
697 DISABLED,
698 #[doc = "CTR Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
699 ENABLED,
700}
701impl CTRMR {
702 #[doc = r" Returns `true` if the bit is clear (0)"]
703 #[inline]
704 pub fn bit_is_clear(&self) -> bool {
705 !self.bit()
706 }
707 #[doc = r" Returns `true` if the bit is set (1)"]
708 #[inline]
709 pub fn bit_is_set(&self) -> bool {
710 self.bit()
711 }
712 #[doc = r" Value of the field as raw bits"]
713 #[inline]
714 pub fn bit(&self) -> bool {
715 match *self {
716 CTRMR::DISABLED => false,
717 CTRMR::ENABLED => true,
718 }
719 }
720 #[allow(missing_docs)]
721 #[doc(hidden)]
722 #[inline]
723 pub fn _from(value: bool) -> CTRMR {
724 match value {
725 false => CTRMR::DISABLED,
726 true => CTRMR::ENABLED,
727 }
728 }
729 #[doc = "Checks if the value of the field is `DISABLED`"]
730 #[inline]
731 pub fn is_disabled(&self) -> bool {
732 *self == CTRMR::DISABLED
733 }
734 #[doc = "Checks if the value of the field is `ENABLED`"]
735 #[inline]
736 pub fn is_enabled(&self) -> bool {
737 *self == CTRMR::ENABLED
738 }
739}
740#[doc = "Values that can be written to the field `FRES`"]
741pub enum FRESW {
742 #[doc = "Clear USB reset"]
743 NORESET,
744 #[doc = "Force a reset of the USB peripheral, exactly like a RESET signaling on the USB"]
745 RESET,
746}
747impl FRESW {
748 #[allow(missing_docs)]
749 #[doc(hidden)]
750 #[inline]
751 pub fn _bits(&self) -> bool {
752 match *self {
753 FRESW::NORESET => false,
754 FRESW::RESET => true,
755 }
756 }
757}
758#[doc = r" Proxy"]
759pub struct _FRESW<'a> {
760 w: &'a mut W,
761}
762impl<'a> _FRESW<'a> {
763 #[doc = r" Writes `variant` to the field"]
764 #[inline]
765 pub fn variant(self, variant: FRESW) -> &'a mut W {
766 {
767 self.bit(variant._bits())
768 }
769 }
770 #[doc = "Clear USB reset"]
771 #[inline]
772 pub fn no_reset(self) -> &'a mut W {
773 self.variant(FRESW::NORESET)
774 }
775 #[doc = "Force a reset of the USB peripheral, exactly like a RESET signaling on the USB"]
776 #[inline]
777 pub fn reset(self) -> &'a mut W {
778 self.variant(FRESW::RESET)
779 }
780 #[doc = r" Sets the field bit"]
781 pub fn set_bit(self) -> &'a mut W {
782 self.bit(true)
783 }
784 #[doc = r" Clears the field bit"]
785 pub fn clear_bit(self) -> &'a mut W {
786 self.bit(false)
787 }
788 #[doc = r" Writes raw bits to the field"]
789 #[inline]
790 pub fn bit(self, value: bool) -> &'a mut W {
791 const MASK: bool = true;
792 const OFFSET: u8 = 0;
793 self.w.bits &= !((MASK as u32) << OFFSET);
794 self.w.bits |= ((value & MASK) as u32) << OFFSET;
795 self.w
796 }
797}
798#[doc = "Values that can be written to the field `PDWN`"]
799pub enum PDWNW {
800 #[doc = "No power down"]
801 DISABLED,
802 #[doc = "Enter power down mode"]
803 ENABLED,
804}
805impl PDWNW {
806 #[allow(missing_docs)]
807 #[doc(hidden)]
808 #[inline]
809 pub fn _bits(&self) -> bool {
810 match *self {
811 PDWNW::DISABLED => false,
812 PDWNW::ENABLED => true,
813 }
814 }
815}
816#[doc = r" Proxy"]
817pub struct _PDWNW<'a> {
818 w: &'a mut W,
819}
820impl<'a> _PDWNW<'a> {
821 #[doc = r" Writes `variant` to the field"]
822 #[inline]
823 pub fn variant(self, variant: PDWNW) -> &'a mut W {
824 {
825 self.bit(variant._bits())
826 }
827 }
828 #[doc = "No power down"]
829 #[inline]
830 pub fn disabled(self) -> &'a mut W {
831 self.variant(PDWNW::DISABLED)
832 }
833 #[doc = "Enter power down mode"]
834 #[inline]
835 pub fn enabled(self) -> &'a mut W {
836 self.variant(PDWNW::ENABLED)
837 }
838 #[doc = r" Sets the field bit"]
839 pub fn set_bit(self) -> &'a mut W {
840 self.bit(true)
841 }
842 #[doc = r" Clears the field bit"]
843 pub fn clear_bit(self) -> &'a mut W {
844 self.bit(false)
845 }
846 #[doc = r" Writes raw bits to the field"]
847 #[inline]
848 pub fn bit(self, value: bool) -> &'a mut W {
849 const MASK: bool = true;
850 const OFFSET: u8 = 1;
851 self.w.bits &= !((MASK as u32) << OFFSET);
852 self.w.bits |= ((value & MASK) as u32) << OFFSET;
853 self.w
854 }
855}
856#[doc = "Values that can be written to the field `LPMODE`"]
857pub enum LPMODEW {
858 #[doc = "No low-power mode"]
859 DISABLED,
860 #[doc = "Enter low-power mode"]
861 ENABLED,
862}
863impl LPMODEW {
864 #[allow(missing_docs)]
865 #[doc(hidden)]
866 #[inline]
867 pub fn _bits(&self) -> bool {
868 match *self {
869 LPMODEW::DISABLED => false,
870 LPMODEW::ENABLED => true,
871 }
872 }
873}
874#[doc = r" Proxy"]
875pub struct _LPMODEW<'a> {
876 w: &'a mut W,
877}
878impl<'a> _LPMODEW<'a> {
879 #[doc = r" Writes `variant` to the field"]
880 #[inline]
881 pub fn variant(self, variant: LPMODEW) -> &'a mut W {
882 {
883 self.bit(variant._bits())
884 }
885 }
886 #[doc = "No low-power mode"]
887 #[inline]
888 pub fn disabled(self) -> &'a mut W {
889 self.variant(LPMODEW::DISABLED)
890 }
891 #[doc = "Enter low-power mode"]
892 #[inline]
893 pub fn enabled(self) -> &'a mut W {
894 self.variant(LPMODEW::ENABLED)
895 }
896 #[doc = r" Sets the field bit"]
897 pub fn set_bit(self) -> &'a mut W {
898 self.bit(true)
899 }
900 #[doc = r" Clears the field bit"]
901 pub fn clear_bit(self) -> &'a mut W {
902 self.bit(false)
903 }
904 #[doc = r" Writes raw bits to the field"]
905 #[inline]
906 pub fn bit(self, value: bool) -> &'a mut W {
907 const MASK: bool = true;
908 const OFFSET: u8 = 2;
909 self.w.bits &= !((MASK as u32) << OFFSET);
910 self.w.bits |= ((value & MASK) as u32) << OFFSET;
911 self.w
912 }
913}
914#[doc = "Values that can be written to the field `FSUSP`"]
915pub enum FSUSPW {
916 #[doc = "No effect"]
917 NOEFFECT,
918 #[doc = "Enter suspend mode. Clocks and static power dissipation in the analog transceiver are left unaffected"]
919 SUSPEND,
920}
921impl FSUSPW {
922 #[allow(missing_docs)]
923 #[doc(hidden)]
924 #[inline]
925 pub fn _bits(&self) -> bool {
926 match *self {
927 FSUSPW::NOEFFECT => false,
928 FSUSPW::SUSPEND => true,
929 }
930 }
931}
932#[doc = r" Proxy"]
933pub struct _FSUSPW<'a> {
934 w: &'a mut W,
935}
936impl<'a> _FSUSPW<'a> {
937 #[doc = r" Writes `variant` to the field"]
938 #[inline]
939 pub fn variant(self, variant: FSUSPW) -> &'a mut W {
940 {
941 self.bit(variant._bits())
942 }
943 }
944 #[doc = "No effect"]
945 #[inline]
946 pub fn no_effect(self) -> &'a mut W {
947 self.variant(FSUSPW::NOEFFECT)
948 }
949 #[doc = "Enter suspend mode. Clocks and static power dissipation in the analog transceiver are left unaffected"]
950 #[inline]
951 pub fn suspend(self) -> &'a mut W {
952 self.variant(FSUSPW::SUSPEND)
953 }
954 #[doc = r" Sets the field bit"]
955 pub fn set_bit(self) -> &'a mut W {
956 self.bit(true)
957 }
958 #[doc = r" Clears the field bit"]
959 pub fn clear_bit(self) -> &'a mut W {
960 self.bit(false)
961 }
962 #[doc = r" Writes raw bits to the field"]
963 #[inline]
964 pub fn bit(self, value: bool) -> &'a mut W {
965 const MASK: bool = true;
966 const OFFSET: u8 = 3;
967 self.w.bits &= !((MASK as u32) << OFFSET);
968 self.w.bits |= ((value & MASK) as u32) << OFFSET;
969 self.w
970 }
971}
972#[doc = "Values that can be written to the field `RESUME`"]
973pub enum RESUMEW {
974 #[doc = "Resume requested"]
975 REQUESTED,
976}
977impl RESUMEW {
978 #[allow(missing_docs)]
979 #[doc(hidden)]
980 #[inline]
981 pub fn _bits(&self) -> bool {
982 match *self {
983 RESUMEW::REQUESTED => true,
984 }
985 }
986}
987#[doc = r" Proxy"]
988pub struct _RESUMEW<'a> {
989 w: &'a mut W,
990}
991impl<'a> _RESUMEW<'a> {
992 #[doc = r" Writes `variant` to the field"]
993 #[inline]
994 pub fn variant(self, variant: RESUMEW) -> &'a mut W {
995 {
996 self.bit(variant._bits())
997 }
998 }
999 #[doc = "Resume requested"]
1000 #[inline]
1001 pub fn requested(self) -> &'a mut W {
1002 self.variant(RESUMEW::REQUESTED)
1003 }
1004 #[doc = r" Sets the field bit"]
1005 pub fn set_bit(self) -> &'a mut W {
1006 self.bit(true)
1007 }
1008 #[doc = r" Clears the field bit"]
1009 pub fn clear_bit(self) -> &'a mut W {
1010 self.bit(false)
1011 }
1012 #[doc = r" Writes raw bits to the field"]
1013 #[inline]
1014 pub fn bit(self, value: bool) -> &'a mut W {
1015 const MASK: bool = true;
1016 const OFFSET: u8 = 4;
1017 self.w.bits &= !((MASK as u32) << OFFSET);
1018 self.w.bits |= ((value & MASK) as u32) << OFFSET;
1019 self.w
1020 }
1021}
1022#[doc = "Values that can be written to the field `L1RESUME`"]
1023pub enum L1RESUMEW {
1024 #[doc = "LPM L1 request requested"]
1025 REQUESTED,
1026}
1027impl L1RESUMEW {
1028 #[allow(missing_docs)]
1029 #[doc(hidden)]
1030 #[inline]
1031 pub fn _bits(&self) -> bool {
1032 match *self {
1033 L1RESUMEW::REQUESTED => true,
1034 }
1035 }
1036}
1037#[doc = r" Proxy"]
1038pub struct _L1RESUMEW<'a> {
1039 w: &'a mut W,
1040}
1041impl<'a> _L1RESUMEW<'a> {
1042 #[doc = r" Writes `variant` to the field"]
1043 #[inline]
1044 pub fn variant(self, variant: L1RESUMEW) -> &'a mut W {
1045 {
1046 self.bit(variant._bits())
1047 }
1048 }
1049 #[doc = "LPM L1 request requested"]
1050 #[inline]
1051 pub fn requested(self) -> &'a mut W {
1052 self.variant(L1RESUMEW::REQUESTED)
1053 }
1054 #[doc = r" Sets the field bit"]
1055 pub fn set_bit(self) -> &'a mut W {
1056 self.bit(true)
1057 }
1058 #[doc = r" Clears the field bit"]
1059 pub fn clear_bit(self) -> &'a mut W {
1060 self.bit(false)
1061 }
1062 #[doc = r" Writes raw bits to the field"]
1063 #[inline]
1064 pub fn bit(self, value: bool) -> &'a mut W {
1065 const MASK: bool = true;
1066 const OFFSET: u8 = 5;
1067 self.w.bits &= !((MASK as u32) << OFFSET);
1068 self.w.bits |= ((value & MASK) as u32) << OFFSET;
1069 self.w
1070 }
1071}
1072#[doc = "Values that can be written to the field `L1REQM`"]
1073pub enum L1REQMW {
1074 #[doc = "L1REQ Interrupt disabled"]
1075 DISABLED,
1076 #[doc = "L1REQ Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1077 ENABLED,
1078}
1079impl L1REQMW {
1080 #[allow(missing_docs)]
1081 #[doc(hidden)]
1082 #[inline]
1083 pub fn _bits(&self) -> bool {
1084 match *self {
1085 L1REQMW::DISABLED => false,
1086 L1REQMW::ENABLED => true,
1087 }
1088 }
1089}
1090#[doc = r" Proxy"]
1091pub struct _L1REQMW<'a> {
1092 w: &'a mut W,
1093}
1094impl<'a> _L1REQMW<'a> {
1095 #[doc = r" Writes `variant` to the field"]
1096 #[inline]
1097 pub fn variant(self, variant: L1REQMW) -> &'a mut W {
1098 {
1099 self.bit(variant._bits())
1100 }
1101 }
1102 #[doc = "L1REQ Interrupt disabled"]
1103 #[inline]
1104 pub fn disabled(self) -> &'a mut W {
1105 self.variant(L1REQMW::DISABLED)
1106 }
1107 #[doc = "L1REQ Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1108 #[inline]
1109 pub fn enabled(self) -> &'a mut W {
1110 self.variant(L1REQMW::ENABLED)
1111 }
1112 #[doc = r" Sets the field bit"]
1113 pub fn set_bit(self) -> &'a mut W {
1114 self.bit(true)
1115 }
1116 #[doc = r" Clears the field bit"]
1117 pub fn clear_bit(self) -> &'a mut W {
1118 self.bit(false)
1119 }
1120 #[doc = r" Writes raw bits to the field"]
1121 #[inline]
1122 pub fn bit(self, value: bool) -> &'a mut W {
1123 const MASK: bool = true;
1124 const OFFSET: u8 = 7;
1125 self.w.bits &= !((MASK as u32) << OFFSET);
1126 self.w.bits |= ((value & MASK) as u32) << OFFSET;
1127 self.w
1128 }
1129}
1130#[doc = "Values that can be written to the field `ESOFM`"]
1131pub enum ESOFMW {
1132 #[doc = "ESOF Interrupt disabled"]
1133 DISABLED,
1134 #[doc = "ESOF Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1135 ENABLED,
1136}
1137impl ESOFMW {
1138 #[allow(missing_docs)]
1139 #[doc(hidden)]
1140 #[inline]
1141 pub fn _bits(&self) -> bool {
1142 match *self {
1143 ESOFMW::DISABLED => false,
1144 ESOFMW::ENABLED => true,
1145 }
1146 }
1147}
1148#[doc = r" Proxy"]
1149pub struct _ESOFMW<'a> {
1150 w: &'a mut W,
1151}
1152impl<'a> _ESOFMW<'a> {
1153 #[doc = r" Writes `variant` to the field"]
1154 #[inline]
1155 pub fn variant(self, variant: ESOFMW) -> &'a mut W {
1156 {
1157 self.bit(variant._bits())
1158 }
1159 }
1160 #[doc = "ESOF Interrupt disabled"]
1161 #[inline]
1162 pub fn disabled(self) -> &'a mut W {
1163 self.variant(ESOFMW::DISABLED)
1164 }
1165 #[doc = "ESOF Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1166 #[inline]
1167 pub fn enabled(self) -> &'a mut W {
1168 self.variant(ESOFMW::ENABLED)
1169 }
1170 #[doc = r" Sets the field bit"]
1171 pub fn set_bit(self) -> &'a mut W {
1172 self.bit(true)
1173 }
1174 #[doc = r" Clears the field bit"]
1175 pub fn clear_bit(self) -> &'a mut W {
1176 self.bit(false)
1177 }
1178 #[doc = r" Writes raw bits to the field"]
1179 #[inline]
1180 pub fn bit(self, value: bool) -> &'a mut W {
1181 const MASK: bool = true;
1182 const OFFSET: u8 = 8;
1183 self.w.bits &= !((MASK as u32) << OFFSET);
1184 self.w.bits |= ((value & MASK) as u32) << OFFSET;
1185 self.w
1186 }
1187}
1188#[doc = "Values that can be written to the field `SOFM`"]
1189pub enum SOFMW {
1190 #[doc = "SOF Interrupt disabled"]
1191 DISABLED,
1192 #[doc = "SOF Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1193 ENABLED,
1194}
1195impl SOFMW {
1196 #[allow(missing_docs)]
1197 #[doc(hidden)]
1198 #[inline]
1199 pub fn _bits(&self) -> bool {
1200 match *self {
1201 SOFMW::DISABLED => false,
1202 SOFMW::ENABLED => true,
1203 }
1204 }
1205}
1206#[doc = r" Proxy"]
1207pub struct _SOFMW<'a> {
1208 w: &'a mut W,
1209}
1210impl<'a> _SOFMW<'a> {
1211 #[doc = r" Writes `variant` to the field"]
1212 #[inline]
1213 pub fn variant(self, variant: SOFMW) -> &'a mut W {
1214 {
1215 self.bit(variant._bits())
1216 }
1217 }
1218 #[doc = "SOF Interrupt disabled"]
1219 #[inline]
1220 pub fn disabled(self) -> &'a mut W {
1221 self.variant(SOFMW::DISABLED)
1222 }
1223 #[doc = "SOF Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1224 #[inline]
1225 pub fn enabled(self) -> &'a mut W {
1226 self.variant(SOFMW::ENABLED)
1227 }
1228 #[doc = r" Sets the field bit"]
1229 pub fn set_bit(self) -> &'a mut W {
1230 self.bit(true)
1231 }
1232 #[doc = r" Clears the field bit"]
1233 pub fn clear_bit(self) -> &'a mut W {
1234 self.bit(false)
1235 }
1236 #[doc = r" Writes raw bits to the field"]
1237 #[inline]
1238 pub fn bit(self, value: bool) -> &'a mut W {
1239 const MASK: bool = true;
1240 const OFFSET: u8 = 9;
1241 self.w.bits &= !((MASK as u32) << OFFSET);
1242 self.w.bits |= ((value & MASK) as u32) << OFFSET;
1243 self.w
1244 }
1245}
1246#[doc = "Values that can be written to the field `RESETM`"]
1247pub enum RESETMW {
1248 #[doc = "RESET Interrupt disabled"]
1249 DISABLED,
1250 #[doc = "RESET Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1251 ENABLED,
1252}
1253impl RESETMW {
1254 #[allow(missing_docs)]
1255 #[doc(hidden)]
1256 #[inline]
1257 pub fn _bits(&self) -> bool {
1258 match *self {
1259 RESETMW::DISABLED => false,
1260 RESETMW::ENABLED => true,
1261 }
1262 }
1263}
1264#[doc = r" Proxy"]
1265pub struct _RESETMW<'a> {
1266 w: &'a mut W,
1267}
1268impl<'a> _RESETMW<'a> {
1269 #[doc = r" Writes `variant` to the field"]
1270 #[inline]
1271 pub fn variant(self, variant: RESETMW) -> &'a mut W {
1272 {
1273 self.bit(variant._bits())
1274 }
1275 }
1276 #[doc = "RESET Interrupt disabled"]
1277 #[inline]
1278 pub fn disabled(self) -> &'a mut W {
1279 self.variant(RESETMW::DISABLED)
1280 }
1281 #[doc = "RESET Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1282 #[inline]
1283 pub fn enabled(self) -> &'a mut W {
1284 self.variant(RESETMW::ENABLED)
1285 }
1286 #[doc = r" Sets the field bit"]
1287 pub fn set_bit(self) -> &'a mut W {
1288 self.bit(true)
1289 }
1290 #[doc = r" Clears the field bit"]
1291 pub fn clear_bit(self) -> &'a mut W {
1292 self.bit(false)
1293 }
1294 #[doc = r" Writes raw bits to the field"]
1295 #[inline]
1296 pub fn bit(self, value: bool) -> &'a mut W {
1297 const MASK: bool = true;
1298 const OFFSET: u8 = 10;
1299 self.w.bits &= !((MASK as u32) << OFFSET);
1300 self.w.bits |= ((value & MASK) as u32) << OFFSET;
1301 self.w
1302 }
1303}
1304#[doc = "Values that can be written to the field `SUSPM`"]
1305pub enum SUSPMW {
1306 #[doc = "Suspend Mode Request SUSP Interrupt disabled"]
1307 DISABLED,
1308 #[doc = "SUSP Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1309 ENABLED,
1310}
1311impl SUSPMW {
1312 #[allow(missing_docs)]
1313 #[doc(hidden)]
1314 #[inline]
1315 pub fn _bits(&self) -> bool {
1316 match *self {
1317 SUSPMW::DISABLED => false,
1318 SUSPMW::ENABLED => true,
1319 }
1320 }
1321}
1322#[doc = r" Proxy"]
1323pub struct _SUSPMW<'a> {
1324 w: &'a mut W,
1325}
1326impl<'a> _SUSPMW<'a> {
1327 #[doc = r" Writes `variant` to the field"]
1328 #[inline]
1329 pub fn variant(self, variant: SUSPMW) -> &'a mut W {
1330 {
1331 self.bit(variant._bits())
1332 }
1333 }
1334 #[doc = "Suspend Mode Request SUSP Interrupt disabled"]
1335 #[inline]
1336 pub fn disabled(self) -> &'a mut W {
1337 self.variant(SUSPMW::DISABLED)
1338 }
1339 #[doc = "SUSP Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1340 #[inline]
1341 pub fn enabled(self) -> &'a mut W {
1342 self.variant(SUSPMW::ENABLED)
1343 }
1344 #[doc = r" Sets the field bit"]
1345 pub fn set_bit(self) -> &'a mut W {
1346 self.bit(true)
1347 }
1348 #[doc = r" Clears the field bit"]
1349 pub fn clear_bit(self) -> &'a mut W {
1350 self.bit(false)
1351 }
1352 #[doc = r" Writes raw bits to the field"]
1353 #[inline]
1354 pub fn bit(self, value: bool) -> &'a mut W {
1355 const MASK: bool = true;
1356 const OFFSET: u8 = 11;
1357 self.w.bits &= !((MASK as u32) << OFFSET);
1358 self.w.bits |= ((value & MASK) as u32) << OFFSET;
1359 self.w
1360 }
1361}
1362#[doc = "Values that can be written to the field `WKUPM`"]
1363pub enum WKUPMW {
1364 #[doc = "WKUP Interrupt disabled"]
1365 DISABLED,
1366 #[doc = "WKUP Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1367 ENABLED,
1368}
1369impl WKUPMW {
1370 #[allow(missing_docs)]
1371 #[doc(hidden)]
1372 #[inline]
1373 pub fn _bits(&self) -> bool {
1374 match *self {
1375 WKUPMW::DISABLED => false,
1376 WKUPMW::ENABLED => true,
1377 }
1378 }
1379}
1380#[doc = r" Proxy"]
1381pub struct _WKUPMW<'a> {
1382 w: &'a mut W,
1383}
1384impl<'a> _WKUPMW<'a> {
1385 #[doc = r" Writes `variant` to the field"]
1386 #[inline]
1387 pub fn variant(self, variant: WKUPMW) -> &'a mut W {
1388 {
1389 self.bit(variant._bits())
1390 }
1391 }
1392 #[doc = "WKUP Interrupt disabled"]
1393 #[inline]
1394 pub fn disabled(self) -> &'a mut W {
1395 self.variant(WKUPMW::DISABLED)
1396 }
1397 #[doc = "WKUP Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1398 #[inline]
1399 pub fn enabled(self) -> &'a mut W {
1400 self.variant(WKUPMW::ENABLED)
1401 }
1402 #[doc = r" Sets the field bit"]
1403 pub fn set_bit(self) -> &'a mut W {
1404 self.bit(true)
1405 }
1406 #[doc = r" Clears the field bit"]
1407 pub fn clear_bit(self) -> &'a mut W {
1408 self.bit(false)
1409 }
1410 #[doc = r" Writes raw bits to the field"]
1411 #[inline]
1412 pub fn bit(self, value: bool) -> &'a mut W {
1413 const MASK: bool = true;
1414 const OFFSET: u8 = 12;
1415 self.w.bits &= !((MASK as u32) << OFFSET);
1416 self.w.bits |= ((value & MASK) as u32) << OFFSET;
1417 self.w
1418 }
1419}
1420#[doc = "Values that can be written to the field `ERRM`"]
1421pub enum ERRMW {
1422 #[doc = "ERR Interrupt disabled"]
1423 DISABLED,
1424 #[doc = "ERR Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1425 ENABLED,
1426}
1427impl ERRMW {
1428 #[allow(missing_docs)]
1429 #[doc(hidden)]
1430 #[inline]
1431 pub fn _bits(&self) -> bool {
1432 match *self {
1433 ERRMW::DISABLED => false,
1434 ERRMW::ENABLED => true,
1435 }
1436 }
1437}
1438#[doc = r" Proxy"]
1439pub struct _ERRMW<'a> {
1440 w: &'a mut W,
1441}
1442impl<'a> _ERRMW<'a> {
1443 #[doc = r" Writes `variant` to the field"]
1444 #[inline]
1445 pub fn variant(self, variant: ERRMW) -> &'a mut W {
1446 {
1447 self.bit(variant._bits())
1448 }
1449 }
1450 #[doc = "ERR Interrupt disabled"]
1451 #[inline]
1452 pub fn disabled(self) -> &'a mut W {
1453 self.variant(ERRMW::DISABLED)
1454 }
1455 #[doc = "ERR Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1456 #[inline]
1457 pub fn enabled(self) -> &'a mut W {
1458 self.variant(ERRMW::ENABLED)
1459 }
1460 #[doc = r" Sets the field bit"]
1461 pub fn set_bit(self) -> &'a mut W {
1462 self.bit(true)
1463 }
1464 #[doc = r" Clears the field bit"]
1465 pub fn clear_bit(self) -> &'a mut W {
1466 self.bit(false)
1467 }
1468 #[doc = r" Writes raw bits to the field"]
1469 #[inline]
1470 pub fn bit(self, value: bool) -> &'a mut W {
1471 const MASK: bool = true;
1472 const OFFSET: u8 = 13;
1473 self.w.bits &= !((MASK as u32) << OFFSET);
1474 self.w.bits |= ((value & MASK) as u32) << OFFSET;
1475 self.w
1476 }
1477}
1478#[doc = "Values that can be written to the field `PMAOVRM`"]
1479pub enum PMAOVRMW {
1480 #[doc = "PMAOVR Interrupt disabled"]
1481 DISABLED,
1482 #[doc = "PMAOVR Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1483 ENABLED,
1484}
1485impl PMAOVRMW {
1486 #[allow(missing_docs)]
1487 #[doc(hidden)]
1488 #[inline]
1489 pub fn _bits(&self) -> bool {
1490 match *self {
1491 PMAOVRMW::DISABLED => false,
1492 PMAOVRMW::ENABLED => true,
1493 }
1494 }
1495}
1496#[doc = r" Proxy"]
1497pub struct _PMAOVRMW<'a> {
1498 w: &'a mut W,
1499}
1500impl<'a> _PMAOVRMW<'a> {
1501 #[doc = r" Writes `variant` to the field"]
1502 #[inline]
1503 pub fn variant(self, variant: PMAOVRMW) -> &'a mut W {
1504 {
1505 self.bit(variant._bits())
1506 }
1507 }
1508 #[doc = "PMAOVR Interrupt disabled"]
1509 #[inline]
1510 pub fn disabled(self) -> &'a mut W {
1511 self.variant(PMAOVRMW::DISABLED)
1512 }
1513 #[doc = "PMAOVR Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1514 #[inline]
1515 pub fn enabled(self) -> &'a mut W {
1516 self.variant(PMAOVRMW::ENABLED)
1517 }
1518 #[doc = r" Sets the field bit"]
1519 pub fn set_bit(self) -> &'a mut W {
1520 self.bit(true)
1521 }
1522 #[doc = r" Clears the field bit"]
1523 pub fn clear_bit(self) -> &'a mut W {
1524 self.bit(false)
1525 }
1526 #[doc = r" Writes raw bits to the field"]
1527 #[inline]
1528 pub fn bit(self, value: bool) -> &'a mut W {
1529 const MASK: bool = true;
1530 const OFFSET: u8 = 14;
1531 self.w.bits &= !((MASK as u32) << OFFSET);
1532 self.w.bits |= ((value & MASK) as u32) << OFFSET;
1533 self.w
1534 }
1535}
1536#[doc = "Values that can be written to the field `CTRM`"]
1537pub enum CTRMW {
1538 #[doc = "Correct Transfer (CTR) Interrupt disabled"]
1539 DISABLED,
1540 #[doc = "CTR Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1541 ENABLED,
1542}
1543impl CTRMW {
1544 #[allow(missing_docs)]
1545 #[doc(hidden)]
1546 #[inline]
1547 pub fn _bits(&self) -> bool {
1548 match *self {
1549 CTRMW::DISABLED => false,
1550 CTRMW::ENABLED => true,
1551 }
1552 }
1553}
1554#[doc = r" Proxy"]
1555pub struct _CTRMW<'a> {
1556 w: &'a mut W,
1557}
1558impl<'a> _CTRMW<'a> {
1559 #[doc = r" Writes `variant` to the field"]
1560 #[inline]
1561 pub fn variant(self, variant: CTRMW) -> &'a mut W {
1562 {
1563 self.bit(variant._bits())
1564 }
1565 }
1566 #[doc = "Correct Transfer (CTR) Interrupt disabled"]
1567 #[inline]
1568 pub fn disabled(self) -> &'a mut W {
1569 self.variant(CTRMW::DISABLED)
1570 }
1571 #[doc = "CTR Interrupt enabled, an interrupt request is generated when the corresponding bit in the USB_ISTR register is set"]
1572 #[inline]
1573 pub fn enabled(self) -> &'a mut W {
1574 self.variant(CTRMW::ENABLED)
1575 }
1576 #[doc = r" Sets the field bit"]
1577 pub fn set_bit(self) -> &'a mut W {
1578 self.bit(true)
1579 }
1580 #[doc = r" Clears the field bit"]
1581 pub fn clear_bit(self) -> &'a mut W {
1582 self.bit(false)
1583 }
1584 #[doc = r" Writes raw bits to the field"]
1585 #[inline]
1586 pub fn bit(self, value: bool) -> &'a mut W {
1587 const MASK: bool = true;
1588 const OFFSET: u8 = 15;
1589 self.w.bits &= !((MASK as u32) << OFFSET);
1590 self.w.bits |= ((value & MASK) as u32) << OFFSET;
1591 self.w
1592 }
1593}
1594impl R {
1595 #[doc = r" Value of the register as raw bits"]
1596 #[inline]
1597 pub fn bits(&self) -> u32 {
1598 self.bits
1599 }
1600 #[doc = "Bit 0 - Force USB Reset"]
1601 #[inline]
1602 pub fn fres(&self) -> FRESR {
1603 FRESR::_from({
1604 const MASK: bool = true;
1605 const OFFSET: u8 = 0;
1606 ((self.bits >> OFFSET) & MASK as u32) != 0
1607 })
1608 }
1609 #[doc = "Bit 1 - Power down"]
1610 #[inline]
1611 pub fn pdwn(&self) -> PDWNR {
1612 PDWNR::_from({
1613 const MASK: bool = true;
1614 const OFFSET: u8 = 1;
1615 ((self.bits >> OFFSET) & MASK as u32) != 0
1616 })
1617 }
1618 #[doc = "Bit 2 - Low-power mode"]
1619 #[inline]
1620 pub fn lpmode(&self) -> LPMODER {
1621 LPMODER::_from({
1622 const MASK: bool = true;
1623 const OFFSET: u8 = 2;
1624 ((self.bits >> OFFSET) & MASK as u32) != 0
1625 })
1626 }
1627 #[doc = "Bit 3 - Force suspend"]
1628 #[inline]
1629 pub fn fsusp(&self) -> FSUSPR {
1630 FSUSPR::_from({
1631 const MASK: bool = true;
1632 const OFFSET: u8 = 3;
1633 ((self.bits >> OFFSET) & MASK as u32) != 0
1634 })
1635 }
1636 #[doc = "Bit 4 - Resume request"]
1637 #[inline]
1638 pub fn resume(&self) -> RESUMER {
1639 RESUMER::_from({
1640 const MASK: bool = true;
1641 const OFFSET: u8 = 4;
1642 ((self.bits >> OFFSET) & MASK as u32) != 0
1643 })
1644 }
1645 #[doc = "Bit 5 - LPM L1 Resume request"]
1646 #[inline]
1647 pub fn l1resume(&self) -> L1RESUMER {
1648 L1RESUMER::_from({
1649 const MASK: bool = true;
1650 const OFFSET: u8 = 5;
1651 ((self.bits >> OFFSET) & MASK as u32) != 0
1652 })
1653 }
1654 #[doc = "Bit 7 - LPM L1 state request interrupt mask"]
1655 #[inline]
1656 pub fn l1reqm(&self) -> L1REQMR {
1657 L1REQMR::_from({
1658 const MASK: bool = true;
1659 const OFFSET: u8 = 7;
1660 ((self.bits >> OFFSET) & MASK as u32) != 0
1661 })
1662 }
1663 #[doc = "Bit 8 - Expected start of frame interrupt mask"]
1664 #[inline]
1665 pub fn esofm(&self) -> ESOFMR {
1666 ESOFMR::_from({
1667 const MASK: bool = true;
1668 const OFFSET: u8 = 8;
1669 ((self.bits >> OFFSET) & MASK as u32) != 0
1670 })
1671 }
1672 #[doc = "Bit 9 - Start of frame interrupt mask"]
1673 #[inline]
1674 pub fn sofm(&self) -> SOFMR {
1675 SOFMR::_from({
1676 const MASK: bool = true;
1677 const OFFSET: u8 = 9;
1678 ((self.bits >> OFFSET) & MASK as u32) != 0
1679 })
1680 }
1681 #[doc = "Bit 10 - USB reset interrupt mask"]
1682 #[inline]
1683 pub fn resetm(&self) -> RESETMR {
1684 RESETMR::_from({
1685 const MASK: bool = true;
1686 const OFFSET: u8 = 10;
1687 ((self.bits >> OFFSET) & MASK as u32) != 0
1688 })
1689 }
1690 #[doc = "Bit 11 - Suspend mode interrupt mask"]
1691 #[inline]
1692 pub fn suspm(&self) -> SUSPMR {
1693 SUSPMR::_from({
1694 const MASK: bool = true;
1695 const OFFSET: u8 = 11;
1696 ((self.bits >> OFFSET) & MASK as u32) != 0
1697 })
1698 }
1699 #[doc = "Bit 12 - Wakeup interrupt mask"]
1700 #[inline]
1701 pub fn wkupm(&self) -> WKUPMR {
1702 WKUPMR::_from({
1703 const MASK: bool = true;
1704 const OFFSET: u8 = 12;
1705 ((self.bits >> OFFSET) & MASK as u32) != 0
1706 })
1707 }
1708 #[doc = "Bit 13 - Error interrupt mask"]
1709 #[inline]
1710 pub fn errm(&self) -> ERRMR {
1711 ERRMR::_from({
1712 const MASK: bool = true;
1713 const OFFSET: u8 = 13;
1714 ((self.bits >> OFFSET) & MASK as u32) != 0
1715 })
1716 }
1717 #[doc = "Bit 14 - Packet memory area over / underrun interrupt mask"]
1718 #[inline]
1719 pub fn pmaovrm(&self) -> PMAOVRMR {
1720 PMAOVRMR::_from({
1721 const MASK: bool = true;
1722 const OFFSET: u8 = 14;
1723 ((self.bits >> OFFSET) & MASK as u32) != 0
1724 })
1725 }
1726 #[doc = "Bit 15 - Correct transfer interrupt mask"]
1727 #[inline]
1728 pub fn ctrm(&self) -> CTRMR {
1729 CTRMR::_from({
1730 const MASK: bool = true;
1731 const OFFSET: u8 = 15;
1732 ((self.bits >> OFFSET) & MASK as u32) != 0
1733 })
1734 }
1735}
1736impl W {
1737 #[doc = r" Reset value of the register"]
1738 #[inline]
1739 pub fn reset_value() -> W {
1740 W { bits: 3 }
1741 }
1742 #[doc = r" Writes raw bits to the register"]
1743 #[inline]
1744 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1745 self.bits = bits;
1746 self
1747 }
1748 #[doc = "Bit 0 - Force USB Reset"]
1749 #[inline]
1750 pub fn fres(&mut self) -> _FRESW {
1751 _FRESW { w: self }
1752 }
1753 #[doc = "Bit 1 - Power down"]
1754 #[inline]
1755 pub fn pdwn(&mut self) -> _PDWNW {
1756 _PDWNW { w: self }
1757 }
1758 #[doc = "Bit 2 - Low-power mode"]
1759 #[inline]
1760 pub fn lpmode(&mut self) -> _LPMODEW {
1761 _LPMODEW { w: self }
1762 }
1763 #[doc = "Bit 3 - Force suspend"]
1764 #[inline]
1765 pub fn fsusp(&mut self) -> _FSUSPW {
1766 _FSUSPW { w: self }
1767 }
1768 #[doc = "Bit 4 - Resume request"]
1769 #[inline]
1770 pub fn resume(&mut self) -> _RESUMEW {
1771 _RESUMEW { w: self }
1772 }
1773 #[doc = "Bit 5 - LPM L1 Resume request"]
1774 #[inline]
1775 pub fn l1resume(&mut self) -> _L1RESUMEW {
1776 _L1RESUMEW { w: self }
1777 }
1778 #[doc = "Bit 7 - LPM L1 state request interrupt mask"]
1779 #[inline]
1780 pub fn l1reqm(&mut self) -> _L1REQMW {
1781 _L1REQMW { w: self }
1782 }
1783 #[doc = "Bit 8 - Expected start of frame interrupt mask"]
1784 #[inline]
1785 pub fn esofm(&mut self) -> _ESOFMW {
1786 _ESOFMW { w: self }
1787 }
1788 #[doc = "Bit 9 - Start of frame interrupt mask"]
1789 #[inline]
1790 pub fn sofm(&mut self) -> _SOFMW {
1791 _SOFMW { w: self }
1792 }
1793 #[doc = "Bit 10 - USB reset interrupt mask"]
1794 #[inline]
1795 pub fn resetm(&mut self) -> _RESETMW {
1796 _RESETMW { w: self }
1797 }
1798 #[doc = "Bit 11 - Suspend mode interrupt mask"]
1799 #[inline]
1800 pub fn suspm(&mut self) -> _SUSPMW {
1801 _SUSPMW { w: self }
1802 }
1803 #[doc = "Bit 12 - Wakeup interrupt mask"]
1804 #[inline]
1805 pub fn wkupm(&mut self) -> _WKUPMW {
1806 _WKUPMW { w: self }
1807 }
1808 #[doc = "Bit 13 - Error interrupt mask"]
1809 #[inline]
1810 pub fn errm(&mut self) -> _ERRMW {
1811 _ERRMW { w: self }
1812 }
1813 #[doc = "Bit 14 - Packet memory area over / underrun interrupt mask"]
1814 #[inline]
1815 pub fn pmaovrm(&mut self) -> _PMAOVRMW {
1816 _PMAOVRMW { w: self }
1817 }
1818 #[doc = "Bit 15 - Correct transfer interrupt mask"]
1819 #[inline]
1820 pub fn ctrm(&mut self) -> _CTRMW {
1821 _CTRMW { w: self }
1822 }
1823}