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