efm32tg11b540_pac/emu/
status.rs1#[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 `VMONBUVDD` reader - VMON BUVDD Channel"]
27pub type VMONBUVDD_R = crate::BitReader<bool>;
28#[doc = "Field `VMONFVDD` reader - VMON VDDFLASH Channel"]
29pub type VMONFVDD_R = crate::BitReader<bool>;
30#[doc = "Field `BURDY` reader - Backup Mode Ready"]
31pub type BURDY_R = crate::BitReader<bool>;
32#[doc = "Current Voltage Scale Value\n\nValue on reset: 0"]
33#[derive(Clone, Copy, Debug, PartialEq)]
34#[repr(u8)]
35pub enum VSCALE_A {
36 #[doc = "0: Voltage Scale Level 2"]
37 VSCALE2 = 0,
38 #[doc = "2: Voltage Scale Level 0"]
39 VSCALE0 = 2,
40 #[doc = "3: RESV"]
41 RESV = 3,
42}
43impl From<VSCALE_A> for u8 {
44 #[inline(always)]
45 fn from(variant: VSCALE_A) -> Self {
46 variant as _
47 }
48}
49#[doc = "Field `VSCALE` reader - Current Voltage Scale Value"]
50pub type VSCALE_R = crate::FieldReader<u8, VSCALE_A>;
51impl VSCALE_R {
52 #[doc = "Get enumerated values variant"]
53 #[inline(always)]
54 pub fn variant(&self) -> Option<VSCALE_A> {
55 match self.bits {
56 0 => Some(VSCALE_A::VSCALE2),
57 2 => Some(VSCALE_A::VSCALE0),
58 3 => Some(VSCALE_A::RESV),
59 _ => None,
60 }
61 }
62 #[doc = "Checks if the value of the field is `VSCALE2`"]
63 #[inline(always)]
64 pub fn is_vscale2(&self) -> bool {
65 *self == VSCALE_A::VSCALE2
66 }
67 #[doc = "Checks if the value of the field is `VSCALE0`"]
68 #[inline(always)]
69 pub fn is_vscale0(&self) -> bool {
70 *self == VSCALE_A::VSCALE0
71 }
72 #[doc = "Checks if the value of the field is `RESV`"]
73 #[inline(always)]
74 pub fn is_resv(&self) -> bool {
75 *self == VSCALE_A::RESV
76 }
77}
78#[doc = "Field `VSCALEBUSY` reader - System is Busy Scaling Voltage"]
79pub type VSCALEBUSY_R = crate::BitReader<bool>;
80#[doc = "Field `EM4IORET` reader - IO Retention Status"]
81pub type EM4IORET_R = crate::BitReader<bool>;
82#[doc = "Field `TEMPACTIVE` reader - Temperature Measurement Active"]
83pub type TEMPACTIVE_R = crate::BitReader<bool>;
84impl R {
85 #[doc = "Bit 0 - VMON Ready"]
86 #[inline(always)]
87 pub fn vmonrdy(&self) -> VMONRDY_R {
88 VMONRDY_R::new((self.bits & 1) != 0)
89 }
90 #[doc = "Bit 1 - VMON AVDD Channel"]
91 #[inline(always)]
92 pub fn vmonavdd(&self) -> VMONAVDD_R {
93 VMONAVDD_R::new(((self.bits >> 1) & 1) != 0)
94 }
95 #[doc = "Bit 2 - Alternate VMON AVDD Channel"]
96 #[inline(always)]
97 pub fn vmonaltavdd(&self) -> VMONALTAVDD_R {
98 VMONALTAVDD_R::new(((self.bits >> 2) & 1) != 0)
99 }
100 #[doc = "Bit 3 - VMON DVDD Channel"]
101 #[inline(always)]
102 pub fn vmondvdd(&self) -> VMONDVDD_R {
103 VMONDVDD_R::new(((self.bits >> 3) & 1) != 0)
104 }
105 #[doc = "Bit 4 - VMON IOVDD0 Channel"]
106 #[inline(always)]
107 pub fn vmonio0(&self) -> VMONIO0_R {
108 VMONIO0_R::new(((self.bits >> 4) & 1) != 0)
109 }
110 #[doc = "Bit 7 - VMON BUVDD Channel"]
111 #[inline(always)]
112 pub fn vmonbuvdd(&self) -> VMONBUVDD_R {
113 VMONBUVDD_R::new(((self.bits >> 7) & 1) != 0)
114 }
115 #[doc = "Bit 8 - VMON VDDFLASH Channel"]
116 #[inline(always)]
117 pub fn vmonfvdd(&self) -> VMONFVDD_R {
118 VMONFVDD_R::new(((self.bits >> 8) & 1) != 0)
119 }
120 #[doc = "Bit 12 - Backup Mode Ready"]
121 #[inline(always)]
122 pub fn burdy(&self) -> BURDY_R {
123 BURDY_R::new(((self.bits >> 12) & 1) != 0)
124 }
125 #[doc = "Bits 16:17 - Current Voltage Scale Value"]
126 #[inline(always)]
127 pub fn vscale(&self) -> VSCALE_R {
128 VSCALE_R::new(((self.bits >> 16) & 3) as u8)
129 }
130 #[doc = "Bit 18 - System is Busy Scaling Voltage"]
131 #[inline(always)]
132 pub fn vscalebusy(&self) -> VSCALEBUSY_R {
133 VSCALEBUSY_R::new(((self.bits >> 18) & 1) != 0)
134 }
135 #[doc = "Bit 20 - IO Retention Status"]
136 #[inline(always)]
137 pub fn em4ioret(&self) -> EM4IORET_R {
138 EM4IORET_R::new(((self.bits >> 20) & 1) != 0)
139 }
140 #[doc = "Bit 26 - Temperature Measurement Active"]
141 #[inline(always)]
142 pub fn tempactive(&self) -> TEMPACTIVE_R {
143 TEMPACTIVE_R::new(((self.bits >> 26) & 1) != 0)
144 }
145}
146#[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"]
147pub struct STATUS_SPEC;
148impl crate::RegisterSpec for STATUS_SPEC {
149 type Ux = u32;
150}
151#[doc = "`read()` method returns [status::R](R) reader structure"]
152impl crate::Readable for STATUS_SPEC {
153 type Reader = R;
154}
155#[doc = "`reset()` method sets STATUS to value 0"]
156impl crate::Resettable for STATUS_SPEC {
157 #[inline(always)]
158 fn reset_value() -> Self::Ux {
159 0
160 }
161}