esp32c6_lp/lp_io/
gpio.rs

1#[doc = "Register `GPIO%s` reader"]
2pub type R = crate::R<GPIO_SPEC>;
3#[doc = "Register `GPIO%s` writer"]
4pub type W = crate::W<GPIO_SPEC>;
5#[doc = "Field `MCU_OE` reader - need des"]
6pub type MCU_OE_R = crate::BitReader;
7#[doc = "Field `MCU_OE` writer - need des"]
8pub type MCU_OE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `SLP_SEL` reader - need des"]
10pub type SLP_SEL_R = crate::BitReader;
11#[doc = "Field `SLP_SEL` writer - need des"]
12pub type SLP_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `MCU_WPD` reader - need des"]
14pub type MCU_WPD_R = crate::BitReader;
15#[doc = "Field `MCU_WPD` writer - need des"]
16pub type MCU_WPD_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `MCU_WPU` reader - need des"]
18pub type MCU_WPU_R = crate::BitReader;
19#[doc = "Field `MCU_WPU` writer - need des"]
20pub type MCU_WPU_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `MCU_IE` reader - need des"]
22pub type MCU_IE_R = crate::BitReader;
23#[doc = "Field `MCU_IE` writer - need des"]
24pub type MCU_IE_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `MCU_DRV` reader - need des"]
26pub type MCU_DRV_R = crate::FieldReader;
27#[doc = "Field `MCU_DRV` writer - need des"]
28pub type MCU_DRV_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
29#[doc = "Field `FUN_WPD` reader - need des"]
30pub type FUN_WPD_R = crate::BitReader;
31#[doc = "Field `FUN_WPD` writer - need des"]
32pub type FUN_WPD_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `FUN_WPU` reader - need des"]
34pub type FUN_WPU_R = crate::BitReader;
35#[doc = "Field `FUN_WPU` writer - need des"]
36pub type FUN_WPU_W<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `FUN_IE` reader - need des"]
38pub type FUN_IE_R = crate::BitReader;
39#[doc = "Field `FUN_IE` writer - need des"]
40pub type FUN_IE_W<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `FUN_DRV` reader - need des"]
42pub type FUN_DRV_R = crate::FieldReader;
43#[doc = "Field `FUN_DRV` writer - need des"]
44pub type FUN_DRV_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
45#[doc = "Field `FUN_SEL` reader - need des"]
46pub type FUN_SEL_R = crate::FieldReader;
47#[doc = "Field `FUN_SEL` writer - need des"]
48pub type FUN_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
49impl R {
50    #[doc = "Bit 0 - need des"]
51    #[inline(always)]
52    pub fn mcu_oe(&self) -> MCU_OE_R {
53        MCU_OE_R::new((self.bits & 1) != 0)
54    }
55    #[doc = "Bit 1 - need des"]
56    #[inline(always)]
57    pub fn slp_sel(&self) -> SLP_SEL_R {
58        SLP_SEL_R::new(((self.bits >> 1) & 1) != 0)
59    }
60    #[doc = "Bit 2 - need des"]
61    #[inline(always)]
62    pub fn mcu_wpd(&self) -> MCU_WPD_R {
63        MCU_WPD_R::new(((self.bits >> 2) & 1) != 0)
64    }
65    #[doc = "Bit 3 - need des"]
66    #[inline(always)]
67    pub fn mcu_wpu(&self) -> MCU_WPU_R {
68        MCU_WPU_R::new(((self.bits >> 3) & 1) != 0)
69    }
70    #[doc = "Bit 4 - need des"]
71    #[inline(always)]
72    pub fn mcu_ie(&self) -> MCU_IE_R {
73        MCU_IE_R::new(((self.bits >> 4) & 1) != 0)
74    }
75    #[doc = "Bits 5:6 - need des"]
76    #[inline(always)]
77    pub fn mcu_drv(&self) -> MCU_DRV_R {
78        MCU_DRV_R::new(((self.bits >> 5) & 3) as u8)
79    }
80    #[doc = "Bit 7 - need des"]
81    #[inline(always)]
82    pub fn fun_wpd(&self) -> FUN_WPD_R {
83        FUN_WPD_R::new(((self.bits >> 7) & 1) != 0)
84    }
85    #[doc = "Bit 8 - need des"]
86    #[inline(always)]
87    pub fn fun_wpu(&self) -> FUN_WPU_R {
88        FUN_WPU_R::new(((self.bits >> 8) & 1) != 0)
89    }
90    #[doc = "Bit 9 - need des"]
91    #[inline(always)]
92    pub fn fun_ie(&self) -> FUN_IE_R {
93        FUN_IE_R::new(((self.bits >> 9) & 1) != 0)
94    }
95    #[doc = "Bits 10:11 - need des"]
96    #[inline(always)]
97    pub fn fun_drv(&self) -> FUN_DRV_R {
98        FUN_DRV_R::new(((self.bits >> 10) & 3) as u8)
99    }
100    #[doc = "Bits 12:14 - need des"]
101    #[inline(always)]
102    pub fn fun_sel(&self) -> FUN_SEL_R {
103        FUN_SEL_R::new(((self.bits >> 12) & 7) as u8)
104    }
105}
106#[cfg(feature = "impl-register-debug")]
107impl core::fmt::Debug for R {
108    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
109        f.debug_struct("GPIO")
110            .field("mcu_oe", &self.mcu_oe())
111            .field("slp_sel", &self.slp_sel())
112            .field("mcu_wpd", &self.mcu_wpd())
113            .field("mcu_wpu", &self.mcu_wpu())
114            .field("mcu_ie", &self.mcu_ie())
115            .field("mcu_drv", &self.mcu_drv())
116            .field("fun_wpd", &self.fun_wpd())
117            .field("fun_wpu", &self.fun_wpu())
118            .field("fun_ie", &self.fun_ie())
119            .field("fun_drv", &self.fun_drv())
120            .field("fun_sel", &self.fun_sel())
121            .finish()
122    }
123}
124impl W {
125    #[doc = "Bit 0 - need des"]
126    #[inline(always)]
127    #[must_use]
128    pub fn mcu_oe(&mut self) -> MCU_OE_W<GPIO_SPEC> {
129        MCU_OE_W::new(self, 0)
130    }
131    #[doc = "Bit 1 - need des"]
132    #[inline(always)]
133    #[must_use]
134    pub fn slp_sel(&mut self) -> SLP_SEL_W<GPIO_SPEC> {
135        SLP_SEL_W::new(self, 1)
136    }
137    #[doc = "Bit 2 - need des"]
138    #[inline(always)]
139    #[must_use]
140    pub fn mcu_wpd(&mut self) -> MCU_WPD_W<GPIO_SPEC> {
141        MCU_WPD_W::new(self, 2)
142    }
143    #[doc = "Bit 3 - need des"]
144    #[inline(always)]
145    #[must_use]
146    pub fn mcu_wpu(&mut self) -> MCU_WPU_W<GPIO_SPEC> {
147        MCU_WPU_W::new(self, 3)
148    }
149    #[doc = "Bit 4 - need des"]
150    #[inline(always)]
151    #[must_use]
152    pub fn mcu_ie(&mut self) -> MCU_IE_W<GPIO_SPEC> {
153        MCU_IE_W::new(self, 4)
154    }
155    #[doc = "Bits 5:6 - need des"]
156    #[inline(always)]
157    #[must_use]
158    pub fn mcu_drv(&mut self) -> MCU_DRV_W<GPIO_SPEC> {
159        MCU_DRV_W::new(self, 5)
160    }
161    #[doc = "Bit 7 - need des"]
162    #[inline(always)]
163    #[must_use]
164    pub fn fun_wpd(&mut self) -> FUN_WPD_W<GPIO_SPEC> {
165        FUN_WPD_W::new(self, 7)
166    }
167    #[doc = "Bit 8 - need des"]
168    #[inline(always)]
169    #[must_use]
170    pub fn fun_wpu(&mut self) -> FUN_WPU_W<GPIO_SPEC> {
171        FUN_WPU_W::new(self, 8)
172    }
173    #[doc = "Bit 9 - need des"]
174    #[inline(always)]
175    #[must_use]
176    pub fn fun_ie(&mut self) -> FUN_IE_W<GPIO_SPEC> {
177        FUN_IE_W::new(self, 9)
178    }
179    #[doc = "Bits 10:11 - need des"]
180    #[inline(always)]
181    #[must_use]
182    pub fn fun_drv(&mut self) -> FUN_DRV_W<GPIO_SPEC> {
183        FUN_DRV_W::new(self, 10)
184    }
185    #[doc = "Bits 12:14 - need des"]
186    #[inline(always)]
187    #[must_use]
188    pub fn fun_sel(&mut self) -> FUN_SEL_W<GPIO_SPEC> {
189        FUN_SEL_W::new(self, 12)
190    }
191}
192#[doc = "need des\n\nYou can [`read`](crate::Reg::read) this register and get [`gpio::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gpio::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
193pub struct GPIO_SPEC;
194impl crate::RegisterSpec for GPIO_SPEC {
195    type Ux = u32;
196}
197#[doc = "`read()` method returns [`gpio::R`](R) reader structure"]
198impl crate::Readable for GPIO_SPEC {}
199#[doc = "`write(|w| ..)` method takes [`gpio::W`](W) writer structure"]
200impl crate::Writable for GPIO_SPEC {
201    type Safety = crate::Unsafe;
202    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
203    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
204}
205#[doc = "`reset()` method sets GPIO%s to value 0"]
206impl crate::Resettable for GPIO_SPEC {
207    const RESET_VALUE: u32 = 0;
208}