stm32f1_staging/stm32f101/wwdg/
sr.rs

1///Register `SR` reader
2pub type R = crate::R<SRrs>;
3///Register `SR` writer
4pub type W = crate::W<SRrs>;
5/**Early Wakeup Interrupt
6
7Value on reset: 0*/
8#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum EWIFR {
11    ///0: The EWI Interrupt Service Routine has been serviced
12    Finished = 0,
13    ///1: The EWI Interrupt Service Routine has been triggered
14    Pending = 1,
15}
16impl From<EWIFR> for bool {
17    #[inline(always)]
18    fn from(variant: EWIFR) -> Self {
19        variant as u8 != 0
20    }
21}
22///Field `EWIF` reader - Early Wakeup Interrupt
23pub type EWIF_R = crate::BitReader<EWIFR>;
24impl EWIF_R {
25    ///Get enumerated values variant
26    #[inline(always)]
27    pub const fn variant(&self) -> EWIFR {
28        match self.bits {
29            false => EWIFR::Finished,
30            true => EWIFR::Pending,
31        }
32    }
33    ///The EWI Interrupt Service Routine has been serviced
34    #[inline(always)]
35    pub fn is_finished(&self) -> bool {
36        *self == EWIFR::Finished
37    }
38    ///The EWI Interrupt Service Routine has been triggered
39    #[inline(always)]
40    pub fn is_pending(&self) -> bool {
41        *self == EWIFR::Pending
42    }
43}
44/**Early Wakeup Interrupt
45
46Value on reset: 0*/
47#[cfg_attr(feature = "defmt", derive(defmt::Format))]
48#[derive(Clone, Copy, Debug, PartialEq, Eq)]
49pub enum EWIFW {
50    ///0: The EWI Interrupt Service Routine has been serviced
51    Finished = 0,
52}
53impl From<EWIFW> for bool {
54    #[inline(always)]
55    fn from(variant: EWIFW) -> Self {
56        variant as u8 != 0
57    }
58}
59///Field `EWIF` writer - Early Wakeup Interrupt
60pub type EWIF_W<'a, REG> = crate::BitWriter0C<'a, REG, EWIFW>;
61impl<'a, REG> EWIF_W<'a, REG>
62where
63    REG: crate::Writable + crate::RegisterSpec,
64{
65    ///The EWI Interrupt Service Routine has been serviced
66    #[inline(always)]
67    pub fn finished(self) -> &'a mut crate::W<REG> {
68        self.variant(EWIFW::Finished)
69    }
70}
71impl R {
72    ///Bit 0 - Early Wakeup Interrupt
73    #[inline(always)]
74    pub fn ewif(&self) -> EWIF_R {
75        EWIF_R::new((self.bits & 1) != 0)
76    }
77}
78impl core::fmt::Debug for R {
79    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
80        f.debug_struct("SR").field("ewif", &self.ewif()).finish()
81    }
82}
83impl W {
84    ///Bit 0 - Early Wakeup Interrupt
85    #[inline(always)]
86    pub fn ewif(&mut self) -> EWIF_W<SRrs> {
87        EWIF_W::new(self, 0)
88    }
89}
90/**Status register (WWDG_SR)
91
92You can [`read`](crate::Reg::read) this register and get [`sr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
93
94See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F101.html#WWDG:SR)*/
95pub struct SRrs;
96impl crate::RegisterSpec for SRrs {
97    type Ux = u16;
98}
99///`read()` method returns [`sr::R`](R) reader structure
100impl crate::Readable for SRrs {}
101///`write(|w| ..)` method takes [`sr::W`](W) writer structure
102impl crate::Writable for SRrs {
103    type Safety = crate::Unsafe;
104    const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0x01;
105}
106///`reset()` method sets SR to value 0
107impl crate::Resettable for SRrs {}