py32f0/py32f040/wwdg/
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///Register `SR` writer
17pub struct W(crate::W<SR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SR_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<SR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37///Field `EWIF` reader - Early Wakeup Interrupt flag
38pub type EWIF_R = crate::BitReader<EWIFR_A>;
39/**Early Wakeup Interrupt flag
40
41Value on reset: 0*/
42#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum EWIFR_A {
44    ///0: The EWI Interrupt Service Routine has been serviced
45    Finished = 0,
46    ///1: The EWI Interrupt Service Routine has been triggered
47    Pending = 1,
48}
49impl From<EWIFR_A> for bool {
50    #[inline(always)]
51    fn from(variant: EWIFR_A) -> Self {
52        variant as u8 != 0
53    }
54}
55impl EWIF_R {
56    ///Get enumerated values variant
57    #[inline(always)]
58    pub fn variant(&self) -> EWIFR_A {
59        match self.bits {
60            false => EWIFR_A::Finished,
61            true => EWIFR_A::Pending,
62        }
63    }
64    ///Checks if the value of the field is `Finished`
65    #[inline(always)]
66    pub fn is_finished(&self) -> bool {
67        *self == EWIFR_A::Finished
68    }
69    ///Checks if the value of the field is `Pending`
70    #[inline(always)]
71    pub fn is_pending(&self) -> bool {
72        *self == EWIFR_A::Pending
73    }
74}
75/**Early Wakeup Interrupt flag
76
77Value on reset: 0*/
78#[derive(Clone, Copy, Debug, PartialEq, Eq)]
79pub enum EWIFW_AW {
80    ///0: The EWI Interrupt Service Routine has been serviced
81    Finished = 0,
82}
83impl From<EWIFW_AW> for bool {
84    #[inline(always)]
85    fn from(variant: EWIFW_AW) -> Self {
86        variant as u8 != 0
87    }
88}
89///Field `EWIF` writer - Early Wakeup Interrupt flag
90pub type EWIF_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR_SPEC, EWIFW_AW, O>;
91impl<'a, const O: u8> EWIF_W<'a, O> {
92    ///The EWI Interrupt Service Routine has been serviced
93    #[inline(always)]
94    pub fn finished(self) -> &'a mut W {
95        self.variant(EWIFW_AW::Finished)
96    }
97}
98impl R {
99    ///Bit 0 - Early Wakeup Interrupt flag
100    #[inline(always)]
101    pub fn ewif(&self) -> EWIF_R {
102        EWIF_R::new((self.bits & 1) != 0)
103    }
104}
105impl W {
106    ///Bit 0 - Early Wakeup Interrupt flag
107    #[inline(always)]
108    #[must_use]
109    pub fn ewif(&mut self) -> EWIF_W<0> {
110        EWIF_W::new(self)
111    }
112    ///Writes raw bits to the register.
113    #[inline(always)]
114    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
115        self.0.bits(bits);
116        self
117    }
118}
119/**Status register (WWDG_SR)
120
121This register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
122
123For information about available fields see [sr](index.html) module*/
124pub struct SR_SPEC;
125impl crate::RegisterSpec for SR_SPEC {
126    type Ux = u32;
127}
128///`read()` method returns [sr::R](R) reader structure
129impl crate::Readable for SR_SPEC {
130    type Reader = R;
131}
132///`write(|w| ..)` method takes [sr::W](W) writer structure
133impl crate::Writable for SR_SPEC {
134    type Writer = W;
135    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0x01;
136    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
137}
138///`reset()` method sets SR to value 0
139impl crate::Resettable for SR_SPEC {
140    const RESET_VALUE: Self::Ux = 0;
141}