1#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"Independent Watchdog Timer"]
28unsafe impl ::core::marker::Send for super::Iwdt {}
29unsafe impl ::core::marker::Sync for super::Iwdt {}
30impl super::Iwdt {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36 #[doc = "IWDT Refresh Register"]
37 #[inline(always)]
38 pub const fn iwdtrr(
39 &self,
40 ) -> &'static crate::common::Reg<self::Iwdtrr_SPEC, crate::common::RW> {
41 unsafe {
42 crate::common::Reg::<self::Iwdtrr_SPEC, crate::common::RW>::from_ptr(
43 self._svd2pac_as_ptr().add(0usize),
44 )
45 }
46 }
47
48 #[doc = "IWDT Status Register"]
49 #[inline(always)]
50 pub const fn iwdtsr(
51 &self,
52 ) -> &'static crate::common::Reg<self::Iwdtsr_SPEC, crate::common::RW> {
53 unsafe {
54 crate::common::Reg::<self::Iwdtsr_SPEC, crate::common::RW>::from_ptr(
55 self._svd2pac_as_ptr().add(4usize),
56 )
57 }
58 }
59}
60#[doc(hidden)]
61#[derive(Copy, Clone, Eq, PartialEq)]
62pub struct Iwdtrr_SPEC;
63impl crate::sealed::RegSpec for Iwdtrr_SPEC {
64 type DataType = u8;
65}
66#[doc = "IWDT Refresh Register"]
67pub type Iwdtrr = crate::RegValueT<Iwdtrr_SPEC>;
68
69impl NoBitfieldReg<Iwdtrr_SPEC> for Iwdtrr {}
70impl ::core::default::Default for Iwdtrr {
71 #[inline(always)]
72 fn default() -> Iwdtrr {
73 <crate::RegValueT<Iwdtrr_SPEC> as RegisterValue<_>>::new(255)
74 }
75}
76
77#[doc(hidden)]
78#[derive(Copy, Clone, Eq, PartialEq)]
79pub struct Iwdtsr_SPEC;
80impl crate::sealed::RegSpec for Iwdtsr_SPEC {
81 type DataType = u16;
82}
83#[doc = "IWDT Status Register"]
84pub type Iwdtsr = crate::RegValueT<Iwdtsr_SPEC>;
85
86impl Iwdtsr {
87 #[doc = "Down-counter Value"]
88 #[inline(always)]
89 pub fn cntval(
90 self,
91 ) -> crate::common::RegisterField<0, 0x3fff, 1, 0, u16, Iwdtsr_SPEC, crate::common::R> {
92 crate::common::RegisterField::<0,0x3fff,1,0,u16, Iwdtsr_SPEC,crate::common::R>::from_register(self,0)
93 }
94 #[doc = "Underflow Flag"]
95 #[inline(always)]
96 pub fn undff(
97 self,
98 ) -> crate::common::RegisterField<14, 0x1, 1, 0, iwdtsr::Undff, Iwdtsr_SPEC, crate::common::RW>
99 {
100 crate::common::RegisterField::<14,0x1,1,0,iwdtsr::Undff, Iwdtsr_SPEC,crate::common::RW>::from_register(self,0)
101 }
102 #[doc = "Refresh Error Flag"]
103 #[inline(always)]
104 pub fn refef(
105 self,
106 ) -> crate::common::RegisterField<15, 0x1, 1, 0, iwdtsr::Refef, Iwdtsr_SPEC, crate::common::RW>
107 {
108 crate::common::RegisterField::<15,0x1,1,0,iwdtsr::Refef, Iwdtsr_SPEC,crate::common::RW>::from_register(self,0)
109 }
110}
111impl ::core::default::Default for Iwdtsr {
112 #[inline(always)]
113 fn default() -> Iwdtsr {
114 <crate::RegValueT<Iwdtsr_SPEC> as RegisterValue<_>>::new(0)
115 }
116}
117pub mod iwdtsr {
118
119 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
120 pub struct Undff_SPEC;
121 pub type Undff = crate::EnumBitfieldStruct<u8, Undff_SPEC>;
122 impl Undff {
123 #[doc = "No underflow occurred"]
124 pub const _0: Self = Self::new(0);
125 #[doc = "Underflow occurred"]
126 pub const _1: Self = Self::new(1);
127 }
128 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
129 pub struct Refef_SPEC;
130 pub type Refef = crate::EnumBitfieldStruct<u8, Refef_SPEC>;
131 impl Refef {
132 #[doc = "No refresh error occurred"]
133 pub const _0: Self = Self::new(0);
134 #[doc = "Refresh error occurred"]
135 pub const _1: Self = Self::new(1);
136 }
137}