corstone300_pac/syscontrol/
pdcm_pd_vmr0_sense.rs

1// Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
2//
3// SPDX-License-Identifier: MIT
4
5#[doc = "Register `PDCM_PD_VMR0_SENSE` reader"]
6pub struct R(crate::R<PDCM_PD_VMR0_SENSE_SPEC>);
7impl core::ops::Deref for R {
8    type Target = crate::R<PDCM_PD_VMR0_SENSE_SPEC>;
9    #[inline(always)]
10    fn deref(&self) -> &Self::Target {
11        &self.0
12    }
13}
14impl From<crate::R<PDCM_PD_VMR0_SENSE_SPEC>> for R {
15    #[inline(always)]
16    fn from(reader: crate::R<PDCM_PD_VMR0_SENSE_SPEC>) -> Self {
17        R(reader)
18    }
19}
20#[doc = "Register `PDCM_PD_VMR0_SENSE` writer"]
21pub struct W(crate::W<PDCM_PD_VMR0_SENSE_SPEC>);
22impl core::ops::Deref for W {
23    type Target = crate::W<PDCM_PD_VMR0_SENSE_SPEC>;
24    #[inline(always)]
25    fn deref(&self) -> &Self::Target {
26        &self.0
27    }
28}
29impl core::ops::DerefMut for W {
30    #[inline(always)]
31    fn deref_mut(&mut self) -> &mut Self::Target {
32        &mut self.0
33    }
34}
35impl From<crate::W<PDCM_PD_VMR0_SENSE_SPEC>> for W {
36    #[inline(always)]
37    fn from(writer: crate::W<PDCM_PD_VMR0_SENSE_SPEC>) -> Self {
38        W(writer)
39    }
40}
41#[doc = "Field `S_PD_SYS_ON` reader - Enable PD_SYS ON Sensitivity"]
42pub type S_PD_SYS_ON_R = crate::BitReader<S_PD_SYS_ON_A>;
43#[doc = "Enable PD_SYS ON Sensitivity\n\nValue on reset: 0"]
44#[derive(Clone, Copy, Debug, PartialEq, Eq)]
45pub enum S_PD_SYS_ON_A {
46    #[doc = "1: Keep PD_SYS awake after powered ON"]
47    ENABLE = 1,
48}
49impl From<S_PD_SYS_ON_A> for bool {
50    #[inline(always)]
51    fn from(variant: S_PD_SYS_ON_A) -> Self {
52        variant as u8 != 0
53    }
54}
55impl S_PD_SYS_ON_R {
56    #[doc = "Get enumerated values variant"]
57    #[inline(always)]
58    pub fn variant(&self) -> Option<S_PD_SYS_ON_A> {
59        match self.bits {
60            true => Some(S_PD_SYS_ON_A::ENABLE),
61            _ => None,
62        }
63    }
64    #[doc = "Checks if the value of the field is `ENABLE`"]
65    #[inline(always)]
66    pub fn is_enable(&self) -> bool {
67        *self == S_PD_SYS_ON_A::ENABLE
68    }
69}
70#[doc = "Field `S_PD_SYS_ON` writer - Enable PD_SYS ON Sensitivity"]
71pub type S_PD_SYS_ON_W<'a, const O: u8> =
72    crate::BitWriter<'a, u32, PDCM_PD_VMR0_SENSE_SPEC, S_PD_SYS_ON_A, O>;
73impl<'a, const O: u8> S_PD_SYS_ON_W<'a, O> {
74    #[doc = "Keep PD_SYS awake after powered ON"]
75    #[inline(always)]
76    pub fn enable(self) -> &'a mut W {
77        self.variant(S_PD_SYS_ON_A::ENABLE)
78    }
79}
80#[doc = "Field `S_PD_CPU0_ON` reader - Tied to HIGH"]
81pub type S_PD_CPU0_ON_R = crate::BitReader<S_PD_CPU0_ON_A>;
82#[doc = "Tied to HIGH\n\nValue on reset: 0"]
83#[derive(Clone, Copy, Debug, PartialEq, Eq)]
84pub enum S_PD_CPU0_ON_A {
85    #[doc = "1: PD_SYS always tries to stay ON if PD_CPU0CORE is ON"]
86    HIGH = 1,
87}
88impl From<S_PD_CPU0_ON_A> for bool {
89    #[inline(always)]
90    fn from(variant: S_PD_CPU0_ON_A) -> Self {
91        variant as u8 != 0
92    }
93}
94impl S_PD_CPU0_ON_R {
95    #[doc = "Get enumerated values variant"]
96    #[inline(always)]
97    pub fn variant(&self) -> Option<S_PD_CPU0_ON_A> {
98        match self.bits {
99            true => Some(S_PD_CPU0_ON_A::HIGH),
100            _ => None,
101        }
102    }
103    #[doc = "Checks if the value of the field is `HIGH`"]
104    #[inline(always)]
105    pub fn is_high(&self) -> bool {
106        *self == S_PD_CPU0_ON_A::HIGH
107    }
108}
109#[doc = "Field `S_PD_DEBUG_ON` reader - Tied to LOW"]
110pub type S_PD_DEBUG_ON_R = crate::BitReader<bool>;
111#[doc = "Field `S_PDCMQREQ0` reader - Enable PDCMQREQn\\[0\\]
112signal Sensitivity"]
113pub type S_PDCMQREQ0_R = crate::BitReader<S_PDCMQREQ0_A>;
114#[doc = "Enable PDCMQREQn\\[0\\]
115signal Sensitivity\n\nValue on reset: 0"]
116#[derive(Clone, Copy, Debug, PartialEq, Eq)]
117pub enum S_PDCMQREQ0_A {
118    #[doc = "1: Enable PDCMQREQn\\[0\\]
119signal Sensitivity."]
120    ENABLE = 1,
121    #[doc = "0: Disable PDCMQREQn\\[0\\]
122signal Sensitivity."]
123    DISABLED = 0,
124}
125impl From<S_PDCMQREQ0_A> for bool {
126    #[inline(always)]
127    fn from(variant: S_PDCMQREQ0_A) -> Self {
128        variant as u8 != 0
129    }
130}
131impl S_PDCMQREQ0_R {
132    #[doc = "Get enumerated values variant"]
133    #[inline(always)]
134    pub fn variant(&self) -> S_PDCMQREQ0_A {
135        match self.bits {
136            true => S_PDCMQREQ0_A::ENABLE,
137            false => S_PDCMQREQ0_A::DISABLED,
138        }
139    }
140    #[doc = "Checks if the value of the field is `ENABLE`"]
141    #[inline(always)]
142    pub fn is_enable(&self) -> bool {
143        *self == S_PDCMQREQ0_A::ENABLE
144    }
145    #[doc = "Checks if the value of the field is `DISABLED`"]
146    #[inline(always)]
147    pub fn is_disabled(&self) -> bool {
148        *self == S_PDCMQREQ0_A::DISABLED
149    }
150}
151#[doc = "Field `S_PDCMQREQ0` writer - Enable PDCMQREQn\\[0\\]
152signal Sensitivity"]
153pub type S_PDCMQREQ0_W<'a, const O: u8> =
154    crate::BitWriter<'a, u32, PDCM_PD_VMR0_SENSE_SPEC, S_PDCMQREQ0_A, O>;
155impl<'a, const O: u8> S_PDCMQREQ0_W<'a, O> {
156    #[doc = "Enable PDCMQREQn\\[0\\]
157signal Sensitivity."]
158    #[inline(always)]
159    pub fn enable(self) -> &'a mut W {
160        self.variant(S_PDCMQREQ0_A::ENABLE)
161    }
162    #[doc = "Disable PDCMQREQn\\[0\\]
163signal Sensitivity."]
164    #[inline(always)]
165    pub fn disabled(self) -> &'a mut W {
166        self.variant(S_PDCMQREQ0_A::DISABLED)
167    }
168}
169#[doc = "Field `S_PDCMQREQ1` reader - Enable PDCMQREQn\\[1\\]
170signal Sensitivity"]
171pub type S_PDCMQREQ1_R = crate::BitReader<S_PDCMQREQ1_A>;
172#[doc = "Enable PDCMQREQn\\[1\\]
173signal Sensitivity\n\nValue on reset: 0"]
174#[derive(Clone, Copy, Debug, PartialEq, Eq)]
175pub enum S_PDCMQREQ1_A {
176    #[doc = "1: Enable PDCMQREQn\\[1\\]
177signal Sensitivity."]
178    ENABLE = 1,
179    #[doc = "0: Disable PDCMQREQn\\[1\\]
180signal Sensitivity."]
181    DISABLED = 0,
182}
183impl From<S_PDCMQREQ1_A> for bool {
184    #[inline(always)]
185    fn from(variant: S_PDCMQREQ1_A) -> Self {
186        variant as u8 != 0
187    }
188}
189impl S_PDCMQREQ1_R {
190    #[doc = "Get enumerated values variant"]
191    #[inline(always)]
192    pub fn variant(&self) -> S_PDCMQREQ1_A {
193        match self.bits {
194            true => S_PDCMQREQ1_A::ENABLE,
195            false => S_PDCMQREQ1_A::DISABLED,
196        }
197    }
198    #[doc = "Checks if the value of the field is `ENABLE`"]
199    #[inline(always)]
200    pub fn is_enable(&self) -> bool {
201        *self == S_PDCMQREQ1_A::ENABLE
202    }
203    #[doc = "Checks if the value of the field is `DISABLED`"]
204    #[inline(always)]
205    pub fn is_disabled(&self) -> bool {
206        *self == S_PDCMQREQ1_A::DISABLED
207    }
208}
209#[doc = "Field `S_PDCMQREQ1` writer - Enable PDCMQREQn\\[1\\]
210signal Sensitivity"]
211pub type S_PDCMQREQ1_W<'a, const O: u8> =
212    crate::BitWriter<'a, u32, PDCM_PD_VMR0_SENSE_SPEC, S_PDCMQREQ1_A, O>;
213impl<'a, const O: u8> S_PDCMQREQ1_W<'a, O> {
214    #[doc = "Enable PDCMQREQn\\[1\\]
215signal Sensitivity."]
216    #[inline(always)]
217    pub fn enable(self) -> &'a mut W {
218        self.variant(S_PDCMQREQ1_A::ENABLE)
219    }
220    #[doc = "Disable PDCMQREQn\\[1\\]
221signal Sensitivity."]
222    #[inline(always)]
223    pub fn disabled(self) -> &'a mut W {
224        self.variant(S_PDCMQREQ1_A::DISABLED)
225    }
226}
227#[doc = "Field `S_PDCMQREQ2` reader - Enable PDCMQREQn\\[2\\]
228signal Sensitivity"]
229pub type S_PDCMQREQ2_R = crate::BitReader<S_PDCMQREQ2_A>;
230#[doc = "Enable PDCMQREQn\\[2\\]
231signal Sensitivity\n\nValue on reset: 0"]
232#[derive(Clone, Copy, Debug, PartialEq, Eq)]
233pub enum S_PDCMQREQ2_A {
234    #[doc = "1: Enable PDCMQREQn\\[2\\]
235signal Sensitivity."]
236    ENABLE = 1,
237    #[doc = "0: Disable PDCMQREQn\\[2\\]
238signal Sensitivity."]
239    DISABLED = 0,
240}
241impl From<S_PDCMQREQ2_A> for bool {
242    #[inline(always)]
243    fn from(variant: S_PDCMQREQ2_A) -> Self {
244        variant as u8 != 0
245    }
246}
247impl S_PDCMQREQ2_R {
248    #[doc = "Get enumerated values variant"]
249    #[inline(always)]
250    pub fn variant(&self) -> S_PDCMQREQ2_A {
251        match self.bits {
252            true => S_PDCMQREQ2_A::ENABLE,
253            false => S_PDCMQREQ2_A::DISABLED,
254        }
255    }
256    #[doc = "Checks if the value of the field is `ENABLE`"]
257    #[inline(always)]
258    pub fn is_enable(&self) -> bool {
259        *self == S_PDCMQREQ2_A::ENABLE
260    }
261    #[doc = "Checks if the value of the field is `DISABLED`"]
262    #[inline(always)]
263    pub fn is_disabled(&self) -> bool {
264        *self == S_PDCMQREQ2_A::DISABLED
265    }
266}
267#[doc = "Field `S_PDCMQREQ2` writer - Enable PDCMQREQn\\[2\\]
268signal Sensitivity"]
269pub type S_PDCMQREQ2_W<'a, const O: u8> =
270    crate::BitWriter<'a, u32, PDCM_PD_VMR0_SENSE_SPEC, S_PDCMQREQ2_A, O>;
271impl<'a, const O: u8> S_PDCMQREQ2_W<'a, O> {
272    #[doc = "Enable PDCMQREQn\\[2\\]
273signal Sensitivity."]
274    #[inline(always)]
275    pub fn enable(self) -> &'a mut W {
276        self.variant(S_PDCMQREQ2_A::ENABLE)
277    }
278    #[doc = "Disable PDCMQREQn\\[2\\]
279signal Sensitivity."]
280    #[inline(always)]
281    pub fn disabled(self) -> &'a mut W {
282        self.variant(S_PDCMQREQ2_A::DISABLED)
283    }
284}
285#[doc = "Field `S_PDCMQREQ3` reader - Enable PDCMQREQn\\[3\\]
286signal Sensitivity"]
287pub type S_PDCMQREQ3_R = crate::BitReader<S_PDCMQREQ3_A>;
288#[doc = "Enable PDCMQREQn\\[3\\]
289signal Sensitivity\n\nValue on reset: 0"]
290#[derive(Clone, Copy, Debug, PartialEq, Eq)]
291pub enum S_PDCMQREQ3_A {
292    #[doc = "1: Enable PDCMQREQn\\[3\\]
293signal Sensitivity."]
294    ENABLE = 1,
295    #[doc = "0: Disable PDCMQREQn\\[3\\]
296signal Sensitivity."]
297    DISABLED = 0,
298}
299impl From<S_PDCMQREQ3_A> for bool {
300    #[inline(always)]
301    fn from(variant: S_PDCMQREQ3_A) -> Self {
302        variant as u8 != 0
303    }
304}
305impl S_PDCMQREQ3_R {
306    #[doc = "Get enumerated values variant"]
307    #[inline(always)]
308    pub fn variant(&self) -> S_PDCMQREQ3_A {
309        match self.bits {
310            true => S_PDCMQREQ3_A::ENABLE,
311            false => S_PDCMQREQ3_A::DISABLED,
312        }
313    }
314    #[doc = "Checks if the value of the field is `ENABLE`"]
315    #[inline(always)]
316    pub fn is_enable(&self) -> bool {
317        *self == S_PDCMQREQ3_A::ENABLE
318    }
319    #[doc = "Checks if the value of the field is `DISABLED`"]
320    #[inline(always)]
321    pub fn is_disabled(&self) -> bool {
322        *self == S_PDCMQREQ3_A::DISABLED
323    }
324}
325#[doc = "Field `S_PDCMQREQ3` writer - Enable PDCMQREQn\\[3\\]
326signal Sensitivity"]
327pub type S_PDCMQREQ3_W<'a, const O: u8> =
328    crate::BitWriter<'a, u32, PDCM_PD_VMR0_SENSE_SPEC, S_PDCMQREQ3_A, O>;
329impl<'a, const O: u8> S_PDCMQREQ3_W<'a, O> {
330    #[doc = "Enable PDCMQREQn\\[3\\]
331signal Sensitivity."]
332    #[inline(always)]
333    pub fn enable(self) -> &'a mut W {
334        self.variant(S_PDCMQREQ3_A::ENABLE)
335    }
336    #[doc = "Disable PDCMQREQn\\[3\\]
337signal Sensitivity."]
338    #[inline(always)]
339    pub fn disabled(self) -> &'a mut W {
340        self.variant(S_PDCMQREQ3_A::DISABLED)
341    }
342}
343#[doc = "Field `MIN_PWR_STATE` reader - Defines the Minimum Power State, when PD_SYS is trying to enter a lower power state."]
344pub type MIN_PWR_STATE_R = crate::FieldReader<u8, u8>;
345#[doc = "Field `MIN_PWR_STATE` writer - Defines the Minimum Power State, when PD_SYS is trying to enter a lower power state."]
346pub type MIN_PWR_STATE_W<'a, const O: u8> =
347    crate::FieldWriter<'a, u32, PDCM_PD_VMR0_SENSE_SPEC, u8, u8, 2, O>;
348impl R {
349    #[doc = "Bit 0 - Enable PD_SYS ON Sensitivity"]
350    #[inline(always)]
351    pub fn s_pd_sys_on(&self) -> S_PD_SYS_ON_R {
352        S_PD_SYS_ON_R::new((self.bits & 1) != 0)
353    }
354    #[doc = "Bit 1 - Tied to HIGH"]
355    #[inline(always)]
356    pub fn s_pd_cpu0_on(&self) -> S_PD_CPU0_ON_R {
357        S_PD_CPU0_ON_R::new(((self.bits >> 1) & 1) != 0)
358    }
359    #[doc = "Bit 13 - Tied to LOW"]
360    #[inline(always)]
361    pub fn s_pd_debug_on(&self) -> S_PD_DEBUG_ON_R {
362        S_PD_DEBUG_ON_R::new(((self.bits >> 13) & 1) != 0)
363    }
364    #[doc = "Bit 16 - Enable PDCMQREQn\\[0\\]
365signal Sensitivity"]
366    #[inline(always)]
367    pub fn s_pdcmqreq0(&self) -> S_PDCMQREQ0_R {
368        S_PDCMQREQ0_R::new(((self.bits >> 16) & 1) != 0)
369    }
370    #[doc = "Bit 17 - Enable PDCMQREQn\\[1\\]
371signal Sensitivity"]
372    #[inline(always)]
373    pub fn s_pdcmqreq1(&self) -> S_PDCMQREQ1_R {
374        S_PDCMQREQ1_R::new(((self.bits >> 17) & 1) != 0)
375    }
376    #[doc = "Bit 18 - Enable PDCMQREQn\\[2\\]
377signal Sensitivity"]
378    #[inline(always)]
379    pub fn s_pdcmqreq2(&self) -> S_PDCMQREQ2_R {
380        S_PDCMQREQ2_R::new(((self.bits >> 18) & 1) != 0)
381    }
382    #[doc = "Bit 19 - Enable PDCMQREQn\\[3\\]
383signal Sensitivity"]
384    #[inline(always)]
385    pub fn s_pdcmqreq3(&self) -> S_PDCMQREQ3_R {
386        S_PDCMQREQ3_R::new(((self.bits >> 19) & 1) != 0)
387    }
388    #[doc = "Bits 30:31 - Defines the Minimum Power State, when PD_SYS is trying to enter a lower power state."]
389    #[inline(always)]
390    pub fn min_pwr_state(&self) -> MIN_PWR_STATE_R {
391        MIN_PWR_STATE_R::new(((self.bits >> 30) & 3) as u8)
392    }
393}
394impl W {
395    #[doc = "Bit 0 - Enable PD_SYS ON Sensitivity"]
396    #[inline(always)]
397    pub fn s_pd_sys_on(&mut self) -> S_PD_SYS_ON_W<0> {
398        S_PD_SYS_ON_W::new(self)
399    }
400    #[doc = "Bit 16 - Enable PDCMQREQn\\[0\\]
401signal Sensitivity"]
402    #[inline(always)]
403    pub fn s_pdcmqreq0(&mut self) -> S_PDCMQREQ0_W<16> {
404        S_PDCMQREQ0_W::new(self)
405    }
406    #[doc = "Bit 17 - Enable PDCMQREQn\\[1\\]
407signal Sensitivity"]
408    #[inline(always)]
409    pub fn s_pdcmqreq1(&mut self) -> S_PDCMQREQ1_W<17> {
410        S_PDCMQREQ1_W::new(self)
411    }
412    #[doc = "Bit 18 - Enable PDCMQREQn\\[2\\]
413signal Sensitivity"]
414    #[inline(always)]
415    pub fn s_pdcmqreq2(&mut self) -> S_PDCMQREQ2_W<18> {
416        S_PDCMQREQ2_W::new(self)
417    }
418    #[doc = "Bit 19 - Enable PDCMQREQn\\[3\\]
419signal Sensitivity"]
420    #[inline(always)]
421    pub fn s_pdcmqreq3(&mut self) -> S_PDCMQREQ3_W<19> {
422        S_PDCMQREQ3_W::new(self)
423    }
424    #[doc = "Bits 30:31 - Defines the Minimum Power State, when PD_SYS is trying to enter a lower power state."]
425    #[inline(always)]
426    pub fn min_pwr_state(&mut self) -> MIN_PWR_STATE_W<30> {
427        MIN_PWR_STATE_W::new(self)
428    }
429    #[doc = "Writes raw bits to the register."]
430    #[inline(always)]
431    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
432        self.0.bits(bits);
433        self
434    }
435}
436#[doc = "PDCM PD_VMR0 Sensitivity.\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 [pdcm_pd_vmr0_sense](index.html) module"]
437pub struct PDCM_PD_VMR0_SENSE_SPEC;
438impl crate::RegisterSpec for PDCM_PD_VMR0_SENSE_SPEC {
439    type Ux = u32;
440}
441#[doc = "`read()` method returns [pdcm_pd_vmr0_sense::R](R) reader structure"]
442impl crate::Readable for PDCM_PD_VMR0_SENSE_SPEC {
443    type Reader = R;
444}
445#[doc = "`write(|w| ..)` method takes [pdcm_pd_vmr0_sense::W](W) writer structure"]
446impl crate::Writable for PDCM_PD_VMR0_SENSE_SPEC {
447    type Writer = W;
448}
449#[doc = "`reset()` method sets PDCM_PD_VMR0_SENSE to value 0x4000_0000"]
450impl crate::Resettable for PDCM_PD_VMR0_SENSE_SPEC {
451    #[inline(always)]
452    fn reset_value() -> Self::Ux {
453        0x4000_0000
454    }
455}