py32f0/py32f002a/iwdg/
sr.rs

1///Register `SR` reader
2pub struct R(crate::R<SR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16///Field `PVU` reader - Watchdog prescaler value update
17pub type PVU_R = crate::BitReader<PVU_A>;
18/**Watchdog prescaler value update
19
20Value on reset: 0*/
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22pub enum PVU_A {
23    ///0: No update on-going
24    Idle = 0,
25    ///1: Update on-going
26    Busy = 1,
27}
28impl From<PVU_A> for bool {
29    #[inline(always)]
30    fn from(variant: PVU_A) -> Self {
31        variant as u8 != 0
32    }
33}
34impl PVU_R {
35    ///Get enumerated values variant
36    #[inline(always)]
37    pub fn variant(&self) -> PVU_A {
38        match self.bits {
39            false => PVU_A::Idle,
40            true => PVU_A::Busy,
41        }
42    }
43    ///Checks if the value of the field is `Idle`
44    #[inline(always)]
45    pub fn is_idle(&self) -> bool {
46        *self == PVU_A::Idle
47    }
48    ///Checks if the value of the field is `Busy`
49    #[inline(always)]
50    pub fn is_busy(&self) -> bool {
51        *self == PVU_A::Busy
52    }
53}
54///Field `RVU` reader - Watchdog counter reload value update
55pub type RVU_R = crate::BitReader<RVU_A>;
56/**Watchdog counter reload value update
57
58Value on reset: 0*/
59#[derive(Clone, Copy, Debug, PartialEq, Eq)]
60pub enum RVU_A {
61    ///0: No update on-going
62    Idle = 0,
63    ///1: Update on-going
64    Busy = 1,
65}
66impl From<RVU_A> for bool {
67    #[inline(always)]
68    fn from(variant: RVU_A) -> Self {
69        variant as u8 != 0
70    }
71}
72impl RVU_R {
73    ///Get enumerated values variant
74    #[inline(always)]
75    pub fn variant(&self) -> RVU_A {
76        match self.bits {
77            false => RVU_A::Idle,
78            true => RVU_A::Busy,
79        }
80    }
81    ///Checks if the value of the field is `Idle`
82    #[inline(always)]
83    pub fn is_idle(&self) -> bool {
84        *self == RVU_A::Idle
85    }
86    ///Checks if the value of the field is `Busy`
87    #[inline(always)]
88    pub fn is_busy(&self) -> bool {
89        *self == RVU_A::Busy
90    }
91}
92///Field `WVU` reader - Watchdog counter window value update
93pub type WVU_R = crate::BitReader<WVU_A>;
94/**Watchdog counter window value update
95
96Value on reset: 0*/
97#[derive(Clone, Copy, Debug, PartialEq, Eq)]
98pub enum WVU_A {
99    ///0: No update on-going
100    Idle = 0,
101    ///1: Update on-going
102    Busy = 1,
103}
104impl From<WVU_A> for bool {
105    #[inline(always)]
106    fn from(variant: WVU_A) -> Self {
107        variant as u8 != 0
108    }
109}
110impl WVU_R {
111    ///Get enumerated values variant
112    #[inline(always)]
113    pub fn variant(&self) -> WVU_A {
114        match self.bits {
115            false => WVU_A::Idle,
116            true => WVU_A::Busy,
117        }
118    }
119    ///Checks if the value of the field is `Idle`
120    #[inline(always)]
121    pub fn is_idle(&self) -> bool {
122        *self == WVU_A::Idle
123    }
124    ///Checks if the value of the field is `Busy`
125    #[inline(always)]
126    pub fn is_busy(&self) -> bool {
127        *self == WVU_A::Busy
128    }
129}
130impl R {
131    ///Bit 0 - Watchdog prescaler value update
132    #[inline(always)]
133    pub fn pvu(&self) -> PVU_R {
134        PVU_R::new((self.bits & 1) != 0)
135    }
136    ///Bit 1 - Watchdog counter reload value update
137    #[inline(always)]
138    pub fn rvu(&self) -> RVU_R {
139        RVU_R::new(((self.bits >> 1) & 1) != 0)
140    }
141    ///Bit 2 - Watchdog counter window value update
142    #[inline(always)]
143    pub fn wvu(&self) -> WVU_R {
144        WVU_R::new(((self.bits >> 2) & 1) != 0)
145    }
146}
147/**Status register (IWDG_SR)
148
149This register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
150
151For information about available fields see [sr](index.html) module*/
152pub struct SR_SPEC;
153impl crate::RegisterSpec for SR_SPEC {
154    type Ux = u32;
155}
156///`read()` method returns [sr::R](R) reader structure
157impl crate::Readable for SR_SPEC {
158    type Reader = R;
159}
160///`reset()` method sets SR to value 0
161impl crate::Resettable for SR_SPEC {
162    const RESET_VALUE: Self::Ux = 0;
163}