esp32s2/rtc_cntl/
usb_conf.rs

1#[doc = "Register `USB_CONF` reader"]
2pub type R = crate::R<USB_CONF_SPEC>;
3#[doc = "Register `USB_CONF` writer"]
4pub type W = crate::W<USB_CONF_SPEC>;
5#[doc = "Field `USB_VREFH` reader - "]
6pub type USB_VREFH_R = crate::FieldReader;
7#[doc = "Field `USB_VREFH` writer - "]
8pub type USB_VREFH_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `USB_VREFL` reader - "]
10pub type USB_VREFL_R = crate::FieldReader;
11#[doc = "Field `USB_VREFL` writer - "]
12pub type USB_VREFL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13#[doc = "Field `USB_VREF_OVERRIDE` reader - "]
14pub type USB_VREF_OVERRIDE_R = crate::BitReader;
15#[doc = "Field `USB_VREF_OVERRIDE` writer - "]
16pub type USB_VREF_OVERRIDE_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `USB_PAD_PULL_OVERRIDE` reader - "]
18pub type USB_PAD_PULL_OVERRIDE_R = crate::BitReader;
19#[doc = "Field `USB_PAD_PULL_OVERRIDE` writer - "]
20pub type USB_PAD_PULL_OVERRIDE_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `USB_DP_PULLUP` reader - "]
22pub type USB_DP_PULLUP_R = crate::BitReader;
23#[doc = "Field `USB_DP_PULLUP` writer - "]
24pub type USB_DP_PULLUP_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `USB_DP_PULLDOWN` reader - "]
26pub type USB_DP_PULLDOWN_R = crate::BitReader;
27#[doc = "Field `USB_DP_PULLDOWN` writer - "]
28pub type USB_DP_PULLDOWN_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `USB_DM_PULLUP` reader - "]
30pub type USB_DM_PULLUP_R = crate::BitReader;
31#[doc = "Field `USB_DM_PULLUP` writer - "]
32pub type USB_DM_PULLUP_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `USB_DM_PULLDOWN` reader - "]
34pub type USB_DM_PULLDOWN_R = crate::BitReader;
35#[doc = "Field `USB_DM_PULLDOWN` writer - "]
36pub type USB_DM_PULLDOWN_W<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `USB_PULLUP_VALUE` reader - "]
38pub type USB_PULLUP_VALUE_R = crate::BitReader;
39#[doc = "Field `USB_PULLUP_VALUE` writer - "]
40pub type USB_PULLUP_VALUE_W<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `USB_PAD_ENABLE_OVERRIDE` reader - "]
42pub type USB_PAD_ENABLE_OVERRIDE_R = crate::BitReader;
43#[doc = "Field `USB_PAD_ENABLE_OVERRIDE` writer - "]
44pub type USB_PAD_ENABLE_OVERRIDE_W<'a, REG> = crate::BitWriter<'a, REG>;
45#[doc = "Field `USB_PAD_ENABLE` reader - "]
46pub type USB_PAD_ENABLE_R = crate::BitReader;
47#[doc = "Field `USB_PAD_ENABLE` writer - "]
48pub type USB_PAD_ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
49#[doc = "Field `USB_TXM` reader - "]
50pub type USB_TXM_R = crate::BitReader;
51#[doc = "Field `USB_TXM` writer - "]
52pub type USB_TXM_W<'a, REG> = crate::BitWriter<'a, REG>;
53#[doc = "Field `USB_TXP` reader - "]
54pub type USB_TXP_R = crate::BitReader;
55#[doc = "Field `USB_TXP` writer - "]
56pub type USB_TXP_W<'a, REG> = crate::BitWriter<'a, REG>;
57#[doc = "Field `USB_TX_EN` reader - "]
58pub type USB_TX_EN_R = crate::BitReader;
59#[doc = "Field `USB_TX_EN` writer - "]
60pub type USB_TX_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
61#[doc = "Field `USB_TX_EN_OVERRIDE` reader - "]
62pub type USB_TX_EN_OVERRIDE_R = crate::BitReader;
63#[doc = "Field `USB_TX_EN_OVERRIDE` writer - "]
64pub type USB_TX_EN_OVERRIDE_W<'a, REG> = crate::BitWriter<'a, REG>;
65#[doc = "Field `USB_RESET_DISABLE` reader - "]
66pub type USB_RESET_DISABLE_R = crate::BitReader;
67#[doc = "Field `USB_RESET_DISABLE` writer - "]
68pub type USB_RESET_DISABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
69#[doc = "Field `IO_MUX_RESET_DISABLE` reader - "]
70pub type IO_MUX_RESET_DISABLE_R = crate::BitReader;
71#[doc = "Field `IO_MUX_RESET_DISABLE` writer - "]
72pub type IO_MUX_RESET_DISABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
73impl R {
74    #[doc = "Bits 0:1"]
75    #[inline(always)]
76    pub fn usb_vrefh(&self) -> USB_VREFH_R {
77        USB_VREFH_R::new((self.bits & 3) as u8)
78    }
79    #[doc = "Bits 2:3"]
80    #[inline(always)]
81    pub fn usb_vrefl(&self) -> USB_VREFL_R {
82        USB_VREFL_R::new(((self.bits >> 2) & 3) as u8)
83    }
84    #[doc = "Bit 4"]
85    #[inline(always)]
86    pub fn usb_vref_override(&self) -> USB_VREF_OVERRIDE_R {
87        USB_VREF_OVERRIDE_R::new(((self.bits >> 4) & 1) != 0)
88    }
89    #[doc = "Bit 5"]
90    #[inline(always)]
91    pub fn usb_pad_pull_override(&self) -> USB_PAD_PULL_OVERRIDE_R {
92        USB_PAD_PULL_OVERRIDE_R::new(((self.bits >> 5) & 1) != 0)
93    }
94    #[doc = "Bit 6"]
95    #[inline(always)]
96    pub fn usb_dp_pullup(&self) -> USB_DP_PULLUP_R {
97        USB_DP_PULLUP_R::new(((self.bits >> 6) & 1) != 0)
98    }
99    #[doc = "Bit 7"]
100    #[inline(always)]
101    pub fn usb_dp_pulldown(&self) -> USB_DP_PULLDOWN_R {
102        USB_DP_PULLDOWN_R::new(((self.bits >> 7) & 1) != 0)
103    }
104    #[doc = "Bit 8"]
105    #[inline(always)]
106    pub fn usb_dm_pullup(&self) -> USB_DM_PULLUP_R {
107        USB_DM_PULLUP_R::new(((self.bits >> 8) & 1) != 0)
108    }
109    #[doc = "Bit 9"]
110    #[inline(always)]
111    pub fn usb_dm_pulldown(&self) -> USB_DM_PULLDOWN_R {
112        USB_DM_PULLDOWN_R::new(((self.bits >> 9) & 1) != 0)
113    }
114    #[doc = "Bit 10"]
115    #[inline(always)]
116    pub fn usb_pullup_value(&self) -> USB_PULLUP_VALUE_R {
117        USB_PULLUP_VALUE_R::new(((self.bits >> 10) & 1) != 0)
118    }
119    #[doc = "Bit 11"]
120    #[inline(always)]
121    pub fn usb_pad_enable_override(&self) -> USB_PAD_ENABLE_OVERRIDE_R {
122        USB_PAD_ENABLE_OVERRIDE_R::new(((self.bits >> 11) & 1) != 0)
123    }
124    #[doc = "Bit 12"]
125    #[inline(always)]
126    pub fn usb_pad_enable(&self) -> USB_PAD_ENABLE_R {
127        USB_PAD_ENABLE_R::new(((self.bits >> 12) & 1) != 0)
128    }
129    #[doc = "Bit 13"]
130    #[inline(always)]
131    pub fn usb_txm(&self) -> USB_TXM_R {
132        USB_TXM_R::new(((self.bits >> 13) & 1) != 0)
133    }
134    #[doc = "Bit 14"]
135    #[inline(always)]
136    pub fn usb_txp(&self) -> USB_TXP_R {
137        USB_TXP_R::new(((self.bits >> 14) & 1) != 0)
138    }
139    #[doc = "Bit 15"]
140    #[inline(always)]
141    pub fn usb_tx_en(&self) -> USB_TX_EN_R {
142        USB_TX_EN_R::new(((self.bits >> 15) & 1) != 0)
143    }
144    #[doc = "Bit 16"]
145    #[inline(always)]
146    pub fn usb_tx_en_override(&self) -> USB_TX_EN_OVERRIDE_R {
147        USB_TX_EN_OVERRIDE_R::new(((self.bits >> 16) & 1) != 0)
148    }
149    #[doc = "Bit 17"]
150    #[inline(always)]
151    pub fn usb_reset_disable(&self) -> USB_RESET_DISABLE_R {
152        USB_RESET_DISABLE_R::new(((self.bits >> 17) & 1) != 0)
153    }
154    #[doc = "Bit 18"]
155    #[inline(always)]
156    pub fn io_mux_reset_disable(&self) -> IO_MUX_RESET_DISABLE_R {
157        IO_MUX_RESET_DISABLE_R::new(((self.bits >> 18) & 1) != 0)
158    }
159}
160#[cfg(feature = "impl-register-debug")]
161impl core::fmt::Debug for R {
162    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
163        f.debug_struct("USB_CONF")
164            .field("usb_vrefh", &self.usb_vrefh())
165            .field("usb_vrefl", &self.usb_vrefl())
166            .field("usb_vref_override", &self.usb_vref_override())
167            .field("usb_pad_pull_override", &self.usb_pad_pull_override())
168            .field("usb_dp_pullup", &self.usb_dp_pullup())
169            .field("usb_dp_pulldown", &self.usb_dp_pulldown())
170            .field("usb_dm_pullup", &self.usb_dm_pullup())
171            .field("usb_dm_pulldown", &self.usb_dm_pulldown())
172            .field("usb_pullup_value", &self.usb_pullup_value())
173            .field("usb_pad_enable_override", &self.usb_pad_enable_override())
174            .field("usb_pad_enable", &self.usb_pad_enable())
175            .field("usb_txm", &self.usb_txm())
176            .field("usb_txp", &self.usb_txp())
177            .field("usb_tx_en", &self.usb_tx_en())
178            .field("usb_tx_en_override", &self.usb_tx_en_override())
179            .field("usb_reset_disable", &self.usb_reset_disable())
180            .field("io_mux_reset_disable", &self.io_mux_reset_disable())
181            .finish()
182    }
183}
184impl W {
185    #[doc = "Bits 0:1"]
186    #[inline(always)]
187    pub fn usb_vrefh(&mut self) -> USB_VREFH_W<USB_CONF_SPEC> {
188        USB_VREFH_W::new(self, 0)
189    }
190    #[doc = "Bits 2:3"]
191    #[inline(always)]
192    pub fn usb_vrefl(&mut self) -> USB_VREFL_W<USB_CONF_SPEC> {
193        USB_VREFL_W::new(self, 2)
194    }
195    #[doc = "Bit 4"]
196    #[inline(always)]
197    pub fn usb_vref_override(&mut self) -> USB_VREF_OVERRIDE_W<USB_CONF_SPEC> {
198        USB_VREF_OVERRIDE_W::new(self, 4)
199    }
200    #[doc = "Bit 5"]
201    #[inline(always)]
202    pub fn usb_pad_pull_override(&mut self) -> USB_PAD_PULL_OVERRIDE_W<USB_CONF_SPEC> {
203        USB_PAD_PULL_OVERRIDE_W::new(self, 5)
204    }
205    #[doc = "Bit 6"]
206    #[inline(always)]
207    pub fn usb_dp_pullup(&mut self) -> USB_DP_PULLUP_W<USB_CONF_SPEC> {
208        USB_DP_PULLUP_W::new(self, 6)
209    }
210    #[doc = "Bit 7"]
211    #[inline(always)]
212    pub fn usb_dp_pulldown(&mut self) -> USB_DP_PULLDOWN_W<USB_CONF_SPEC> {
213        USB_DP_PULLDOWN_W::new(self, 7)
214    }
215    #[doc = "Bit 8"]
216    #[inline(always)]
217    pub fn usb_dm_pullup(&mut self) -> USB_DM_PULLUP_W<USB_CONF_SPEC> {
218        USB_DM_PULLUP_W::new(self, 8)
219    }
220    #[doc = "Bit 9"]
221    #[inline(always)]
222    pub fn usb_dm_pulldown(&mut self) -> USB_DM_PULLDOWN_W<USB_CONF_SPEC> {
223        USB_DM_PULLDOWN_W::new(self, 9)
224    }
225    #[doc = "Bit 10"]
226    #[inline(always)]
227    pub fn usb_pullup_value(&mut self) -> USB_PULLUP_VALUE_W<USB_CONF_SPEC> {
228        USB_PULLUP_VALUE_W::new(self, 10)
229    }
230    #[doc = "Bit 11"]
231    #[inline(always)]
232    pub fn usb_pad_enable_override(&mut self) -> USB_PAD_ENABLE_OVERRIDE_W<USB_CONF_SPEC> {
233        USB_PAD_ENABLE_OVERRIDE_W::new(self, 11)
234    }
235    #[doc = "Bit 12"]
236    #[inline(always)]
237    pub fn usb_pad_enable(&mut self) -> USB_PAD_ENABLE_W<USB_CONF_SPEC> {
238        USB_PAD_ENABLE_W::new(self, 12)
239    }
240    #[doc = "Bit 13"]
241    #[inline(always)]
242    pub fn usb_txm(&mut self) -> USB_TXM_W<USB_CONF_SPEC> {
243        USB_TXM_W::new(self, 13)
244    }
245    #[doc = "Bit 14"]
246    #[inline(always)]
247    pub fn usb_txp(&mut self) -> USB_TXP_W<USB_CONF_SPEC> {
248        USB_TXP_W::new(self, 14)
249    }
250    #[doc = "Bit 15"]
251    #[inline(always)]
252    pub fn usb_tx_en(&mut self) -> USB_TX_EN_W<USB_CONF_SPEC> {
253        USB_TX_EN_W::new(self, 15)
254    }
255    #[doc = "Bit 16"]
256    #[inline(always)]
257    pub fn usb_tx_en_override(&mut self) -> USB_TX_EN_OVERRIDE_W<USB_CONF_SPEC> {
258        USB_TX_EN_OVERRIDE_W::new(self, 16)
259    }
260    #[doc = "Bit 17"]
261    #[inline(always)]
262    pub fn usb_reset_disable(&mut self) -> USB_RESET_DISABLE_W<USB_CONF_SPEC> {
263        USB_RESET_DISABLE_W::new(self, 17)
264    }
265    #[doc = "Bit 18"]
266    #[inline(always)]
267    pub fn io_mux_reset_disable(&mut self) -> IO_MUX_RESET_DISABLE_W<USB_CONF_SPEC> {
268        IO_MUX_RESET_DISABLE_W::new(self, 18)
269    }
270}
271#[doc = "configure usb control register\n\nYou can [`read`](crate::Reg::read) this register and get [`usb_conf::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`usb_conf::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
272pub struct USB_CONF_SPEC;
273impl crate::RegisterSpec for USB_CONF_SPEC {
274    type Ux = u32;
275}
276#[doc = "`read()` method returns [`usb_conf::R`](R) reader structure"]
277impl crate::Readable for USB_CONF_SPEC {}
278#[doc = "`write(|w| ..)` method takes [`usb_conf::W`](W) writer structure"]
279impl crate::Writable for USB_CONF_SPEC {
280    type Safety = crate::Unsafe;
281    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
282    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
283}
284#[doc = "`reset()` method sets USB_CONF to value 0"]
285impl crate::Resettable for USB_CONF_SPEC {
286    const RESET_VALUE: u32 = 0;
287}