py32f0/py32f030/pwr/
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 `PVDO` reader - PVD output
17pub type PVDO_R = crate::BitReader<PVDOR_A>;
18/**PVD output
19
20Value on reset: 0*/
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22pub enum PVDOR_A {
23    /**0: VDD is higher than the PVD threshold selected with the PLS\[2:0\]
24    bits*/
25    AboveThreshold = 0,
26    /**1: VDD is lower than the PVD threshold selected with the PLS\[2:0\]
27    bits*/
28    BelowThreshold = 1,
29}
30impl From<PVDOR_A> for bool {
31    #[inline(always)]
32    fn from(variant: PVDOR_A) -> Self {
33        variant as u8 != 0
34    }
35}
36impl PVDO_R {
37    ///Get enumerated values variant
38    #[inline(always)]
39    pub fn variant(&self) -> PVDOR_A {
40        match self.bits {
41            false => PVDOR_A::AboveThreshold,
42            true => PVDOR_A::BelowThreshold,
43        }
44    }
45    ///Checks if the value of the field is `AboveThreshold`
46    #[inline(always)]
47    pub fn is_above_threshold(&self) -> bool {
48        *self == PVDOR_A::AboveThreshold
49    }
50    ///Checks if the value of the field is `BelowThreshold`
51    #[inline(always)]
52    pub fn is_below_threshold(&self) -> bool {
53        *self == PVDOR_A::BelowThreshold
54    }
55}
56impl R {
57    ///Bit 11 - PVD output
58    #[inline(always)]
59    pub fn pvdo(&self) -> PVDO_R {
60        PVDO_R::new(((self.bits >> 11) & 1) != 0)
61    }
62}
63/**Power status register
64
65This register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
66
67For information about available fields see [sr](index.html) module*/
68pub struct SR_SPEC;
69impl crate::RegisterSpec for SR_SPEC {
70    type Ux = u32;
71}
72///`read()` method returns [sr::R](R) reader structure
73impl crate::Readable for SR_SPEC {
74    type Reader = R;
75}
76///`reset()` method sets SR to value 0
77impl crate::Resettable for SR_SPEC {
78    const RESET_VALUE: Self::Ux = 0;
79}