nrf5340_net_pac/vmc_ns/ram/
powerclr.rs

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