nrf9160_pac/vmc_ns/ram/
powerset.rs

1#[doc = "Register `POWERSET` writer"]
2pub struct W(crate::W<POWERSET_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<POWERSET_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl core::ops::DerefMut for W {
11    #[inline(always)]
12    fn deref_mut(&mut self) -> &mut Self::Target {
13        &mut self.0
14    }
15}
16impl From<crate::W<POWERSET_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<POWERSET_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "Keep RAM section S0 of RAM n on or off in System ON mode\n\nValue on reset: 1"]
23#[derive(Clone, Copy, Debug, PartialEq)]
24pub enum S0POWER_AW {
25    #[doc = "1: On"]
26    ON = 1,
27}
28impl From<S0POWER_AW> for bool {
29    #[inline(always)]
30    fn from(variant: S0POWER_AW) -> Self {
31        variant as u8 != 0
32    }
33}
34#[doc = "Field `S0POWER` writer - Keep RAM section S0 of RAM n on or off in System ON mode"]
35pub type S0POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWERSET_SPEC, S0POWER_AW, O>;
36impl<'a, const O: u8> S0POWER_W<'a, O> {
37    #[doc = "On"]
38    #[inline(always)]
39    pub fn on(self) -> &'a mut W {
40        self.variant(S0POWER_AW::ON)
41    }
42}
43#[doc = "Keep RAM section S1 of RAM n on or off in System ON mode\n\nValue on reset: 1"]
44#[derive(Clone, Copy, Debug, PartialEq)]
45pub enum S1POWER_AW {
46    #[doc = "1: On"]
47    ON = 1,
48}
49impl From<S1POWER_AW> for bool {
50    #[inline(always)]
51    fn from(variant: S1POWER_AW) -> Self {
52        variant as u8 != 0
53    }
54}
55#[doc = "Field `S1POWER` writer - Keep RAM section S1 of RAM n on or off in System ON mode"]
56pub type S1POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWERSET_SPEC, S1POWER_AW, O>;
57impl<'a, const O: u8> S1POWER_W<'a, O> {
58    #[doc = "On"]
59    #[inline(always)]
60    pub fn on(self) -> &'a mut W {
61        self.variant(S1POWER_AW::ON)
62    }
63}
64#[doc = "Keep RAM section S2 of RAM n on or off in System ON mode\n\nValue on reset: 1"]
65#[derive(Clone, Copy, Debug, PartialEq)]
66pub enum S2POWER_AW {
67    #[doc = "1: On"]
68    ON = 1,
69}
70impl From<S2POWER_AW> for bool {
71    #[inline(always)]
72    fn from(variant: S2POWER_AW) -> Self {
73        variant as u8 != 0
74    }
75}
76#[doc = "Field `S2POWER` writer - Keep RAM section S2 of RAM n on or off in System ON mode"]
77pub type S2POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWERSET_SPEC, S2POWER_AW, O>;
78impl<'a, const O: u8> S2POWER_W<'a, O> {
79    #[doc = "On"]
80    #[inline(always)]
81    pub fn on(self) -> &'a mut W {
82        self.variant(S2POWER_AW::ON)
83    }
84}
85#[doc = "Keep RAM section S3 of RAM n on or off in System ON mode\n\nValue on reset: 1"]
86#[derive(Clone, Copy, Debug, PartialEq)]
87pub enum S3POWER_AW {
88    #[doc = "1: On"]
89    ON = 1,
90}
91impl From<S3POWER_AW> for bool {
92    #[inline(always)]
93    fn from(variant: S3POWER_AW) -> Self {
94        variant as u8 != 0
95    }
96}
97#[doc = "Field `S3POWER` writer - Keep RAM section S3 of RAM n on or off in System ON mode"]
98pub type S3POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWERSET_SPEC, S3POWER_AW, O>;
99impl<'a, const O: u8> S3POWER_W<'a, O> {
100    #[doc = "On"]
101    #[inline(always)]
102    pub fn on(self) -> &'a mut W {
103        self.variant(S3POWER_AW::ON)
104    }
105}
106#[doc = "Keep retention on RAM section S0 of RAM n when RAM section is switched off\n\nValue on reset: 0"]
107#[derive(Clone, Copy, Debug, PartialEq)]
108pub enum S0RETENTION_AW {
109    #[doc = "1: On"]
110    ON = 1,
111}
112impl From<S0RETENTION_AW> for bool {
113    #[inline(always)]
114    fn from(variant: S0RETENTION_AW) -> Self {
115        variant as u8 != 0
116    }
117}
118#[doc = "Field `S0RETENTION` writer - Keep retention on RAM section S0 of RAM n when RAM section is switched off"]
119pub type S0RETENTION_W<'a, const O: u8> =
120    crate::BitWriter<'a, u32, POWERSET_SPEC, S0RETENTION_AW, O>;
121impl<'a, const O: u8> S0RETENTION_W<'a, O> {
122    #[doc = "On"]
123    #[inline(always)]
124    pub fn on(self) -> &'a mut W {
125        self.variant(S0RETENTION_AW::ON)
126    }
127}
128#[doc = "Keep retention on RAM section S1 of RAM n when RAM section is switched off\n\nValue on reset: 0"]
129#[derive(Clone, Copy, Debug, PartialEq)]
130pub enum S1RETENTION_AW {
131    #[doc = "1: On"]
132    ON = 1,
133}
134impl From<S1RETENTION_AW> for bool {
135    #[inline(always)]
136    fn from(variant: S1RETENTION_AW) -> Self {
137        variant as u8 != 0
138    }
139}
140#[doc = "Field `S1RETENTION` writer - Keep retention on RAM section S1 of RAM n when RAM section is switched off"]
141pub type S1RETENTION_W<'a, const O: u8> =
142    crate::BitWriter<'a, u32, POWERSET_SPEC, S1RETENTION_AW, O>;
143impl<'a, const O: u8> S1RETENTION_W<'a, O> {
144    #[doc = "On"]
145    #[inline(always)]
146    pub fn on(self) -> &'a mut W {
147        self.variant(S1RETENTION_AW::ON)
148    }
149}
150#[doc = "Keep retention on RAM section S2 of RAM n when RAM section is switched off\n\nValue on reset: 0"]
151#[derive(Clone, Copy, Debug, PartialEq)]
152pub enum S2RETENTION_AW {
153    #[doc = "1: On"]
154    ON = 1,
155}
156impl From<S2RETENTION_AW> for bool {
157    #[inline(always)]
158    fn from(variant: S2RETENTION_AW) -> Self {
159        variant as u8 != 0
160    }
161}
162#[doc = "Field `S2RETENTION` writer - Keep retention on RAM section S2 of RAM n when RAM section is switched off"]
163pub type S2RETENTION_W<'a, const O: u8> =
164    crate::BitWriter<'a, u32, POWERSET_SPEC, S2RETENTION_AW, O>;
165impl<'a, const O: u8> S2RETENTION_W<'a, O> {
166    #[doc = "On"]
167    #[inline(always)]
168    pub fn on(self) -> &'a mut W {
169        self.variant(S2RETENTION_AW::ON)
170    }
171}
172#[doc = "Keep retention on RAM section S3 of RAM n when RAM section is switched off\n\nValue on reset: 0"]
173#[derive(Clone, Copy, Debug, PartialEq)]
174pub enum S3RETENTION_AW {
175    #[doc = "1: On"]
176    ON = 1,
177}
178impl From<S3RETENTION_AW> for bool {
179    #[inline(always)]
180    fn from(variant: S3RETENTION_AW) -> Self {
181        variant as u8 != 0
182    }
183}
184#[doc = "Field `S3RETENTION` writer - Keep retention on RAM section S3 of RAM n when RAM section is switched off"]
185pub type S3RETENTION_W<'a, const O: u8> =
186    crate::BitWriter<'a, u32, POWERSET_SPEC, S3RETENTION_AW, O>;
187impl<'a, const O: u8> S3RETENTION_W<'a, O> {
188    #[doc = "On"]
189    #[inline(always)]
190    pub fn on(self) -> &'a mut W {
191        self.variant(S3RETENTION_AW::ON)
192    }
193}
194impl W {
195    #[doc = "Bit 0 - Keep RAM section S0 of RAM n on or off in System ON mode"]
196    #[inline(always)]
197    pub fn s0power(&mut self) -> S0POWER_W<0> {
198        S0POWER_W::new(self)
199    }
200    #[doc = "Bit 1 - Keep RAM section S1 of RAM n on or off in System ON mode"]
201    #[inline(always)]
202    pub fn s1power(&mut self) -> S1POWER_W<1> {
203        S1POWER_W::new(self)
204    }
205    #[doc = "Bit 2 - Keep RAM section S2 of RAM n on or off in System ON mode"]
206    #[inline(always)]
207    pub fn s2power(&mut self) -> S2POWER_W<2> {
208        S2POWER_W::new(self)
209    }
210    #[doc = "Bit 3 - Keep RAM section S3 of RAM n on or off in System ON mode"]
211    #[inline(always)]
212    pub fn s3power(&mut self) -> S3POWER_W<3> {
213        S3POWER_W::new(self)
214    }
215    #[doc = "Bit 16 - Keep retention on RAM section S0 of RAM n when RAM section is switched off"]
216    #[inline(always)]
217    pub fn s0retention(&mut self) -> S0RETENTION_W<16> {
218        S0RETENTION_W::new(self)
219    }
220    #[doc = "Bit 17 - Keep retention on RAM section S1 of RAM n when RAM section is switched off"]
221    #[inline(always)]
222    pub fn s1retention(&mut self) -> S1RETENTION_W<17> {
223        S1RETENTION_W::new(self)
224    }
225    #[doc = "Bit 18 - Keep retention on RAM section S2 of RAM n when RAM section is switched off"]
226    #[inline(always)]
227    pub fn s2retention(&mut self) -> S2RETENTION_W<18> {
228        S2RETENTION_W::new(self)
229    }
230    #[doc = "Bit 19 - Keep retention on RAM section S3 of RAM n when RAM section is switched off"]
231    #[inline(always)]
232    pub fn s3retention(&mut self) -> S3RETENTION_W<19> {
233        S3RETENTION_W::new(self)
234    }
235    #[doc = "Writes raw bits to the register."]
236    #[inline(always)]
237    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
238        self.0.bits(bits);
239        self
240    }
241}
242#[doc = "Description cluster: RAMn power control set register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [powerset](index.html) module"]
243pub struct POWERSET_SPEC;
244impl crate::RegisterSpec for POWERSET_SPEC {
245    type Ux = u32;
246}
247#[doc = "`write(|w| ..)` method takes [powerset::W](W) writer structure"]
248impl crate::Writable for POWERSET_SPEC {
249    type Writer = W;
250}
251#[doc = "`reset()` method sets POWERSET to value 0xffff"]
252impl crate::Resettable for POWERSET_SPEC {
253    #[inline(always)]
254    fn reset_value() -> Self::Ux {
255        0xffff
256    }
257}