nrf52840_pac/power/
ramstatus.rs
1#[doc = "Register `RAMSTATUS` reader"]
2pub struct R(crate::R<RAMSTATUS_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<RAMSTATUS_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<RAMSTATUS_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<RAMSTATUS_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `RAMBLOCK0` reader - RAM block 0 is on or off/powering up"]
17pub type RAMBLOCK0_R = crate::BitReader<RAMBLOCK0_A>;
18#[doc = "RAM block 0 is on or off/powering up\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq)]
20pub enum RAMBLOCK0_A {
21 #[doc = "0: Off"]
22 OFF = 0,
23 #[doc = "1: On"]
24 ON = 1,
25}
26impl From<RAMBLOCK0_A> for bool {
27 #[inline(always)]
28 fn from(variant: RAMBLOCK0_A) -> Self {
29 variant as u8 != 0
30 }
31}
32impl RAMBLOCK0_R {
33 #[doc = "Get enumerated values variant"]
34 #[inline(always)]
35 pub fn variant(&self) -> RAMBLOCK0_A {
36 match self.bits {
37 false => RAMBLOCK0_A::OFF,
38 true => RAMBLOCK0_A::ON,
39 }
40 }
41 #[doc = "Checks if the value of the field is `OFF`"]
42 #[inline(always)]
43 pub fn is_off(&self) -> bool {
44 *self == RAMBLOCK0_A::OFF
45 }
46 #[doc = "Checks if the value of the field is `ON`"]
47 #[inline(always)]
48 pub fn is_on(&self) -> bool {
49 *self == RAMBLOCK0_A::ON
50 }
51}
52#[doc = "Field `RAMBLOCK1` reader - RAM block 1 is on or off/powering up"]
53pub type RAMBLOCK1_R = crate::BitReader<RAMBLOCK1_A>;
54#[doc = "RAM block 1 is on or off/powering up\n\nValue on reset: 0"]
55#[derive(Clone, Copy, Debug, PartialEq)]
56pub enum RAMBLOCK1_A {
57 #[doc = "0: Off"]
58 OFF = 0,
59 #[doc = "1: On"]
60 ON = 1,
61}
62impl From<RAMBLOCK1_A> for bool {
63 #[inline(always)]
64 fn from(variant: RAMBLOCK1_A) -> Self {
65 variant as u8 != 0
66 }
67}
68impl RAMBLOCK1_R {
69 #[doc = "Get enumerated values variant"]
70 #[inline(always)]
71 pub fn variant(&self) -> RAMBLOCK1_A {
72 match self.bits {
73 false => RAMBLOCK1_A::OFF,
74 true => RAMBLOCK1_A::ON,
75 }
76 }
77 #[doc = "Checks if the value of the field is `OFF`"]
78 #[inline(always)]
79 pub fn is_off(&self) -> bool {
80 *self == RAMBLOCK1_A::OFF
81 }
82 #[doc = "Checks if the value of the field is `ON`"]
83 #[inline(always)]
84 pub fn is_on(&self) -> bool {
85 *self == RAMBLOCK1_A::ON
86 }
87}
88#[doc = "Field `RAMBLOCK2` reader - RAM block 2 is on or off/powering up"]
89pub type RAMBLOCK2_R = crate::BitReader<RAMBLOCK2_A>;
90#[doc = "RAM block 2 is on or off/powering up\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq)]
92pub enum RAMBLOCK2_A {
93 #[doc = "0: Off"]
94 OFF = 0,
95 #[doc = "1: On"]
96 ON = 1,
97}
98impl From<RAMBLOCK2_A> for bool {
99 #[inline(always)]
100 fn from(variant: RAMBLOCK2_A) -> Self {
101 variant as u8 != 0
102 }
103}
104impl RAMBLOCK2_R {
105 #[doc = "Get enumerated values variant"]
106 #[inline(always)]
107 pub fn variant(&self) -> RAMBLOCK2_A {
108 match self.bits {
109 false => RAMBLOCK2_A::OFF,
110 true => RAMBLOCK2_A::ON,
111 }
112 }
113 #[doc = "Checks if the value of the field is `OFF`"]
114 #[inline(always)]
115 pub fn is_off(&self) -> bool {
116 *self == RAMBLOCK2_A::OFF
117 }
118 #[doc = "Checks if the value of the field is `ON`"]
119 #[inline(always)]
120 pub fn is_on(&self) -> bool {
121 *self == RAMBLOCK2_A::ON
122 }
123}
124#[doc = "Field `RAMBLOCK3` reader - RAM block 3 is on or off/powering up"]
125pub type RAMBLOCK3_R = crate::BitReader<RAMBLOCK3_A>;
126#[doc = "RAM block 3 is on or off/powering up\n\nValue on reset: 0"]
127#[derive(Clone, Copy, Debug, PartialEq)]
128pub enum RAMBLOCK3_A {
129 #[doc = "0: Off"]
130 OFF = 0,
131 #[doc = "1: On"]
132 ON = 1,
133}
134impl From<RAMBLOCK3_A> for bool {
135 #[inline(always)]
136 fn from(variant: RAMBLOCK3_A) -> Self {
137 variant as u8 != 0
138 }
139}
140impl RAMBLOCK3_R {
141 #[doc = "Get enumerated values variant"]
142 #[inline(always)]
143 pub fn variant(&self) -> RAMBLOCK3_A {
144 match self.bits {
145 false => RAMBLOCK3_A::OFF,
146 true => RAMBLOCK3_A::ON,
147 }
148 }
149 #[doc = "Checks if the value of the field is `OFF`"]
150 #[inline(always)]
151 pub fn is_off(&self) -> bool {
152 *self == RAMBLOCK3_A::OFF
153 }
154 #[doc = "Checks if the value of the field is `ON`"]
155 #[inline(always)]
156 pub fn is_on(&self) -> bool {
157 *self == RAMBLOCK3_A::ON
158 }
159}
160impl R {
161 #[doc = "Bit 0 - RAM block 0 is on or off/powering up"]
162 #[inline(always)]
163 pub fn ramblock0(&self) -> RAMBLOCK0_R {
164 RAMBLOCK0_R::new((self.bits & 1) != 0)
165 }
166 #[doc = "Bit 1 - RAM block 1 is on or off/powering up"]
167 #[inline(always)]
168 pub fn ramblock1(&self) -> RAMBLOCK1_R {
169 RAMBLOCK1_R::new(((self.bits >> 1) & 1) != 0)
170 }
171 #[doc = "Bit 2 - RAM block 2 is on or off/powering up"]
172 #[inline(always)]
173 pub fn ramblock2(&self) -> RAMBLOCK2_R {
174 RAMBLOCK2_R::new(((self.bits >> 2) & 1) != 0)
175 }
176 #[doc = "Bit 3 - RAM block 3 is on or off/powering up"]
177 #[inline(always)]
178 pub fn ramblock3(&self) -> RAMBLOCK3_R {
179 RAMBLOCK3_R::new(((self.bits >> 3) & 1) != 0)
180 }
181}
182#[doc = "Deprecated register - RAM 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 [ramstatus](index.html) module"]
183pub struct RAMSTATUS_SPEC;
184impl crate::RegisterSpec for RAMSTATUS_SPEC {
185 type Ux = u32;
186}
187#[doc = "`read()` method returns [ramstatus::R](R) reader structure"]
188impl crate::Readable for RAMSTATUS_SPEC {
189 type Reader = R;
190}
191#[doc = "`reset()` method sets RAMSTATUS to value 0"]
192impl crate::Resettable for RAMSTATUS_SPEC {
193 #[inline(always)]
194 fn reset_value() -> Self::Ux {
195 0
196 }
197}