rp2040_pac/usbctrl_regs/
usb_muxing.rs

1#[doc = "Register `USB_MUXING` reader"]
2pub type R = crate::R<USB_MUXING_SPEC>;
3#[doc = "Register `USB_MUXING` writer"]
4pub type W = crate::W<USB_MUXING_SPEC>;
5#[doc = "Field `TO_PHY` reader - "]
6pub type TO_PHY_R = crate::BitReader;
7#[doc = "Field `TO_PHY` writer - "]
8pub type TO_PHY_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `TO_EXTPHY` reader - "]
10pub type TO_EXTPHY_R = crate::BitReader;
11#[doc = "Field `TO_EXTPHY` writer - "]
12pub type TO_EXTPHY_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `TO_DIGITAL_PAD` reader - "]
14pub type TO_DIGITAL_PAD_R = crate::BitReader;
15#[doc = "Field `TO_DIGITAL_PAD` writer - "]
16pub type TO_DIGITAL_PAD_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `SOFTCON` reader - "]
18pub type SOFTCON_R = crate::BitReader;
19#[doc = "Field `SOFTCON` writer - "]
20pub type SOFTCON_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bit 0"]
23    #[inline(always)]
24    pub fn to_phy(&self) -> TO_PHY_R {
25        TO_PHY_R::new((self.bits & 1) != 0)
26    }
27    #[doc = "Bit 1"]
28    #[inline(always)]
29    pub fn to_extphy(&self) -> TO_EXTPHY_R {
30        TO_EXTPHY_R::new(((self.bits >> 1) & 1) != 0)
31    }
32    #[doc = "Bit 2"]
33    #[inline(always)]
34    pub fn to_digital_pad(&self) -> TO_DIGITAL_PAD_R {
35        TO_DIGITAL_PAD_R::new(((self.bits >> 2) & 1) != 0)
36    }
37    #[doc = "Bit 3"]
38    #[inline(always)]
39    pub fn softcon(&self) -> SOFTCON_R {
40        SOFTCON_R::new(((self.bits >> 3) & 1) != 0)
41    }
42}
43impl W {
44    #[doc = "Bit 0"]
45    #[inline(always)]
46    #[must_use]
47    pub fn to_phy(&mut self) -> TO_PHY_W<USB_MUXING_SPEC> {
48        TO_PHY_W::new(self, 0)
49    }
50    #[doc = "Bit 1"]
51    #[inline(always)]
52    #[must_use]
53    pub fn to_extphy(&mut self) -> TO_EXTPHY_W<USB_MUXING_SPEC> {
54        TO_EXTPHY_W::new(self, 1)
55    }
56    #[doc = "Bit 2"]
57    #[inline(always)]
58    #[must_use]
59    pub fn to_digital_pad(&mut self) -> TO_DIGITAL_PAD_W<USB_MUXING_SPEC> {
60        TO_DIGITAL_PAD_W::new(self, 2)
61    }
62    #[doc = "Bit 3"]
63    #[inline(always)]
64    #[must_use]
65    pub fn softcon(&mut self) -> SOFTCON_W<USB_MUXING_SPEC> {
66        SOFTCON_W::new(self, 3)
67    }
68    #[doc = r" Writes raw bits to the register."]
69    #[doc = r""]
70    #[doc = r" # Safety"]
71    #[doc = r""]
72    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
73    #[inline(always)]
74    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
75        self.bits = bits;
76        self
77    }
78}
79#[doc = "Where to connect the USB controller. Should be to_phy by default.  
80
81You can [`read`](crate::generic::Reg::read) this register and get [`usb_muxing::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_muxing::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
82pub struct USB_MUXING_SPEC;
83impl crate::RegisterSpec for USB_MUXING_SPEC {
84    type Ux = u32;
85}
86#[doc = "`read()` method returns [`usb_muxing::R`](R) reader structure"]
87impl crate::Readable for USB_MUXING_SPEC {}
88#[doc = "`write(|w| ..)` method takes [`usb_muxing::W`](W) writer structure"]
89impl crate::Writable for USB_MUXING_SPEC {
90    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
91    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
92}
93#[doc = "`reset()` method sets USB_MUXING to value 0"]
94impl crate::Resettable for USB_MUXING_SPEC {
95    const RESET_VALUE: u32 = 0;
96}