nrf5340_net_pac/vmc_ns/ram/
power.rs1#[doc = "Register `POWER` reader"]
2pub struct R(crate::R<POWER_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<POWER_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<POWER_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<POWER_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `POWER` writer"]
17pub struct W(crate::W<POWER_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<POWER_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<POWER_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<POWER_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `S0POWER` reader - Keep RAM section S0 of RAM\\[n\\]
38on or off in System ON mode"]
39pub type S0POWER_R = crate::BitReader<S0POWER_A>;
40#[doc = "Keep RAM section S0 of RAM\\[n\\]
41on or off in System ON mode\n\nValue on reset: 1"]
42#[derive(Clone, Copy, Debug, PartialEq)]
43pub enum S0POWER_A {
44 #[doc = "0: Off"]
45 OFF = 0,
46 #[doc = "1: On"]
47 ON = 1,
48}
49impl From<S0POWER_A> for bool {
50 #[inline(always)]
51 fn from(variant: S0POWER_A) -> Self {
52 variant as u8 != 0
53 }
54}
55impl S0POWER_R {
56 #[doc = "Get enumerated values variant"]
57 #[inline(always)]
58 pub fn variant(&self) -> S0POWER_A {
59 match self.bits {
60 false => S0POWER_A::OFF,
61 true => S0POWER_A::ON,
62 }
63 }
64 #[doc = "Checks if the value of the field is `OFF`"]
65 #[inline(always)]
66 pub fn is_off(&self) -> bool {
67 *self == S0POWER_A::OFF
68 }
69 #[doc = "Checks if the value of the field is `ON`"]
70 #[inline(always)]
71 pub fn is_on(&self) -> bool {
72 *self == S0POWER_A::ON
73 }
74}
75#[doc = "Field `S0POWER` writer - Keep RAM section S0 of RAM\\[n\\]
76on or off in System ON mode"]
77pub type S0POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S0POWER_A, O>;
78impl<'a, const O: u8> S0POWER_W<'a, O> {
79 #[doc = "Off"]
80 #[inline(always)]
81 pub fn off(self) -> &'a mut W {
82 self.variant(S0POWER_A::OFF)
83 }
84 #[doc = "On"]
85 #[inline(always)]
86 pub fn on(self) -> &'a mut W {
87 self.variant(S0POWER_A::ON)
88 }
89}
90#[doc = "Field `S1POWER` reader - Keep RAM section S1 of RAM\\[n\\]
91on or off in System ON mode"]
92pub type S1POWER_R = crate::BitReader<S1POWER_A>;
93#[doc = "Keep RAM section S1 of RAM\\[n\\]
94on or off in System ON mode\n\nValue on reset: 1"]
95#[derive(Clone, Copy, Debug, PartialEq)]
96pub enum S1POWER_A {
97 #[doc = "0: Off"]
98 OFF = 0,
99 #[doc = "1: On"]
100 ON = 1,
101}
102impl From<S1POWER_A> for bool {
103 #[inline(always)]
104 fn from(variant: S1POWER_A) -> Self {
105 variant as u8 != 0
106 }
107}
108impl S1POWER_R {
109 #[doc = "Get enumerated values variant"]
110 #[inline(always)]
111 pub fn variant(&self) -> S1POWER_A {
112 match self.bits {
113 false => S1POWER_A::OFF,
114 true => S1POWER_A::ON,
115 }
116 }
117 #[doc = "Checks if the value of the field is `OFF`"]
118 #[inline(always)]
119 pub fn is_off(&self) -> bool {
120 *self == S1POWER_A::OFF
121 }
122 #[doc = "Checks if the value of the field is `ON`"]
123 #[inline(always)]
124 pub fn is_on(&self) -> bool {
125 *self == S1POWER_A::ON
126 }
127}
128#[doc = "Field `S1POWER` writer - Keep RAM section S1 of RAM\\[n\\]
129on or off in System ON mode"]
130pub type S1POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S1POWER_A, O>;
131impl<'a, const O: u8> S1POWER_W<'a, O> {
132 #[doc = "Off"]
133 #[inline(always)]
134 pub fn off(self) -> &'a mut W {
135 self.variant(S1POWER_A::OFF)
136 }
137 #[doc = "On"]
138 #[inline(always)]
139 pub fn on(self) -> &'a mut W {
140 self.variant(S1POWER_A::ON)
141 }
142}
143#[doc = "Field `S2POWER` reader - Keep RAM section S2 of RAM\\[n\\]
144on or off in System ON mode"]
145pub type S2POWER_R = crate::BitReader<S2POWER_A>;
146#[doc = "Keep RAM section S2 of RAM\\[n\\]
147on or off in System ON mode\n\nValue on reset: 1"]
148#[derive(Clone, Copy, Debug, PartialEq)]
149pub enum S2POWER_A {
150 #[doc = "0: Off"]
151 OFF = 0,
152 #[doc = "1: On"]
153 ON = 1,
154}
155impl From<S2POWER_A> for bool {
156 #[inline(always)]
157 fn from(variant: S2POWER_A) -> Self {
158 variant as u8 != 0
159 }
160}
161impl S2POWER_R {
162 #[doc = "Get enumerated values variant"]
163 #[inline(always)]
164 pub fn variant(&self) -> S2POWER_A {
165 match self.bits {
166 false => S2POWER_A::OFF,
167 true => S2POWER_A::ON,
168 }
169 }
170 #[doc = "Checks if the value of the field is `OFF`"]
171 #[inline(always)]
172 pub fn is_off(&self) -> bool {
173 *self == S2POWER_A::OFF
174 }
175 #[doc = "Checks if the value of the field is `ON`"]
176 #[inline(always)]
177 pub fn is_on(&self) -> bool {
178 *self == S2POWER_A::ON
179 }
180}
181#[doc = "Field `S2POWER` writer - Keep RAM section S2 of RAM\\[n\\]
182on or off in System ON mode"]
183pub type S2POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S2POWER_A, O>;
184impl<'a, const O: u8> S2POWER_W<'a, O> {
185 #[doc = "Off"]
186 #[inline(always)]
187 pub fn off(self) -> &'a mut W {
188 self.variant(S2POWER_A::OFF)
189 }
190 #[doc = "On"]
191 #[inline(always)]
192 pub fn on(self) -> &'a mut W {
193 self.variant(S2POWER_A::ON)
194 }
195}
196#[doc = "Field `S3POWER` reader - Keep RAM section S3 of RAM\\[n\\]
197on or off in System ON mode"]
198pub type S3POWER_R = crate::BitReader<S3POWER_A>;
199#[doc = "Keep RAM section S3 of RAM\\[n\\]
200on or off in System ON mode\n\nValue on reset: 1"]
201#[derive(Clone, Copy, Debug, PartialEq)]
202pub enum S3POWER_A {
203 #[doc = "0: Off"]
204 OFF = 0,
205 #[doc = "1: On"]
206 ON = 1,
207}
208impl From<S3POWER_A> for bool {
209 #[inline(always)]
210 fn from(variant: S3POWER_A) -> Self {
211 variant as u8 != 0
212 }
213}
214impl S3POWER_R {
215 #[doc = "Get enumerated values variant"]
216 #[inline(always)]
217 pub fn variant(&self) -> S3POWER_A {
218 match self.bits {
219 false => S3POWER_A::OFF,
220 true => S3POWER_A::ON,
221 }
222 }
223 #[doc = "Checks if the value of the field is `OFF`"]
224 #[inline(always)]
225 pub fn is_off(&self) -> bool {
226 *self == S3POWER_A::OFF
227 }
228 #[doc = "Checks if the value of the field is `ON`"]
229 #[inline(always)]
230 pub fn is_on(&self) -> bool {
231 *self == S3POWER_A::ON
232 }
233}
234#[doc = "Field `S3POWER` writer - Keep RAM section S3 of RAM\\[n\\]
235on or off in System ON mode"]
236pub type S3POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S3POWER_A, O>;
237impl<'a, const O: u8> S3POWER_W<'a, O> {
238 #[doc = "Off"]
239 #[inline(always)]
240 pub fn off(self) -> &'a mut W {
241 self.variant(S3POWER_A::OFF)
242 }
243 #[doc = "On"]
244 #[inline(always)]
245 pub fn on(self) -> &'a mut W {
246 self.variant(S3POWER_A::ON)
247 }
248}
249#[doc = "Field `S0RETENTION` reader - Keep retention on RAM section S0 of RAM\\[n\\]
250when RAM section is switched off"]
251pub type S0RETENTION_R = crate::BitReader<S0RETENTION_A>;
252#[doc = "Keep retention on RAM section S0 of RAM\\[n\\]
253when RAM section is switched off\n\nValue on reset: 0"]
254#[derive(Clone, Copy, Debug, PartialEq)]
255pub enum S0RETENTION_A {
256 #[doc = "0: Off"]
257 OFF = 0,
258 #[doc = "1: On"]
259 ON = 1,
260}
261impl From<S0RETENTION_A> for bool {
262 #[inline(always)]
263 fn from(variant: S0RETENTION_A) -> Self {
264 variant as u8 != 0
265 }
266}
267impl S0RETENTION_R {
268 #[doc = "Get enumerated values variant"]
269 #[inline(always)]
270 pub fn variant(&self) -> S0RETENTION_A {
271 match self.bits {
272 false => S0RETENTION_A::OFF,
273 true => S0RETENTION_A::ON,
274 }
275 }
276 #[doc = "Checks if the value of the field is `OFF`"]
277 #[inline(always)]
278 pub fn is_off(&self) -> bool {
279 *self == S0RETENTION_A::OFF
280 }
281 #[doc = "Checks if the value of the field is `ON`"]
282 #[inline(always)]
283 pub fn is_on(&self) -> bool {
284 *self == S0RETENTION_A::ON
285 }
286}
287#[doc = "Field `S0RETENTION` writer - Keep retention on RAM section S0 of RAM\\[n\\]
288when RAM section is switched off"]
289pub type S0RETENTION_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S0RETENTION_A, O>;
290impl<'a, const O: u8> S0RETENTION_W<'a, O> {
291 #[doc = "Off"]
292 #[inline(always)]
293 pub fn off(self) -> &'a mut W {
294 self.variant(S0RETENTION_A::OFF)
295 }
296 #[doc = "On"]
297 #[inline(always)]
298 pub fn on(self) -> &'a mut W {
299 self.variant(S0RETENTION_A::ON)
300 }
301}
302#[doc = "Field `S1RETENTION` reader - Keep retention on RAM section S1 of RAM\\[n\\]
303when RAM section is switched off"]
304pub type S1RETENTION_R = crate::BitReader<S1RETENTION_A>;
305#[doc = "Keep retention on RAM section S1 of RAM\\[n\\]
306when RAM section is switched off\n\nValue on reset: 0"]
307#[derive(Clone, Copy, Debug, PartialEq)]
308pub enum S1RETENTION_A {
309 #[doc = "0: Off"]
310 OFF = 0,
311 #[doc = "1: On"]
312 ON = 1,
313}
314impl From<S1RETENTION_A> for bool {
315 #[inline(always)]
316 fn from(variant: S1RETENTION_A) -> Self {
317 variant as u8 != 0
318 }
319}
320impl S1RETENTION_R {
321 #[doc = "Get enumerated values variant"]
322 #[inline(always)]
323 pub fn variant(&self) -> S1RETENTION_A {
324 match self.bits {
325 false => S1RETENTION_A::OFF,
326 true => S1RETENTION_A::ON,
327 }
328 }
329 #[doc = "Checks if the value of the field is `OFF`"]
330 #[inline(always)]
331 pub fn is_off(&self) -> bool {
332 *self == S1RETENTION_A::OFF
333 }
334 #[doc = "Checks if the value of the field is `ON`"]
335 #[inline(always)]
336 pub fn is_on(&self) -> bool {
337 *self == S1RETENTION_A::ON
338 }
339}
340#[doc = "Field `S1RETENTION` writer - Keep retention on RAM section S1 of RAM\\[n\\]
341when RAM section is switched off"]
342pub type S1RETENTION_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S1RETENTION_A, O>;
343impl<'a, const O: u8> S1RETENTION_W<'a, O> {
344 #[doc = "Off"]
345 #[inline(always)]
346 pub fn off(self) -> &'a mut W {
347 self.variant(S1RETENTION_A::OFF)
348 }
349 #[doc = "On"]
350 #[inline(always)]
351 pub fn on(self) -> &'a mut W {
352 self.variant(S1RETENTION_A::ON)
353 }
354}
355#[doc = "Field `S2RETENTION` reader - Keep retention on RAM section S2 of RAM\\[n\\]
356when RAM section is switched off"]
357pub type S2RETENTION_R = crate::BitReader<S2RETENTION_A>;
358#[doc = "Keep retention on RAM section S2 of RAM\\[n\\]
359when RAM section is switched off\n\nValue on reset: 0"]
360#[derive(Clone, Copy, Debug, PartialEq)]
361pub enum S2RETENTION_A {
362 #[doc = "0: Off"]
363 OFF = 0,
364 #[doc = "1: On"]
365 ON = 1,
366}
367impl From<S2RETENTION_A> for bool {
368 #[inline(always)]
369 fn from(variant: S2RETENTION_A) -> Self {
370 variant as u8 != 0
371 }
372}
373impl S2RETENTION_R {
374 #[doc = "Get enumerated values variant"]
375 #[inline(always)]
376 pub fn variant(&self) -> S2RETENTION_A {
377 match self.bits {
378 false => S2RETENTION_A::OFF,
379 true => S2RETENTION_A::ON,
380 }
381 }
382 #[doc = "Checks if the value of the field is `OFF`"]
383 #[inline(always)]
384 pub fn is_off(&self) -> bool {
385 *self == S2RETENTION_A::OFF
386 }
387 #[doc = "Checks if the value of the field is `ON`"]
388 #[inline(always)]
389 pub fn is_on(&self) -> bool {
390 *self == S2RETENTION_A::ON
391 }
392}
393#[doc = "Field `S2RETENTION` writer - Keep retention on RAM section S2 of RAM\\[n\\]
394when RAM section is switched off"]
395pub type S2RETENTION_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S2RETENTION_A, O>;
396impl<'a, const O: u8> S2RETENTION_W<'a, O> {
397 #[doc = "Off"]
398 #[inline(always)]
399 pub fn off(self) -> &'a mut W {
400 self.variant(S2RETENTION_A::OFF)
401 }
402 #[doc = "On"]
403 #[inline(always)]
404 pub fn on(self) -> &'a mut W {
405 self.variant(S2RETENTION_A::ON)
406 }
407}
408#[doc = "Field `S3RETENTION` reader - Keep retention on RAM section S3 of RAM\\[n\\]
409when RAM section is switched off"]
410pub type S3RETENTION_R = crate::BitReader<S3RETENTION_A>;
411#[doc = "Keep retention on RAM section S3 of RAM\\[n\\]
412when RAM section is switched off\n\nValue on reset: 0"]
413#[derive(Clone, Copy, Debug, PartialEq)]
414pub enum S3RETENTION_A {
415 #[doc = "0: Off"]
416 OFF = 0,
417 #[doc = "1: On"]
418 ON = 1,
419}
420impl From<S3RETENTION_A> for bool {
421 #[inline(always)]
422 fn from(variant: S3RETENTION_A) -> Self {
423 variant as u8 != 0
424 }
425}
426impl S3RETENTION_R {
427 #[doc = "Get enumerated values variant"]
428 #[inline(always)]
429 pub fn variant(&self) -> S3RETENTION_A {
430 match self.bits {
431 false => S3RETENTION_A::OFF,
432 true => S3RETENTION_A::ON,
433 }
434 }
435 #[doc = "Checks if the value of the field is `OFF`"]
436 #[inline(always)]
437 pub fn is_off(&self) -> bool {
438 *self == S3RETENTION_A::OFF
439 }
440 #[doc = "Checks if the value of the field is `ON`"]
441 #[inline(always)]
442 pub fn is_on(&self) -> bool {
443 *self == S3RETENTION_A::ON
444 }
445}
446#[doc = "Field `S3RETENTION` writer - Keep retention on RAM section S3 of RAM\\[n\\]
447when RAM section is switched off"]
448pub type S3RETENTION_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S3RETENTION_A, O>;
449impl<'a, const O: u8> S3RETENTION_W<'a, O> {
450 #[doc = "Off"]
451 #[inline(always)]
452 pub fn off(self) -> &'a mut W {
453 self.variant(S3RETENTION_A::OFF)
454 }
455 #[doc = "On"]
456 #[inline(always)]
457 pub fn on(self) -> &'a mut W {
458 self.variant(S3RETENTION_A::ON)
459 }
460}
461impl R {
462 #[doc = "Bit 0 - Keep RAM section S0 of RAM\\[n\\]
463on or off in System ON mode"]
464 #[inline(always)]
465 pub fn s0power(&self) -> S0POWER_R {
466 S0POWER_R::new((self.bits & 1) != 0)
467 }
468 #[doc = "Bit 1 - Keep RAM section S1 of RAM\\[n\\]
469on or off in System ON mode"]
470 #[inline(always)]
471 pub fn s1power(&self) -> S1POWER_R {
472 S1POWER_R::new(((self.bits >> 1) & 1) != 0)
473 }
474 #[doc = "Bit 2 - Keep RAM section S2 of RAM\\[n\\]
475on or off in System ON mode"]
476 #[inline(always)]
477 pub fn s2power(&self) -> S2POWER_R {
478 S2POWER_R::new(((self.bits >> 2) & 1) != 0)
479 }
480 #[doc = "Bit 3 - Keep RAM section S3 of RAM\\[n\\]
481on or off in System ON mode"]
482 #[inline(always)]
483 pub fn s3power(&self) -> S3POWER_R {
484 S3POWER_R::new(((self.bits >> 3) & 1) != 0)
485 }
486 #[doc = "Bit 16 - Keep retention on RAM section S0 of RAM\\[n\\]
487when RAM section is switched off"]
488 #[inline(always)]
489 pub fn s0retention(&self) -> S0RETENTION_R {
490 S0RETENTION_R::new(((self.bits >> 16) & 1) != 0)
491 }
492 #[doc = "Bit 17 - Keep retention on RAM section S1 of RAM\\[n\\]
493when RAM section is switched off"]
494 #[inline(always)]
495 pub fn s1retention(&self) -> S1RETENTION_R {
496 S1RETENTION_R::new(((self.bits >> 17) & 1) != 0)
497 }
498 #[doc = "Bit 18 - Keep retention on RAM section S2 of RAM\\[n\\]
499when RAM section is switched off"]
500 #[inline(always)]
501 pub fn s2retention(&self) -> S2RETENTION_R {
502 S2RETENTION_R::new(((self.bits >> 18) & 1) != 0)
503 }
504 #[doc = "Bit 19 - Keep retention on RAM section S3 of RAM\\[n\\]
505when RAM section is switched off"]
506 #[inline(always)]
507 pub fn s3retention(&self) -> S3RETENTION_R {
508 S3RETENTION_R::new(((self.bits >> 19) & 1) != 0)
509 }
510}
511impl W {
512 #[doc = "Bit 0 - Keep RAM section S0 of RAM\\[n\\]
513on or off in System ON mode"]
514 #[inline(always)]
515 pub fn s0power(&mut self) -> S0POWER_W<0> {
516 S0POWER_W::new(self)
517 }
518 #[doc = "Bit 1 - Keep RAM section S1 of RAM\\[n\\]
519on or off in System ON mode"]
520 #[inline(always)]
521 pub fn s1power(&mut self) -> S1POWER_W<1> {
522 S1POWER_W::new(self)
523 }
524 #[doc = "Bit 2 - Keep RAM section S2 of RAM\\[n\\]
525on or off in System ON mode"]
526 #[inline(always)]
527 pub fn s2power(&mut self) -> S2POWER_W<2> {
528 S2POWER_W::new(self)
529 }
530 #[doc = "Bit 3 - Keep RAM section S3 of RAM\\[n\\]
531on or off in System ON mode"]
532 #[inline(always)]
533 pub fn s3power(&mut self) -> S3POWER_W<3> {
534 S3POWER_W::new(self)
535 }
536 #[doc = "Bit 16 - Keep retention on RAM section S0 of RAM\\[n\\]
537when RAM section is switched off"]
538 #[inline(always)]
539 pub fn s0retention(&mut self) -> S0RETENTION_W<16> {
540 S0RETENTION_W::new(self)
541 }
542 #[doc = "Bit 17 - Keep retention on RAM section S1 of RAM\\[n\\]
543when RAM section is switched off"]
544 #[inline(always)]
545 pub fn s1retention(&mut self) -> S1RETENTION_W<17> {
546 S1RETENTION_W::new(self)
547 }
548 #[doc = "Bit 18 - Keep retention on RAM section S2 of RAM\\[n\\]
549when RAM section is switched off"]
550 #[inline(always)]
551 pub fn s2retention(&mut self) -> S2RETENTION_W<18> {
552 S2RETENTION_W::new(self)
553 }
554 #[doc = "Bit 19 - Keep retention on RAM section S3 of RAM\\[n\\]
555when RAM section is switched off"]
556 #[inline(always)]
557 pub fn s3retention(&mut self) -> S3RETENTION_W<19> {
558 S3RETENTION_W::new(self)
559 }
560 #[doc = "Writes raw bits to the register."]
561 #[inline(always)]
562 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
563 self.0.bits(bits);
564 self
565 }
566}
567#[doc = "Description cluster: RAM\\[n\\]
568power control register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [power](index.html) module"]
569pub struct POWER_SPEC;
570impl crate::RegisterSpec for POWER_SPEC {
571 type Ux = u32;
572}
573#[doc = "`read()` method returns [power::R](R) reader structure"]
574impl crate::Readable for POWER_SPEC {
575 type Reader = R;
576}
577#[doc = "`write(|w| ..)` method takes [power::W](W) writer structure"]
578impl crate::Writable for POWER_SPEC {
579 type Writer = W;
580}
581#[doc = "`reset()` method sets POWER to value 0xffff"]
582impl crate::Resettable for POWER_SPEC {
583 #[inline(always)]
584 fn reset_value() -> Self::Ux {
585 0xffff
586 }
587}