1#[doc = "Register `SRIF` reader"]
2pub type R = crate::R<SrifSpec>;
3#[doc = "Register `SRIF` writer"]
4pub type W = crate::W<SrifSpec>;
5#[doc = "Pin Reset\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Pin {
9 #[doc = "0: Reset source not pending"]
10 Disabled = 0,
11 #[doc = "1: Reset source pending"]
12 Enabled = 1,
13}
14impl From<Pin> for bool {
15 #[inline(always)]
16 fn from(variant: Pin) -> Self {
17 variant as u8 != 0
18 }
19}
20#[doc = "Field `PIN` reader - Pin Reset"]
21pub type PinR = crate::BitReader<Pin>;
22impl PinR {
23 #[doc = "Get enumerated values variant"]
24 #[inline(always)]
25 pub const fn variant(&self) -> Pin {
26 match self.bits {
27 false => Pin::Disabled,
28 true => Pin::Enabled,
29 }
30 }
31 #[doc = "Reset source not pending"]
32 #[inline(always)]
33 pub fn is_disabled(&self) -> bool {
34 *self == Pin::Disabled
35 }
36 #[doc = "Reset source pending"]
37 #[inline(always)]
38 pub fn is_enabled(&self) -> bool {
39 *self == Pin::Enabled
40 }
41}
42#[doc = "Field `PIN` writer - Pin Reset"]
43pub type PinW<'a, REG> = crate::BitWriter1C<'a, REG, Pin>;
44impl<'a, REG> PinW<'a, REG>
45where
46 REG: crate::Writable + crate::RegisterSpec,
47{
48 #[doc = "Reset source not pending"]
49 #[inline(always)]
50 pub fn disabled(self) -> &'a mut crate::W<REG> {
51 self.variant(Pin::Disabled)
52 }
53 #[doc = "Reset source pending"]
54 #[inline(always)]
55 pub fn enabled(self) -> &'a mut crate::W<REG> {
56 self.variant(Pin::Enabled)
57 }
58}
59#[doc = "DAP Reset\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Dap {
63 #[doc = "0: Reset source not pending"]
64 Disabled = 0,
65 #[doc = "1: Reset source pending"]
66 Enabled = 1,
67}
68impl From<Dap> for bool {
69 #[inline(always)]
70 fn from(variant: Dap) -> Self {
71 variant as u8 != 0
72 }
73}
74#[doc = "Field `DAP` reader - DAP Reset"]
75pub type DapR = crate::BitReader<Dap>;
76impl DapR {
77 #[doc = "Get enumerated values variant"]
78 #[inline(always)]
79 pub const fn variant(&self) -> Dap {
80 match self.bits {
81 false => Dap::Disabled,
82 true => Dap::Enabled,
83 }
84 }
85 #[doc = "Reset source not pending"]
86 #[inline(always)]
87 pub fn is_disabled(&self) -> bool {
88 *self == Dap::Disabled
89 }
90 #[doc = "Reset source pending"]
91 #[inline(always)]
92 pub fn is_enabled(&self) -> bool {
93 *self == Dap::Enabled
94 }
95}
96#[doc = "Field `DAP` writer - DAP Reset"]
97pub type DapW<'a, REG> = crate::BitWriter1C<'a, REG, Dap>;
98impl<'a, REG> DapW<'a, REG>
99where
100 REG: crate::Writable + crate::RegisterSpec,
101{
102 #[doc = "Reset source not pending"]
103 #[inline(always)]
104 pub fn disabled(self) -> &'a mut crate::W<REG> {
105 self.variant(Dap::Disabled)
106 }
107 #[doc = "Reset source pending"]
108 #[inline(always)]
109 pub fn enabled(self) -> &'a mut crate::W<REG> {
110 self.variant(Dap::Enabled)
111 }
112}
113#[doc = "Low Power Acknowledge Timeout Reset\n\nValue on reset: 0"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum Lpack {
117 #[doc = "0: Reset source not pending"]
118 Disabled = 0,
119 #[doc = "1: Reset source pending"]
120 Enabled = 1,
121}
122impl From<Lpack> for bool {
123 #[inline(always)]
124 fn from(variant: Lpack) -> Self {
125 variant as u8 != 0
126 }
127}
128#[doc = "Field `LPACK` reader - Low Power Acknowledge Timeout Reset"]
129pub type LpackR = crate::BitReader<Lpack>;
130impl LpackR {
131 #[doc = "Get enumerated values variant"]
132 #[inline(always)]
133 pub const fn variant(&self) -> Lpack {
134 match self.bits {
135 false => Lpack::Disabled,
136 true => Lpack::Enabled,
137 }
138 }
139 #[doc = "Reset source not pending"]
140 #[inline(always)]
141 pub fn is_disabled(&self) -> bool {
142 *self == Lpack::Disabled
143 }
144 #[doc = "Reset source pending"]
145 #[inline(always)]
146 pub fn is_enabled(&self) -> bool {
147 *self == Lpack::Enabled
148 }
149}
150#[doc = "Field `LPACK` writer - Low Power Acknowledge Timeout Reset"]
151pub type LpackW<'a, REG> = crate::BitWriter1C<'a, REG, Lpack>;
152impl<'a, REG> LpackW<'a, REG>
153where
154 REG: crate::Writable + crate::RegisterSpec,
155{
156 #[doc = "Reset source not pending"]
157 #[inline(always)]
158 pub fn disabled(self) -> &'a mut crate::W<REG> {
159 self.variant(Lpack::Disabled)
160 }
161 #[doc = "Reset source pending"]
162 #[inline(always)]
163 pub fn enabled(self) -> &'a mut crate::W<REG> {
164 self.variant(Lpack::Enabled)
165 }
166}
167#[doc = "Windowed Watchdog 0 Reset\n\nValue on reset: 0"]
168#[cfg_attr(feature = "defmt", derive(defmt::Format))]
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
170pub enum Wwdt0 {
171 #[doc = "0: Reset source not pending"]
172 Disabled = 0,
173 #[doc = "1: Reset source pending"]
174 Enabled = 1,
175}
176impl From<Wwdt0> for bool {
177 #[inline(always)]
178 fn from(variant: Wwdt0) -> Self {
179 variant as u8 != 0
180 }
181}
182#[doc = "Field `WWDT0` reader - Windowed Watchdog 0 Reset"]
183pub type Wwdt0R = crate::BitReader<Wwdt0>;
184impl Wwdt0R {
185 #[doc = "Get enumerated values variant"]
186 #[inline(always)]
187 pub const fn variant(&self) -> Wwdt0 {
188 match self.bits {
189 false => Wwdt0::Disabled,
190 true => Wwdt0::Enabled,
191 }
192 }
193 #[doc = "Reset source not pending"]
194 #[inline(always)]
195 pub fn is_disabled(&self) -> bool {
196 *self == Wwdt0::Disabled
197 }
198 #[doc = "Reset source pending"]
199 #[inline(always)]
200 pub fn is_enabled(&self) -> bool {
201 *self == Wwdt0::Enabled
202 }
203}
204#[doc = "Field `WWDT0` writer - Windowed Watchdog 0 Reset"]
205pub type Wwdt0W<'a, REG> = crate::BitWriter1C<'a, REG, Wwdt0>;
206impl<'a, REG> Wwdt0W<'a, REG>
207where
208 REG: crate::Writable + crate::RegisterSpec,
209{
210 #[doc = "Reset source not pending"]
211 #[inline(always)]
212 pub fn disabled(self) -> &'a mut crate::W<REG> {
213 self.variant(Wwdt0::Disabled)
214 }
215 #[doc = "Reset source pending"]
216 #[inline(always)]
217 pub fn enabled(self) -> &'a mut crate::W<REG> {
218 self.variant(Wwdt0::Enabled)
219 }
220}
221#[doc = "Software Reset\n\nValue on reset: 0"]
222#[cfg_attr(feature = "defmt", derive(defmt::Format))]
223#[derive(Clone, Copy, Debug, PartialEq, Eq)]
224pub enum Sw {
225 #[doc = "0: Reset source not pending"]
226 Disabled = 0,
227 #[doc = "1: Reset source pending"]
228 Enabled = 1,
229}
230impl From<Sw> for bool {
231 #[inline(always)]
232 fn from(variant: Sw) -> Self {
233 variant as u8 != 0
234 }
235}
236#[doc = "Field `SW` reader - Software Reset"]
237pub type SwR = crate::BitReader<Sw>;
238impl SwR {
239 #[doc = "Get enumerated values variant"]
240 #[inline(always)]
241 pub const fn variant(&self) -> Sw {
242 match self.bits {
243 false => Sw::Disabled,
244 true => Sw::Enabled,
245 }
246 }
247 #[doc = "Reset source not pending"]
248 #[inline(always)]
249 pub fn is_disabled(&self) -> bool {
250 *self == Sw::Disabled
251 }
252 #[doc = "Reset source pending"]
253 #[inline(always)]
254 pub fn is_enabled(&self) -> bool {
255 *self == Sw::Enabled
256 }
257}
258#[doc = "Field `SW` writer - Software Reset"]
259pub type SwW<'a, REG> = crate::BitWriter1C<'a, REG, Sw>;
260impl<'a, REG> SwW<'a, REG>
261where
262 REG: crate::Writable + crate::RegisterSpec,
263{
264 #[doc = "Reset source not pending"]
265 #[inline(always)]
266 pub fn disabled(self) -> &'a mut crate::W<REG> {
267 self.variant(Sw::Disabled)
268 }
269 #[doc = "Reset source pending"]
270 #[inline(always)]
271 pub fn enabled(self) -> &'a mut crate::W<REG> {
272 self.variant(Sw::Enabled)
273 }
274}
275#[doc = "Lockup Reset\n\nValue on reset: 0"]
276#[cfg_attr(feature = "defmt", derive(defmt::Format))]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278pub enum Lockup {
279 #[doc = "0: Reset source not pending"]
280 Disabled = 0,
281 #[doc = "1: Reset source pending"]
282 Enabled = 1,
283}
284impl From<Lockup> for bool {
285 #[inline(always)]
286 fn from(variant: Lockup) -> Self {
287 variant as u8 != 0
288 }
289}
290#[doc = "Field `LOCKUP` reader - Lockup Reset"]
291pub type LockupR = crate::BitReader<Lockup>;
292impl LockupR {
293 #[doc = "Get enumerated values variant"]
294 #[inline(always)]
295 pub const fn variant(&self) -> Lockup {
296 match self.bits {
297 false => Lockup::Disabled,
298 true => Lockup::Enabled,
299 }
300 }
301 #[doc = "Reset source not pending"]
302 #[inline(always)]
303 pub fn is_disabled(&self) -> bool {
304 *self == Lockup::Disabled
305 }
306 #[doc = "Reset source pending"]
307 #[inline(always)]
308 pub fn is_enabled(&self) -> bool {
309 *self == Lockup::Enabled
310 }
311}
312#[doc = "Field `LOCKUP` writer - Lockup Reset"]
313pub type LockupW<'a, REG> = crate::BitWriter1C<'a, REG, Lockup>;
314impl<'a, REG> LockupW<'a, REG>
315where
316 REG: crate::Writable + crate::RegisterSpec,
317{
318 #[doc = "Reset source not pending"]
319 #[inline(always)]
320 pub fn disabled(self) -> &'a mut crate::W<REG> {
321 self.variant(Lockup::Disabled)
322 }
323 #[doc = "Reset source pending"]
324 #[inline(always)]
325 pub fn enabled(self) -> &'a mut crate::W<REG> {
326 self.variant(Lockup::Enabled)
327 }
328}
329#[doc = "Code Watchdog 0 Reset\n\nValue on reset: 0"]
330#[cfg_attr(feature = "defmt", derive(defmt::Format))]
331#[derive(Clone, Copy, Debug, PartialEq, Eq)]
332pub enum Cdog0 {
333 #[doc = "0: Reset source not pending"]
334 Disabled = 0,
335 #[doc = "1: Reset source pending"]
336 Enabled = 1,
337}
338impl From<Cdog0> for bool {
339 #[inline(always)]
340 fn from(variant: Cdog0) -> Self {
341 variant as u8 != 0
342 }
343}
344#[doc = "Field `CDOG0` reader - Code Watchdog 0 Reset"]
345pub type Cdog0R = crate::BitReader<Cdog0>;
346impl Cdog0R {
347 #[doc = "Get enumerated values variant"]
348 #[inline(always)]
349 pub const fn variant(&self) -> Cdog0 {
350 match self.bits {
351 false => Cdog0::Disabled,
352 true => Cdog0::Enabled,
353 }
354 }
355 #[doc = "Reset source not pending"]
356 #[inline(always)]
357 pub fn is_disabled(&self) -> bool {
358 *self == Cdog0::Disabled
359 }
360 #[doc = "Reset source pending"]
361 #[inline(always)]
362 pub fn is_enabled(&self) -> bool {
363 *self == Cdog0::Enabled
364 }
365}
366#[doc = "Field `CDOG0` writer - Code Watchdog 0 Reset"]
367pub type Cdog0W<'a, REG> = crate::BitWriter1C<'a, REG, Cdog0>;
368impl<'a, REG> Cdog0W<'a, REG>
369where
370 REG: crate::Writable + crate::RegisterSpec,
371{
372 #[doc = "Reset source not pending"]
373 #[inline(always)]
374 pub fn disabled(self) -> &'a mut crate::W<REG> {
375 self.variant(Cdog0::Disabled)
376 }
377 #[doc = "Reset source pending"]
378 #[inline(always)]
379 pub fn enabled(self) -> &'a mut crate::W<REG> {
380 self.variant(Cdog0::Enabled)
381 }
382}
383#[doc = "Code Watchdog 1 Reset\n\nValue on reset: 0"]
384#[cfg_attr(feature = "defmt", derive(defmt::Format))]
385#[derive(Clone, Copy, Debug, PartialEq, Eq)]
386pub enum Cdog1 {
387 #[doc = "0: Reset source not pending"]
388 Disabled = 0,
389 #[doc = "1: Reset source pending"]
390 Enabled = 1,
391}
392impl From<Cdog1> for bool {
393 #[inline(always)]
394 fn from(variant: Cdog1) -> Self {
395 variant as u8 != 0
396 }
397}
398#[doc = "Field `CDOG1` reader - Code Watchdog 1 Reset"]
399pub type Cdog1R = crate::BitReader<Cdog1>;
400impl Cdog1R {
401 #[doc = "Get enumerated values variant"]
402 #[inline(always)]
403 pub const fn variant(&self) -> Cdog1 {
404 match self.bits {
405 false => Cdog1::Disabled,
406 true => Cdog1::Enabled,
407 }
408 }
409 #[doc = "Reset source not pending"]
410 #[inline(always)]
411 pub fn is_disabled(&self) -> bool {
412 *self == Cdog1::Disabled
413 }
414 #[doc = "Reset source pending"]
415 #[inline(always)]
416 pub fn is_enabled(&self) -> bool {
417 *self == Cdog1::Enabled
418 }
419}
420#[doc = "Field `CDOG1` writer - Code Watchdog 1 Reset"]
421pub type Cdog1W<'a, REG> = crate::BitWriter1C<'a, REG, Cdog1>;
422impl<'a, REG> Cdog1W<'a, REG>
423where
424 REG: crate::Writable + crate::RegisterSpec,
425{
426 #[doc = "Reset source not pending"]
427 #[inline(always)]
428 pub fn disabled(self) -> &'a mut crate::W<REG> {
429 self.variant(Cdog1::Disabled)
430 }
431 #[doc = "Reset source pending"]
432 #[inline(always)]
433 pub fn enabled(self) -> &'a mut crate::W<REG> {
434 self.variant(Cdog1::Enabled)
435 }
436}
437impl R {
438 #[doc = "Bit 8 - Pin Reset"]
439 #[inline(always)]
440 pub fn pin(&self) -> PinR {
441 PinR::new(((self.bits >> 8) & 1) != 0)
442 }
443 #[doc = "Bit 9 - DAP Reset"]
444 #[inline(always)]
445 pub fn dap(&self) -> DapR {
446 DapR::new(((self.bits >> 9) & 1) != 0)
447 }
448 #[doc = "Bit 11 - Low Power Acknowledge Timeout Reset"]
449 #[inline(always)]
450 pub fn lpack(&self) -> LpackR {
451 LpackR::new(((self.bits >> 11) & 1) != 0)
452 }
453 #[doc = "Bit 13 - Windowed Watchdog 0 Reset"]
454 #[inline(always)]
455 pub fn wwdt0(&self) -> Wwdt0R {
456 Wwdt0R::new(((self.bits >> 13) & 1) != 0)
457 }
458 #[doc = "Bit 14 - Software Reset"]
459 #[inline(always)]
460 pub fn sw(&self) -> SwR {
461 SwR::new(((self.bits >> 14) & 1) != 0)
462 }
463 #[doc = "Bit 15 - Lockup Reset"]
464 #[inline(always)]
465 pub fn lockup(&self) -> LockupR {
466 LockupR::new(((self.bits >> 15) & 1) != 0)
467 }
468 #[doc = "Bit 26 - Code Watchdog 0 Reset"]
469 #[inline(always)]
470 pub fn cdog0(&self) -> Cdog0R {
471 Cdog0R::new(((self.bits >> 26) & 1) != 0)
472 }
473 #[doc = "Bit 27 - Code Watchdog 1 Reset"]
474 #[inline(always)]
475 pub fn cdog1(&self) -> Cdog1R {
476 Cdog1R::new(((self.bits >> 27) & 1) != 0)
477 }
478}
479#[cfg(feature = "debug")]
480impl core::fmt::Debug for R {
481 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
482 f.debug_struct("SRIF")
483 .field("pin", &self.pin())
484 .field("dap", &self.dap())
485 .field("lpack", &self.lpack())
486 .field("wwdt0", &self.wwdt0())
487 .field("sw", &self.sw())
488 .field("lockup", &self.lockup())
489 .field("cdog0", &self.cdog0())
490 .field("cdog1", &self.cdog1())
491 .finish()
492 }
493}
494impl W {
495 #[doc = "Bit 8 - Pin Reset"]
496 #[inline(always)]
497 pub fn pin(&mut self) -> PinW<'_, SrifSpec> {
498 PinW::new(self, 8)
499 }
500 #[doc = "Bit 9 - DAP Reset"]
501 #[inline(always)]
502 pub fn dap(&mut self) -> DapW<'_, SrifSpec> {
503 DapW::new(self, 9)
504 }
505 #[doc = "Bit 11 - Low Power Acknowledge Timeout Reset"]
506 #[inline(always)]
507 pub fn lpack(&mut self) -> LpackW<'_, SrifSpec> {
508 LpackW::new(self, 11)
509 }
510 #[doc = "Bit 13 - Windowed Watchdog 0 Reset"]
511 #[inline(always)]
512 pub fn wwdt0(&mut self) -> Wwdt0W<'_, SrifSpec> {
513 Wwdt0W::new(self, 13)
514 }
515 #[doc = "Bit 14 - Software Reset"]
516 #[inline(always)]
517 pub fn sw(&mut self) -> SwW<'_, SrifSpec> {
518 SwW::new(self, 14)
519 }
520 #[doc = "Bit 15 - Lockup Reset"]
521 #[inline(always)]
522 pub fn lockup(&mut self) -> LockupW<'_, SrifSpec> {
523 LockupW::new(self, 15)
524 }
525 #[doc = "Bit 26 - Code Watchdog 0 Reset"]
526 #[inline(always)]
527 pub fn cdog0(&mut self) -> Cdog0W<'_, SrifSpec> {
528 Cdog0W::new(self, 26)
529 }
530 #[doc = "Bit 27 - Code Watchdog 1 Reset"]
531 #[inline(always)]
532 pub fn cdog1(&mut self) -> Cdog1W<'_, SrifSpec> {
533 Cdog1W::new(self, 27)
534 }
535}
536#[doc = "System Reset Interrupt Flag\n\nYou can [`read`](crate::Reg::read) this register and get [`srif::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`srif::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
537pub struct SrifSpec;
538impl crate::RegisterSpec for SrifSpec {
539 type Ux = u32;
540}
541#[doc = "`read()` method returns [`srif::R`](R) reader structure"]
542impl crate::Readable for SrifSpec {}
543#[doc = "`write(|w| ..)` method takes [`srif::W`](W) writer structure"]
544impl crate::Writable for SrifSpec {
545 type Safety = crate::Unsafe;
546 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x0c00_eb00;
547}
548#[doc = "`reset()` method sets SRIF to value 0"]
549impl crate::Resettable for SrifSpec {}