py32f0/py32f030/pwr/
sr.rs1pub 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}
16pub type PVDO_R = crate::BitReader<PVDOR_A>;
18#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22pub enum PVDOR_A {
23 AboveThreshold = 0,
26 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 #[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 #[inline(always)]
47 pub fn is_above_threshold(&self) -> bool {
48 *self == PVDOR_A::AboveThreshold
49 }
50 #[inline(always)]
52 pub fn is_below_threshold(&self) -> bool {
53 *self == PVDOR_A::BelowThreshold
54 }
55}
56impl R {
57 #[inline(always)]
59 pub fn pvdo(&self) -> PVDO_R {
60 PVDO_R::new(((self.bits >> 11) & 1) != 0)
61 }
62}
63pub struct SR_SPEC;
69impl crate::RegisterSpec for SR_SPEC {
70 type Ux = u32;
71}
72impl crate::Readable for SR_SPEC {
74 type Reader = R;
75}
76impl crate::Resettable for SR_SPEC {
78 const RESET_VALUE: Self::Ux = 0;
79}