lpc55_pac/usbphy/
pwd_clr.rs

1#[doc = "Register `PWD_CLR` reader"]
2pub struct R(crate::R<PWD_CLR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PWD_CLR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PWD_CLR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PWD_CLR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PWD_CLR` writer"]
17pub struct W(crate::W<PWD_CLR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PWD_CLR_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<PWD_CLR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PWD_CLR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled\n\nValue on reset: 1"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum TXPWDFS_A {
40    #[doc = "0: Normal operation."]
41    VALUE0 = 0,
42    #[doc = "1: Power-down the USB full-speed drivers. This turns off the current starvation sources and puts the"]
43    VALUE1 = 1,
44}
45impl From<TXPWDFS_A> for bool {
46    #[inline(always)]
47    fn from(variant: TXPWDFS_A) -> Self {
48        variant as u8 != 0
49    }
50}
51#[doc = "Field `TXPWDFS` reader - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
52pub struct TXPWDFS_R(crate::FieldReader<bool, TXPWDFS_A>);
53impl TXPWDFS_R {
54    #[inline(always)]
55    pub(crate) fn new(bits: bool) -> Self {
56        TXPWDFS_R(crate::FieldReader::new(bits))
57    }
58    #[doc = r"Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> TXPWDFS_A {
61        match self.bits {
62            false => TXPWDFS_A::VALUE0,
63            true => TXPWDFS_A::VALUE1,
64        }
65    }
66    #[doc = "Checks if the value of the field is `VALUE0`"]
67    #[inline(always)]
68    pub fn is_value0(&self) -> bool {
69        **self == TXPWDFS_A::VALUE0
70    }
71    #[doc = "Checks if the value of the field is `VALUE1`"]
72    #[inline(always)]
73    pub fn is_value1(&self) -> bool {
74        **self == TXPWDFS_A::VALUE1
75    }
76}
77impl core::ops::Deref for TXPWDFS_R {
78    type Target = crate::FieldReader<bool, TXPWDFS_A>;
79    #[inline(always)]
80    fn deref(&self) -> &Self::Target {
81        &self.0
82    }
83}
84#[doc = "Field `TXPWDFS` writer - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
85pub struct TXPWDFS_W<'a> {
86    w: &'a mut W,
87}
88impl<'a> TXPWDFS_W<'a> {
89    #[doc = r"Writes `variant` to the field"]
90    #[inline(always)]
91    pub fn variant(self, variant: TXPWDFS_A) -> &'a mut W {
92        self.bit(variant.into())
93    }
94    #[doc = "Normal operation."]
95    #[inline(always)]
96    pub fn value0(self) -> &'a mut W {
97        self.variant(TXPWDFS_A::VALUE0)
98    }
99    #[doc = "Power-down the USB full-speed drivers. This turns off the current starvation sources and puts the"]
100    #[inline(always)]
101    pub fn value1(self) -> &'a mut W {
102        self.variant(TXPWDFS_A::VALUE1)
103    }
104    #[doc = r"Sets the field bit"]
105    #[inline(always)]
106    pub fn set_bit(self) -> &'a mut W {
107        self.bit(true)
108    }
109    #[doc = r"Clears the field bit"]
110    #[inline(always)]
111    pub fn clear_bit(self) -> &'a mut W {
112        self.bit(false)
113    }
114    #[doc = r"Writes raw bits to the field"]
115    #[inline(always)]
116    pub fn bit(self, value: bool) -> &'a mut W {
117        self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10);
118        self.w
119    }
120}
121#[doc = "Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled\n\nValue on reset: 1"]
122#[derive(Clone, Copy, Debug, PartialEq)]
123pub enum TXPWDIBIAS_A {
124    #[doc = "0: Normal operation."]
125    VALUE0 = 0,
126    #[doc = "1: Power-down the USB PHY current bias block for the transmitter. This bit should be set only when the"]
127    VALUE1 = 1,
128}
129impl From<TXPWDIBIAS_A> for bool {
130    #[inline(always)]
131    fn from(variant: TXPWDIBIAS_A) -> Self {
132        variant as u8 != 0
133    }
134}
135#[doc = "Field `TXPWDIBIAS` reader - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
136pub struct TXPWDIBIAS_R(crate::FieldReader<bool, TXPWDIBIAS_A>);
137impl TXPWDIBIAS_R {
138    #[inline(always)]
139    pub(crate) fn new(bits: bool) -> Self {
140        TXPWDIBIAS_R(crate::FieldReader::new(bits))
141    }
142    #[doc = r"Get enumerated values variant"]
143    #[inline(always)]
144    pub fn variant(&self) -> TXPWDIBIAS_A {
145        match self.bits {
146            false => TXPWDIBIAS_A::VALUE0,
147            true => TXPWDIBIAS_A::VALUE1,
148        }
149    }
150    #[doc = "Checks if the value of the field is `VALUE0`"]
151    #[inline(always)]
152    pub fn is_value0(&self) -> bool {
153        **self == TXPWDIBIAS_A::VALUE0
154    }
155    #[doc = "Checks if the value of the field is `VALUE1`"]
156    #[inline(always)]
157    pub fn is_value1(&self) -> bool {
158        **self == TXPWDIBIAS_A::VALUE1
159    }
160}
161impl core::ops::Deref for TXPWDIBIAS_R {
162    type Target = crate::FieldReader<bool, TXPWDIBIAS_A>;
163    #[inline(always)]
164    fn deref(&self) -> &Self::Target {
165        &self.0
166    }
167}
168#[doc = "Field `TXPWDIBIAS` writer - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
169pub struct TXPWDIBIAS_W<'a> {
170    w: &'a mut W,
171}
172impl<'a> TXPWDIBIAS_W<'a> {
173    #[doc = r"Writes `variant` to the field"]
174    #[inline(always)]
175    pub fn variant(self, variant: TXPWDIBIAS_A) -> &'a mut W {
176        self.bit(variant.into())
177    }
178    #[doc = "Normal operation."]
179    #[inline(always)]
180    pub fn value0(self) -> &'a mut W {
181        self.variant(TXPWDIBIAS_A::VALUE0)
182    }
183    #[doc = "Power-down the USB PHY current bias block for the transmitter. This bit should be set only when the"]
184    #[inline(always)]
185    pub fn value1(self) -> &'a mut W {
186        self.variant(TXPWDIBIAS_A::VALUE1)
187    }
188    #[doc = r"Sets the field bit"]
189    #[inline(always)]
190    pub fn set_bit(self) -> &'a mut W {
191        self.bit(true)
192    }
193    #[doc = r"Clears the field bit"]
194    #[inline(always)]
195    pub fn clear_bit(self) -> &'a mut W {
196        self.bit(false)
197    }
198    #[doc = r"Writes raw bits to the field"]
199    #[inline(always)]
200    pub fn bit(self, value: bool) -> &'a mut W {
201        self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11);
202        self.w
203    }
204}
205#[doc = "Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled\n\nValue on reset: 1"]
206#[derive(Clone, Copy, Debug, PartialEq)]
207pub enum TXPWDV2I_A {
208    #[doc = "0: Normal operation."]
209    VALUE0 = 0,
210    #[doc = "1: Power-down the USB PHY transmit V-to-I converter and the current mirror"]
211    VALUE1 = 1,
212}
213impl From<TXPWDV2I_A> for bool {
214    #[inline(always)]
215    fn from(variant: TXPWDV2I_A) -> Self {
216        variant as u8 != 0
217    }
218}
219#[doc = "Field `TXPWDV2I` reader - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
220pub struct TXPWDV2I_R(crate::FieldReader<bool, TXPWDV2I_A>);
221impl TXPWDV2I_R {
222    #[inline(always)]
223    pub(crate) fn new(bits: bool) -> Self {
224        TXPWDV2I_R(crate::FieldReader::new(bits))
225    }
226    #[doc = r"Get enumerated values variant"]
227    #[inline(always)]
228    pub fn variant(&self) -> TXPWDV2I_A {
229        match self.bits {
230            false => TXPWDV2I_A::VALUE0,
231            true => TXPWDV2I_A::VALUE1,
232        }
233    }
234    #[doc = "Checks if the value of the field is `VALUE0`"]
235    #[inline(always)]
236    pub fn is_value0(&self) -> bool {
237        **self == TXPWDV2I_A::VALUE0
238    }
239    #[doc = "Checks if the value of the field is `VALUE1`"]
240    #[inline(always)]
241    pub fn is_value1(&self) -> bool {
242        **self == TXPWDV2I_A::VALUE1
243    }
244}
245impl core::ops::Deref for TXPWDV2I_R {
246    type Target = crate::FieldReader<bool, TXPWDV2I_A>;
247    #[inline(always)]
248    fn deref(&self) -> &Self::Target {
249        &self.0
250    }
251}
252#[doc = "Field `TXPWDV2I` writer - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
253pub struct TXPWDV2I_W<'a> {
254    w: &'a mut W,
255}
256impl<'a> TXPWDV2I_W<'a> {
257    #[doc = r"Writes `variant` to the field"]
258    #[inline(always)]
259    pub fn variant(self, variant: TXPWDV2I_A) -> &'a mut W {
260        self.bit(variant.into())
261    }
262    #[doc = "Normal operation."]
263    #[inline(always)]
264    pub fn value0(self) -> &'a mut W {
265        self.variant(TXPWDV2I_A::VALUE0)
266    }
267    #[doc = "Power-down the USB PHY transmit V-to-I converter and the current mirror"]
268    #[inline(always)]
269    pub fn value1(self) -> &'a mut W {
270        self.variant(TXPWDV2I_A::VALUE1)
271    }
272    #[doc = r"Sets the field bit"]
273    #[inline(always)]
274    pub fn set_bit(self) -> &'a mut W {
275        self.bit(true)
276    }
277    #[doc = r"Clears the field bit"]
278    #[inline(always)]
279    pub fn clear_bit(self) -> &'a mut W {
280        self.bit(false)
281    }
282    #[doc = r"Writes raw bits to the field"]
283    #[inline(always)]
284    pub fn bit(self, value: bool) -> &'a mut W {
285        self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12);
286        self.w
287    }
288}
289#[doc = "Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled\n\nValue on reset: 1"]
290#[derive(Clone, Copy, Debug, PartialEq)]
291pub enum RXPWDENV_A {
292    #[doc = "0: Normal operation."]
293    VALUE0 = 0,
294    #[doc = "1: Power-down the USB high-speed receiver envelope detector (squelch signal)"]
295    VALUE1 = 1,
296}
297impl From<RXPWDENV_A> for bool {
298    #[inline(always)]
299    fn from(variant: RXPWDENV_A) -> Self {
300        variant as u8 != 0
301    }
302}
303#[doc = "Field `RXPWDENV` reader - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
304pub struct RXPWDENV_R(crate::FieldReader<bool, RXPWDENV_A>);
305impl RXPWDENV_R {
306    #[inline(always)]
307    pub(crate) fn new(bits: bool) -> Self {
308        RXPWDENV_R(crate::FieldReader::new(bits))
309    }
310    #[doc = r"Get enumerated values variant"]
311    #[inline(always)]
312    pub fn variant(&self) -> RXPWDENV_A {
313        match self.bits {
314            false => RXPWDENV_A::VALUE0,
315            true => RXPWDENV_A::VALUE1,
316        }
317    }
318    #[doc = "Checks if the value of the field is `VALUE0`"]
319    #[inline(always)]
320    pub fn is_value0(&self) -> bool {
321        **self == RXPWDENV_A::VALUE0
322    }
323    #[doc = "Checks if the value of the field is `VALUE1`"]
324    #[inline(always)]
325    pub fn is_value1(&self) -> bool {
326        **self == RXPWDENV_A::VALUE1
327    }
328}
329impl core::ops::Deref for RXPWDENV_R {
330    type Target = crate::FieldReader<bool, RXPWDENV_A>;
331    #[inline(always)]
332    fn deref(&self) -> &Self::Target {
333        &self.0
334    }
335}
336#[doc = "Field `RXPWDENV` writer - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
337pub struct RXPWDENV_W<'a> {
338    w: &'a mut W,
339}
340impl<'a> RXPWDENV_W<'a> {
341    #[doc = r"Writes `variant` to the field"]
342    #[inline(always)]
343    pub fn variant(self, variant: RXPWDENV_A) -> &'a mut W {
344        self.bit(variant.into())
345    }
346    #[doc = "Normal operation."]
347    #[inline(always)]
348    pub fn value0(self) -> &'a mut W {
349        self.variant(RXPWDENV_A::VALUE0)
350    }
351    #[doc = "Power-down the USB high-speed receiver envelope detector (squelch signal)"]
352    #[inline(always)]
353    pub fn value1(self) -> &'a mut W {
354        self.variant(RXPWDENV_A::VALUE1)
355    }
356    #[doc = r"Sets the field bit"]
357    #[inline(always)]
358    pub fn set_bit(self) -> &'a mut W {
359        self.bit(true)
360    }
361    #[doc = r"Clears the field bit"]
362    #[inline(always)]
363    pub fn clear_bit(self) -> &'a mut W {
364        self.bit(false)
365    }
366    #[doc = r"Writes raw bits to the field"]
367    #[inline(always)]
368    pub fn bit(self, value: bool) -> &'a mut W {
369        self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17);
370        self.w
371    }
372}
373#[doc = "Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled\n\nValue on reset: 1"]
374#[derive(Clone, Copy, Debug, PartialEq)]
375pub enum RXPWD1PT1_A {
376    #[doc = "0: Normal operation."]
377    VALUE0 = 0,
378    #[doc = "1: Power-down the USB full-speed differential receiver."]
379    VALUE1 = 1,
380}
381impl From<RXPWD1PT1_A> for bool {
382    #[inline(always)]
383    fn from(variant: RXPWD1PT1_A) -> Self {
384        variant as u8 != 0
385    }
386}
387#[doc = "Field `RXPWD1PT1` reader - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
388pub struct RXPWD1PT1_R(crate::FieldReader<bool, RXPWD1PT1_A>);
389impl RXPWD1PT1_R {
390    #[inline(always)]
391    pub(crate) fn new(bits: bool) -> Self {
392        RXPWD1PT1_R(crate::FieldReader::new(bits))
393    }
394    #[doc = r"Get enumerated values variant"]
395    #[inline(always)]
396    pub fn variant(&self) -> RXPWD1PT1_A {
397        match self.bits {
398            false => RXPWD1PT1_A::VALUE0,
399            true => RXPWD1PT1_A::VALUE1,
400        }
401    }
402    #[doc = "Checks if the value of the field is `VALUE0`"]
403    #[inline(always)]
404    pub fn is_value0(&self) -> bool {
405        **self == RXPWD1PT1_A::VALUE0
406    }
407    #[doc = "Checks if the value of the field is `VALUE1`"]
408    #[inline(always)]
409    pub fn is_value1(&self) -> bool {
410        **self == RXPWD1PT1_A::VALUE1
411    }
412}
413impl core::ops::Deref for RXPWD1PT1_R {
414    type Target = crate::FieldReader<bool, RXPWD1PT1_A>;
415    #[inline(always)]
416    fn deref(&self) -> &Self::Target {
417        &self.0
418    }
419}
420#[doc = "Field `RXPWD1PT1` writer - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
421pub struct RXPWD1PT1_W<'a> {
422    w: &'a mut W,
423}
424impl<'a> RXPWD1PT1_W<'a> {
425    #[doc = r"Writes `variant` to the field"]
426    #[inline(always)]
427    pub fn variant(self, variant: RXPWD1PT1_A) -> &'a mut W {
428        self.bit(variant.into())
429    }
430    #[doc = "Normal operation."]
431    #[inline(always)]
432    pub fn value0(self) -> &'a mut W {
433        self.variant(RXPWD1PT1_A::VALUE0)
434    }
435    #[doc = "Power-down the USB full-speed differential receiver."]
436    #[inline(always)]
437    pub fn value1(self) -> &'a mut W {
438        self.variant(RXPWD1PT1_A::VALUE1)
439    }
440    #[doc = r"Sets the field bit"]
441    #[inline(always)]
442    pub fn set_bit(self) -> &'a mut W {
443        self.bit(true)
444    }
445    #[doc = r"Clears the field bit"]
446    #[inline(always)]
447    pub fn clear_bit(self) -> &'a mut W {
448        self.bit(false)
449    }
450    #[doc = r"Writes raw bits to the field"]
451    #[inline(always)]
452    pub fn bit(self, value: bool) -> &'a mut W {
453        self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18);
454        self.w
455    }
456}
457#[doc = "Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled\n\nValue on reset: 1"]
458#[derive(Clone, Copy, Debug, PartialEq)]
459pub enum RXPWDDIFF_A {
460    #[doc = "0: Normal operation."]
461    VALUE0 = 0,
462    #[doc = "1: Power-down the USB high-speed differential receive"]
463    VALUE1 = 1,
464}
465impl From<RXPWDDIFF_A> for bool {
466    #[inline(always)]
467    fn from(variant: RXPWDDIFF_A) -> Self {
468        variant as u8 != 0
469    }
470}
471#[doc = "Field `RXPWDDIFF` reader - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
472pub struct RXPWDDIFF_R(crate::FieldReader<bool, RXPWDDIFF_A>);
473impl RXPWDDIFF_R {
474    #[inline(always)]
475    pub(crate) fn new(bits: bool) -> Self {
476        RXPWDDIFF_R(crate::FieldReader::new(bits))
477    }
478    #[doc = r"Get enumerated values variant"]
479    #[inline(always)]
480    pub fn variant(&self) -> RXPWDDIFF_A {
481        match self.bits {
482            false => RXPWDDIFF_A::VALUE0,
483            true => RXPWDDIFF_A::VALUE1,
484        }
485    }
486    #[doc = "Checks if the value of the field is `VALUE0`"]
487    #[inline(always)]
488    pub fn is_value0(&self) -> bool {
489        **self == RXPWDDIFF_A::VALUE0
490    }
491    #[doc = "Checks if the value of the field is `VALUE1`"]
492    #[inline(always)]
493    pub fn is_value1(&self) -> bool {
494        **self == RXPWDDIFF_A::VALUE1
495    }
496}
497impl core::ops::Deref for RXPWDDIFF_R {
498    type Target = crate::FieldReader<bool, RXPWDDIFF_A>;
499    #[inline(always)]
500    fn deref(&self) -> &Self::Target {
501        &self.0
502    }
503}
504#[doc = "Field `RXPWDDIFF` writer - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
505pub struct RXPWDDIFF_W<'a> {
506    w: &'a mut W,
507}
508impl<'a> RXPWDDIFF_W<'a> {
509    #[doc = r"Writes `variant` to the field"]
510    #[inline(always)]
511    pub fn variant(self, variant: RXPWDDIFF_A) -> &'a mut W {
512        self.bit(variant.into())
513    }
514    #[doc = "Normal operation."]
515    #[inline(always)]
516    pub fn value0(self) -> &'a mut W {
517        self.variant(RXPWDDIFF_A::VALUE0)
518    }
519    #[doc = "Power-down the USB high-speed differential receive"]
520    #[inline(always)]
521    pub fn value1(self) -> &'a mut W {
522        self.variant(RXPWDDIFF_A::VALUE1)
523    }
524    #[doc = r"Sets the field bit"]
525    #[inline(always)]
526    pub fn set_bit(self) -> &'a mut W {
527        self.bit(true)
528    }
529    #[doc = r"Clears the field bit"]
530    #[inline(always)]
531    pub fn clear_bit(self) -> &'a mut W {
532        self.bit(false)
533    }
534    #[doc = r"Writes raw bits to the field"]
535    #[inline(always)]
536    pub fn bit(self, value: bool) -> &'a mut W {
537        self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19);
538        self.w
539    }
540}
541#[doc = "This bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled\n\nValue on reset: 1"]
542#[derive(Clone, Copy, Debug, PartialEq)]
543pub enum RXPWDRX_A {
544    #[doc = "0: Normal operation."]
545    VALUE0 = 0,
546    #[doc = "1: Power-down the entire USB PHY receiver block except for the full-speed differential receiver"]
547    VALUE1 = 1,
548}
549impl From<RXPWDRX_A> for bool {
550    #[inline(always)]
551    fn from(variant: RXPWDRX_A) -> Self {
552        variant as u8 != 0
553    }
554}
555#[doc = "Field `RXPWDRX` reader - This bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
556pub struct RXPWDRX_R(crate::FieldReader<bool, RXPWDRX_A>);
557impl RXPWDRX_R {
558    #[inline(always)]
559    pub(crate) fn new(bits: bool) -> Self {
560        RXPWDRX_R(crate::FieldReader::new(bits))
561    }
562    #[doc = r"Get enumerated values variant"]
563    #[inline(always)]
564    pub fn variant(&self) -> RXPWDRX_A {
565        match self.bits {
566            false => RXPWDRX_A::VALUE0,
567            true => RXPWDRX_A::VALUE1,
568        }
569    }
570    #[doc = "Checks if the value of the field is `VALUE0`"]
571    #[inline(always)]
572    pub fn is_value0(&self) -> bool {
573        **self == RXPWDRX_A::VALUE0
574    }
575    #[doc = "Checks if the value of the field is `VALUE1`"]
576    #[inline(always)]
577    pub fn is_value1(&self) -> bool {
578        **self == RXPWDRX_A::VALUE1
579    }
580}
581impl core::ops::Deref for RXPWDRX_R {
582    type Target = crate::FieldReader<bool, RXPWDRX_A>;
583    #[inline(always)]
584    fn deref(&self) -> &Self::Target {
585        &self.0
586    }
587}
588#[doc = "Field `RXPWDRX` writer - This bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
589pub struct RXPWDRX_W<'a> {
590    w: &'a mut W,
591}
592impl<'a> RXPWDRX_W<'a> {
593    #[doc = r"Writes `variant` to the field"]
594    #[inline(always)]
595    pub fn variant(self, variant: RXPWDRX_A) -> &'a mut W {
596        self.bit(variant.into())
597    }
598    #[doc = "Normal operation."]
599    #[inline(always)]
600    pub fn value0(self) -> &'a mut W {
601        self.variant(RXPWDRX_A::VALUE0)
602    }
603    #[doc = "Power-down the entire USB PHY receiver block except for the full-speed differential receiver"]
604    #[inline(always)]
605    pub fn value1(self) -> &'a mut W {
606        self.variant(RXPWDRX_A::VALUE1)
607    }
608    #[doc = r"Sets the field bit"]
609    #[inline(always)]
610    pub fn set_bit(self) -> &'a mut W {
611        self.bit(true)
612    }
613    #[doc = r"Clears the field bit"]
614    #[inline(always)]
615    pub fn clear_bit(self) -> &'a mut W {
616        self.bit(false)
617    }
618    #[doc = r"Writes raw bits to the field"]
619    #[inline(always)]
620    pub fn bit(self, value: bool) -> &'a mut W {
621        self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20);
622        self.w
623    }
624}
625impl R {
626    #[doc = "Bit 10 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
627    #[inline(always)]
628    pub fn txpwdfs(&self) -> TXPWDFS_R {
629        TXPWDFS_R::new(((self.bits >> 10) & 0x01) != 0)
630    }
631    #[doc = "Bit 11 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
632    #[inline(always)]
633    pub fn txpwdibias(&self) -> TXPWDIBIAS_R {
634        TXPWDIBIAS_R::new(((self.bits >> 11) & 0x01) != 0)
635    }
636    #[doc = "Bit 12 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
637    #[inline(always)]
638    pub fn txpwdv2i(&self) -> TXPWDV2I_R {
639        TXPWDV2I_R::new(((self.bits >> 12) & 0x01) != 0)
640    }
641    #[doc = "Bit 17 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
642    #[inline(always)]
643    pub fn rxpwdenv(&self) -> RXPWDENV_R {
644        RXPWDENV_R::new(((self.bits >> 17) & 0x01) != 0)
645    }
646    #[doc = "Bit 18 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
647    #[inline(always)]
648    pub fn rxpwd1pt1(&self) -> RXPWD1PT1_R {
649        RXPWD1PT1_R::new(((self.bits >> 18) & 0x01) != 0)
650    }
651    #[doc = "Bit 19 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
652    #[inline(always)]
653    pub fn rxpwddiff(&self) -> RXPWDDIFF_R {
654        RXPWDDIFF_R::new(((self.bits >> 19) & 0x01) != 0)
655    }
656    #[doc = "Bit 20 - This bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
657    #[inline(always)]
658    pub fn rxpwdrx(&self) -> RXPWDRX_R {
659        RXPWDRX_R::new(((self.bits >> 20) & 0x01) != 0)
660    }
661}
662impl W {
663    #[doc = "Bit 10 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
664    #[inline(always)]
665    pub fn txpwdfs(&mut self) -> TXPWDFS_W {
666        TXPWDFS_W { w: self }
667    }
668    #[doc = "Bit 11 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
669    #[inline(always)]
670    pub fn txpwdibias(&mut self) -> TXPWDIBIAS_W {
671        TXPWDIBIAS_W { w: self }
672    }
673    #[doc = "Bit 12 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
674    #[inline(always)]
675    pub fn txpwdv2i(&mut self) -> TXPWDV2I_W {
676        TXPWDV2I_W { w: self }
677    }
678    #[doc = "Bit 17 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
679    #[inline(always)]
680    pub fn rxpwdenv(&mut self) -> RXPWDENV_W {
681        RXPWDENV_W { w: self }
682    }
683    #[doc = "Bit 18 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
684    #[inline(always)]
685    pub fn rxpwd1pt1(&mut self) -> RXPWD1PT1_W {
686        RXPWD1PT1_W { w: self }
687    }
688    #[doc = "Bit 19 - Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
689    #[inline(always)]
690    pub fn rxpwddiff(&mut self) -> RXPWDDIFF_W {
691        RXPWDDIFF_W { w: self }
692    }
693    #[doc = "Bit 20 - This bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of CTRL is enabled"]
694    #[inline(always)]
695    pub fn rxpwdrx(&mut self) -> RXPWDRX_W {
696        RXPWDRX_W { w: self }
697    }
698    #[doc = "Writes raw bits to the register."]
699    #[inline(always)]
700    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
701        self.0.bits(bits);
702        self
703    }
704}
705#[doc = "USB PHY Power-Down Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pwd_clr](index.html) module"]
706pub struct PWD_CLR_SPEC;
707impl crate::RegisterSpec for PWD_CLR_SPEC {
708    type Ux = u32;
709}
710#[doc = "`read()` method returns [pwd_clr::R](R) reader structure"]
711impl crate::Readable for PWD_CLR_SPEC {
712    type Reader = R;
713}
714#[doc = "`write(|w| ..)` method takes [pwd_clr::W](W) writer structure"]
715impl crate::Writable for PWD_CLR_SPEC {
716    type Writer = W;
717}
718#[doc = "`reset()` method sets PWD_CLR to value 0x001e_1c00"]
719impl crate::Resettable for PWD_CLR_SPEC {
720    #[inline(always)]
721    fn reset_value() -> Self::Ux {
722        0x001e_1c00
723    }
724}