esp32s2/usb0/
ghwcfg4.rs

1#[doc = "Register `GHWCFG4` reader"]
2pub type R = crate::R<GHWCFG4_SPEC>;
3#[doc = "Field `G_NUMDEVPERIOEPS` reader - "]
4pub type G_NUMDEVPERIOEPS_R = crate::FieldReader;
5#[doc = "Field `G_PARTIALPWRDN` reader - "]
6pub type G_PARTIALPWRDN_R = crate::BitReader;
7#[doc = "Field `G_AHBFREQ` reader - "]
8pub type G_AHBFREQ_R = crate::BitReader;
9#[doc = "Field `G_HIBERNATION` reader - "]
10pub type G_HIBERNATION_R = crate::BitReader;
11#[doc = "Field `G_EXTENDEDHIBERNATION` reader - "]
12pub type G_EXTENDEDHIBERNATION_R = crate::BitReader;
13#[doc = "Field `G_ACGSUPT` reader - "]
14pub type G_ACGSUPT_R = crate::BitReader;
15#[doc = "Field `G_ENHANCEDLPMSUPT` reader - "]
16pub type G_ENHANCEDLPMSUPT_R = crate::BitReader;
17#[doc = "Field `G_PHYDATAWIDTH` reader - "]
18pub type G_PHYDATAWIDTH_R = crate::FieldReader;
19#[doc = "Field `G_NUMCTLEPS` reader - "]
20pub type G_NUMCTLEPS_R = crate::FieldReader;
21#[doc = "Field `G_IDDQFLTR` reader - "]
22pub type G_IDDQFLTR_R = crate::BitReader;
23#[doc = "Field `G_VBUSVALIDFLTR` reader - "]
24pub type G_VBUSVALIDFLTR_R = crate::BitReader;
25#[doc = "Field `G_AVALIDFLTR` reader - "]
26pub type G_AVALIDFLTR_R = crate::BitReader;
27#[doc = "Field `G_BVALIDFLTR` reader - "]
28pub type G_BVALIDFLTR_R = crate::BitReader;
29#[doc = "Field `G_SESSENDFLTR` reader - "]
30pub type G_SESSENDFLTR_R = crate::BitReader;
31#[doc = "Field `G_DEDFIFOMODE` reader - "]
32pub type G_DEDFIFOMODE_R = crate::BitReader;
33#[doc = "Field `G_INEPS` reader - "]
34pub type G_INEPS_R = crate::FieldReader;
35#[doc = "Field `G_DESCDMAENABLED` reader - "]
36pub type G_DESCDMAENABLED_R = crate::BitReader;
37#[doc = "Field `G_DESCDMA` reader - "]
38pub type G_DESCDMA_R = crate::BitReader;
39impl R {
40    #[doc = "Bits 0:3"]
41    #[inline(always)]
42    pub fn g_numdevperioeps(&self) -> G_NUMDEVPERIOEPS_R {
43        G_NUMDEVPERIOEPS_R::new((self.bits & 0x0f) as u8)
44    }
45    #[doc = "Bit 4"]
46    #[inline(always)]
47    pub fn g_partialpwrdn(&self) -> G_PARTIALPWRDN_R {
48        G_PARTIALPWRDN_R::new(((self.bits >> 4) & 1) != 0)
49    }
50    #[doc = "Bit 5"]
51    #[inline(always)]
52    pub fn g_ahbfreq(&self) -> G_AHBFREQ_R {
53        G_AHBFREQ_R::new(((self.bits >> 5) & 1) != 0)
54    }
55    #[doc = "Bit 6"]
56    #[inline(always)]
57    pub fn g_hibernation(&self) -> G_HIBERNATION_R {
58        G_HIBERNATION_R::new(((self.bits >> 6) & 1) != 0)
59    }
60    #[doc = "Bit 7"]
61    #[inline(always)]
62    pub fn g_extendedhibernation(&self) -> G_EXTENDEDHIBERNATION_R {
63        G_EXTENDEDHIBERNATION_R::new(((self.bits >> 7) & 1) != 0)
64    }
65    #[doc = "Bit 12"]
66    #[inline(always)]
67    pub fn g_acgsupt(&self) -> G_ACGSUPT_R {
68        G_ACGSUPT_R::new(((self.bits >> 12) & 1) != 0)
69    }
70    #[doc = "Bit 13"]
71    #[inline(always)]
72    pub fn g_enhancedlpmsupt(&self) -> G_ENHANCEDLPMSUPT_R {
73        G_ENHANCEDLPMSUPT_R::new(((self.bits >> 13) & 1) != 0)
74    }
75    #[doc = "Bits 14:15"]
76    #[inline(always)]
77    pub fn g_phydatawidth(&self) -> G_PHYDATAWIDTH_R {
78        G_PHYDATAWIDTH_R::new(((self.bits >> 14) & 3) as u8)
79    }
80    #[doc = "Bits 16:19"]
81    #[inline(always)]
82    pub fn g_numctleps(&self) -> G_NUMCTLEPS_R {
83        G_NUMCTLEPS_R::new(((self.bits >> 16) & 0x0f) as u8)
84    }
85    #[doc = "Bit 20"]
86    #[inline(always)]
87    pub fn g_iddqfltr(&self) -> G_IDDQFLTR_R {
88        G_IDDQFLTR_R::new(((self.bits >> 20) & 1) != 0)
89    }
90    #[doc = "Bit 21"]
91    #[inline(always)]
92    pub fn g_vbusvalidfltr(&self) -> G_VBUSVALIDFLTR_R {
93        G_VBUSVALIDFLTR_R::new(((self.bits >> 21) & 1) != 0)
94    }
95    #[doc = "Bit 22"]
96    #[inline(always)]
97    pub fn g_avalidfltr(&self) -> G_AVALIDFLTR_R {
98        G_AVALIDFLTR_R::new(((self.bits >> 22) & 1) != 0)
99    }
100    #[doc = "Bit 23"]
101    #[inline(always)]
102    pub fn g_bvalidfltr(&self) -> G_BVALIDFLTR_R {
103        G_BVALIDFLTR_R::new(((self.bits >> 23) & 1) != 0)
104    }
105    #[doc = "Bit 24"]
106    #[inline(always)]
107    pub fn g_sessendfltr(&self) -> G_SESSENDFLTR_R {
108        G_SESSENDFLTR_R::new(((self.bits >> 24) & 1) != 0)
109    }
110    #[doc = "Bit 25"]
111    #[inline(always)]
112    pub fn g_dedfifomode(&self) -> G_DEDFIFOMODE_R {
113        G_DEDFIFOMODE_R::new(((self.bits >> 25) & 1) != 0)
114    }
115    #[doc = "Bits 26:29"]
116    #[inline(always)]
117    pub fn g_ineps(&self) -> G_INEPS_R {
118        G_INEPS_R::new(((self.bits >> 26) & 0x0f) as u8)
119    }
120    #[doc = "Bit 30"]
121    #[inline(always)]
122    pub fn g_descdmaenabled(&self) -> G_DESCDMAENABLED_R {
123        G_DESCDMAENABLED_R::new(((self.bits >> 30) & 1) != 0)
124    }
125    #[doc = "Bit 31"]
126    #[inline(always)]
127    pub fn g_descdma(&self) -> G_DESCDMA_R {
128        G_DESCDMA_R::new(((self.bits >> 31) & 1) != 0)
129    }
130}
131#[cfg(feature = "impl-register-debug")]
132impl core::fmt::Debug for R {
133    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
134        f.debug_struct("GHWCFG4")
135            .field("g_numdevperioeps", &self.g_numdevperioeps())
136            .field("g_partialpwrdn", &self.g_partialpwrdn())
137            .field("g_ahbfreq", &self.g_ahbfreq())
138            .field("g_hibernation", &self.g_hibernation())
139            .field("g_extendedhibernation", &self.g_extendedhibernation())
140            .field("g_acgsupt", &self.g_acgsupt())
141            .field("g_enhancedlpmsupt", &self.g_enhancedlpmsupt())
142            .field("g_phydatawidth", &self.g_phydatawidth())
143            .field("g_numctleps", &self.g_numctleps())
144            .field("g_iddqfltr", &self.g_iddqfltr())
145            .field("g_vbusvalidfltr", &self.g_vbusvalidfltr())
146            .field("g_avalidfltr", &self.g_avalidfltr())
147            .field("g_bvalidfltr", &self.g_bvalidfltr())
148            .field("g_sessendfltr", &self.g_sessendfltr())
149            .field("g_dedfifomode", &self.g_dedfifomode())
150            .field("g_ineps", &self.g_ineps())
151            .field("g_descdmaenabled", &self.g_descdmaenabled())
152            .field("g_descdma", &self.g_descdma())
153            .finish()
154    }
155}
156#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`ghwcfg4::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
157pub struct GHWCFG4_SPEC;
158impl crate::RegisterSpec for GHWCFG4_SPEC {
159    type Ux = u32;
160}
161#[doc = "`read()` method returns [`ghwcfg4::R`](R) reader structure"]
162impl crate::Readable for GHWCFG4_SPEC {}
163#[doc = "`reset()` method sets GHWCFG4 to value 0xd3f0_a030"]
164impl crate::Resettable for GHWCFG4_SPEC {
165    const RESET_VALUE: u32 = 0xd3f0_a030;
166}