esp32p4/lp_sys/
usb_ctrl.rs1#[doc = "Register `USB_CTRL` reader"]
2pub type R = crate::R<USB_CTRL_SPEC>;
3#[doc = "Register `USB_CTRL` writer"]
4pub type W = crate::W<USB_CTRL_SPEC>;
5#[doc = "Field `SW_HW_USB_PHY_SEL` reader - need_des"]
6pub type SW_HW_USB_PHY_SEL_R = crate::BitReader;
7#[doc = "Field `SW_HW_USB_PHY_SEL` writer - need_des"]
8pub type SW_HW_USB_PHY_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `SW_USB_PHY_SEL` reader - need_des"]
10pub type SW_USB_PHY_SEL_R = crate::BitReader;
11#[doc = "Field `SW_USB_PHY_SEL` writer - need_des"]
12pub type SW_USB_PHY_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `USBOTG20_WAKEUP_CLR` writer - clear usb wakeup to PMU."]
14pub type USBOTG20_WAKEUP_CLR_W<'a, REG> = crate::BitWriter<'a, REG>;
15#[doc = "Field `USBOTG20_IN_SUSPEND` reader - indicate usb otg2.0 is in suspend state."]
16pub type USBOTG20_IN_SUSPEND_R = crate::BitReader;
17#[doc = "Field `USBOTG20_IN_SUSPEND` writer - indicate usb otg2.0 is in suspend state."]
18pub type USBOTG20_IN_SUSPEND_W<'a, REG> = crate::BitWriter<'a, REG>;
19impl R {
20 #[doc = "Bit 0 - need_des"]
21 #[inline(always)]
22 pub fn sw_hw_usb_phy_sel(&self) -> SW_HW_USB_PHY_SEL_R {
23 SW_HW_USB_PHY_SEL_R::new((self.bits & 1) != 0)
24 }
25 #[doc = "Bit 1 - need_des"]
26 #[inline(always)]
27 pub fn sw_usb_phy_sel(&self) -> SW_USB_PHY_SEL_R {
28 SW_USB_PHY_SEL_R::new(((self.bits >> 1) & 1) != 0)
29 }
30 #[doc = "Bit 3 - indicate usb otg2.0 is in suspend state."]
31 #[inline(always)]
32 pub fn usbotg20_in_suspend(&self) -> USBOTG20_IN_SUSPEND_R {
33 USBOTG20_IN_SUSPEND_R::new(((self.bits >> 3) & 1) != 0)
34 }
35}
36#[cfg(feature = "impl-register-debug")]
37impl core::fmt::Debug for R {
38 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
39 f.debug_struct("USB_CTRL")
40 .field(
41 "sw_hw_usb_phy_sel",
42 &format_args!("{}", self.sw_hw_usb_phy_sel().bit()),
43 )
44 .field(
45 "sw_usb_phy_sel",
46 &format_args!("{}", self.sw_usb_phy_sel().bit()),
47 )
48 .field(
49 "usbotg20_in_suspend",
50 &format_args!("{}", self.usbotg20_in_suspend().bit()),
51 )
52 .finish()
53 }
54}
55#[cfg(feature = "impl-register-debug")]
56impl core::fmt::Debug for crate::generic::Reg<USB_CTRL_SPEC> {
57 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
58 core::fmt::Debug::fmt(&self.read(), f)
59 }
60}
61impl W {
62 #[doc = "Bit 0 - need_des"]
63 #[inline(always)]
64 #[must_use]
65 pub fn sw_hw_usb_phy_sel(&mut self) -> SW_HW_USB_PHY_SEL_W<USB_CTRL_SPEC> {
66 SW_HW_USB_PHY_SEL_W::new(self, 0)
67 }
68 #[doc = "Bit 1 - need_des"]
69 #[inline(always)]
70 #[must_use]
71 pub fn sw_usb_phy_sel(&mut self) -> SW_USB_PHY_SEL_W<USB_CTRL_SPEC> {
72 SW_USB_PHY_SEL_W::new(self, 1)
73 }
74 #[doc = "Bit 2 - clear usb wakeup to PMU."]
75 #[inline(always)]
76 #[must_use]
77 pub fn usbotg20_wakeup_clr(&mut self) -> USBOTG20_WAKEUP_CLR_W<USB_CTRL_SPEC> {
78 USBOTG20_WAKEUP_CLR_W::new(self, 2)
79 }
80 #[doc = "Bit 3 - indicate usb otg2.0 is in suspend state."]
81 #[inline(always)]
82 #[must_use]
83 pub fn usbotg20_in_suspend(&mut self) -> USBOTG20_IN_SUSPEND_W<USB_CTRL_SPEC> {
84 USBOTG20_IN_SUSPEND_W::new(self, 3)
85 }
86}
87#[doc = "need_des\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`usb_ctrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`usb_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
88pub struct USB_CTRL_SPEC;
89impl crate::RegisterSpec for USB_CTRL_SPEC {
90 type Ux = u32;
91}
92#[doc = "`read()` method returns [`usb_ctrl::R`](R) reader structure"]
93impl crate::Readable for USB_CTRL_SPEC {}
94#[doc = "`write(|w| ..)` method takes [`usb_ctrl::W`](W) writer structure"]
95impl crate::Writable for USB_CTRL_SPEC {
96 type Safety = crate::Unsafe;
97 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
98 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
99}
100#[doc = "`reset()` method sets USB_CTRL to value 0"]
101impl crate::Resettable for USB_CTRL_SPEC {
102 const RESET_VALUE: u32 = 0;
103}