efm32jg12b500_pac/emu/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub struct R(crate::R<STATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<STATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<STATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<STATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `VMONRDY` reader - VMON Ready"]
17pub type VMONRDY_R = crate::BitReader<bool>;
18#[doc = "Field `VMONAVDD` reader - VMON AVDD Channel"]
19pub type VMONAVDD_R = crate::BitReader<bool>;
20#[doc = "Field `VMONALTAVDD` reader - Alternate VMON AVDD Channel"]
21pub type VMONALTAVDD_R = crate::BitReader<bool>;
22#[doc = "Field `VMONDVDD` reader - VMON DVDD Channel"]
23pub type VMONDVDD_R = crate::BitReader<bool>;
24#[doc = "Field `VMONIO0` reader - VMON IOVDD0 Channel"]
25pub type VMONIO0_R = crate::BitReader<bool>;
26#[doc = "Field `VMONFVDD` reader - VMON VDDFLASH Channel"]
27pub type VMONFVDD_R = crate::BitReader<bool>;
28#[doc = "Current Voltage Scale Value\n\nValue on reset: 0"]
29#[derive(Clone, Copy, Debug, PartialEq)]
30#[repr(u8)]
31pub enum VSCALE_A {
32    #[doc = "0: Voltage Scale Level 2"]
33    VSCALE2 = 0,
34    #[doc = "2: Voltage Scale Level 0"]
35    VSCALE0 = 2,
36    #[doc = "3: RESV"]
37    RESV = 3,
38}
39impl From<VSCALE_A> for u8 {
40    #[inline(always)]
41    fn from(variant: VSCALE_A) -> Self {
42        variant as _
43    }
44}
45#[doc = "Field `VSCALE` reader - Current Voltage Scale Value"]
46pub type VSCALE_R = crate::FieldReader<u8, VSCALE_A>;
47impl VSCALE_R {
48    #[doc = "Get enumerated values variant"]
49    #[inline(always)]
50    pub fn variant(&self) -> Option<VSCALE_A> {
51        match self.bits {
52            0 => Some(VSCALE_A::VSCALE2),
53            2 => Some(VSCALE_A::VSCALE0),
54            3 => Some(VSCALE_A::RESV),
55            _ => None,
56        }
57    }
58    #[doc = "Checks if the value of the field is `VSCALE2`"]
59    #[inline(always)]
60    pub fn is_vscale2(&self) -> bool {
61        *self == VSCALE_A::VSCALE2
62    }
63    #[doc = "Checks if the value of the field is `VSCALE0`"]
64    #[inline(always)]
65    pub fn is_vscale0(&self) -> bool {
66        *self == VSCALE_A::VSCALE0
67    }
68    #[doc = "Checks if the value of the field is `RESV`"]
69    #[inline(always)]
70    pub fn is_resv(&self) -> bool {
71        *self == VSCALE_A::RESV
72    }
73}
74#[doc = "Field `VSCALEBUSY` reader - System is Busy Scaling Voltage"]
75pub type VSCALEBUSY_R = crate::BitReader<bool>;
76#[doc = "Field `EM4IORET` reader - IO Retention Status"]
77pub type EM4IORET_R = crate::BitReader<bool>;
78#[doc = "Field `TEMPACTIVE` reader - Temperature Measurement Active"]
79pub type TEMPACTIVE_R = crate::BitReader<bool>;
80impl R {
81    #[doc = "Bit 0 - VMON Ready"]
82    #[inline(always)]
83    pub fn vmonrdy(&self) -> VMONRDY_R {
84        VMONRDY_R::new((self.bits & 1) != 0)
85    }
86    #[doc = "Bit 1 - VMON AVDD Channel"]
87    #[inline(always)]
88    pub fn vmonavdd(&self) -> VMONAVDD_R {
89        VMONAVDD_R::new(((self.bits >> 1) & 1) != 0)
90    }
91    #[doc = "Bit 2 - Alternate VMON AVDD Channel"]
92    #[inline(always)]
93    pub fn vmonaltavdd(&self) -> VMONALTAVDD_R {
94        VMONALTAVDD_R::new(((self.bits >> 2) & 1) != 0)
95    }
96    #[doc = "Bit 3 - VMON DVDD Channel"]
97    #[inline(always)]
98    pub fn vmondvdd(&self) -> VMONDVDD_R {
99        VMONDVDD_R::new(((self.bits >> 3) & 1) != 0)
100    }
101    #[doc = "Bit 4 - VMON IOVDD0 Channel"]
102    #[inline(always)]
103    pub fn vmonio0(&self) -> VMONIO0_R {
104        VMONIO0_R::new(((self.bits >> 4) & 1) != 0)
105    }
106    #[doc = "Bit 8 - VMON VDDFLASH Channel"]
107    #[inline(always)]
108    pub fn vmonfvdd(&self) -> VMONFVDD_R {
109        VMONFVDD_R::new(((self.bits >> 8) & 1) != 0)
110    }
111    #[doc = "Bits 16:17 - Current Voltage Scale Value"]
112    #[inline(always)]
113    pub fn vscale(&self) -> VSCALE_R {
114        VSCALE_R::new(((self.bits >> 16) & 3) as u8)
115    }
116    #[doc = "Bit 18 - System is Busy Scaling Voltage"]
117    #[inline(always)]
118    pub fn vscalebusy(&self) -> VSCALEBUSY_R {
119        VSCALEBUSY_R::new(((self.bits >> 18) & 1) != 0)
120    }
121    #[doc = "Bit 20 - IO Retention Status"]
122    #[inline(always)]
123    pub fn em4ioret(&self) -> EM4IORET_R {
124        EM4IORET_R::new(((self.bits >> 20) & 1) != 0)
125    }
126    #[doc = "Bit 26 - Temperature Measurement Active"]
127    #[inline(always)]
128    pub fn tempactive(&self) -> TEMPACTIVE_R {
129        TEMPACTIVE_R::new(((self.bits >> 26) & 1) != 0)
130    }
131}
132#[doc = "Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [status](index.html) module"]
133pub struct STATUS_SPEC;
134impl crate::RegisterSpec for STATUS_SPEC {
135    type Ux = u32;
136}
137#[doc = "`read()` method returns [status::R](R) reader structure"]
138impl crate::Readable for STATUS_SPEC {
139    type Reader = R;
140}
141#[doc = "`reset()` method sets STATUS to value 0"]
142impl crate::Resettable for STATUS_SPEC {
143    #[inline(always)]
144    fn reset_value() -> Self::Ux {
145        0
146    }
147}