esp32s3/usb_wrap/
test_conf.rs

1#[doc = "Register `TEST_CONF` reader"]
2pub type R = crate::R<TEST_CONF_SPEC>;
3#[doc = "Register `TEST_CONF` writer"]
4pub type W = crate::W<TEST_CONF_SPEC>;
5#[doc = "Field `TEST_ENABLE` reader - Enable test of the USB pad"]
6pub type TEST_ENABLE_R = crate::BitReader;
7#[doc = "Field `TEST_ENABLE` writer - Enable test of the USB pad"]
8pub type TEST_ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `TEST_USB_OE` reader - USB pad oen in test"]
10pub type TEST_USB_OE_R = crate::BitReader;
11#[doc = "Field `TEST_USB_OE` writer - USB pad oen in test"]
12pub type TEST_USB_OE_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `TEST_TX_DP` reader - USB D+ tx value in test"]
14pub type TEST_TX_DP_R = crate::BitReader;
15#[doc = "Field `TEST_TX_DP` writer - USB D+ tx value in test"]
16pub type TEST_TX_DP_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `TEST_TX_DM` reader - USB D- tx value in test"]
18pub type TEST_TX_DM_R = crate::BitReader;
19#[doc = "Field `TEST_TX_DM` writer - USB D- tx value in test"]
20pub type TEST_TX_DM_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `TEST_RX_RCV` reader - USB differential rx value in test"]
22pub type TEST_RX_RCV_R = crate::BitReader;
23#[doc = "Field `TEST_RX_DP` reader - USB D+ rx value in test"]
24pub type TEST_RX_DP_R = crate::BitReader;
25#[doc = "Field `TEST_RX_DM` reader - USB D- rx value in test"]
26pub type TEST_RX_DM_R = crate::BitReader;
27impl R {
28    #[doc = "Bit 0 - Enable test of the USB pad"]
29    #[inline(always)]
30    pub fn test_enable(&self) -> TEST_ENABLE_R {
31        TEST_ENABLE_R::new((self.bits & 1) != 0)
32    }
33    #[doc = "Bit 1 - USB pad oen in test"]
34    #[inline(always)]
35    pub fn test_usb_oe(&self) -> TEST_USB_OE_R {
36        TEST_USB_OE_R::new(((self.bits >> 1) & 1) != 0)
37    }
38    #[doc = "Bit 2 - USB D+ tx value in test"]
39    #[inline(always)]
40    pub fn test_tx_dp(&self) -> TEST_TX_DP_R {
41        TEST_TX_DP_R::new(((self.bits >> 2) & 1) != 0)
42    }
43    #[doc = "Bit 3 - USB D- tx value in test"]
44    #[inline(always)]
45    pub fn test_tx_dm(&self) -> TEST_TX_DM_R {
46        TEST_TX_DM_R::new(((self.bits >> 3) & 1) != 0)
47    }
48    #[doc = "Bit 4 - USB differential rx value in test"]
49    #[inline(always)]
50    pub fn test_rx_rcv(&self) -> TEST_RX_RCV_R {
51        TEST_RX_RCV_R::new(((self.bits >> 4) & 1) != 0)
52    }
53    #[doc = "Bit 5 - USB D+ rx value in test"]
54    #[inline(always)]
55    pub fn test_rx_dp(&self) -> TEST_RX_DP_R {
56        TEST_RX_DP_R::new(((self.bits >> 5) & 1) != 0)
57    }
58    #[doc = "Bit 6 - USB D- rx value in test"]
59    #[inline(always)]
60    pub fn test_rx_dm(&self) -> TEST_RX_DM_R {
61        TEST_RX_DM_R::new(((self.bits >> 6) & 1) != 0)
62    }
63}
64#[cfg(feature = "impl-register-debug")]
65impl core::fmt::Debug for R {
66    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
67        f.debug_struct("TEST_CONF")
68            .field("test_enable", &self.test_enable())
69            .field("test_usb_oe", &self.test_usb_oe())
70            .field("test_tx_dp", &self.test_tx_dp())
71            .field("test_tx_dm", &self.test_tx_dm())
72            .field("test_rx_rcv", &self.test_rx_rcv())
73            .field("test_rx_dp", &self.test_rx_dp())
74            .field("test_rx_dm", &self.test_rx_dm())
75            .finish()
76    }
77}
78impl W {
79    #[doc = "Bit 0 - Enable test of the USB pad"]
80    #[inline(always)]
81    pub fn test_enable(&mut self) -> TEST_ENABLE_W<TEST_CONF_SPEC> {
82        TEST_ENABLE_W::new(self, 0)
83    }
84    #[doc = "Bit 1 - USB pad oen in test"]
85    #[inline(always)]
86    pub fn test_usb_oe(&mut self) -> TEST_USB_OE_W<TEST_CONF_SPEC> {
87        TEST_USB_OE_W::new(self, 1)
88    }
89    #[doc = "Bit 2 - USB D+ tx value in test"]
90    #[inline(always)]
91    pub fn test_tx_dp(&mut self) -> TEST_TX_DP_W<TEST_CONF_SPEC> {
92        TEST_TX_DP_W::new(self, 2)
93    }
94    #[doc = "Bit 3 - USB D- tx value in test"]
95    #[inline(always)]
96    pub fn test_tx_dm(&mut self) -> TEST_TX_DM_W<TEST_CONF_SPEC> {
97        TEST_TX_DM_W::new(self, 3)
98    }
99}
100#[doc = "USB Internal PHY Testing Register\n\nYou can [`read`](crate::Reg::read) this register and get [`test_conf::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`test_conf::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
101pub struct TEST_CONF_SPEC;
102impl crate::RegisterSpec for TEST_CONF_SPEC {
103    type Ux = u32;
104}
105#[doc = "`read()` method returns [`test_conf::R`](R) reader structure"]
106impl crate::Readable for TEST_CONF_SPEC {}
107#[doc = "`write(|w| ..)` method takes [`test_conf::W`](W) writer structure"]
108impl crate::Writable for TEST_CONF_SPEC {
109    type Safety = crate::Unsafe;
110}
111#[doc = "`reset()` method sets TEST_CONF to value 0"]
112impl crate::Resettable for TEST_CONF_SPEC {}