esp32c6_lp/lp_wdt/
config0.rs

1#[doc = "Register `CONFIG0` reader"]
2pub type R = crate::R<CONFIG0_SPEC>;
3#[doc = "Register `CONFIG0` writer"]
4pub type W = crate::W<CONFIG0_SPEC>;
5#[doc = "Field `WDT_CHIP_RESET_WIDTH` reader - need_des"]
6pub type WDT_CHIP_RESET_WIDTH_R = crate::FieldReader;
7#[doc = "Field `WDT_CHIP_RESET_WIDTH` writer - need_des"]
8pub type WDT_CHIP_RESET_WIDTH_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `WDT_CHIP_RESET_EN` reader - need_des"]
10pub type WDT_CHIP_RESET_EN_R = crate::BitReader;
11#[doc = "Field `WDT_CHIP_RESET_EN` writer - need_des"]
12pub type WDT_CHIP_RESET_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `WDT_PAUSE_IN_SLP` reader - need_des"]
14pub type WDT_PAUSE_IN_SLP_R = crate::BitReader;
15#[doc = "Field `WDT_PAUSE_IN_SLP` writer - need_des"]
16pub type WDT_PAUSE_IN_SLP_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `WDT_APPCPU_RESET_EN` reader - need_des"]
18pub type WDT_APPCPU_RESET_EN_R = crate::BitReader;
19#[doc = "Field `WDT_APPCPU_RESET_EN` writer - need_des"]
20pub type WDT_APPCPU_RESET_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `WDT_PROCPU_RESET_EN` reader - need_des"]
22pub type WDT_PROCPU_RESET_EN_R = crate::BitReader;
23#[doc = "Field `WDT_PROCPU_RESET_EN` writer - need_des"]
24pub type WDT_PROCPU_RESET_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `WDT_FLASHBOOT_MOD_EN` reader - need_des"]
26pub type WDT_FLASHBOOT_MOD_EN_R = crate::BitReader;
27#[doc = "Field `WDT_FLASHBOOT_MOD_EN` writer - need_des"]
28pub type WDT_FLASHBOOT_MOD_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `WDT_SYS_RESET_LENGTH` reader - need_des"]
30pub type WDT_SYS_RESET_LENGTH_R = crate::FieldReader;
31#[doc = "Field `WDT_SYS_RESET_LENGTH` writer - need_des"]
32pub type WDT_SYS_RESET_LENGTH_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
33#[doc = "Field `WDT_CPU_RESET_LENGTH` reader - need_des"]
34pub type WDT_CPU_RESET_LENGTH_R = crate::FieldReader;
35#[doc = "Field `WDT_CPU_RESET_LENGTH` writer - need_des"]
36pub type WDT_CPU_RESET_LENGTH_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
37#[doc = "Field `WDT_STG3` reader - need_des"]
38pub type WDT_STG3_R = crate::FieldReader;
39#[doc = "Field `WDT_STG3` writer - need_des"]
40pub type WDT_STG3_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
41#[doc = "Field `WDT_STG2` reader - need_des"]
42pub type WDT_STG2_R = crate::FieldReader;
43#[doc = "Field `WDT_STG2` writer - need_des"]
44pub type WDT_STG2_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
45#[doc = "Field `WDT_STG1` reader - need_des"]
46pub type WDT_STG1_R = crate::FieldReader;
47#[doc = "Field `WDT_STG1` writer - need_des"]
48pub type WDT_STG1_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
49#[doc = "Field `WDT_STG0` reader - need_des"]
50pub type WDT_STG0_R = crate::FieldReader;
51#[doc = "Field `WDT_STG0` writer - need_des"]
52pub type WDT_STG0_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
53#[doc = "Field `WDT_EN` reader - need_des"]
54pub type WDT_EN_R = crate::BitReader;
55#[doc = "Field `WDT_EN` writer - need_des"]
56pub type WDT_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
57impl R {
58    #[doc = "Bits 0:7 - need_des"]
59    #[inline(always)]
60    pub fn wdt_chip_reset_width(&self) -> WDT_CHIP_RESET_WIDTH_R {
61        WDT_CHIP_RESET_WIDTH_R::new((self.bits & 0xff) as u8)
62    }
63    #[doc = "Bit 8 - need_des"]
64    #[inline(always)]
65    pub fn wdt_chip_reset_en(&self) -> WDT_CHIP_RESET_EN_R {
66        WDT_CHIP_RESET_EN_R::new(((self.bits >> 8) & 1) != 0)
67    }
68    #[doc = "Bit 9 - need_des"]
69    #[inline(always)]
70    pub fn wdt_pause_in_slp(&self) -> WDT_PAUSE_IN_SLP_R {
71        WDT_PAUSE_IN_SLP_R::new(((self.bits >> 9) & 1) != 0)
72    }
73    #[doc = "Bit 10 - need_des"]
74    #[inline(always)]
75    pub fn wdt_appcpu_reset_en(&self) -> WDT_APPCPU_RESET_EN_R {
76        WDT_APPCPU_RESET_EN_R::new(((self.bits >> 10) & 1) != 0)
77    }
78    #[doc = "Bit 11 - need_des"]
79    #[inline(always)]
80    pub fn wdt_procpu_reset_en(&self) -> WDT_PROCPU_RESET_EN_R {
81        WDT_PROCPU_RESET_EN_R::new(((self.bits >> 11) & 1) != 0)
82    }
83    #[doc = "Bit 12 - need_des"]
84    #[inline(always)]
85    pub fn wdt_flashboot_mod_en(&self) -> WDT_FLASHBOOT_MOD_EN_R {
86        WDT_FLASHBOOT_MOD_EN_R::new(((self.bits >> 12) & 1) != 0)
87    }
88    #[doc = "Bits 13:15 - need_des"]
89    #[inline(always)]
90    pub fn wdt_sys_reset_length(&self) -> WDT_SYS_RESET_LENGTH_R {
91        WDT_SYS_RESET_LENGTH_R::new(((self.bits >> 13) & 7) as u8)
92    }
93    #[doc = "Bits 16:18 - need_des"]
94    #[inline(always)]
95    pub fn wdt_cpu_reset_length(&self) -> WDT_CPU_RESET_LENGTH_R {
96        WDT_CPU_RESET_LENGTH_R::new(((self.bits >> 16) & 7) as u8)
97    }
98    #[doc = "Bits 19:21 - need_des"]
99    #[inline(always)]
100    pub fn wdt_stg3(&self) -> WDT_STG3_R {
101        WDT_STG3_R::new(((self.bits >> 19) & 7) as u8)
102    }
103    #[doc = "Bits 22:24 - need_des"]
104    #[inline(always)]
105    pub fn wdt_stg2(&self) -> WDT_STG2_R {
106        WDT_STG2_R::new(((self.bits >> 22) & 7) as u8)
107    }
108    #[doc = "Bits 25:27 - need_des"]
109    #[inline(always)]
110    pub fn wdt_stg1(&self) -> WDT_STG1_R {
111        WDT_STG1_R::new(((self.bits >> 25) & 7) as u8)
112    }
113    #[doc = "Bits 28:30 - need_des"]
114    #[inline(always)]
115    pub fn wdt_stg0(&self) -> WDT_STG0_R {
116        WDT_STG0_R::new(((self.bits >> 28) & 7) as u8)
117    }
118    #[doc = "Bit 31 - need_des"]
119    #[inline(always)]
120    pub fn wdt_en(&self) -> WDT_EN_R {
121        WDT_EN_R::new(((self.bits >> 31) & 1) != 0)
122    }
123}
124#[cfg(feature = "impl-register-debug")]
125impl core::fmt::Debug for R {
126    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
127        f.debug_struct("CONFIG0")
128            .field("wdt_chip_reset_width", &self.wdt_chip_reset_width())
129            .field("wdt_chip_reset_en", &self.wdt_chip_reset_en())
130            .field("wdt_pause_in_slp", &self.wdt_pause_in_slp())
131            .field("wdt_appcpu_reset_en", &self.wdt_appcpu_reset_en())
132            .field("wdt_procpu_reset_en", &self.wdt_procpu_reset_en())
133            .field("wdt_flashboot_mod_en", &self.wdt_flashboot_mod_en())
134            .field("wdt_sys_reset_length", &self.wdt_sys_reset_length())
135            .field("wdt_cpu_reset_length", &self.wdt_cpu_reset_length())
136            .field("wdt_stg3", &self.wdt_stg3())
137            .field("wdt_stg2", &self.wdt_stg2())
138            .field("wdt_stg1", &self.wdt_stg1())
139            .field("wdt_stg0", &self.wdt_stg0())
140            .field("wdt_en", &self.wdt_en())
141            .finish()
142    }
143}
144impl W {
145    #[doc = "Bits 0:7 - need_des"]
146    #[inline(always)]
147    #[must_use]
148    pub fn wdt_chip_reset_width(&mut self) -> WDT_CHIP_RESET_WIDTH_W<CONFIG0_SPEC> {
149        WDT_CHIP_RESET_WIDTH_W::new(self, 0)
150    }
151    #[doc = "Bit 8 - need_des"]
152    #[inline(always)]
153    #[must_use]
154    pub fn wdt_chip_reset_en(&mut self) -> WDT_CHIP_RESET_EN_W<CONFIG0_SPEC> {
155        WDT_CHIP_RESET_EN_W::new(self, 8)
156    }
157    #[doc = "Bit 9 - need_des"]
158    #[inline(always)]
159    #[must_use]
160    pub fn wdt_pause_in_slp(&mut self) -> WDT_PAUSE_IN_SLP_W<CONFIG0_SPEC> {
161        WDT_PAUSE_IN_SLP_W::new(self, 9)
162    }
163    #[doc = "Bit 10 - need_des"]
164    #[inline(always)]
165    #[must_use]
166    pub fn wdt_appcpu_reset_en(&mut self) -> WDT_APPCPU_RESET_EN_W<CONFIG0_SPEC> {
167        WDT_APPCPU_RESET_EN_W::new(self, 10)
168    }
169    #[doc = "Bit 11 - need_des"]
170    #[inline(always)]
171    #[must_use]
172    pub fn wdt_procpu_reset_en(&mut self) -> WDT_PROCPU_RESET_EN_W<CONFIG0_SPEC> {
173        WDT_PROCPU_RESET_EN_W::new(self, 11)
174    }
175    #[doc = "Bit 12 - need_des"]
176    #[inline(always)]
177    #[must_use]
178    pub fn wdt_flashboot_mod_en(&mut self) -> WDT_FLASHBOOT_MOD_EN_W<CONFIG0_SPEC> {
179        WDT_FLASHBOOT_MOD_EN_W::new(self, 12)
180    }
181    #[doc = "Bits 13:15 - need_des"]
182    #[inline(always)]
183    #[must_use]
184    pub fn wdt_sys_reset_length(&mut self) -> WDT_SYS_RESET_LENGTH_W<CONFIG0_SPEC> {
185        WDT_SYS_RESET_LENGTH_W::new(self, 13)
186    }
187    #[doc = "Bits 16:18 - need_des"]
188    #[inline(always)]
189    #[must_use]
190    pub fn wdt_cpu_reset_length(&mut self) -> WDT_CPU_RESET_LENGTH_W<CONFIG0_SPEC> {
191        WDT_CPU_RESET_LENGTH_W::new(self, 16)
192    }
193    #[doc = "Bits 19:21 - need_des"]
194    #[inline(always)]
195    #[must_use]
196    pub fn wdt_stg3(&mut self) -> WDT_STG3_W<CONFIG0_SPEC> {
197        WDT_STG3_W::new(self, 19)
198    }
199    #[doc = "Bits 22:24 - need_des"]
200    #[inline(always)]
201    #[must_use]
202    pub fn wdt_stg2(&mut self) -> WDT_STG2_W<CONFIG0_SPEC> {
203        WDT_STG2_W::new(self, 22)
204    }
205    #[doc = "Bits 25:27 - need_des"]
206    #[inline(always)]
207    #[must_use]
208    pub fn wdt_stg1(&mut self) -> WDT_STG1_W<CONFIG0_SPEC> {
209        WDT_STG1_W::new(self, 25)
210    }
211    #[doc = "Bits 28:30 - need_des"]
212    #[inline(always)]
213    #[must_use]
214    pub fn wdt_stg0(&mut self) -> WDT_STG0_W<CONFIG0_SPEC> {
215        WDT_STG0_W::new(self, 28)
216    }
217    #[doc = "Bit 31 - need_des"]
218    #[inline(always)]
219    #[must_use]
220    pub fn wdt_en(&mut self) -> WDT_EN_W<CONFIG0_SPEC> {
221        WDT_EN_W::new(self, 31)
222    }
223}
224#[doc = "need_des\n\nYou can [`read`](crate::Reg::read) this register and get [`config0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`config0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
225pub struct CONFIG0_SPEC;
226impl crate::RegisterSpec for CONFIG0_SPEC {
227    type Ux = u32;
228}
229#[doc = "`read()` method returns [`config0::R`](R) reader structure"]
230impl crate::Readable for CONFIG0_SPEC {}
231#[doc = "`write(|w| ..)` method takes [`config0::W`](W) writer structure"]
232impl crate::Writable for CONFIG0_SPEC {
233    type Safety = crate::Unsafe;
234    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
235    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
236}
237#[doc = "`reset()` method sets CONFIG0 to value 0x0001_3214"]
238impl crate::Resettable for CONFIG0_SPEC {
239    const RESET_VALUE: u32 = 0x0001_3214;
240}