1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
#[doc = "Register `RSTSCK` reader"]
pub type R = crate::R<RstsckSpec>;
#[doc = "Register `RSTSCK` writer"]
pub type W = crate::W<RstsckSpec>;
#[doc = "IRC40K enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Irc40ken {
    #[doc = "0: IRC40K oscillator disabled"]
    Off = 0,
    #[doc = "1: IRC40K oscillator enabled"]
    On = 1,
}
impl From<Irc40ken> for bool {
    #[inline(always)]
    fn from(variant: Irc40ken) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IRC40KEN` reader - IRC40K enable"]
pub type Irc40kenR = crate::BitReader<Irc40ken>;
impl Irc40kenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Irc40ken {
        match self.bits {
            false => Irc40ken::Off,
            true => Irc40ken::On,
        }
    }
    #[doc = "IRC40K oscillator disabled"]
    #[inline(always)]
    pub fn is_off(&self) -> bool {
        *self == Irc40ken::Off
    }
    #[doc = "IRC40K oscillator enabled"]
    #[inline(always)]
    pub fn is_on(&self) -> bool {
        *self == Irc40ken::On
    }
}
#[doc = "Field `IRC40KEN` writer - IRC40K enable"]
pub type Irc40kenW<'a, REG> = crate::BitWriter<'a, REG, Irc40ken>;
impl<'a, REG> Irc40kenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "IRC40K oscillator disabled"]
    #[inline(always)]
    pub fn off(self) -> &'a mut crate::W<REG> {
        self.variant(Irc40ken::Off)
    }
    #[doc = "IRC40K oscillator enabled"]
    #[inline(always)]
    pub fn on(self) -> &'a mut crate::W<REG> {
        self.variant(Irc40ken::On)
    }
}
#[doc = "IRC40K stabilization\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Irc40kstbr {
    #[doc = "0: IRC40K oscillator is not stable"]
    NotReady = 0,
    #[doc = "1: IRC40K oscillator is stable"]
    Ready = 1,
}
impl From<Irc40kstbr> for bool {
    #[inline(always)]
    fn from(variant: Irc40kstbr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IRC40KSTB` reader - IRC40K stabilization"]
pub type Irc40kstbR = crate::BitReader<Irc40kstbr>;
impl Irc40kstbR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Irc40kstbr {
        match self.bits {
            false => Irc40kstbr::NotReady,
            true => Irc40kstbr::Ready,
        }
    }
    #[doc = "IRC40K oscillator is not stable"]
    #[inline(always)]
    pub fn is_not_ready(&self) -> bool {
        *self == Irc40kstbr::NotReady
    }
    #[doc = "IRC40K oscillator is stable"]
    #[inline(always)]
    pub fn is_ready(&self) -> bool {
        *self == Irc40kstbr::Ready
    }
}
#[doc = "V12 domain Power reset flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum V12rstfr {
    #[doc = "0: No reset has occured"]
    NoReset = 0,
    #[doc = "1: A reset has occured"]
    Reset = 1,
}
impl From<V12rstfr> for bool {
    #[inline(always)]
    fn from(variant: V12rstfr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `V12RSTF` reader - V12 domain Power reset flag"]
pub type V12rstfR = crate::BitReader<V12rstfr>;
impl V12rstfR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> V12rstfr {
        match self.bits {
            false => V12rstfr::NoReset,
            true => V12rstfr::Reset,
        }
    }
    #[doc = "No reset has occured"]
    #[inline(always)]
    pub fn is_no_reset(&self) -> bool {
        *self == V12rstfr::NoReset
    }
    #[doc = "A reset has occured"]
    #[inline(always)]
    pub fn is_reset(&self) -> bool {
        *self == V12rstfr::Reset
    }
}
#[doc = "Field `V12RSTF` writer - V12 domain Power reset flag"]
pub type V12rstfW<'a, REG> = crate::BitWriter<'a, REG, V12rstfr>;
impl<'a, REG> V12rstfW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No reset has occured"]
    #[inline(always)]
    pub fn no_reset(self) -> &'a mut crate::W<REG> {
        self.variant(V12rstfr::NoReset)
    }
    #[doc = "A reset has occured"]
    #[inline(always)]
    pub fn reset(self) -> &'a mut crate::W<REG> {
        self.variant(V12rstfr::Reset)
    }
}
#[doc = "Reset flag clear\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Rstfcw {
    #[doc = "1: Clears reset flags"]
    Clear = 1,
}
impl From<Rstfcw> for bool {
    #[inline(always)]
    fn from(variant: Rstfcw) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RSTFC` reader - Reset flag clear"]
pub type RstfcR = crate::BitReader<Rstfcw>;
impl RstfcR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Rstfcw> {
        match self.bits {
            true => Some(Rstfcw::Clear),
            _ => None,
        }
    }
    #[doc = "Clears reset flags"]
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        *self == Rstfcw::Clear
    }
}
#[doc = "Field `RSTFC` writer - Reset flag clear"]
pub type RstfcW<'a, REG> = crate::BitWriter<'a, REG, Rstfcw>;
impl<'a, REG> RstfcW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Clears reset flags"]
    #[inline(always)]
    pub fn clear(self) -> &'a mut crate::W<REG> {
        self.variant(Rstfcw::Clear)
    }
}
#[doc = "Field `OBLRSTF` reader - Option byte loader reset flag"]
pub use V12rstfR as OblrstfR;
#[doc = "Field `EPRSTF` reader - External PIN reset flag"]
pub use V12rstfR as EprstfR;
#[doc = "Field `PORRSTF` reader - Power reset flag"]
pub use V12rstfR as PorrstfR;
#[doc = "Field `SWRSTF` reader - Software reset flag"]
pub use V12rstfR as SwrstfR;
#[doc = "Field `FWDGTRSTF` reader - Free Watchdog timer reset flag"]
pub use V12rstfR as FwdgtrstfR;
#[doc = "Field `WWDGTRSTF` reader - Window watchdog timer reset flag"]
pub use V12rstfR as WwdgtrstfR;
#[doc = "Field `LPRSTF` reader - Low-power reset flag"]
pub use V12rstfR as LprstfR;
#[doc = "Field `OBLRSTF` writer - Option byte loader reset flag"]
pub use V12rstfW as OblrstfW;
#[doc = "Field `EPRSTF` writer - External PIN reset flag"]
pub use V12rstfW as EprstfW;
#[doc = "Field `PORRSTF` writer - Power reset flag"]
pub use V12rstfW as PorrstfW;
#[doc = "Field `SWRSTF` writer - Software reset flag"]
pub use V12rstfW as SwrstfW;
#[doc = "Field `FWDGTRSTF` writer - Free Watchdog timer reset flag"]
pub use V12rstfW as FwdgtrstfW;
#[doc = "Field `WWDGTRSTF` writer - Window watchdog timer reset flag"]
pub use V12rstfW as WwdgtrstfW;
#[doc = "Field `LPRSTF` writer - Low-power reset flag"]
pub use V12rstfW as LprstfW;
impl R {
    #[doc = "Bit 0 - IRC40K enable"]
    #[inline(always)]
    pub fn irc40ken(&self) -> Irc40kenR {
        Irc40kenR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - IRC40K stabilization"]
    #[inline(always)]
    pub fn irc40kstb(&self) -> Irc40kstbR {
        Irc40kstbR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 23 - V12 domain Power reset flag"]
    #[inline(always)]
    pub fn v12rstf(&self) -> V12rstfR {
        V12rstfR::new(((self.bits >> 23) & 1) != 0)
    }
    #[doc = "Bit 24 - Reset flag clear"]
    #[inline(always)]
    pub fn rstfc(&self) -> RstfcR {
        RstfcR::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 25 - Option byte loader reset flag"]
    #[inline(always)]
    pub fn oblrstf(&self) -> OblrstfR {
        OblrstfR::new(((self.bits >> 25) & 1) != 0)
    }
    #[doc = "Bit 26 - External PIN reset flag"]
    #[inline(always)]
    pub fn eprstf(&self) -> EprstfR {
        EprstfR::new(((self.bits >> 26) & 1) != 0)
    }
    #[doc = "Bit 27 - Power reset flag"]
    #[inline(always)]
    pub fn porrstf(&self) -> PorrstfR {
        PorrstfR::new(((self.bits >> 27) & 1) != 0)
    }
    #[doc = "Bit 28 - Software reset flag"]
    #[inline(always)]
    pub fn swrstf(&self) -> SwrstfR {
        SwrstfR::new(((self.bits >> 28) & 1) != 0)
    }
    #[doc = "Bit 29 - Free Watchdog timer reset flag"]
    #[inline(always)]
    pub fn fwdgtrstf(&self) -> FwdgtrstfR {
        FwdgtrstfR::new(((self.bits >> 29) & 1) != 0)
    }
    #[doc = "Bit 30 - Window watchdog timer reset flag"]
    #[inline(always)]
    pub fn wwdgtrstf(&self) -> WwdgtrstfR {
        WwdgtrstfR::new(((self.bits >> 30) & 1) != 0)
    }
    #[doc = "Bit 31 - Low-power reset flag"]
    #[inline(always)]
    pub fn lprstf(&self) -> LprstfR {
        LprstfR::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - IRC40K enable"]
    #[inline(always)]
    #[must_use]
    pub fn irc40ken(&mut self) -> Irc40kenW<RstsckSpec> {
        Irc40kenW::new(self, 0)
    }
    #[doc = "Bit 23 - V12 domain Power reset flag"]
    #[inline(always)]
    #[must_use]
    pub fn v12rstf(&mut self) -> V12rstfW<RstsckSpec> {
        V12rstfW::new(self, 23)
    }
    #[doc = "Bit 24 - Reset flag clear"]
    #[inline(always)]
    #[must_use]
    pub fn rstfc(&mut self) -> RstfcW<RstsckSpec> {
        RstfcW::new(self, 24)
    }
    #[doc = "Bit 25 - Option byte loader reset flag"]
    #[inline(always)]
    #[must_use]
    pub fn oblrstf(&mut self) -> OblrstfW<RstsckSpec> {
        OblrstfW::new(self, 25)
    }
    #[doc = "Bit 26 - External PIN reset flag"]
    #[inline(always)]
    #[must_use]
    pub fn eprstf(&mut self) -> EprstfW<RstsckSpec> {
        EprstfW::new(self, 26)
    }
    #[doc = "Bit 27 - Power reset flag"]
    #[inline(always)]
    #[must_use]
    pub fn porrstf(&mut self) -> PorrstfW<RstsckSpec> {
        PorrstfW::new(self, 27)
    }
    #[doc = "Bit 28 - Software reset flag"]
    #[inline(always)]
    #[must_use]
    pub fn swrstf(&mut self) -> SwrstfW<RstsckSpec> {
        SwrstfW::new(self, 28)
    }
    #[doc = "Bit 29 - Free Watchdog timer reset flag"]
    #[inline(always)]
    #[must_use]
    pub fn fwdgtrstf(&mut self) -> FwdgtrstfW<RstsckSpec> {
        FwdgtrstfW::new(self, 29)
    }
    #[doc = "Bit 30 - Window watchdog timer reset flag"]
    #[inline(always)]
    #[must_use]
    pub fn wwdgtrstf(&mut self) -> WwdgtrstfW<RstsckSpec> {
        WwdgtrstfW::new(self, 30)
    }
    #[doc = "Bit 31 - Low-power reset flag"]
    #[inline(always)]
    #[must_use]
    pub fn lprstf(&mut self) -> LprstfW<RstsckSpec> {
        LprstfW::new(self, 31)
    }
}
#[doc = "Reset source /clock register (RCU_RSTSCK)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rstsck::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 [`rstsck::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct RstsckSpec;
impl crate::RegisterSpec for RstsckSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`rstsck::R`](R) reader structure"]
impl crate::Readable for RstsckSpec {}
#[doc = "`write(|w| ..)` method takes [`rstsck::W`](W) writer structure"]
impl crate::Writable for RstsckSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets RSTSCK to value 0x0c00_0000"]
impl crate::Resettable for RstsckSpec {
    const RESET_VALUE: u32 = 0x0c00_0000;
}