k66/usbphy/
usb1_vbus_detect.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::USB1_VBUS_DETECT {
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 `VBUSVALID_THRESH`"]
46#[derive(Clone, Copy, Debug, PartialEq)]
47pub enum VBUSVALID_THRESHR {
48    #[doc = "4.0 V"]
49    _000,
50    #[doc = "4.1 V"]
51    _001,
52    #[doc = "4.2 V"]
53    _010,
54    #[doc = "4.3 V"]
55    _011,
56    #[doc = "4.4 V (Default)"]
57    _100,
58    #[doc = "4.5 V"]
59    _101,
60    #[doc = "4.6 V"]
61    _110,
62    #[doc = "4.7 V"]
63    _111,
64}
65impl VBUSVALID_THRESHR {
66    #[doc = r" Value of the field as raw bits"]
67    #[inline]
68    pub fn bits(&self) -> u8 {
69        match *self {
70            VBUSVALID_THRESHR::_000 => 0,
71            VBUSVALID_THRESHR::_001 => 1,
72            VBUSVALID_THRESHR::_010 => 2,
73            VBUSVALID_THRESHR::_011 => 3,
74            VBUSVALID_THRESHR::_100 => 4,
75            VBUSVALID_THRESHR::_101 => 5,
76            VBUSVALID_THRESHR::_110 => 6,
77            VBUSVALID_THRESHR::_111 => 7,
78        }
79    }
80    #[allow(missing_docs)]
81    #[doc(hidden)]
82    #[inline]
83    pub fn _from(value: u8) -> VBUSVALID_THRESHR {
84        match value {
85            0 => VBUSVALID_THRESHR::_000,
86            1 => VBUSVALID_THRESHR::_001,
87            2 => VBUSVALID_THRESHR::_010,
88            3 => VBUSVALID_THRESHR::_011,
89            4 => VBUSVALID_THRESHR::_100,
90            5 => VBUSVALID_THRESHR::_101,
91            6 => VBUSVALID_THRESHR::_110,
92            7 => VBUSVALID_THRESHR::_111,
93            _ => unreachable!(),
94        }
95    }
96    #[doc = "Checks if the value of the field is `_000`"]
97    #[inline]
98    pub fn is_000(&self) -> bool {
99        *self == VBUSVALID_THRESHR::_000
100    }
101    #[doc = "Checks if the value of the field is `_001`"]
102    #[inline]
103    pub fn is_001(&self) -> bool {
104        *self == VBUSVALID_THRESHR::_001
105    }
106    #[doc = "Checks if the value of the field is `_010`"]
107    #[inline]
108    pub fn is_010(&self) -> bool {
109        *self == VBUSVALID_THRESHR::_010
110    }
111    #[doc = "Checks if the value of the field is `_011`"]
112    #[inline]
113    pub fn is_011(&self) -> bool {
114        *self == VBUSVALID_THRESHR::_011
115    }
116    #[doc = "Checks if the value of the field is `_100`"]
117    #[inline]
118    pub fn is_100(&self) -> bool {
119        *self == VBUSVALID_THRESHR::_100
120    }
121    #[doc = "Checks if the value of the field is `_101`"]
122    #[inline]
123    pub fn is_101(&self) -> bool {
124        *self == VBUSVALID_THRESHR::_101
125    }
126    #[doc = "Checks if the value of the field is `_110`"]
127    #[inline]
128    pub fn is_110(&self) -> bool {
129        *self == VBUSVALID_THRESHR::_110
130    }
131    #[doc = "Checks if the value of the field is `_111`"]
132    #[inline]
133    pub fn is_111(&self) -> bool {
134        *self == VBUSVALID_THRESHR::_111
135    }
136}
137#[doc = "Possible values of the field `VBUS_OVERRIDE_EN`"]
138#[derive(Clone, Copy, Debug, PartialEq)]
139pub enum VBUS_OVERRIDE_ENR {
140    #[doc = "Use the results of the internal VBUS_VALID and Session Valid comparators for VBUS_VALID, AVALID, BVALID, and SESSEND (Default)"]
141    _0,
142    #[doc = "Use the override values for VBUS_VALID, AVALID, BVALID, and SESSEND"]
143    _1,
144}
145impl VBUS_OVERRIDE_ENR {
146    #[doc = r" Returns `true` if the bit is clear (0)"]
147    #[inline]
148    pub fn bit_is_clear(&self) -> bool {
149        !self.bit()
150    }
151    #[doc = r" Returns `true` if the bit is set (1)"]
152    #[inline]
153    pub fn bit_is_set(&self) -> bool {
154        self.bit()
155    }
156    #[doc = r" Value of the field as raw bits"]
157    #[inline]
158    pub fn bit(&self) -> bool {
159        match *self {
160            VBUS_OVERRIDE_ENR::_0 => false,
161            VBUS_OVERRIDE_ENR::_1 => true,
162        }
163    }
164    #[allow(missing_docs)]
165    #[doc(hidden)]
166    #[inline]
167    pub fn _from(value: bool) -> VBUS_OVERRIDE_ENR {
168        match value {
169            false => VBUS_OVERRIDE_ENR::_0,
170            true => VBUS_OVERRIDE_ENR::_1,
171        }
172    }
173    #[doc = "Checks if the value of the field is `_0`"]
174    #[inline]
175    pub fn is_0(&self) -> bool {
176        *self == VBUS_OVERRIDE_ENR::_0
177    }
178    #[doc = "Checks if the value of the field is `_1`"]
179    #[inline]
180    pub fn is_1(&self) -> bool {
181        *self == VBUS_OVERRIDE_ENR::_1
182    }
183}
184#[doc = r" Value of the field"]
185pub struct SESSEND_OVERRIDER {
186    bits: bool,
187}
188impl SESSEND_OVERRIDER {
189    #[doc = r" Value of the field as raw bits"]
190    #[inline]
191    pub fn bit(&self) -> bool {
192        self.bits
193    }
194    #[doc = r" Returns `true` if the bit is clear (0)"]
195    #[inline]
196    pub fn bit_is_clear(&self) -> bool {
197        !self.bit()
198    }
199    #[doc = r" Returns `true` if the bit is set (1)"]
200    #[inline]
201    pub fn bit_is_set(&self) -> bool {
202        self.bit()
203    }
204}
205#[doc = r" Value of the field"]
206pub struct BVALID_OVERRIDER {
207    bits: bool,
208}
209impl BVALID_OVERRIDER {
210    #[doc = r" Value of the field as raw bits"]
211    #[inline]
212    pub fn bit(&self) -> bool {
213        self.bits
214    }
215    #[doc = r" Returns `true` if the bit is clear (0)"]
216    #[inline]
217    pub fn bit_is_clear(&self) -> bool {
218        !self.bit()
219    }
220    #[doc = r" Returns `true` if the bit is set (1)"]
221    #[inline]
222    pub fn bit_is_set(&self) -> bool {
223        self.bit()
224    }
225}
226#[doc = r" Value of the field"]
227pub struct AVALID_OVERRIDER {
228    bits: bool,
229}
230impl AVALID_OVERRIDER {
231    #[doc = r" Value of the field as raw bits"]
232    #[inline]
233    pub fn bit(&self) -> bool {
234        self.bits
235    }
236    #[doc = r" Returns `true` if the bit is clear (0)"]
237    #[inline]
238    pub fn bit_is_clear(&self) -> bool {
239        !self.bit()
240    }
241    #[doc = r" Returns `true` if the bit is set (1)"]
242    #[inline]
243    pub fn bit_is_set(&self) -> bool {
244        self.bit()
245    }
246}
247#[doc = r" Value of the field"]
248pub struct VBUSVALID_OVERRIDER {
249    bits: bool,
250}
251impl VBUSVALID_OVERRIDER {
252    #[doc = r" Value of the field as raw bits"]
253    #[inline]
254    pub fn bit(&self) -> bool {
255        self.bits
256    }
257    #[doc = r" Returns `true` if the bit is clear (0)"]
258    #[inline]
259    pub fn bit_is_clear(&self) -> bool {
260        !self.bit()
261    }
262    #[doc = r" Returns `true` if the bit is set (1)"]
263    #[inline]
264    pub fn bit_is_set(&self) -> bool {
265        self.bit()
266    }
267}
268#[doc = "Possible values of the field `VBUSVALID_SEL`"]
269#[derive(Clone, Copy, Debug, PartialEq)]
270pub enum VBUSVALID_SELR {
271    #[doc = "Use the VBUS_VALID comparator results for signal reported to the USB controller (Default)"]
272    _0,
273    #[doc = "Use the VBUS_VALID_3V detector results for signal reported to the USB controller"]
274    _1,
275}
276impl VBUSVALID_SELR {
277    #[doc = r" Returns `true` if the bit is clear (0)"]
278    #[inline]
279    pub fn bit_is_clear(&self) -> bool {
280        !self.bit()
281    }
282    #[doc = r" Returns `true` if the bit is set (1)"]
283    #[inline]
284    pub fn bit_is_set(&self) -> bool {
285        self.bit()
286    }
287    #[doc = r" Value of the field as raw bits"]
288    #[inline]
289    pub fn bit(&self) -> bool {
290        match *self {
291            VBUSVALID_SELR::_0 => false,
292            VBUSVALID_SELR::_1 => true,
293        }
294    }
295    #[allow(missing_docs)]
296    #[doc(hidden)]
297    #[inline]
298    pub fn _from(value: bool) -> VBUSVALID_SELR {
299        match value {
300            false => VBUSVALID_SELR::_0,
301            true => VBUSVALID_SELR::_1,
302        }
303    }
304    #[doc = "Checks if the value of the field is `_0`"]
305    #[inline]
306    pub fn is_0(&self) -> bool {
307        *self == VBUSVALID_SELR::_0
308    }
309    #[doc = "Checks if the value of the field is `_1`"]
310    #[inline]
311    pub fn is_1(&self) -> bool {
312        *self == VBUSVALID_SELR::_1
313    }
314}
315#[doc = "Possible values of the field `VBUS_SOURCE_SEL`"]
316#[derive(Clone, Copy, Debug, PartialEq)]
317pub enum VBUS_SOURCE_SELR {
318    #[doc = "Use the VBUS_VALID comparator results for signal reported to the USB controller (Default)"]
319    _00,
320    #[doc = "Use the Session Valid comparator results for signal reported to the USB controller"]
321    _01,
322    #[doc = "Use the Session Valid comparator results for signal reported to the USB controller"]
323    _10,
324    #[doc = "Reserved, do not use"]
325    _11,
326}
327impl VBUS_SOURCE_SELR {
328    #[doc = r" Value of the field as raw bits"]
329    #[inline]
330    pub fn bits(&self) -> u8 {
331        match *self {
332            VBUS_SOURCE_SELR::_00 => 0,
333            VBUS_SOURCE_SELR::_01 => 1,
334            VBUS_SOURCE_SELR::_10 => 2,
335            VBUS_SOURCE_SELR::_11 => 3,
336        }
337    }
338    #[allow(missing_docs)]
339    #[doc(hidden)]
340    #[inline]
341    pub fn _from(value: u8) -> VBUS_SOURCE_SELR {
342        match value {
343            0 => VBUS_SOURCE_SELR::_00,
344            1 => VBUS_SOURCE_SELR::_01,
345            2 => VBUS_SOURCE_SELR::_10,
346            3 => VBUS_SOURCE_SELR::_11,
347            _ => unreachable!(),
348        }
349    }
350    #[doc = "Checks if the value of the field is `_00`"]
351    #[inline]
352    pub fn is_00(&self) -> bool {
353        *self == VBUS_SOURCE_SELR::_00
354    }
355    #[doc = "Checks if the value of the field is `_01`"]
356    #[inline]
357    pub fn is_01(&self) -> bool {
358        *self == VBUS_SOURCE_SELR::_01
359    }
360    #[doc = "Checks if the value of the field is `_10`"]
361    #[inline]
362    pub fn is_10(&self) -> bool {
363        *self == VBUS_SOURCE_SELR::_10
364    }
365    #[doc = "Checks if the value of the field is `_11`"]
366    #[inline]
367    pub fn is_11(&self) -> bool {
368        *self == VBUS_SOURCE_SELR::_11
369    }
370}
371#[doc = "Possible values of the field `VBUSVALID_TO_SESSVALID`"]
372#[derive(Clone, Copy, Debug, PartialEq)]
373pub enum VBUSVALID_TO_SESSVALIDR {
374    #[doc = "Use the VBUS_VALID comparator for VBUS_VALID results"]
375    _0,
376    #[doc = "Use the Session End comparator for VBUS_VALID results. The Session End threshold is >0.8V and <4.0V."]
377    _1,
378}
379impl VBUSVALID_TO_SESSVALIDR {
380    #[doc = r" Returns `true` if the bit is clear (0)"]
381    #[inline]
382    pub fn bit_is_clear(&self) -> bool {
383        !self.bit()
384    }
385    #[doc = r" Returns `true` if the bit is set (1)"]
386    #[inline]
387    pub fn bit_is_set(&self) -> bool {
388        self.bit()
389    }
390    #[doc = r" Value of the field as raw bits"]
391    #[inline]
392    pub fn bit(&self) -> bool {
393        match *self {
394            VBUSVALID_TO_SESSVALIDR::_0 => false,
395            VBUSVALID_TO_SESSVALIDR::_1 => true,
396        }
397    }
398    #[allow(missing_docs)]
399    #[doc(hidden)]
400    #[inline]
401    pub fn _from(value: bool) -> VBUSVALID_TO_SESSVALIDR {
402        match value {
403            false => VBUSVALID_TO_SESSVALIDR::_0,
404            true => VBUSVALID_TO_SESSVALIDR::_1,
405        }
406    }
407    #[doc = "Checks if the value of the field is `_0`"]
408    #[inline]
409    pub fn is_0(&self) -> bool {
410        *self == VBUSVALID_TO_SESSVALIDR::_0
411    }
412    #[doc = "Checks if the value of the field is `_1`"]
413    #[inline]
414    pub fn is_1(&self) -> bool {
415        *self == VBUSVALID_TO_SESSVALIDR::_1
416    }
417}
418#[doc = "Possible values of the field `PWRUP_CMPS`"]
419#[derive(Clone, Copy, Debug, PartialEq)]
420pub enum PWRUP_CMPSR {
421    #[doc = "Powers down the VBUS_VALID comparator"]
422    _0,
423    #[doc = "Enables the VBUS_VALID comparator (default)"]
424    _1,
425}
426impl PWRUP_CMPSR {
427    #[doc = r" Returns `true` if the bit is clear (0)"]
428    #[inline]
429    pub fn bit_is_clear(&self) -> bool {
430        !self.bit()
431    }
432    #[doc = r" Returns `true` if the bit is set (1)"]
433    #[inline]
434    pub fn bit_is_set(&self) -> bool {
435        self.bit()
436    }
437    #[doc = r" Value of the field as raw bits"]
438    #[inline]
439    pub fn bit(&self) -> bool {
440        match *self {
441            PWRUP_CMPSR::_0 => false,
442            PWRUP_CMPSR::_1 => true,
443        }
444    }
445    #[allow(missing_docs)]
446    #[doc(hidden)]
447    #[inline]
448    pub fn _from(value: bool) -> PWRUP_CMPSR {
449        match value {
450            false => PWRUP_CMPSR::_0,
451            true => PWRUP_CMPSR::_1,
452        }
453    }
454    #[doc = "Checks if the value of the field is `_0`"]
455    #[inline]
456    pub fn is_0(&self) -> bool {
457        *self == PWRUP_CMPSR::_0
458    }
459    #[doc = "Checks if the value of the field is `_1`"]
460    #[inline]
461    pub fn is_1(&self) -> bool {
462        *self == PWRUP_CMPSR::_1
463    }
464}
465#[doc = "Possible values of the field `DISCHARGE_VBUS`"]
466#[derive(Clone, Copy, Debug, PartialEq)]
467pub enum DISCHARGE_VBUSR {
468    #[doc = "VBUS discharge resistor is disabled (Default)"]
469    _0,
470    #[doc = "VBUS discharge resistor is enabled"]
471    _1,
472}
473impl DISCHARGE_VBUSR {
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    #[doc = r" Value of the field as raw bits"]
485    #[inline]
486    pub fn bit(&self) -> bool {
487        match *self {
488            DISCHARGE_VBUSR::_0 => false,
489            DISCHARGE_VBUSR::_1 => true,
490        }
491    }
492    #[allow(missing_docs)]
493    #[doc(hidden)]
494    #[inline]
495    pub fn _from(value: bool) -> DISCHARGE_VBUSR {
496        match value {
497            false => DISCHARGE_VBUSR::_0,
498            true => DISCHARGE_VBUSR::_1,
499        }
500    }
501    #[doc = "Checks if the value of the field is `_0`"]
502    #[inline]
503    pub fn is_0(&self) -> bool {
504        *self == DISCHARGE_VBUSR::_0
505    }
506    #[doc = "Checks if the value of the field is `_1`"]
507    #[inline]
508    pub fn is_1(&self) -> bool {
509        *self == DISCHARGE_VBUSR::_1
510    }
511}
512#[doc = "Possible values of the field `EN_CHARGER_RESISTOR`"]
513#[derive(Clone, Copy, Debug, PartialEq)]
514pub enum EN_CHARGER_RESISTORR {
515    #[doc = "Disable resistive charger detection resistors on USB_DP and USB_DP"]
516    _0,
517    #[doc = "Enable resistive charger detection resistors on USB_DP and USB_DP"]
518    _1,
519}
520impl EN_CHARGER_RESISTORR {
521    #[doc = r" Returns `true` if the bit is clear (0)"]
522    #[inline]
523    pub fn bit_is_clear(&self) -> bool {
524        !self.bit()
525    }
526    #[doc = r" Returns `true` if the bit is set (1)"]
527    #[inline]
528    pub fn bit_is_set(&self) -> bool {
529        self.bit()
530    }
531    #[doc = r" Value of the field as raw bits"]
532    #[inline]
533    pub fn bit(&self) -> bool {
534        match *self {
535            EN_CHARGER_RESISTORR::_0 => false,
536            EN_CHARGER_RESISTORR::_1 => true,
537        }
538    }
539    #[allow(missing_docs)]
540    #[doc(hidden)]
541    #[inline]
542    pub fn _from(value: bool) -> EN_CHARGER_RESISTORR {
543        match value {
544            false => EN_CHARGER_RESISTORR::_0,
545            true => EN_CHARGER_RESISTORR::_1,
546        }
547    }
548    #[doc = "Checks if the value of the field is `_0`"]
549    #[inline]
550    pub fn is_0(&self) -> bool {
551        *self == EN_CHARGER_RESISTORR::_0
552    }
553    #[doc = "Checks if the value of the field is `_1`"]
554    #[inline]
555    pub fn is_1(&self) -> bool {
556        *self == EN_CHARGER_RESISTORR::_1
557    }
558}
559#[doc = "Values that can be written to the field `VBUSVALID_THRESH`"]
560pub enum VBUSVALID_THRESHW {
561    #[doc = "4.0 V"]
562    _000,
563    #[doc = "4.1 V"]
564    _001,
565    #[doc = "4.2 V"]
566    _010,
567    #[doc = "4.3 V"]
568    _011,
569    #[doc = "4.4 V (Default)"]
570    _100,
571    #[doc = "4.5 V"]
572    _101,
573    #[doc = "4.6 V"]
574    _110,
575    #[doc = "4.7 V"]
576    _111,
577}
578impl VBUSVALID_THRESHW {
579    #[allow(missing_docs)]
580    #[doc(hidden)]
581    #[inline]
582    pub fn _bits(&self) -> u8 {
583        match *self {
584            VBUSVALID_THRESHW::_000 => 0,
585            VBUSVALID_THRESHW::_001 => 1,
586            VBUSVALID_THRESHW::_010 => 2,
587            VBUSVALID_THRESHW::_011 => 3,
588            VBUSVALID_THRESHW::_100 => 4,
589            VBUSVALID_THRESHW::_101 => 5,
590            VBUSVALID_THRESHW::_110 => 6,
591            VBUSVALID_THRESHW::_111 => 7,
592        }
593    }
594}
595#[doc = r" Proxy"]
596pub struct _VBUSVALID_THRESHW<'a> {
597    w: &'a mut W,
598}
599impl<'a> _VBUSVALID_THRESHW<'a> {
600    #[doc = r" Writes `variant` to the field"]
601    #[inline]
602    pub fn variant(self, variant: VBUSVALID_THRESHW) -> &'a mut W {
603        {
604            self.bits(variant._bits())
605        }
606    }
607    #[doc = "4.0 V"]
608    #[inline]
609    pub fn _000(self) -> &'a mut W {
610        self.variant(VBUSVALID_THRESHW::_000)
611    }
612    #[doc = "4.1 V"]
613    #[inline]
614    pub fn _001(self) -> &'a mut W {
615        self.variant(VBUSVALID_THRESHW::_001)
616    }
617    #[doc = "4.2 V"]
618    #[inline]
619    pub fn _010(self) -> &'a mut W {
620        self.variant(VBUSVALID_THRESHW::_010)
621    }
622    #[doc = "4.3 V"]
623    #[inline]
624    pub fn _011(self) -> &'a mut W {
625        self.variant(VBUSVALID_THRESHW::_011)
626    }
627    #[doc = "4.4 V (Default)"]
628    #[inline]
629    pub fn _100(self) -> &'a mut W {
630        self.variant(VBUSVALID_THRESHW::_100)
631    }
632    #[doc = "4.5 V"]
633    #[inline]
634    pub fn _101(self) -> &'a mut W {
635        self.variant(VBUSVALID_THRESHW::_101)
636    }
637    #[doc = "4.6 V"]
638    #[inline]
639    pub fn _110(self) -> &'a mut W {
640        self.variant(VBUSVALID_THRESHW::_110)
641    }
642    #[doc = "4.7 V"]
643    #[inline]
644    pub fn _111(self) -> &'a mut W {
645        self.variant(VBUSVALID_THRESHW::_111)
646    }
647    #[doc = r" Writes raw bits to the field"]
648    #[inline]
649    pub fn bits(self, value: u8) -> &'a mut W {
650        const MASK: u8 = 7;
651        const OFFSET: u8 = 0;
652        self.w.bits &= !((MASK as u32) << OFFSET);
653        self.w.bits |= ((value & MASK) as u32) << OFFSET;
654        self.w
655    }
656}
657#[doc = "Values that can be written to the field `VBUS_OVERRIDE_EN`"]
658pub enum VBUS_OVERRIDE_ENW {
659    #[doc = "Use the results of the internal VBUS_VALID and Session Valid comparators for VBUS_VALID, AVALID, BVALID, and SESSEND (Default)"]
660    _0,
661    #[doc = "Use the override values for VBUS_VALID, AVALID, BVALID, and SESSEND"]
662    _1,
663}
664impl VBUS_OVERRIDE_ENW {
665    #[allow(missing_docs)]
666    #[doc(hidden)]
667    #[inline]
668    pub fn _bits(&self) -> bool {
669        match *self {
670            VBUS_OVERRIDE_ENW::_0 => false,
671            VBUS_OVERRIDE_ENW::_1 => true,
672        }
673    }
674}
675#[doc = r" Proxy"]
676pub struct _VBUS_OVERRIDE_ENW<'a> {
677    w: &'a mut W,
678}
679impl<'a> _VBUS_OVERRIDE_ENW<'a> {
680    #[doc = r" Writes `variant` to the field"]
681    #[inline]
682    pub fn variant(self, variant: VBUS_OVERRIDE_ENW) -> &'a mut W {
683        {
684            self.bit(variant._bits())
685        }
686    }
687    #[doc = "Use the results of the internal VBUS_VALID and Session Valid comparators for VBUS_VALID, AVALID, BVALID, and SESSEND (Default)"]
688    #[inline]
689    pub fn _0(self) -> &'a mut W {
690        self.variant(VBUS_OVERRIDE_ENW::_0)
691    }
692    #[doc = "Use the override values for VBUS_VALID, AVALID, BVALID, and SESSEND"]
693    #[inline]
694    pub fn _1(self) -> &'a mut W {
695        self.variant(VBUS_OVERRIDE_ENW::_1)
696    }
697    #[doc = r" Sets the field bit"]
698    pub fn set_bit(self) -> &'a mut W {
699        self.bit(true)
700    }
701    #[doc = r" Clears the field bit"]
702    pub fn clear_bit(self) -> &'a mut W {
703        self.bit(false)
704    }
705    #[doc = r" Writes raw bits to the field"]
706    #[inline]
707    pub fn bit(self, value: bool) -> &'a mut W {
708        const MASK: bool = true;
709        const OFFSET: u8 = 3;
710        self.w.bits &= !((MASK as u32) << OFFSET);
711        self.w.bits |= ((value & MASK) as u32) << OFFSET;
712        self.w
713    }
714}
715#[doc = r" Proxy"]
716pub struct _SESSEND_OVERRIDEW<'a> {
717    w: &'a mut W,
718}
719impl<'a> _SESSEND_OVERRIDEW<'a> {
720    #[doc = r" Sets the field bit"]
721    pub fn set_bit(self) -> &'a mut W {
722        self.bit(true)
723    }
724    #[doc = r" Clears the field bit"]
725    pub fn clear_bit(self) -> &'a mut W {
726        self.bit(false)
727    }
728    #[doc = r" Writes raw bits to the field"]
729    #[inline]
730    pub fn bit(self, value: bool) -> &'a mut W {
731        const MASK: bool = true;
732        const OFFSET: u8 = 4;
733        self.w.bits &= !((MASK as u32) << OFFSET);
734        self.w.bits |= ((value & MASK) as u32) << OFFSET;
735        self.w
736    }
737}
738#[doc = r" Proxy"]
739pub struct _BVALID_OVERRIDEW<'a> {
740    w: &'a mut W,
741}
742impl<'a> _BVALID_OVERRIDEW<'a> {
743    #[doc = r" Sets the field bit"]
744    pub fn set_bit(self) -> &'a mut W {
745        self.bit(true)
746    }
747    #[doc = r" Clears the field bit"]
748    pub fn clear_bit(self) -> &'a mut W {
749        self.bit(false)
750    }
751    #[doc = r" Writes raw bits to the field"]
752    #[inline]
753    pub fn bit(self, value: bool) -> &'a mut W {
754        const MASK: bool = true;
755        const OFFSET: u8 = 5;
756        self.w.bits &= !((MASK as u32) << OFFSET);
757        self.w.bits |= ((value & MASK) as u32) << OFFSET;
758        self.w
759    }
760}
761#[doc = r" Proxy"]
762pub struct _AVALID_OVERRIDEW<'a> {
763    w: &'a mut W,
764}
765impl<'a> _AVALID_OVERRIDEW<'a> {
766    #[doc = r" Sets the field bit"]
767    pub fn set_bit(self) -> &'a mut W {
768        self.bit(true)
769    }
770    #[doc = r" Clears the field bit"]
771    pub fn clear_bit(self) -> &'a mut W {
772        self.bit(false)
773    }
774    #[doc = r" Writes raw bits to the field"]
775    #[inline]
776    pub fn bit(self, value: bool) -> &'a mut W {
777        const MASK: bool = true;
778        const OFFSET: u8 = 6;
779        self.w.bits &= !((MASK as u32) << OFFSET);
780        self.w.bits |= ((value & MASK) as u32) << OFFSET;
781        self.w
782    }
783}
784#[doc = r" Proxy"]
785pub struct _VBUSVALID_OVERRIDEW<'a> {
786    w: &'a mut W,
787}
788impl<'a> _VBUSVALID_OVERRIDEW<'a> {
789    #[doc = r" Sets the field bit"]
790    pub fn set_bit(self) -> &'a mut W {
791        self.bit(true)
792    }
793    #[doc = r" Clears the field bit"]
794    pub fn clear_bit(self) -> &'a mut W {
795        self.bit(false)
796    }
797    #[doc = r" Writes raw bits to the field"]
798    #[inline]
799    pub fn bit(self, value: bool) -> &'a mut W {
800        const MASK: bool = true;
801        const OFFSET: u8 = 7;
802        self.w.bits &= !((MASK as u32) << OFFSET);
803        self.w.bits |= ((value & MASK) as u32) << OFFSET;
804        self.w
805    }
806}
807#[doc = "Values that can be written to the field `VBUSVALID_SEL`"]
808pub enum VBUSVALID_SELW {
809    #[doc = "Use the VBUS_VALID comparator results for signal reported to the USB controller (Default)"]
810    _0,
811    #[doc = "Use the VBUS_VALID_3V detector results for signal reported to the USB controller"]
812    _1,
813}
814impl VBUSVALID_SELW {
815    #[allow(missing_docs)]
816    #[doc(hidden)]
817    #[inline]
818    pub fn _bits(&self) -> bool {
819        match *self {
820            VBUSVALID_SELW::_0 => false,
821            VBUSVALID_SELW::_1 => true,
822        }
823    }
824}
825#[doc = r" Proxy"]
826pub struct _VBUSVALID_SELW<'a> {
827    w: &'a mut W,
828}
829impl<'a> _VBUSVALID_SELW<'a> {
830    #[doc = r" Writes `variant` to the field"]
831    #[inline]
832    pub fn variant(self, variant: VBUSVALID_SELW) -> &'a mut W {
833        {
834            self.bit(variant._bits())
835        }
836    }
837    #[doc = "Use the VBUS_VALID comparator results for signal reported to the USB controller (Default)"]
838    #[inline]
839    pub fn _0(self) -> &'a mut W {
840        self.variant(VBUSVALID_SELW::_0)
841    }
842    #[doc = "Use the VBUS_VALID_3V detector results for signal reported to the USB controller"]
843    #[inline]
844    pub fn _1(self) -> &'a mut W {
845        self.variant(VBUSVALID_SELW::_1)
846    }
847    #[doc = r" Sets the field bit"]
848    pub fn set_bit(self) -> &'a mut W {
849        self.bit(true)
850    }
851    #[doc = r" Clears the field bit"]
852    pub fn clear_bit(self) -> &'a mut W {
853        self.bit(false)
854    }
855    #[doc = r" Writes raw bits to the field"]
856    #[inline]
857    pub fn bit(self, value: bool) -> &'a mut W {
858        const MASK: bool = true;
859        const OFFSET: u8 = 8;
860        self.w.bits &= !((MASK as u32) << OFFSET);
861        self.w.bits |= ((value & MASK) as u32) << OFFSET;
862        self.w
863    }
864}
865#[doc = "Values that can be written to the field `VBUS_SOURCE_SEL`"]
866pub enum VBUS_SOURCE_SELW {
867    #[doc = "Use the VBUS_VALID comparator results for signal reported to the USB controller (Default)"]
868    _00,
869    #[doc = "Use the Session Valid comparator results for signal reported to the USB controller"]
870    _01,
871    #[doc = "Use the Session Valid comparator results for signal reported to the USB controller"]
872    _10,
873    #[doc = "Reserved, do not use"]
874    _11,
875}
876impl VBUS_SOURCE_SELW {
877    #[allow(missing_docs)]
878    #[doc(hidden)]
879    #[inline]
880    pub fn _bits(&self) -> u8 {
881        match *self {
882            VBUS_SOURCE_SELW::_00 => 0,
883            VBUS_SOURCE_SELW::_01 => 1,
884            VBUS_SOURCE_SELW::_10 => 2,
885            VBUS_SOURCE_SELW::_11 => 3,
886        }
887    }
888}
889#[doc = r" Proxy"]
890pub struct _VBUS_SOURCE_SELW<'a> {
891    w: &'a mut W,
892}
893impl<'a> _VBUS_SOURCE_SELW<'a> {
894    #[doc = r" Writes `variant` to the field"]
895    #[inline]
896    pub fn variant(self, variant: VBUS_SOURCE_SELW) -> &'a mut W {
897        {
898            self.bits(variant._bits())
899        }
900    }
901    #[doc = "Use the VBUS_VALID comparator results for signal reported to the USB controller (Default)"]
902    #[inline]
903    pub fn _00(self) -> &'a mut W {
904        self.variant(VBUS_SOURCE_SELW::_00)
905    }
906    #[doc = "Use the Session Valid comparator results for signal reported to the USB controller"]
907    #[inline]
908    pub fn _01(self) -> &'a mut W {
909        self.variant(VBUS_SOURCE_SELW::_01)
910    }
911    #[doc = "Use the Session Valid comparator results for signal reported to the USB controller"]
912    #[inline]
913    pub fn _10(self) -> &'a mut W {
914        self.variant(VBUS_SOURCE_SELW::_10)
915    }
916    #[doc = "Reserved, do not use"]
917    #[inline]
918    pub fn _11(self) -> &'a mut W {
919        self.variant(VBUS_SOURCE_SELW::_11)
920    }
921    #[doc = r" Writes raw bits to the field"]
922    #[inline]
923    pub fn bits(self, value: u8) -> &'a mut W {
924        const MASK: u8 = 3;
925        const OFFSET: u8 = 9;
926        self.w.bits &= !((MASK as u32) << OFFSET);
927        self.w.bits |= ((value & MASK) as u32) << OFFSET;
928        self.w
929    }
930}
931#[doc = "Values that can be written to the field `VBUSVALID_TO_SESSVALID`"]
932pub enum VBUSVALID_TO_SESSVALIDW {
933    #[doc = "Use the VBUS_VALID comparator for VBUS_VALID results"]
934    _0,
935    #[doc = "Use the Session End comparator for VBUS_VALID results. The Session End threshold is >0.8V and <4.0V."]
936    _1,
937}
938impl VBUSVALID_TO_SESSVALIDW {
939    #[allow(missing_docs)]
940    #[doc(hidden)]
941    #[inline]
942    pub fn _bits(&self) -> bool {
943        match *self {
944            VBUSVALID_TO_SESSVALIDW::_0 => false,
945            VBUSVALID_TO_SESSVALIDW::_1 => true,
946        }
947    }
948}
949#[doc = r" Proxy"]
950pub struct _VBUSVALID_TO_SESSVALIDW<'a> {
951    w: &'a mut W,
952}
953impl<'a> _VBUSVALID_TO_SESSVALIDW<'a> {
954    #[doc = r" Writes `variant` to the field"]
955    #[inline]
956    pub fn variant(self, variant: VBUSVALID_TO_SESSVALIDW) -> &'a mut W {
957        {
958            self.bit(variant._bits())
959        }
960    }
961    #[doc = "Use the VBUS_VALID comparator for VBUS_VALID results"]
962    #[inline]
963    pub fn _0(self) -> &'a mut W {
964        self.variant(VBUSVALID_TO_SESSVALIDW::_0)
965    }
966    #[doc = "Use the Session End comparator for VBUS_VALID results. The Session End threshold is >0.8V and <4.0V."]
967    #[inline]
968    pub fn _1(self) -> &'a mut W {
969        self.variant(VBUSVALID_TO_SESSVALIDW::_1)
970    }
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 = 18;
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 `PWRUP_CMPS`"]
990pub enum PWRUP_CMPSW {
991    #[doc = "Powers down the VBUS_VALID comparator"]
992    _0,
993    #[doc = "Enables the VBUS_VALID comparator (default)"]
994    _1,
995}
996impl PWRUP_CMPSW {
997    #[allow(missing_docs)]
998    #[doc(hidden)]
999    #[inline]
1000    pub fn _bits(&self) -> bool {
1001        match *self {
1002            PWRUP_CMPSW::_0 => false,
1003            PWRUP_CMPSW::_1 => true,
1004        }
1005    }
1006}
1007#[doc = r" Proxy"]
1008pub struct _PWRUP_CMPSW<'a> {
1009    w: &'a mut W,
1010}
1011impl<'a> _PWRUP_CMPSW<'a> {
1012    #[doc = r" Writes `variant` to the field"]
1013    #[inline]
1014    pub fn variant(self, variant: PWRUP_CMPSW) -> &'a mut W {
1015        {
1016            self.bit(variant._bits())
1017        }
1018    }
1019    #[doc = "Powers down the VBUS_VALID comparator"]
1020    #[inline]
1021    pub fn _0(self) -> &'a mut W {
1022        self.variant(PWRUP_CMPSW::_0)
1023    }
1024    #[doc = "Enables the VBUS_VALID comparator (default)"]
1025    #[inline]
1026    pub fn _1(self) -> &'a mut W {
1027        self.variant(PWRUP_CMPSW::_1)
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 = 20;
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 `DISCHARGE_VBUS`"]
1048pub enum DISCHARGE_VBUSW {
1049    #[doc = "VBUS discharge resistor is disabled (Default)"]
1050    _0,
1051    #[doc = "VBUS discharge resistor is enabled"]
1052    _1,
1053}
1054impl DISCHARGE_VBUSW {
1055    #[allow(missing_docs)]
1056    #[doc(hidden)]
1057    #[inline]
1058    pub fn _bits(&self) -> bool {
1059        match *self {
1060            DISCHARGE_VBUSW::_0 => false,
1061            DISCHARGE_VBUSW::_1 => true,
1062        }
1063    }
1064}
1065#[doc = r" Proxy"]
1066pub struct _DISCHARGE_VBUSW<'a> {
1067    w: &'a mut W,
1068}
1069impl<'a> _DISCHARGE_VBUSW<'a> {
1070    #[doc = r" Writes `variant` to the field"]
1071    #[inline]
1072    pub fn variant(self, variant: DISCHARGE_VBUSW) -> &'a mut W {
1073        {
1074            self.bit(variant._bits())
1075        }
1076    }
1077    #[doc = "VBUS discharge resistor is disabled (Default)"]
1078    #[inline]
1079    pub fn _0(self) -> &'a mut W {
1080        self.variant(DISCHARGE_VBUSW::_0)
1081    }
1082    #[doc = "VBUS discharge resistor is enabled"]
1083    #[inline]
1084    pub fn _1(self) -> &'a mut W {
1085        self.variant(DISCHARGE_VBUSW::_1)
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 = 26;
1100        self.w.bits &= !((MASK as u32) << OFFSET);
1101        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1102        self.w
1103    }
1104}
1105#[doc = "Values that can be written to the field `EN_CHARGER_RESISTOR`"]
1106pub enum EN_CHARGER_RESISTORW {
1107    #[doc = "Disable resistive charger detection resistors on USB_DP and USB_DP"]
1108    _0,
1109    #[doc = "Enable resistive charger detection resistors on USB_DP and USB_DP"]
1110    _1,
1111}
1112impl EN_CHARGER_RESISTORW {
1113    #[allow(missing_docs)]
1114    #[doc(hidden)]
1115    #[inline]
1116    pub fn _bits(&self) -> bool {
1117        match *self {
1118            EN_CHARGER_RESISTORW::_0 => false,
1119            EN_CHARGER_RESISTORW::_1 => true,
1120        }
1121    }
1122}
1123#[doc = r" Proxy"]
1124pub struct _EN_CHARGER_RESISTORW<'a> {
1125    w: &'a mut W,
1126}
1127impl<'a> _EN_CHARGER_RESISTORW<'a> {
1128    #[doc = r" Writes `variant` to the field"]
1129    #[inline]
1130    pub fn variant(self, variant: EN_CHARGER_RESISTORW) -> &'a mut W {
1131        {
1132            self.bit(variant._bits())
1133        }
1134    }
1135    #[doc = "Disable resistive charger detection resistors on USB_DP and USB_DP"]
1136    #[inline]
1137    pub fn _0(self) -> &'a mut W {
1138        self.variant(EN_CHARGER_RESISTORW::_0)
1139    }
1140    #[doc = "Enable resistive charger detection resistors on USB_DP and USB_DP"]
1141    #[inline]
1142    pub fn _1(self) -> &'a mut W {
1143        self.variant(EN_CHARGER_RESISTORW::_1)
1144    }
1145    #[doc = r" Sets the field bit"]
1146    pub fn set_bit(self) -> &'a mut W {
1147        self.bit(true)
1148    }
1149    #[doc = r" Clears the field bit"]
1150    pub fn clear_bit(self) -> &'a mut W {
1151        self.bit(false)
1152    }
1153    #[doc = r" Writes raw bits to the field"]
1154    #[inline]
1155    pub fn bit(self, value: bool) -> &'a mut W {
1156        const MASK: bool = true;
1157        const OFFSET: u8 = 31;
1158        self.w.bits &= !((MASK as u32) << OFFSET);
1159        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1160        self.w
1161    }
1162}
1163impl R {
1164    #[doc = r" Value of the register as raw bits"]
1165    #[inline]
1166    pub fn bits(&self) -> u32 {
1167        self.bits
1168    }
1169    #[doc = "Bits 0:2 - Sets the threshold for the VBUSVALID comparator"]
1170    #[inline]
1171    pub fn vbusvalid_thresh(&self) -> VBUSVALID_THRESHR {
1172        VBUSVALID_THRESHR::_from({
1173            const MASK: u8 = 7;
1174            const OFFSET: u8 = 0;
1175            ((self.bits >> OFFSET) & MASK as u32) as u8
1176        })
1177    }
1178    #[doc = "Bit 3 - VBUS detect signal override enable"]
1179    #[inline]
1180    pub fn vbus_override_en(&self) -> VBUS_OVERRIDE_ENR {
1181        VBUS_OVERRIDE_ENR::_from({
1182            const MASK: bool = true;
1183            const OFFSET: u8 = 3;
1184            ((self.bits >> OFFSET) & MASK as u32) != 0
1185        })
1186    }
1187    #[doc = "Bit 4 - Override value for SESSEND"]
1188    #[inline]
1189    pub fn sessend_override(&self) -> SESSEND_OVERRIDER {
1190        let bits = {
1191            const MASK: bool = true;
1192            const OFFSET: u8 = 4;
1193            ((self.bits >> OFFSET) & MASK as u32) != 0
1194        };
1195        SESSEND_OVERRIDER { bits }
1196    }
1197    #[doc = "Bit 5 - Override value for B-Device Session Valid"]
1198    #[inline]
1199    pub fn bvalid_override(&self) -> BVALID_OVERRIDER {
1200        let bits = {
1201            const MASK: bool = true;
1202            const OFFSET: u8 = 5;
1203            ((self.bits >> OFFSET) & MASK as u32) != 0
1204        };
1205        BVALID_OVERRIDER { bits }
1206    }
1207    #[doc = "Bit 6 - Override value for A-Device Session Valid"]
1208    #[inline]
1209    pub fn avalid_override(&self) -> AVALID_OVERRIDER {
1210        let bits = {
1211            const MASK: bool = true;
1212            const OFFSET: u8 = 6;
1213            ((self.bits >> OFFSET) & MASK as u32) != 0
1214        };
1215        AVALID_OVERRIDER { bits }
1216    }
1217    #[doc = "Bit 7 - Override value for VBUS_VALID signal sent to USB controller"]
1218    #[inline]
1219    pub fn vbusvalid_override(&self) -> VBUSVALID_OVERRIDER {
1220        let bits = {
1221            const MASK: bool = true;
1222            const OFFSET: u8 = 7;
1223            ((self.bits >> OFFSET) & MASK as u32) != 0
1224        };
1225        VBUSVALID_OVERRIDER { bits }
1226    }
1227    #[doc = "Bit 8 - Selects the source of the VBUS_VALID signal reported to the USB controller"]
1228    #[inline]
1229    pub fn vbusvalid_sel(&self) -> VBUSVALID_SELR {
1230        VBUSVALID_SELR::_from({
1231            const MASK: bool = true;
1232            const OFFSET: u8 = 8;
1233            ((self.bits >> OFFSET) & MASK as u32) != 0
1234        })
1235    }
1236    #[doc = "Bits 9:10 - Selects the source of the VBUS_VALID signal reported to the USB controller"]
1237    #[inline]
1238    pub fn vbus_source_sel(&self) -> VBUS_SOURCE_SELR {
1239        VBUS_SOURCE_SELR::_from({
1240            const MASK: u8 = 3;
1241            const OFFSET: u8 = 9;
1242            ((self.bits >> OFFSET) & MASK as u32) as u8
1243        })
1244    }
1245    #[doc = "Bit 18 - Selects the comparator used for VBUS_VALID"]
1246    #[inline]
1247    pub fn vbusvalid_to_sessvalid(&self) -> VBUSVALID_TO_SESSVALIDR {
1248        VBUSVALID_TO_SESSVALIDR::_from({
1249            const MASK: bool = true;
1250            const OFFSET: u8 = 18;
1251            ((self.bits >> OFFSET) & MASK as u32) != 0
1252        })
1253    }
1254    #[doc = "Bit 20 - Enables the VBUS_VALID comparator"]
1255    #[inline]
1256    pub fn pwrup_cmps(&self) -> PWRUP_CMPSR {
1257        PWRUP_CMPSR::_from({
1258            const MASK: bool = true;
1259            const OFFSET: u8 = 20;
1260            ((self.bits >> OFFSET) & MASK as u32) != 0
1261        })
1262    }
1263    #[doc = "Bit 26 - Controls VBUS discharge resistor"]
1264    #[inline]
1265    pub fn discharge_vbus(&self) -> DISCHARGE_VBUSR {
1266        DISCHARGE_VBUSR::_from({
1267            const MASK: bool = true;
1268            const OFFSET: u8 = 26;
1269            ((self.bits >> OFFSET) & MASK as u32) != 0
1270        })
1271    }
1272    #[doc = "Bit 31 - Enables resistors used for an older method of resistive battery charger detection"]
1273    #[inline]
1274    pub fn en_charger_resistor(&self) -> EN_CHARGER_RESISTORR {
1275        EN_CHARGER_RESISTORR::_from({
1276            const MASK: bool = true;
1277            const OFFSET: u8 = 31;
1278            ((self.bits >> OFFSET) & MASK as u32) != 0
1279        })
1280    }
1281}
1282impl W {
1283    #[doc = r" Reset value of the register"]
1284    #[inline]
1285    pub fn reset_value() -> W {
1286        W { bits: 7340036 }
1287    }
1288    #[doc = r" Writes raw bits to the register"]
1289    #[inline]
1290    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1291        self.bits = bits;
1292        self
1293    }
1294    #[doc = "Bits 0:2 - Sets the threshold for the VBUSVALID comparator"]
1295    #[inline]
1296    pub fn vbusvalid_thresh(&mut self) -> _VBUSVALID_THRESHW {
1297        _VBUSVALID_THRESHW { w: self }
1298    }
1299    #[doc = "Bit 3 - VBUS detect signal override enable"]
1300    #[inline]
1301    pub fn vbus_override_en(&mut self) -> _VBUS_OVERRIDE_ENW {
1302        _VBUS_OVERRIDE_ENW { w: self }
1303    }
1304    #[doc = "Bit 4 - Override value for SESSEND"]
1305    #[inline]
1306    pub fn sessend_override(&mut self) -> _SESSEND_OVERRIDEW {
1307        _SESSEND_OVERRIDEW { w: self }
1308    }
1309    #[doc = "Bit 5 - Override value for B-Device Session Valid"]
1310    #[inline]
1311    pub fn bvalid_override(&mut self) -> _BVALID_OVERRIDEW {
1312        _BVALID_OVERRIDEW { w: self }
1313    }
1314    #[doc = "Bit 6 - Override value for A-Device Session Valid"]
1315    #[inline]
1316    pub fn avalid_override(&mut self) -> _AVALID_OVERRIDEW {
1317        _AVALID_OVERRIDEW { w: self }
1318    }
1319    #[doc = "Bit 7 - Override value for VBUS_VALID signal sent to USB controller"]
1320    #[inline]
1321    pub fn vbusvalid_override(&mut self) -> _VBUSVALID_OVERRIDEW {
1322        _VBUSVALID_OVERRIDEW { w: self }
1323    }
1324    #[doc = "Bit 8 - Selects the source of the VBUS_VALID signal reported to the USB controller"]
1325    #[inline]
1326    pub fn vbusvalid_sel(&mut self) -> _VBUSVALID_SELW {
1327        _VBUSVALID_SELW { w: self }
1328    }
1329    #[doc = "Bits 9:10 - Selects the source of the VBUS_VALID signal reported to the USB controller"]
1330    #[inline]
1331    pub fn vbus_source_sel(&mut self) -> _VBUS_SOURCE_SELW {
1332        _VBUS_SOURCE_SELW { w: self }
1333    }
1334    #[doc = "Bit 18 - Selects the comparator used for VBUS_VALID"]
1335    #[inline]
1336    pub fn vbusvalid_to_sessvalid(&mut self) -> _VBUSVALID_TO_SESSVALIDW {
1337        _VBUSVALID_TO_SESSVALIDW { w: self }
1338    }
1339    #[doc = "Bit 20 - Enables the VBUS_VALID comparator"]
1340    #[inline]
1341    pub fn pwrup_cmps(&mut self) -> _PWRUP_CMPSW {
1342        _PWRUP_CMPSW { w: self }
1343    }
1344    #[doc = "Bit 26 - Controls VBUS discharge resistor"]
1345    #[inline]
1346    pub fn discharge_vbus(&mut self) -> _DISCHARGE_VBUSW {
1347        _DISCHARGE_VBUSW { w: self }
1348    }
1349    #[doc = "Bit 31 - Enables resistors used for an older method of resistive battery charger detection"]
1350    #[inline]
1351    pub fn en_charger_resistor(&mut self) -> _EN_CHARGER_RESISTORW {
1352        _EN_CHARGER_RESISTORW { w: self }
1353    }
1354}