lpc43xx/usb0/otgsc/
mod.rs

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::OTGSC {
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 = r" Value of the field"]
46pub struct VDR {
47    bits: bool,
48}
49impl VDR {
50    #[doc = r" Value of the field as raw bits"]
51    #[inline]
52    pub fn bit(&self) -> bool {
53        self.bits
54    }
55    #[doc = r" Returns `true` if the bit is clear (0)"]
56    #[inline]
57    pub fn bit_is_clear(&self) -> bool {
58        !self.bit()
59    }
60    #[doc = r" Returns `true` if the bit is set (1)"]
61    #[inline]
62    pub fn bit_is_set(&self) -> bool {
63        self.bit()
64    }
65}
66#[doc = r" Value of the field"]
67pub struct VCR {
68    bits: bool,
69}
70impl VCR {
71    #[doc = r" Value of the field as raw bits"]
72    #[inline]
73    pub fn bit(&self) -> bool {
74        self.bits
75    }
76    #[doc = r" Returns `true` if the bit is clear (0)"]
77    #[inline]
78    pub fn bit_is_clear(&self) -> bool {
79        !self.bit()
80    }
81    #[doc = r" Returns `true` if the bit is set (1)"]
82    #[inline]
83    pub fn bit_is_set(&self) -> bool {
84        self.bit()
85    }
86}
87#[doc = "Possible values of the field `HAAR`"]
88#[derive(Clone, Copy, Debug, PartialEq)]
89pub enum HAARR {
90    #[doc = "Disabled"]
91    DISABLED,
92    #[doc = "Enable automatic reset after connect on host port."]
93    ENABLE_AUTOMATIC_RES,
94}
95impl HAARR {
96    #[doc = r" Returns `true` if the bit is clear (0)"]
97    #[inline]
98    pub fn bit_is_clear(&self) -> bool {
99        !self.bit()
100    }
101    #[doc = r" Returns `true` if the bit is set (1)"]
102    #[inline]
103    pub fn bit_is_set(&self) -> bool {
104        self.bit()
105    }
106    #[doc = r" Value of the field as raw bits"]
107    #[inline]
108    pub fn bit(&self) -> bool {
109        match *self {
110            HAARR::DISABLED => false,
111            HAARR::ENABLE_AUTOMATIC_RES => true,
112        }
113    }
114    #[allow(missing_docs)]
115    #[doc(hidden)]
116    #[inline]
117    pub fn _from(value: bool) -> HAARR {
118        match value {
119            false => HAARR::DISABLED,
120            true => HAARR::ENABLE_AUTOMATIC_RES,
121        }
122    }
123    #[doc = "Checks if the value of the field is `DISABLED`"]
124    #[inline]
125    pub fn is_disabled(&self) -> bool {
126        *self == HAARR::DISABLED
127    }
128    #[doc = "Checks if the value of the field is `ENABLE_AUTOMATIC_RES`"]
129    #[inline]
130    pub fn is_enable_automatic_res(&self) -> bool {
131        *self == HAARR::ENABLE_AUTOMATIC_RES
132    }
133}
134#[doc = r" Value of the field"]
135pub struct OTR {
136    bits: bool,
137}
138impl OTR {
139    #[doc = r" Value of the field as raw bits"]
140    #[inline]
141    pub fn bit(&self) -> bool {
142        self.bits
143    }
144    #[doc = r" Returns `true` if the bit is clear (0)"]
145    #[inline]
146    pub fn bit_is_clear(&self) -> bool {
147        !self.bit()
148    }
149    #[doc = r" Returns `true` if the bit is set (1)"]
150    #[inline]
151    pub fn bit_is_set(&self) -> bool {
152        self.bit()
153    }
154}
155#[doc = r" Value of the field"]
156pub struct DPR {
157    bits: bool,
158}
159impl DPR {
160    #[doc = r" Value of the field as raw bits"]
161    #[inline]
162    pub fn bit(&self) -> bool {
163        self.bits
164    }
165    #[doc = r" Returns `true` if the bit is clear (0)"]
166    #[inline]
167    pub fn bit_is_clear(&self) -> bool {
168        !self.bit()
169    }
170    #[doc = r" Returns `true` if the bit is set (1)"]
171    #[inline]
172    pub fn bit_is_set(&self) -> bool {
173        self.bit()
174    }
175}
176#[doc = "Possible values of the field `IDPU`"]
177#[derive(Clone, Copy, Debug, PartialEq)]
178pub enum IDPUR {
179    #[doc = "Pull-up off. The ID bit will not be sampled."]
180    PULL_UP_OFF_THE_ID,
181    #[doc = "Pull-up on."]
182    PULL_UP_ON,
183}
184impl IDPUR {
185    #[doc = r" Returns `true` if the bit is clear (0)"]
186    #[inline]
187    pub fn bit_is_clear(&self) -> bool {
188        !self.bit()
189    }
190    #[doc = r" Returns `true` if the bit is set (1)"]
191    #[inline]
192    pub fn bit_is_set(&self) -> bool {
193        self.bit()
194    }
195    #[doc = r" Value of the field as raw bits"]
196    #[inline]
197    pub fn bit(&self) -> bool {
198        match *self {
199            IDPUR::PULL_UP_OFF_THE_ID => false,
200            IDPUR::PULL_UP_ON => true,
201        }
202    }
203    #[allow(missing_docs)]
204    #[doc(hidden)]
205    #[inline]
206    pub fn _from(value: bool) -> IDPUR {
207        match value {
208            false => IDPUR::PULL_UP_OFF_THE_ID,
209            true => IDPUR::PULL_UP_ON,
210        }
211    }
212    #[doc = "Checks if the value of the field is `PULL_UP_OFF_THE_ID`"]
213    #[inline]
214    pub fn is_pull_up_off_the_id(&self) -> bool {
215        *self == IDPUR::PULL_UP_OFF_THE_ID
216    }
217    #[doc = "Checks if the value of the field is `PULL_UP_ON`"]
218    #[inline]
219    pub fn is_pull_up_on(&self) -> bool {
220        *self == IDPUR::PULL_UP_ON
221    }
222}
223#[doc = r" Value of the field"]
224pub struct HADPR {
225    bits: bool,
226}
227impl HADPR {
228    #[doc = r" Value of the field as raw bits"]
229    #[inline]
230    pub fn bit(&self) -> bool {
231        self.bits
232    }
233    #[doc = r" Returns `true` if the bit is clear (0)"]
234    #[inline]
235    pub fn bit_is_clear(&self) -> bool {
236        !self.bit()
237    }
238    #[doc = r" Returns `true` if the bit is set (1)"]
239    #[inline]
240    pub fn bit_is_set(&self) -> bool {
241        self.bit()
242    }
243}
244#[doc = "Possible values of the field `HABA`"]
245#[derive(Clone, Copy, Debug, PartialEq)]
246pub enum HABAR {
247    #[doc = "Disabled."]
248    DISABLED,
249    #[doc = "Enable automatic B-disconnect to A-connect sequence."]
250    ENABLE_AUTOMATIC_B_D,
251}
252impl HABAR {
253    #[doc = r" Returns `true` if the bit is clear (0)"]
254    #[inline]
255    pub fn bit_is_clear(&self) -> bool {
256        !self.bit()
257    }
258    #[doc = r" Returns `true` if the bit is set (1)"]
259    #[inline]
260    pub fn bit_is_set(&self) -> bool {
261        self.bit()
262    }
263    #[doc = r" Value of the field as raw bits"]
264    #[inline]
265    pub fn bit(&self) -> bool {
266        match *self {
267            HABAR::DISABLED => false,
268            HABAR::ENABLE_AUTOMATIC_B_D => true,
269        }
270    }
271    #[allow(missing_docs)]
272    #[doc(hidden)]
273    #[inline]
274    pub fn _from(value: bool) -> HABAR {
275        match value {
276            false => HABAR::DISABLED,
277            true => HABAR::ENABLE_AUTOMATIC_B_D,
278        }
279    }
280    #[doc = "Checks if the value of the field is `DISABLED`"]
281    #[inline]
282    pub fn is_disabled(&self) -> bool {
283        *self == HABAR::DISABLED
284    }
285    #[doc = "Checks if the value of the field is `ENABLE_AUTOMATIC_B_D`"]
286    #[inline]
287    pub fn is_enable_automatic_b_d(&self) -> bool {
288        *self == HABAR::ENABLE_AUTOMATIC_B_D
289    }
290}
291#[doc = "Possible values of the field `ID`"]
292#[derive(Clone, Copy, Debug, PartialEq)]
293pub enum IDR {
294    #[doc = "A-device"]
295    A_DEVICE,
296    #[doc = "B-device"]
297    B_DEVICE,
298}
299impl IDR {
300    #[doc = r" Returns `true` if the bit is clear (0)"]
301    #[inline]
302    pub fn bit_is_clear(&self) -> bool {
303        !self.bit()
304    }
305    #[doc = r" Returns `true` if the bit is set (1)"]
306    #[inline]
307    pub fn bit_is_set(&self) -> bool {
308        self.bit()
309    }
310    #[doc = r" Value of the field as raw bits"]
311    #[inline]
312    pub fn bit(&self) -> bool {
313        match *self {
314            IDR::A_DEVICE => false,
315            IDR::B_DEVICE => true,
316        }
317    }
318    #[allow(missing_docs)]
319    #[doc(hidden)]
320    #[inline]
321    pub fn _from(value: bool) -> IDR {
322        match value {
323            false => IDR::A_DEVICE,
324            true => IDR::B_DEVICE,
325        }
326    }
327    #[doc = "Checks if the value of the field is `A_DEVICE`"]
328    #[inline]
329    pub fn is_a_device(&self) -> bool {
330        *self == IDR::A_DEVICE
331    }
332    #[doc = "Checks if the value of the field is `B_DEVICE`"]
333    #[inline]
334    pub fn is_b_device(&self) -> bool {
335        *self == IDR::B_DEVICE
336    }
337}
338#[doc = r" Value of the field"]
339pub struct AVVR {
340    bits: bool,
341}
342impl AVVR {
343    #[doc = r" Value of the field as raw bits"]
344    #[inline]
345    pub fn bit(&self) -> bool {
346        self.bits
347    }
348    #[doc = r" Returns `true` if the bit is clear (0)"]
349    #[inline]
350    pub fn bit_is_clear(&self) -> bool {
351        !self.bit()
352    }
353    #[doc = r" Returns `true` if the bit is set (1)"]
354    #[inline]
355    pub fn bit_is_set(&self) -> bool {
356        self.bit()
357    }
358}
359#[doc = r" Value of the field"]
360pub struct ASVR {
361    bits: bool,
362}
363impl ASVR {
364    #[doc = r" Value of the field as raw bits"]
365    #[inline]
366    pub fn bit(&self) -> bool {
367        self.bits
368    }
369    #[doc = r" Returns `true` if the bit is clear (0)"]
370    #[inline]
371    pub fn bit_is_clear(&self) -> bool {
372        !self.bit()
373    }
374    #[doc = r" Returns `true` if the bit is set (1)"]
375    #[inline]
376    pub fn bit_is_set(&self) -> bool {
377        self.bit()
378    }
379}
380#[doc = r" Value of the field"]
381pub struct BSVR {
382    bits: bool,
383}
384impl BSVR {
385    #[doc = r" Value of the field as raw bits"]
386    #[inline]
387    pub fn bit(&self) -> bool {
388        self.bits
389    }
390    #[doc = r" Returns `true` if the bit is clear (0)"]
391    #[inline]
392    pub fn bit_is_clear(&self) -> bool {
393        !self.bit()
394    }
395    #[doc = r" Returns `true` if the bit is set (1)"]
396    #[inline]
397    pub fn bit_is_set(&self) -> bool {
398        self.bit()
399    }
400}
401#[doc = r" Value of the field"]
402pub struct BSER {
403    bits: bool,
404}
405impl BSER {
406    #[doc = r" Value of the field as raw bits"]
407    #[inline]
408    pub fn bit(&self) -> bool {
409        self.bits
410    }
411    #[doc = r" Returns `true` if the bit is clear (0)"]
412    #[inline]
413    pub fn bit_is_clear(&self) -> bool {
414        !self.bit()
415    }
416    #[doc = r" Returns `true` if the bit is set (1)"]
417    #[inline]
418    pub fn bit_is_set(&self) -> bool {
419        self.bit()
420    }
421}
422#[doc = r" Value of the field"]
423pub struct MS1TR {
424    bits: bool,
425}
426impl MS1TR {
427    #[doc = r" Value of the field as raw bits"]
428    #[inline]
429    pub fn bit(&self) -> bool {
430        self.bits
431    }
432    #[doc = r" Returns `true` if the bit is clear (0)"]
433    #[inline]
434    pub fn bit_is_clear(&self) -> bool {
435        !self.bit()
436    }
437    #[doc = r" Returns `true` if the bit is set (1)"]
438    #[inline]
439    pub fn bit_is_set(&self) -> bool {
440        self.bit()
441    }
442}
443#[doc = r" Value of the field"]
444pub struct DPSR {
445    bits: bool,
446}
447impl DPSR {
448    #[doc = r" Value of the field as raw bits"]
449    #[inline]
450    pub fn bit(&self) -> bool {
451        self.bits
452    }
453    #[doc = r" Returns `true` if the bit is clear (0)"]
454    #[inline]
455    pub fn bit_is_clear(&self) -> bool {
456        !self.bit()
457    }
458    #[doc = r" Returns `true` if the bit is set (1)"]
459    #[inline]
460    pub fn bit_is_set(&self) -> bool {
461        self.bit()
462    }
463}
464#[doc = r" Value of the field"]
465pub struct IDISR {
466    bits: bool,
467}
468impl IDISR {
469    #[doc = r" Value of the field as raw bits"]
470    #[inline]
471    pub fn bit(&self) -> bool {
472        self.bits
473    }
474    #[doc = r" Returns `true` if the bit is clear (0)"]
475    #[inline]
476    pub fn bit_is_clear(&self) -> bool {
477        !self.bit()
478    }
479    #[doc = r" Returns `true` if the bit is set (1)"]
480    #[inline]
481    pub fn bit_is_set(&self) -> bool {
482        self.bit()
483    }
484}
485#[doc = r" Value of the field"]
486pub struct AVVISR {
487    bits: bool,
488}
489impl AVVISR {
490    #[doc = r" Value of the field as raw bits"]
491    #[inline]
492    pub fn bit(&self) -> bool {
493        self.bits
494    }
495    #[doc = r" Returns `true` if the bit is clear (0)"]
496    #[inline]
497    pub fn bit_is_clear(&self) -> bool {
498        !self.bit()
499    }
500    #[doc = r" Returns `true` if the bit is set (1)"]
501    #[inline]
502    pub fn bit_is_set(&self) -> bool {
503        self.bit()
504    }
505}
506#[doc = r" Value of the field"]
507pub struct ASVISR {
508    bits: bool,
509}
510impl ASVISR {
511    #[doc = r" Value of the field as raw bits"]
512    #[inline]
513    pub fn bit(&self) -> bool {
514        self.bits
515    }
516    #[doc = r" Returns `true` if the bit is clear (0)"]
517    #[inline]
518    pub fn bit_is_clear(&self) -> bool {
519        !self.bit()
520    }
521    #[doc = r" Returns `true` if the bit is set (1)"]
522    #[inline]
523    pub fn bit_is_set(&self) -> bool {
524        self.bit()
525    }
526}
527#[doc = r" Value of the field"]
528pub struct BSVISR {
529    bits: bool,
530}
531impl BSVISR {
532    #[doc = r" Value of the field as raw bits"]
533    #[inline]
534    pub fn bit(&self) -> bool {
535        self.bits
536    }
537    #[doc = r" Returns `true` if the bit is clear (0)"]
538    #[inline]
539    pub fn bit_is_clear(&self) -> bool {
540        !self.bit()
541    }
542    #[doc = r" Returns `true` if the bit is set (1)"]
543    #[inline]
544    pub fn bit_is_set(&self) -> bool {
545        self.bit()
546    }
547}
548#[doc = r" Value of the field"]
549pub struct BSEISR {
550    bits: bool,
551}
552impl BSEISR {
553    #[doc = r" Value of the field as raw bits"]
554    #[inline]
555    pub fn bit(&self) -> bool {
556        self.bits
557    }
558    #[doc = r" Returns `true` if the bit is clear (0)"]
559    #[inline]
560    pub fn bit_is_clear(&self) -> bool {
561        !self.bit()
562    }
563    #[doc = r" Returns `true` if the bit is set (1)"]
564    #[inline]
565    pub fn bit_is_set(&self) -> bool {
566        self.bit()
567    }
568}
569#[doc = r" Value of the field"]
570pub struct MS1SR {
571    bits: bool,
572}
573impl MS1SR {
574    #[doc = r" Value of the field as raw bits"]
575    #[inline]
576    pub fn bit(&self) -> bool {
577        self.bits
578    }
579    #[doc = r" Returns `true` if the bit is clear (0)"]
580    #[inline]
581    pub fn bit_is_clear(&self) -> bool {
582        !self.bit()
583    }
584    #[doc = r" Returns `true` if the bit is set (1)"]
585    #[inline]
586    pub fn bit_is_set(&self) -> bool {
587        self.bit()
588    }
589}
590#[doc = r" Value of the field"]
591pub struct DPISR {
592    bits: bool,
593}
594impl DPISR {
595    #[doc = r" Value of the field as raw bits"]
596    #[inline]
597    pub fn bit(&self) -> bool {
598        self.bits
599    }
600    #[doc = r" Returns `true` if the bit is clear (0)"]
601    #[inline]
602    pub fn bit_is_clear(&self) -> bool {
603        !self.bit()
604    }
605    #[doc = r" Returns `true` if the bit is set (1)"]
606    #[inline]
607    pub fn bit_is_set(&self) -> bool {
608        self.bit()
609    }
610}
611#[doc = r" Value of the field"]
612pub struct IDIER {
613    bits: bool,
614}
615impl IDIER {
616    #[doc = r" Value of the field as raw bits"]
617    #[inline]
618    pub fn bit(&self) -> bool {
619        self.bits
620    }
621    #[doc = r" Returns `true` if the bit is clear (0)"]
622    #[inline]
623    pub fn bit_is_clear(&self) -> bool {
624        !self.bit()
625    }
626    #[doc = r" Returns `true` if the bit is set (1)"]
627    #[inline]
628    pub fn bit_is_set(&self) -> bool {
629        self.bit()
630    }
631}
632#[doc = r" Value of the field"]
633pub struct AVVIER {
634    bits: bool,
635}
636impl AVVIER {
637    #[doc = r" Value of the field as raw bits"]
638    #[inline]
639    pub fn bit(&self) -> bool {
640        self.bits
641    }
642    #[doc = r" Returns `true` if the bit is clear (0)"]
643    #[inline]
644    pub fn bit_is_clear(&self) -> bool {
645        !self.bit()
646    }
647    #[doc = r" Returns `true` if the bit is set (1)"]
648    #[inline]
649    pub fn bit_is_set(&self) -> bool {
650        self.bit()
651    }
652}
653#[doc = r" Value of the field"]
654pub struct ASVIER {
655    bits: bool,
656}
657impl ASVIER {
658    #[doc = r" Value of the field as raw bits"]
659    #[inline]
660    pub fn bit(&self) -> bool {
661        self.bits
662    }
663    #[doc = r" Returns `true` if the bit is clear (0)"]
664    #[inline]
665    pub fn bit_is_clear(&self) -> bool {
666        !self.bit()
667    }
668    #[doc = r" Returns `true` if the bit is set (1)"]
669    #[inline]
670    pub fn bit_is_set(&self) -> bool {
671        self.bit()
672    }
673}
674#[doc = r" Value of the field"]
675pub struct BSVIER {
676    bits: bool,
677}
678impl BSVIER {
679    #[doc = r" Value of the field as raw bits"]
680    #[inline]
681    pub fn bit(&self) -> bool {
682        self.bits
683    }
684    #[doc = r" Returns `true` if the bit is clear (0)"]
685    #[inline]
686    pub fn bit_is_clear(&self) -> bool {
687        !self.bit()
688    }
689    #[doc = r" Returns `true` if the bit is set (1)"]
690    #[inline]
691    pub fn bit_is_set(&self) -> bool {
692        self.bit()
693    }
694}
695#[doc = r" Value of the field"]
696pub struct BSEIER {
697    bits: bool,
698}
699impl BSEIER {
700    #[doc = r" Value of the field as raw bits"]
701    #[inline]
702    pub fn bit(&self) -> bool {
703        self.bits
704    }
705    #[doc = r" Returns `true` if the bit is clear (0)"]
706    #[inline]
707    pub fn bit_is_clear(&self) -> bool {
708        !self.bit()
709    }
710    #[doc = r" Returns `true` if the bit is set (1)"]
711    #[inline]
712    pub fn bit_is_set(&self) -> bool {
713        self.bit()
714    }
715}
716#[doc = r" Value of the field"]
717pub struct MS1ER {
718    bits: bool,
719}
720impl MS1ER {
721    #[doc = r" Value of the field as raw bits"]
722    #[inline]
723    pub fn bit(&self) -> bool {
724        self.bits
725    }
726    #[doc = r" Returns `true` if the bit is clear (0)"]
727    #[inline]
728    pub fn bit_is_clear(&self) -> bool {
729        !self.bit()
730    }
731    #[doc = r" Returns `true` if the bit is set (1)"]
732    #[inline]
733    pub fn bit_is_set(&self) -> bool {
734        self.bit()
735    }
736}
737#[doc = r" Value of the field"]
738pub struct DPIER {
739    bits: bool,
740}
741impl DPIER {
742    #[doc = r" Value of the field as raw bits"]
743    #[inline]
744    pub fn bit(&self) -> bool {
745        self.bits
746    }
747    #[doc = r" Returns `true` if the bit is clear (0)"]
748    #[inline]
749    pub fn bit_is_clear(&self) -> bool {
750        !self.bit()
751    }
752    #[doc = r" Returns `true` if the bit is set (1)"]
753    #[inline]
754    pub fn bit_is_set(&self) -> bool {
755        self.bit()
756    }
757}
758#[doc = r" Proxy"]
759pub struct _VDW<'a> {
760    w: &'a mut W,
761}
762impl<'a> _VDW<'a> {
763    #[doc = r" Sets the field bit"]
764    pub fn set_bit(self) -> &'a mut W {
765        self.bit(true)
766    }
767    #[doc = r" Clears the field bit"]
768    pub fn clear_bit(self) -> &'a mut W {
769        self.bit(false)
770    }
771    #[doc = r" Writes raw bits to the field"]
772    #[inline]
773    pub fn bit(self, value: bool) -> &'a mut W {
774        const MASK: bool = true;
775        const OFFSET: u8 = 0;
776        self.w.bits &= !((MASK as u32) << OFFSET);
777        self.w.bits |= ((value & MASK) as u32) << OFFSET;
778        self.w
779    }
780}
781#[doc = r" Proxy"]
782pub struct _VCW<'a> {
783    w: &'a mut W,
784}
785impl<'a> _VCW<'a> {
786    #[doc = r" Sets the field bit"]
787    pub fn set_bit(self) -> &'a mut W {
788        self.bit(true)
789    }
790    #[doc = r" Clears the field bit"]
791    pub fn clear_bit(self) -> &'a mut W {
792        self.bit(false)
793    }
794    #[doc = r" Writes raw bits to the field"]
795    #[inline]
796    pub fn bit(self, value: bool) -> &'a mut W {
797        const MASK: bool = true;
798        const OFFSET: u8 = 1;
799        self.w.bits &= !((MASK as u32) << OFFSET);
800        self.w.bits |= ((value & MASK) as u32) << OFFSET;
801        self.w
802    }
803}
804#[doc = "Values that can be written to the field `HAAR`"]
805pub enum HAARW {
806    #[doc = "Disabled"]
807    DISABLED,
808    #[doc = "Enable automatic reset after connect on host port."]
809    ENABLE_AUTOMATIC_RES,
810}
811impl HAARW {
812    #[allow(missing_docs)]
813    #[doc(hidden)]
814    #[inline]
815    pub fn _bits(&self) -> bool {
816        match *self {
817            HAARW::DISABLED => false,
818            HAARW::ENABLE_AUTOMATIC_RES => true,
819        }
820    }
821}
822#[doc = r" Proxy"]
823pub struct _HAARW<'a> {
824    w: &'a mut W,
825}
826impl<'a> _HAARW<'a> {
827    #[doc = r" Writes `variant` to the field"]
828    #[inline]
829    pub fn variant(self, variant: HAARW) -> &'a mut W {
830        {
831            self.bit(variant._bits())
832        }
833    }
834    #[doc = "Disabled"]
835    #[inline]
836    pub fn disabled(self) -> &'a mut W {
837        self.variant(HAARW::DISABLED)
838    }
839    #[doc = "Enable automatic reset after connect on host port."]
840    #[inline]
841    pub fn enable_automatic_res(self) -> &'a mut W {
842        self.variant(HAARW::ENABLE_AUTOMATIC_RES)
843    }
844    #[doc = r" Sets the field bit"]
845    pub fn set_bit(self) -> &'a mut W {
846        self.bit(true)
847    }
848    #[doc = r" Clears the field bit"]
849    pub fn clear_bit(self) -> &'a mut W {
850        self.bit(false)
851    }
852    #[doc = r" Writes raw bits to the field"]
853    #[inline]
854    pub fn bit(self, value: bool) -> &'a mut W {
855        const MASK: bool = true;
856        const OFFSET: u8 = 2;
857        self.w.bits &= !((MASK as u32) << OFFSET);
858        self.w.bits |= ((value & MASK) as u32) << OFFSET;
859        self.w
860    }
861}
862#[doc = r" Proxy"]
863pub struct _OTW<'a> {
864    w: &'a mut W,
865}
866impl<'a> _OTW<'a> {
867    #[doc = r" Sets the field bit"]
868    pub fn set_bit(self) -> &'a mut W {
869        self.bit(true)
870    }
871    #[doc = r" Clears the field bit"]
872    pub fn clear_bit(self) -> &'a mut W {
873        self.bit(false)
874    }
875    #[doc = r" Writes raw bits to the field"]
876    #[inline]
877    pub fn bit(self, value: bool) -> &'a mut W {
878        const MASK: bool = true;
879        const OFFSET: u8 = 3;
880        self.w.bits &= !((MASK as u32) << OFFSET);
881        self.w.bits |= ((value & MASK) as u32) << OFFSET;
882        self.w
883    }
884}
885#[doc = r" Proxy"]
886pub struct _DPW<'a> {
887    w: &'a mut W,
888}
889impl<'a> _DPW<'a> {
890    #[doc = r" Sets the field bit"]
891    pub fn set_bit(self) -> &'a mut W {
892        self.bit(true)
893    }
894    #[doc = r" Clears the field bit"]
895    pub fn clear_bit(self) -> &'a mut W {
896        self.bit(false)
897    }
898    #[doc = r" Writes raw bits to the field"]
899    #[inline]
900    pub fn bit(self, value: bool) -> &'a mut W {
901        const MASK: bool = true;
902        const OFFSET: u8 = 4;
903        self.w.bits &= !((MASK as u32) << OFFSET);
904        self.w.bits |= ((value & MASK) as u32) << OFFSET;
905        self.w
906    }
907}
908#[doc = "Values that can be written to the field `IDPU`"]
909pub enum IDPUW {
910    #[doc = "Pull-up off. The ID bit will not be sampled."]
911    PULL_UP_OFF_THE_ID,
912    #[doc = "Pull-up on."]
913    PULL_UP_ON,
914}
915impl IDPUW {
916    #[allow(missing_docs)]
917    #[doc(hidden)]
918    #[inline]
919    pub fn _bits(&self) -> bool {
920        match *self {
921            IDPUW::PULL_UP_OFF_THE_ID => false,
922            IDPUW::PULL_UP_ON => true,
923        }
924    }
925}
926#[doc = r" Proxy"]
927pub struct _IDPUW<'a> {
928    w: &'a mut W,
929}
930impl<'a> _IDPUW<'a> {
931    #[doc = r" Writes `variant` to the field"]
932    #[inline]
933    pub fn variant(self, variant: IDPUW) -> &'a mut W {
934        {
935            self.bit(variant._bits())
936        }
937    }
938    #[doc = "Pull-up off. The ID bit will not be sampled."]
939    #[inline]
940    pub fn pull_up_off_the_id(self) -> &'a mut W {
941        self.variant(IDPUW::PULL_UP_OFF_THE_ID)
942    }
943    #[doc = "Pull-up on."]
944    #[inline]
945    pub fn pull_up_on(self) -> &'a mut W {
946        self.variant(IDPUW::PULL_UP_ON)
947    }
948    #[doc = r" Sets the field bit"]
949    pub fn set_bit(self) -> &'a mut W {
950        self.bit(true)
951    }
952    #[doc = r" Clears the field bit"]
953    pub fn clear_bit(self) -> &'a mut W {
954        self.bit(false)
955    }
956    #[doc = r" Writes raw bits to the field"]
957    #[inline]
958    pub fn bit(self, value: bool) -> &'a mut W {
959        const MASK: bool = true;
960        const OFFSET: u8 = 5;
961        self.w.bits &= !((MASK as u32) << OFFSET);
962        self.w.bits |= ((value & MASK) as u32) << OFFSET;
963        self.w
964    }
965}
966#[doc = r" Proxy"]
967pub struct _HADPW<'a> {
968    w: &'a mut W,
969}
970impl<'a> _HADPW<'a> {
971    #[doc = r" Sets the field bit"]
972    pub fn set_bit(self) -> &'a mut W {
973        self.bit(true)
974    }
975    #[doc = r" Clears the field bit"]
976    pub fn clear_bit(self) -> &'a mut W {
977        self.bit(false)
978    }
979    #[doc = r" Writes raw bits to the field"]
980    #[inline]
981    pub fn bit(self, value: bool) -> &'a mut W {
982        const MASK: bool = true;
983        const OFFSET: u8 = 6;
984        self.w.bits &= !((MASK as u32) << OFFSET);
985        self.w.bits |= ((value & MASK) as u32) << OFFSET;
986        self.w
987    }
988}
989#[doc = "Values that can be written to the field `HABA`"]
990pub enum HABAW {
991    #[doc = "Disabled."]
992    DISABLED,
993    #[doc = "Enable automatic B-disconnect to A-connect sequence."]
994    ENABLE_AUTOMATIC_B_D,
995}
996impl HABAW {
997    #[allow(missing_docs)]
998    #[doc(hidden)]
999    #[inline]
1000    pub fn _bits(&self) -> bool {
1001        match *self {
1002            HABAW::DISABLED => false,
1003            HABAW::ENABLE_AUTOMATIC_B_D => true,
1004        }
1005    }
1006}
1007#[doc = r" Proxy"]
1008pub struct _HABAW<'a> {
1009    w: &'a mut W,
1010}
1011impl<'a> _HABAW<'a> {
1012    #[doc = r" Writes `variant` to the field"]
1013    #[inline]
1014    pub fn variant(self, variant: HABAW) -> &'a mut W {
1015        {
1016            self.bit(variant._bits())
1017        }
1018    }
1019    #[doc = "Disabled."]
1020    #[inline]
1021    pub fn disabled(self) -> &'a mut W {
1022        self.variant(HABAW::DISABLED)
1023    }
1024    #[doc = "Enable automatic B-disconnect to A-connect sequence."]
1025    #[inline]
1026    pub fn enable_automatic_b_d(self) -> &'a mut W {
1027        self.variant(HABAW::ENABLE_AUTOMATIC_B_D)
1028    }
1029    #[doc = r" Sets the field bit"]
1030    pub fn set_bit(self) -> &'a mut W {
1031        self.bit(true)
1032    }
1033    #[doc = r" Clears the field bit"]
1034    pub fn clear_bit(self) -> &'a mut W {
1035        self.bit(false)
1036    }
1037    #[doc = r" Writes raw bits to the field"]
1038    #[inline]
1039    pub fn bit(self, value: bool) -> &'a mut W {
1040        const MASK: bool = true;
1041        const OFFSET: u8 = 7;
1042        self.w.bits &= !((MASK as u32) << OFFSET);
1043        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1044        self.w
1045    }
1046}
1047#[doc = "Values that can be written to the field `ID`"]
1048pub enum IDW {
1049    #[doc = "A-device"]
1050    A_DEVICE,
1051    #[doc = "B-device"]
1052    B_DEVICE,
1053}
1054impl IDW {
1055    #[allow(missing_docs)]
1056    #[doc(hidden)]
1057    #[inline]
1058    pub fn _bits(&self) -> bool {
1059        match *self {
1060            IDW::A_DEVICE => false,
1061            IDW::B_DEVICE => true,
1062        }
1063    }
1064}
1065#[doc = r" Proxy"]
1066pub struct _IDW<'a> {
1067    w: &'a mut W,
1068}
1069impl<'a> _IDW<'a> {
1070    #[doc = r" Writes `variant` to the field"]
1071    #[inline]
1072    pub fn variant(self, variant: IDW) -> &'a mut W {
1073        {
1074            self.bit(variant._bits())
1075        }
1076    }
1077    #[doc = "A-device"]
1078    #[inline]
1079    pub fn a_device(self) -> &'a mut W {
1080        self.variant(IDW::A_DEVICE)
1081    }
1082    #[doc = "B-device"]
1083    #[inline]
1084    pub fn b_device(self) -> &'a mut W {
1085        self.variant(IDW::B_DEVICE)
1086    }
1087    #[doc = r" Sets the field bit"]
1088    pub fn set_bit(self) -> &'a mut W {
1089        self.bit(true)
1090    }
1091    #[doc = r" Clears the field bit"]
1092    pub fn clear_bit(self) -> &'a mut W {
1093        self.bit(false)
1094    }
1095    #[doc = r" Writes raw bits to the field"]
1096    #[inline]
1097    pub fn bit(self, value: bool) -> &'a mut W {
1098        const MASK: bool = true;
1099        const OFFSET: u8 = 8;
1100        self.w.bits &= !((MASK as u32) << OFFSET);
1101        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1102        self.w
1103    }
1104}
1105#[doc = r" Proxy"]
1106pub struct _AVVW<'a> {
1107    w: &'a mut W,
1108}
1109impl<'a> _AVVW<'a> {
1110    #[doc = r" Sets the field bit"]
1111    pub fn set_bit(self) -> &'a mut W {
1112        self.bit(true)
1113    }
1114    #[doc = r" Clears the field bit"]
1115    pub fn clear_bit(self) -> &'a mut W {
1116        self.bit(false)
1117    }
1118    #[doc = r" Writes raw bits to the field"]
1119    #[inline]
1120    pub fn bit(self, value: bool) -> &'a mut W {
1121        const MASK: bool = true;
1122        const OFFSET: u8 = 9;
1123        self.w.bits &= !((MASK as u32) << OFFSET);
1124        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1125        self.w
1126    }
1127}
1128#[doc = r" Proxy"]
1129pub struct _ASVW<'a> {
1130    w: &'a mut W,
1131}
1132impl<'a> _ASVW<'a> {
1133    #[doc = r" Sets the field bit"]
1134    pub fn set_bit(self) -> &'a mut W {
1135        self.bit(true)
1136    }
1137    #[doc = r" Clears the field bit"]
1138    pub fn clear_bit(self) -> &'a mut W {
1139        self.bit(false)
1140    }
1141    #[doc = r" Writes raw bits to the field"]
1142    #[inline]
1143    pub fn bit(self, value: bool) -> &'a mut W {
1144        const MASK: bool = true;
1145        const OFFSET: u8 = 10;
1146        self.w.bits &= !((MASK as u32) << OFFSET);
1147        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1148        self.w
1149    }
1150}
1151#[doc = r" Proxy"]
1152pub struct _BSVW<'a> {
1153    w: &'a mut W,
1154}
1155impl<'a> _BSVW<'a> {
1156    #[doc = r" Sets the field bit"]
1157    pub fn set_bit(self) -> &'a mut W {
1158        self.bit(true)
1159    }
1160    #[doc = r" Clears the field bit"]
1161    pub fn clear_bit(self) -> &'a mut W {
1162        self.bit(false)
1163    }
1164    #[doc = r" Writes raw bits to the field"]
1165    #[inline]
1166    pub fn bit(self, value: bool) -> &'a mut W {
1167        const MASK: bool = true;
1168        const OFFSET: u8 = 11;
1169        self.w.bits &= !((MASK as u32) << OFFSET);
1170        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1171        self.w
1172    }
1173}
1174#[doc = r" Proxy"]
1175pub struct _BSEW<'a> {
1176    w: &'a mut W,
1177}
1178impl<'a> _BSEW<'a> {
1179    #[doc = r" Sets the field bit"]
1180    pub fn set_bit(self) -> &'a mut W {
1181        self.bit(true)
1182    }
1183    #[doc = r" Clears the field bit"]
1184    pub fn clear_bit(self) -> &'a mut W {
1185        self.bit(false)
1186    }
1187    #[doc = r" Writes raw bits to the field"]
1188    #[inline]
1189    pub fn bit(self, value: bool) -> &'a mut W {
1190        const MASK: bool = true;
1191        const OFFSET: u8 = 12;
1192        self.w.bits &= !((MASK as u32) << OFFSET);
1193        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1194        self.w
1195    }
1196}
1197#[doc = r" Proxy"]
1198pub struct _MS1TW<'a> {
1199    w: &'a mut W,
1200}
1201impl<'a> _MS1TW<'a> {
1202    #[doc = r" Sets the field bit"]
1203    pub fn set_bit(self) -> &'a mut W {
1204        self.bit(true)
1205    }
1206    #[doc = r" Clears the field bit"]
1207    pub fn clear_bit(self) -> &'a mut W {
1208        self.bit(false)
1209    }
1210    #[doc = r" Writes raw bits to the field"]
1211    #[inline]
1212    pub fn bit(self, value: bool) -> &'a mut W {
1213        const MASK: bool = true;
1214        const OFFSET: u8 = 13;
1215        self.w.bits &= !((MASK as u32) << OFFSET);
1216        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1217        self.w
1218    }
1219}
1220#[doc = r" Proxy"]
1221pub struct _DPSW<'a> {
1222    w: &'a mut W,
1223}
1224impl<'a> _DPSW<'a> {
1225    #[doc = r" Sets the field bit"]
1226    pub fn set_bit(self) -> &'a mut W {
1227        self.bit(true)
1228    }
1229    #[doc = r" Clears the field bit"]
1230    pub fn clear_bit(self) -> &'a mut W {
1231        self.bit(false)
1232    }
1233    #[doc = r" Writes raw bits to the field"]
1234    #[inline]
1235    pub fn bit(self, value: bool) -> &'a mut W {
1236        const MASK: bool = true;
1237        const OFFSET: u8 = 14;
1238        self.w.bits &= !((MASK as u32) << OFFSET);
1239        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1240        self.w
1241    }
1242}
1243#[doc = r" Proxy"]
1244pub struct _IDISW<'a> {
1245    w: &'a mut W,
1246}
1247impl<'a> _IDISW<'a> {
1248    #[doc = r" Sets the field bit"]
1249    pub fn set_bit(self) -> &'a mut W {
1250        self.bit(true)
1251    }
1252    #[doc = r" Clears the field bit"]
1253    pub fn clear_bit(self) -> &'a mut W {
1254        self.bit(false)
1255    }
1256    #[doc = r" Writes raw bits to the field"]
1257    #[inline]
1258    pub fn bit(self, value: bool) -> &'a mut W {
1259        const MASK: bool = true;
1260        const OFFSET: u8 = 16;
1261        self.w.bits &= !((MASK as u32) << OFFSET);
1262        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1263        self.w
1264    }
1265}
1266#[doc = r" Proxy"]
1267pub struct _AVVISW<'a> {
1268    w: &'a mut W,
1269}
1270impl<'a> _AVVISW<'a> {
1271    #[doc = r" Sets the field bit"]
1272    pub fn set_bit(self) -> &'a mut W {
1273        self.bit(true)
1274    }
1275    #[doc = r" Clears the field bit"]
1276    pub fn clear_bit(self) -> &'a mut W {
1277        self.bit(false)
1278    }
1279    #[doc = r" Writes raw bits to the field"]
1280    #[inline]
1281    pub fn bit(self, value: bool) -> &'a mut W {
1282        const MASK: bool = true;
1283        const OFFSET: u8 = 17;
1284        self.w.bits &= !((MASK as u32) << OFFSET);
1285        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1286        self.w
1287    }
1288}
1289#[doc = r" Proxy"]
1290pub struct _ASVISW<'a> {
1291    w: &'a mut W,
1292}
1293impl<'a> _ASVISW<'a> {
1294    #[doc = r" Sets the field bit"]
1295    pub fn set_bit(self) -> &'a mut W {
1296        self.bit(true)
1297    }
1298    #[doc = r" Clears the field bit"]
1299    pub fn clear_bit(self) -> &'a mut W {
1300        self.bit(false)
1301    }
1302    #[doc = r" Writes raw bits to the field"]
1303    #[inline]
1304    pub fn bit(self, value: bool) -> &'a mut W {
1305        const MASK: bool = true;
1306        const OFFSET: u8 = 18;
1307        self.w.bits &= !((MASK as u32) << OFFSET);
1308        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1309        self.w
1310    }
1311}
1312#[doc = r" Proxy"]
1313pub struct _BSVISW<'a> {
1314    w: &'a mut W,
1315}
1316impl<'a> _BSVISW<'a> {
1317    #[doc = r" Sets the field bit"]
1318    pub fn set_bit(self) -> &'a mut W {
1319        self.bit(true)
1320    }
1321    #[doc = r" Clears the field bit"]
1322    pub fn clear_bit(self) -> &'a mut W {
1323        self.bit(false)
1324    }
1325    #[doc = r" Writes raw bits to the field"]
1326    #[inline]
1327    pub fn bit(self, value: bool) -> &'a mut W {
1328        const MASK: bool = true;
1329        const OFFSET: u8 = 19;
1330        self.w.bits &= !((MASK as u32) << OFFSET);
1331        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1332        self.w
1333    }
1334}
1335#[doc = r" Proxy"]
1336pub struct _BSEISW<'a> {
1337    w: &'a mut W,
1338}
1339impl<'a> _BSEISW<'a> {
1340    #[doc = r" Sets the field bit"]
1341    pub fn set_bit(self) -> &'a mut W {
1342        self.bit(true)
1343    }
1344    #[doc = r" Clears the field bit"]
1345    pub fn clear_bit(self) -> &'a mut W {
1346        self.bit(false)
1347    }
1348    #[doc = r" Writes raw bits to the field"]
1349    #[inline]
1350    pub fn bit(self, value: bool) -> &'a mut W {
1351        const MASK: bool = true;
1352        const OFFSET: u8 = 20;
1353        self.w.bits &= !((MASK as u32) << OFFSET);
1354        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1355        self.w
1356    }
1357}
1358#[doc = r" Proxy"]
1359pub struct _MS1SW<'a> {
1360    w: &'a mut W,
1361}
1362impl<'a> _MS1SW<'a> {
1363    #[doc = r" Sets the field bit"]
1364    pub fn set_bit(self) -> &'a mut W {
1365        self.bit(true)
1366    }
1367    #[doc = r" Clears the field bit"]
1368    pub fn clear_bit(self) -> &'a mut W {
1369        self.bit(false)
1370    }
1371    #[doc = r" Writes raw bits to the field"]
1372    #[inline]
1373    pub fn bit(self, value: bool) -> &'a mut W {
1374        const MASK: bool = true;
1375        const OFFSET: u8 = 21;
1376        self.w.bits &= !((MASK as u32) << OFFSET);
1377        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1378        self.w
1379    }
1380}
1381#[doc = r" Proxy"]
1382pub struct _DPISW<'a> {
1383    w: &'a mut W,
1384}
1385impl<'a> _DPISW<'a> {
1386    #[doc = r" Sets the field bit"]
1387    pub fn set_bit(self) -> &'a mut W {
1388        self.bit(true)
1389    }
1390    #[doc = r" Clears the field bit"]
1391    pub fn clear_bit(self) -> &'a mut W {
1392        self.bit(false)
1393    }
1394    #[doc = r" Writes raw bits to the field"]
1395    #[inline]
1396    pub fn bit(self, value: bool) -> &'a mut W {
1397        const MASK: bool = true;
1398        const OFFSET: u8 = 22;
1399        self.w.bits &= !((MASK as u32) << OFFSET);
1400        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1401        self.w
1402    }
1403}
1404#[doc = r" Proxy"]
1405pub struct _IDIEW<'a> {
1406    w: &'a mut W,
1407}
1408impl<'a> _IDIEW<'a> {
1409    #[doc = r" Sets the field bit"]
1410    pub fn set_bit(self) -> &'a mut W {
1411        self.bit(true)
1412    }
1413    #[doc = r" Clears the field bit"]
1414    pub fn clear_bit(self) -> &'a mut W {
1415        self.bit(false)
1416    }
1417    #[doc = r" Writes raw bits to the field"]
1418    #[inline]
1419    pub fn bit(self, value: bool) -> &'a mut W {
1420        const MASK: bool = true;
1421        const OFFSET: u8 = 24;
1422        self.w.bits &= !((MASK as u32) << OFFSET);
1423        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1424        self.w
1425    }
1426}
1427#[doc = r" Proxy"]
1428pub struct _AVVIEW<'a> {
1429    w: &'a mut W,
1430}
1431impl<'a> _AVVIEW<'a> {
1432    #[doc = r" Sets the field bit"]
1433    pub fn set_bit(self) -> &'a mut W {
1434        self.bit(true)
1435    }
1436    #[doc = r" Clears the field bit"]
1437    pub fn clear_bit(self) -> &'a mut W {
1438        self.bit(false)
1439    }
1440    #[doc = r" Writes raw bits to the field"]
1441    #[inline]
1442    pub fn bit(self, value: bool) -> &'a mut W {
1443        const MASK: bool = true;
1444        const OFFSET: u8 = 25;
1445        self.w.bits &= !((MASK as u32) << OFFSET);
1446        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1447        self.w
1448    }
1449}
1450#[doc = r" Proxy"]
1451pub struct _ASVIEW<'a> {
1452    w: &'a mut W,
1453}
1454impl<'a> _ASVIEW<'a> {
1455    #[doc = r" Sets the field bit"]
1456    pub fn set_bit(self) -> &'a mut W {
1457        self.bit(true)
1458    }
1459    #[doc = r" Clears the field bit"]
1460    pub fn clear_bit(self) -> &'a mut W {
1461        self.bit(false)
1462    }
1463    #[doc = r" Writes raw bits to the field"]
1464    #[inline]
1465    pub fn bit(self, value: bool) -> &'a mut W {
1466        const MASK: bool = true;
1467        const OFFSET: u8 = 26;
1468        self.w.bits &= !((MASK as u32) << OFFSET);
1469        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1470        self.w
1471    }
1472}
1473#[doc = r" Proxy"]
1474pub struct _BSVIEW<'a> {
1475    w: &'a mut W,
1476}
1477impl<'a> _BSVIEW<'a> {
1478    #[doc = r" Sets the field bit"]
1479    pub fn set_bit(self) -> &'a mut W {
1480        self.bit(true)
1481    }
1482    #[doc = r" Clears the field bit"]
1483    pub fn clear_bit(self) -> &'a mut W {
1484        self.bit(false)
1485    }
1486    #[doc = r" Writes raw bits to the field"]
1487    #[inline]
1488    pub fn bit(self, value: bool) -> &'a mut W {
1489        const MASK: bool = true;
1490        const OFFSET: u8 = 27;
1491        self.w.bits &= !((MASK as u32) << OFFSET);
1492        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1493        self.w
1494    }
1495}
1496#[doc = r" Proxy"]
1497pub struct _BSEIEW<'a> {
1498    w: &'a mut W,
1499}
1500impl<'a> _BSEIEW<'a> {
1501    #[doc = r" Sets the field bit"]
1502    pub fn set_bit(self) -> &'a mut W {
1503        self.bit(true)
1504    }
1505    #[doc = r" Clears the field bit"]
1506    pub fn clear_bit(self) -> &'a mut W {
1507        self.bit(false)
1508    }
1509    #[doc = r" Writes raw bits to the field"]
1510    #[inline]
1511    pub fn bit(self, value: bool) -> &'a mut W {
1512        const MASK: bool = true;
1513        const OFFSET: u8 = 28;
1514        self.w.bits &= !((MASK as u32) << OFFSET);
1515        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1516        self.w
1517    }
1518}
1519#[doc = r" Proxy"]
1520pub struct _MS1EW<'a> {
1521    w: &'a mut W,
1522}
1523impl<'a> _MS1EW<'a> {
1524    #[doc = r" Sets the field bit"]
1525    pub fn set_bit(self) -> &'a mut W {
1526        self.bit(true)
1527    }
1528    #[doc = r" Clears the field bit"]
1529    pub fn clear_bit(self) -> &'a mut W {
1530        self.bit(false)
1531    }
1532    #[doc = r" Writes raw bits to the field"]
1533    #[inline]
1534    pub fn bit(self, value: bool) -> &'a mut W {
1535        const MASK: bool = true;
1536        const OFFSET: u8 = 29;
1537        self.w.bits &= !((MASK as u32) << OFFSET);
1538        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1539        self.w
1540    }
1541}
1542#[doc = r" Proxy"]
1543pub struct _DPIEW<'a> {
1544    w: &'a mut W,
1545}
1546impl<'a> _DPIEW<'a> {
1547    #[doc = r" Sets the field bit"]
1548    pub fn set_bit(self) -> &'a mut W {
1549        self.bit(true)
1550    }
1551    #[doc = r" Clears the field bit"]
1552    pub fn clear_bit(self) -> &'a mut W {
1553        self.bit(false)
1554    }
1555    #[doc = r" Writes raw bits to the field"]
1556    #[inline]
1557    pub fn bit(self, value: bool) -> &'a mut W {
1558        const MASK: bool = true;
1559        const OFFSET: u8 = 30;
1560        self.w.bits &= !((MASK as u32) << OFFSET);
1561        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1562        self.w
1563    }
1564}
1565impl R {
1566    #[doc = r" Value of the register as raw bits"]
1567    #[inline]
1568    pub fn bits(&self) -> u32 {
1569        self.bits
1570    }
1571    #[doc = "Bit 0 - VBUS_Discharge Setting this bit to 1 causes VBUS to discharge through a resistor."]
1572    #[inline]
1573    pub fn vd(&self) -> VDR {
1574        let bits = {
1575            const MASK: bool = true;
1576            const OFFSET: u8 = 0;
1577            ((self.bits >> OFFSET) & MASK as u32) != 0
1578        };
1579        VDR { bits }
1580    }
1581    #[doc = "Bit 1 - VBUS_Charge Setting this bit to 1 causes the VBUS line to be charged. This is used for VBUS pulsing during SRP."]
1582    #[inline]
1583    pub fn vc(&self) -> VCR {
1584        let bits = {
1585            const MASK: bool = true;
1586            const OFFSET: u8 = 1;
1587            ((self.bits >> OFFSET) & MASK as u32) != 0
1588        };
1589        VCR { bits }
1590    }
1591    #[doc = "Bit 2 - Hardware assist auto_reset"]
1592    #[inline]
1593    pub fn haar(&self) -> HAARR {
1594        HAARR::_from({
1595            const MASK: bool = true;
1596            const OFFSET: u8 = 2;
1597            ((self.bits >> OFFSET) & MASK as u32) != 0
1598        })
1599    }
1600    #[doc = "Bit 3 - OTG termination This bit must be set to 1 when the OTG controller is in device mode. This controls the pull-down on USB_DM."]
1601    #[inline]
1602    pub fn ot(&self) -> OTR {
1603        let bits = {
1604            const MASK: bool = true;
1605            const OFFSET: u8 = 3;
1606            ((self.bits >> OFFSET) & MASK as u32) != 0
1607        };
1608        OTR { bits }
1609    }
1610    #[doc = "Bit 4 - Data pulsing Setting this bit to 1 causes the pull-up on USB_DP to be asserted for data pulsing during SRP."]
1611    #[inline]
1612    pub fn dp(&self) -> DPR {
1613        let bits = {
1614            const MASK: bool = true;
1615            const OFFSET: u8 = 4;
1616            ((self.bits >> OFFSET) & MASK as u32) != 0
1617        };
1618        DPR { bits }
1619    }
1620    #[doc = "Bit 5 - ID pull-up. This bit provides control over the pull-up resistor."]
1621    #[inline]
1622    pub fn idpu(&self) -> IDPUR {
1623        IDPUR::_from({
1624            const MASK: bool = true;
1625            const OFFSET: u8 = 5;
1626            ((self.bits >> OFFSET) & MASK as u32) != 0
1627        })
1628    }
1629    #[doc = "Bit 6 - Hardware assist data pulse Write a 1 to start data pulse sequence."]
1630    #[inline]
1631    pub fn hadp(&self) -> HADPR {
1632        let bits = {
1633            const MASK: bool = true;
1634            const OFFSET: u8 = 6;
1635            ((self.bits >> OFFSET) & MASK as u32) != 0
1636        };
1637        HADPR { bits }
1638    }
1639    #[doc = "Bit 7 - Hardware assist B-disconnect to A-connect"]
1640    #[inline]
1641    pub fn haba(&self) -> HABAR {
1642        HABAR::_from({
1643            const MASK: bool = true;
1644            const OFFSET: u8 = 7;
1645            ((self.bits >> OFFSET) & MASK as u32) != 0
1646        })
1647    }
1648    #[doc = "Bit 8 - USB ID"]
1649    #[inline]
1650    pub fn id(&self) -> IDR {
1651        IDR::_from({
1652            const MASK: bool = true;
1653            const OFFSET: u8 = 8;
1654            ((self.bits >> OFFSET) & MASK as u32) != 0
1655        })
1656    }
1657    #[doc = "Bit 9 - A-VBUS valid Reading 1 indicates that VBUS is above the A-VBUS valid threshold."]
1658    #[inline]
1659    pub fn avv(&self) -> AVVR {
1660        let bits = {
1661            const MASK: bool = true;
1662            const OFFSET: u8 = 9;
1663            ((self.bits >> OFFSET) & MASK as u32) != 0
1664        };
1665        AVVR { bits }
1666    }
1667    #[doc = "Bit 10 - A-session valid Reading 1 indicates that VBUS is above the A-session valid threshold."]
1668    #[inline]
1669    pub fn asv(&self) -> ASVR {
1670        let bits = {
1671            const MASK: bool = true;
1672            const OFFSET: u8 = 10;
1673            ((self.bits >> OFFSET) & MASK as u32) != 0
1674        };
1675        ASVR { bits }
1676    }
1677    #[doc = "Bit 11 - B-session valid Reading 1 indicates that VBUS is above the B-session valid threshold."]
1678    #[inline]
1679    pub fn bsv(&self) -> BSVR {
1680        let bits = {
1681            const MASK: bool = true;
1682            const OFFSET: u8 = 11;
1683            ((self.bits >> OFFSET) & MASK as u32) != 0
1684        };
1685        BSVR { bits }
1686    }
1687    #[doc = "Bit 12 - B-session end Reading 1 indicates that VBUS is below the B-session end threshold."]
1688    #[inline]
1689    pub fn bse(&self) -> BSER {
1690        let bits = {
1691            const MASK: bool = true;
1692            const OFFSET: u8 = 12;
1693            ((self.bits >> OFFSET) & MASK as u32) != 0
1694        };
1695        BSER { bits }
1696    }
1697    #[doc = "Bit 13 - 1 millisecond timer toggle This bit toggles once per millisecond."]
1698    #[inline]
1699    pub fn ms1t(&self) -> MS1TR {
1700        let bits = {
1701            const MASK: bool = true;
1702            const OFFSET: u8 = 13;
1703            ((self.bits >> OFFSET) & MASK as u32) != 0
1704        };
1705        MS1TR { bits }
1706    }
1707    #[doc = "Bit 14 - Data bus pulsing status Reading a 1 indicates that data bus pulsing is detected on the port."]
1708    #[inline]
1709    pub fn dps(&self) -> DPSR {
1710        let bits = {
1711            const MASK: bool = true;
1712            const OFFSET: u8 = 14;
1713            ((self.bits >> OFFSET) & MASK as u32) != 0
1714        };
1715        DPSR { bits }
1716    }
1717    #[doc = "Bit 16 - USB ID interrupt status This bit is set when a change on the ID input has been detected. Software must write a 1 to this bit to clear it."]
1718    #[inline]
1719    pub fn idis(&self) -> IDISR {
1720        let bits = {
1721            const MASK: bool = true;
1722            const OFFSET: u8 = 16;
1723            ((self.bits >> OFFSET) & MASK as u32) != 0
1724        };
1725        IDISR { bits }
1726    }
1727    #[doc = "Bit 17 - A-VBUS valid interrupt status This bit is set then VBUS has either risen above or fallen below the A-VBUS valid threshold (4.4 V on an A-device). Software must write a 1 to this bit to clear it."]
1728    #[inline]
1729    pub fn avvis(&self) -> AVVISR {
1730        let bits = {
1731            const MASK: bool = true;
1732            const OFFSET: u8 = 17;
1733            ((self.bits >> OFFSET) & MASK as u32) != 0
1734        };
1735        AVVISR { bits }
1736    }
1737    #[doc = "Bit 18 - A-Session valid interrupt status This bit is set then VBUS has either risen above or fallen below the A-session valid threshold (0.8 V). Software must write a 1 to this bit to clear it."]
1738    #[inline]
1739    pub fn asvis(&self) -> ASVISR {
1740        let bits = {
1741            const MASK: bool = true;
1742            const OFFSET: u8 = 18;
1743            ((self.bits >> OFFSET) & MASK as u32) != 0
1744        };
1745        ASVISR { bits }
1746    }
1747    #[doc = "Bit 19 - B-Session valid interrupt status This bit is set then VBUS has either risen above or fallen below the B-session valid threshold (0.8 V). Software must write a 1 to this bit to clear it."]
1748    #[inline]
1749    pub fn bsvis(&self) -> BSVISR {
1750        let bits = {
1751            const MASK: bool = true;
1752            const OFFSET: u8 = 19;
1753            ((self.bits >> OFFSET) & MASK as u32) != 0
1754        };
1755        BSVISR { bits }
1756    }
1757    #[doc = "Bit 20 - B-Session end interrupt status This bit is set then VBUS has fallen below the B-session end threshold. Software must write a 1 to this bit to clear it."]
1758    #[inline]
1759    pub fn bseis(&self) -> BSEISR {
1760        let bits = {
1761            const MASK: bool = true;
1762            const OFFSET: u8 = 20;
1763            ((self.bits >> OFFSET) & MASK as u32) != 0
1764        };
1765        BSEISR { bits }
1766    }
1767    #[doc = "Bit 21 - 1 millisecond timer interrupt status This bit is set once every millisecond. Software must write a 1 to this bit to clear it."]
1768    #[inline]
1769    pub fn ms1s(&self) -> MS1SR {
1770        let bits = {
1771            const MASK: bool = true;
1772            const OFFSET: u8 = 21;
1773            ((self.bits >> OFFSET) & MASK as u32) != 0
1774        };
1775        MS1SR { bits }
1776    }
1777    #[doc = "Bit 22 - Data pulse interrupt status This bit is set when data bus pulsing occurs on DP or DM. Data bus pulsing is only detected when the CM bit in USBMODE = Host (11) and the PortPower bit in PORTSC = Off (0). Software must write a 1 to this bit to clear it."]
1778    #[inline]
1779    pub fn dpis(&self) -> DPISR {
1780        let bits = {
1781            const MASK: bool = true;
1782            const OFFSET: u8 = 22;
1783            ((self.bits >> OFFSET) & MASK as u32) != 0
1784        };
1785        DPISR { bits }
1786    }
1787    #[doc = "Bit 24 - USB ID interrupt enable Setting this bit enables the interrupt. Writing a 0 disables the interrupt."]
1788    #[inline]
1789    pub fn idie(&self) -> IDIER {
1790        let bits = {
1791            const MASK: bool = true;
1792            const OFFSET: u8 = 24;
1793            ((self.bits >> OFFSET) & MASK as u32) != 0
1794        };
1795        IDIER { bits }
1796    }
1797    #[doc = "Bit 25 - A-VBUS valid interrupt enable Setting this bit enables the A-VBUS valid interrupt. Writing a 0 disables the interrupt."]
1798    #[inline]
1799    pub fn avvie(&self) -> AVVIER {
1800        let bits = {
1801            const MASK: bool = true;
1802            const OFFSET: u8 = 25;
1803            ((self.bits >> OFFSET) & MASK as u32) != 0
1804        };
1805        AVVIER { bits }
1806    }
1807    #[doc = "Bit 26 - A-session valid interrupt enable Setting this bit enables the A-session valid interrupt. Writing a 0 disables the interrupt"]
1808    #[inline]
1809    pub fn asvie(&self) -> ASVIER {
1810        let bits = {
1811            const MASK: bool = true;
1812            const OFFSET: u8 = 26;
1813            ((self.bits >> OFFSET) & MASK as u32) != 0
1814        };
1815        ASVIER { bits }
1816    }
1817    #[doc = "Bit 27 - B-session valid interrupt enable Setting this bit enables the B-session valid interrupt. Writing a 0 disables the interrupt."]
1818    #[inline]
1819    pub fn bsvie(&self) -> BSVIER {
1820        let bits = {
1821            const MASK: bool = true;
1822            const OFFSET: u8 = 27;
1823            ((self.bits >> OFFSET) & MASK as u32) != 0
1824        };
1825        BSVIER { bits }
1826    }
1827    #[doc = "Bit 28 - B-session end interrupt enable Setting this bit enables the B-session end interrupt. Writing a 0 disables the interrupt."]
1828    #[inline]
1829    pub fn bseie(&self) -> BSEIER {
1830        let bits = {
1831            const MASK: bool = true;
1832            const OFFSET: u8 = 28;
1833            ((self.bits >> OFFSET) & MASK as u32) != 0
1834        };
1835        BSEIER { bits }
1836    }
1837    #[doc = "Bit 29 - 1 millisecond timer interrupt enable Setting this bit enables the 1 millisecond timer interrupt. Writing a 0 disables the interrupt."]
1838    #[inline]
1839    pub fn ms1e(&self) -> MS1ER {
1840        let bits = {
1841            const MASK: bool = true;
1842            const OFFSET: u8 = 29;
1843            ((self.bits >> OFFSET) & MASK as u32) != 0
1844        };
1845        MS1ER { bits }
1846    }
1847    #[doc = "Bit 30 - Data pulse interrupt enable Setting this bit enables the data pulse interrupt. Writing a 0 disables the interrupt"]
1848    #[inline]
1849    pub fn dpie(&self) -> DPIER {
1850        let bits = {
1851            const MASK: bool = true;
1852            const OFFSET: u8 = 30;
1853            ((self.bits >> OFFSET) & MASK as u32) != 0
1854        };
1855        DPIER { bits }
1856    }
1857}
1858impl W {
1859    #[doc = r" Reset value of the register"]
1860    #[inline]
1861    pub fn reset_value() -> W {
1862        W { bits: 0 }
1863    }
1864    #[doc = r" Writes raw bits to the register"]
1865    #[inline]
1866    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1867        self.bits = bits;
1868        self
1869    }
1870    #[doc = "Bit 0 - VBUS_Discharge Setting this bit to 1 causes VBUS to discharge through a resistor."]
1871    #[inline]
1872    pub fn vd(&mut self) -> _VDW {
1873        _VDW { w: self }
1874    }
1875    #[doc = "Bit 1 - VBUS_Charge Setting this bit to 1 causes the VBUS line to be charged. This is used for VBUS pulsing during SRP."]
1876    #[inline]
1877    pub fn vc(&mut self) -> _VCW {
1878        _VCW { w: self }
1879    }
1880    #[doc = "Bit 2 - Hardware assist auto_reset"]
1881    #[inline]
1882    pub fn haar(&mut self) -> _HAARW {
1883        _HAARW { w: self }
1884    }
1885    #[doc = "Bit 3 - OTG termination This bit must be set to 1 when the OTG controller is in device mode. This controls the pull-down on USB_DM."]
1886    #[inline]
1887    pub fn ot(&mut self) -> _OTW {
1888        _OTW { w: self }
1889    }
1890    #[doc = "Bit 4 - Data pulsing Setting this bit to 1 causes the pull-up on USB_DP to be asserted for data pulsing during SRP."]
1891    #[inline]
1892    pub fn dp(&mut self) -> _DPW {
1893        _DPW { w: self }
1894    }
1895    #[doc = "Bit 5 - ID pull-up. This bit provides control over the pull-up resistor."]
1896    #[inline]
1897    pub fn idpu(&mut self) -> _IDPUW {
1898        _IDPUW { w: self }
1899    }
1900    #[doc = "Bit 6 - Hardware assist data pulse Write a 1 to start data pulse sequence."]
1901    #[inline]
1902    pub fn hadp(&mut self) -> _HADPW {
1903        _HADPW { w: self }
1904    }
1905    #[doc = "Bit 7 - Hardware assist B-disconnect to A-connect"]
1906    #[inline]
1907    pub fn haba(&mut self) -> _HABAW {
1908        _HABAW { w: self }
1909    }
1910    #[doc = "Bit 8 - USB ID"]
1911    #[inline]
1912    pub fn id(&mut self) -> _IDW {
1913        _IDW { w: self }
1914    }
1915    #[doc = "Bit 9 - A-VBUS valid Reading 1 indicates that VBUS is above the A-VBUS valid threshold."]
1916    #[inline]
1917    pub fn avv(&mut self) -> _AVVW {
1918        _AVVW { w: self }
1919    }
1920    #[doc = "Bit 10 - A-session valid Reading 1 indicates that VBUS is above the A-session valid threshold."]
1921    #[inline]
1922    pub fn asv(&mut self) -> _ASVW {
1923        _ASVW { w: self }
1924    }
1925    #[doc = "Bit 11 - B-session valid Reading 1 indicates that VBUS is above the B-session valid threshold."]
1926    #[inline]
1927    pub fn bsv(&mut self) -> _BSVW {
1928        _BSVW { w: self }
1929    }
1930    #[doc = "Bit 12 - B-session end Reading 1 indicates that VBUS is below the B-session end threshold."]
1931    #[inline]
1932    pub fn bse(&mut self) -> _BSEW {
1933        _BSEW { w: self }
1934    }
1935    #[doc = "Bit 13 - 1 millisecond timer toggle This bit toggles once per millisecond."]
1936    #[inline]
1937    pub fn ms1t(&mut self) -> _MS1TW {
1938        _MS1TW { w: self }
1939    }
1940    #[doc = "Bit 14 - Data bus pulsing status Reading a 1 indicates that data bus pulsing is detected on the port."]
1941    #[inline]
1942    pub fn dps(&mut self) -> _DPSW {
1943        _DPSW { w: self }
1944    }
1945    #[doc = "Bit 16 - USB ID interrupt status This bit is set when a change on the ID input has been detected. Software must write a 1 to this bit to clear it."]
1946    #[inline]
1947    pub fn idis(&mut self) -> _IDISW {
1948        _IDISW { w: self }
1949    }
1950    #[doc = "Bit 17 - A-VBUS valid interrupt status This bit is set then VBUS has either risen above or fallen below the A-VBUS valid threshold (4.4 V on an A-device). Software must write a 1 to this bit to clear it."]
1951    #[inline]
1952    pub fn avvis(&mut self) -> _AVVISW {
1953        _AVVISW { w: self }
1954    }
1955    #[doc = "Bit 18 - A-Session valid interrupt status This bit is set then VBUS has either risen above or fallen below the A-session valid threshold (0.8 V). Software must write a 1 to this bit to clear it."]
1956    #[inline]
1957    pub fn asvis(&mut self) -> _ASVISW {
1958        _ASVISW { w: self }
1959    }
1960    #[doc = "Bit 19 - B-Session valid interrupt status This bit is set then VBUS has either risen above or fallen below the B-session valid threshold (0.8 V). Software must write a 1 to this bit to clear it."]
1961    #[inline]
1962    pub fn bsvis(&mut self) -> _BSVISW {
1963        _BSVISW { w: self }
1964    }
1965    #[doc = "Bit 20 - B-Session end interrupt status This bit is set then VBUS has fallen below the B-session end threshold. Software must write a 1 to this bit to clear it."]
1966    #[inline]
1967    pub fn bseis(&mut self) -> _BSEISW {
1968        _BSEISW { w: self }
1969    }
1970    #[doc = "Bit 21 - 1 millisecond timer interrupt status This bit is set once every millisecond. Software must write a 1 to this bit to clear it."]
1971    #[inline]
1972    pub fn ms1s(&mut self) -> _MS1SW {
1973        _MS1SW { w: self }
1974    }
1975    #[doc = "Bit 22 - Data pulse interrupt status This bit is set when data bus pulsing occurs on DP or DM. Data bus pulsing is only detected when the CM bit in USBMODE = Host (11) and the PortPower bit in PORTSC = Off (0). Software must write a 1 to this bit to clear it."]
1976    #[inline]
1977    pub fn dpis(&mut self) -> _DPISW {
1978        _DPISW { w: self }
1979    }
1980    #[doc = "Bit 24 - USB ID interrupt enable Setting this bit enables the interrupt. Writing a 0 disables the interrupt."]
1981    #[inline]
1982    pub fn idie(&mut self) -> _IDIEW {
1983        _IDIEW { w: self }
1984    }
1985    #[doc = "Bit 25 - A-VBUS valid interrupt enable Setting this bit enables the A-VBUS valid interrupt. Writing a 0 disables the interrupt."]
1986    #[inline]
1987    pub fn avvie(&mut self) -> _AVVIEW {
1988        _AVVIEW { w: self }
1989    }
1990    #[doc = "Bit 26 - A-session valid interrupt enable Setting this bit enables the A-session valid interrupt. Writing a 0 disables the interrupt"]
1991    #[inline]
1992    pub fn asvie(&mut self) -> _ASVIEW {
1993        _ASVIEW { w: self }
1994    }
1995    #[doc = "Bit 27 - B-session valid interrupt enable Setting this bit enables the B-session valid interrupt. Writing a 0 disables the interrupt."]
1996    #[inline]
1997    pub fn bsvie(&mut self) -> _BSVIEW {
1998        _BSVIEW { w: self }
1999    }
2000    #[doc = "Bit 28 - B-session end interrupt enable Setting this bit enables the B-session end interrupt. Writing a 0 disables the interrupt."]
2001    #[inline]
2002    pub fn bseie(&mut self) -> _BSEIEW {
2003        _BSEIEW { w: self }
2004    }
2005    #[doc = "Bit 29 - 1 millisecond timer interrupt enable Setting this bit enables the 1 millisecond timer interrupt. Writing a 0 disables the interrupt."]
2006    #[inline]
2007    pub fn ms1e(&mut self) -> _MS1EW {
2008        _MS1EW { w: self }
2009    }
2010    #[doc = "Bit 30 - Data pulse interrupt enable Setting this bit enables the data pulse interrupt. Writing a 0 disables the interrupt"]
2011    #[inline]
2012    pub fn dpie(&mut self) -> _DPIEW {
2013        _DPIEW { w: self }
2014    }
2015}