esp32c6_lp/lp_io/
pin.rs

1#[doc = "Register `PIN%s` reader"]
2pub type R = crate::R<PIN_SPEC>;
3#[doc = "Register `PIN%s` writer"]
4pub type W = crate::W<PIN_SPEC>;
5#[doc = "Field `SYNC_BYPASS` reader - need des"]
6pub type SYNC_BYPASS_R = crate::FieldReader;
7#[doc = "Field `SYNC_BYPASS` writer - need des"]
8pub type SYNC_BYPASS_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `PAD_DRIVER` reader - need des"]
10pub type PAD_DRIVER_R = crate::BitReader;
11#[doc = "Field `PAD_DRIVER` writer - need des"]
12pub type PAD_DRIVER_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `EDGE_WAKEUP_CLR` writer - need des"]
14pub type EDGE_WAKEUP_CLR_W<'a, REG> = crate::BitWriter<'a, REG>;
15#[doc = "Field `INT_TYPE` reader - need des"]
16pub type INT_TYPE_R = crate::FieldReader;
17#[doc = "Field `INT_TYPE` writer - need des"]
18pub type INT_TYPE_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
19#[doc = "Field `WAKEUP_ENABLE` reader - need des"]
20pub type WAKEUP_ENABLE_R = crate::BitReader;
21#[doc = "Field `WAKEUP_ENABLE` writer - need des"]
22pub type WAKEUP_ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
23#[doc = "Field `FILTER_EN` reader - need des"]
24pub type FILTER_EN_R = crate::BitReader;
25#[doc = "Field `FILTER_EN` writer - need des"]
26pub type FILTER_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
27impl R {
28    #[doc = "Bits 0:1 - need des"]
29    #[inline(always)]
30    pub fn sync_bypass(&self) -> SYNC_BYPASS_R {
31        SYNC_BYPASS_R::new((self.bits & 3) as u8)
32    }
33    #[doc = "Bit 2 - need des"]
34    #[inline(always)]
35    pub fn pad_driver(&self) -> PAD_DRIVER_R {
36        PAD_DRIVER_R::new(((self.bits >> 2) & 1) != 0)
37    }
38    #[doc = "Bits 7:9 - need des"]
39    #[inline(always)]
40    pub fn int_type(&self) -> INT_TYPE_R {
41        INT_TYPE_R::new(((self.bits >> 7) & 7) as u8)
42    }
43    #[doc = "Bit 10 - need des"]
44    #[inline(always)]
45    pub fn wakeup_enable(&self) -> WAKEUP_ENABLE_R {
46        WAKEUP_ENABLE_R::new(((self.bits >> 10) & 1) != 0)
47    }
48    #[doc = "Bit 11 - need des"]
49    #[inline(always)]
50    pub fn filter_en(&self) -> FILTER_EN_R {
51        FILTER_EN_R::new(((self.bits >> 11) & 1) != 0)
52    }
53}
54#[cfg(feature = "impl-register-debug")]
55impl core::fmt::Debug for R {
56    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
57        f.debug_struct("PIN")
58            .field("sync_bypass", &self.sync_bypass())
59            .field("pad_driver", &self.pad_driver())
60            .field("int_type", &self.int_type())
61            .field("wakeup_enable", &self.wakeup_enable())
62            .field("filter_en", &self.filter_en())
63            .finish()
64    }
65}
66impl W {
67    #[doc = "Bits 0:1 - need des"]
68    #[inline(always)]
69    #[must_use]
70    pub fn sync_bypass(&mut self) -> SYNC_BYPASS_W<PIN_SPEC> {
71        SYNC_BYPASS_W::new(self, 0)
72    }
73    #[doc = "Bit 2 - need des"]
74    #[inline(always)]
75    #[must_use]
76    pub fn pad_driver(&mut self) -> PAD_DRIVER_W<PIN_SPEC> {
77        PAD_DRIVER_W::new(self, 2)
78    }
79    #[doc = "Bit 3 - need des"]
80    #[inline(always)]
81    #[must_use]
82    pub fn edge_wakeup_clr(&mut self) -> EDGE_WAKEUP_CLR_W<PIN_SPEC> {
83        EDGE_WAKEUP_CLR_W::new(self, 3)
84    }
85    #[doc = "Bits 7:9 - need des"]
86    #[inline(always)]
87    #[must_use]
88    pub fn int_type(&mut self) -> INT_TYPE_W<PIN_SPEC> {
89        INT_TYPE_W::new(self, 7)
90    }
91    #[doc = "Bit 10 - need des"]
92    #[inline(always)]
93    #[must_use]
94    pub fn wakeup_enable(&mut self) -> WAKEUP_ENABLE_W<PIN_SPEC> {
95        WAKEUP_ENABLE_W::new(self, 10)
96    }
97    #[doc = "Bit 11 - need des"]
98    #[inline(always)]
99    #[must_use]
100    pub fn filter_en(&mut self) -> FILTER_EN_W<PIN_SPEC> {
101        FILTER_EN_W::new(self, 11)
102    }
103}
104#[doc = "need des\n\nYou can [`read`](crate::Reg::read) this register and get [`pin::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pin::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
105pub struct PIN_SPEC;
106impl crate::RegisterSpec for PIN_SPEC {
107    type Ux = u32;
108}
109#[doc = "`read()` method returns [`pin::R`](R) reader structure"]
110impl crate::Readable for PIN_SPEC {}
111#[doc = "`write(|w| ..)` method takes [`pin::W`](W) writer structure"]
112impl crate::Writable for PIN_SPEC {
113    type Safety = crate::Unsafe;
114    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
115    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
116}
117#[doc = "`reset()` method sets PIN%s to value 0"]
118impl crate::Resettable for PIN_SPEC {
119    const RESET_VALUE: u32 = 0;
120}