corstone300_pac/scc/
cfg_reg3.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 `CFG_REG3` reader"]
6pub struct R(crate::R<CFG_REG3_SPEC>);
7impl core::ops::Deref for R {
8    type Target = crate::R<CFG_REG3_SPEC>;
9    #[inline(always)]
10    fn deref(&self) -> &Self::Target {
11        &self.0
12    }
13}
14impl From<crate::R<CFG_REG3_SPEC>> for R {
15    #[inline(always)]
16    fn from(reader: crate::R<CFG_REG3_SPEC>) -> Self {
17        R(reader)
18    }
19}
20#[doc = "Field `MCC_SWITCH0` reader - MCC SWITCHES: 0 = OFF 1 = ON"]
21pub type MCC_SWITCH0_R = crate::BitReader<MCC_SWITCH0_A>;
22#[doc = "MCC SWITCHES: 0 = OFF 1 = ON\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq, Eq)]
24pub enum MCC_SWITCH0_A {
25    #[doc = "0: Switch is off"]
26    OFF = 0,
27    #[doc = "1: Switch is on"]
28    ON = 1,
29}
30impl From<MCC_SWITCH0_A> for bool {
31    #[inline(always)]
32    fn from(variant: MCC_SWITCH0_A) -> Self {
33        variant as u8 != 0
34    }
35}
36impl MCC_SWITCH0_R {
37    #[doc = "Get enumerated values variant"]
38    #[inline(always)]
39    pub fn variant(&self) -> MCC_SWITCH0_A {
40        match self.bits {
41            false => MCC_SWITCH0_A::OFF,
42            true => MCC_SWITCH0_A::ON,
43        }
44    }
45    #[doc = "Checks if the value of the field is `OFF`"]
46    #[inline(always)]
47    pub fn is_off(&self) -> bool {
48        *self == MCC_SWITCH0_A::OFF
49    }
50    #[doc = "Checks if the value of the field is `ON`"]
51    #[inline(always)]
52    pub fn is_on(&self) -> bool {
53        *self == MCC_SWITCH0_A::ON
54    }
55}
56#[doc = "Field `MCC_SWITCH1` reader - MCC SWITCHES: 0 = OFF 1 = ON"]
57pub type MCC_SWITCH1_R = crate::BitReader<MCC_SWITCH1_A>;
58#[doc = "MCC SWITCHES: 0 = OFF 1 = ON\n\nValue on reset: 0"]
59#[derive(Clone, Copy, Debug, PartialEq, Eq)]
60pub enum MCC_SWITCH1_A {
61    #[doc = "0: Switch is off"]
62    OFF = 0,
63    #[doc = "1: Switch is on"]
64    ON = 1,
65}
66impl From<MCC_SWITCH1_A> for bool {
67    #[inline(always)]
68    fn from(variant: MCC_SWITCH1_A) -> Self {
69        variant as u8 != 0
70    }
71}
72impl MCC_SWITCH1_R {
73    #[doc = "Get enumerated values variant"]
74    #[inline(always)]
75    pub fn variant(&self) -> MCC_SWITCH1_A {
76        match self.bits {
77            false => MCC_SWITCH1_A::OFF,
78            true => MCC_SWITCH1_A::ON,
79        }
80    }
81    #[doc = "Checks if the value of the field is `OFF`"]
82    #[inline(always)]
83    pub fn is_off(&self) -> bool {
84        *self == MCC_SWITCH1_A::OFF
85    }
86    #[doc = "Checks if the value of the field is `ON`"]
87    #[inline(always)]
88    pub fn is_on(&self) -> bool {
89        *self == MCC_SWITCH1_A::ON
90    }
91}
92#[doc = "Field `MCC_SWITCH2` reader - MCC SWITCHES: 0 = OFF 1 = ON"]
93pub type MCC_SWITCH2_R = crate::BitReader<MCC_SWITCH2_A>;
94#[doc = "MCC SWITCHES: 0 = OFF 1 = ON\n\nValue on reset: 0"]
95#[derive(Clone, Copy, Debug, PartialEq, Eq)]
96pub enum MCC_SWITCH2_A {
97    #[doc = "0: Switch is off"]
98    OFF = 0,
99    #[doc = "1: Switch is on"]
100    ON = 1,
101}
102impl From<MCC_SWITCH2_A> for bool {
103    #[inline(always)]
104    fn from(variant: MCC_SWITCH2_A) -> Self {
105        variant as u8 != 0
106    }
107}
108impl MCC_SWITCH2_R {
109    #[doc = "Get enumerated values variant"]
110    #[inline(always)]
111    pub fn variant(&self) -> MCC_SWITCH2_A {
112        match self.bits {
113            false => MCC_SWITCH2_A::OFF,
114            true => MCC_SWITCH2_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 == MCC_SWITCH2_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 == MCC_SWITCH2_A::ON
126    }
127}
128#[doc = "Field `MCC_SWITCH3` reader - MCC SWITCHES: 0 = OFF 1 = ON"]
129pub type MCC_SWITCH3_R = crate::BitReader<MCC_SWITCH3_A>;
130#[doc = "MCC SWITCHES: 0 = OFF 1 = ON\n\nValue on reset: 0"]
131#[derive(Clone, Copy, Debug, PartialEq, Eq)]
132pub enum MCC_SWITCH3_A {
133    #[doc = "0: Switch is off"]
134    OFF = 0,
135    #[doc = "1: Switch is on"]
136    ON = 1,
137}
138impl From<MCC_SWITCH3_A> for bool {
139    #[inline(always)]
140    fn from(variant: MCC_SWITCH3_A) -> Self {
141        variant as u8 != 0
142    }
143}
144impl MCC_SWITCH3_R {
145    #[doc = "Get enumerated values variant"]
146    #[inline(always)]
147    pub fn variant(&self) -> MCC_SWITCH3_A {
148        match self.bits {
149            false => MCC_SWITCH3_A::OFF,
150            true => MCC_SWITCH3_A::ON,
151        }
152    }
153    #[doc = "Checks if the value of the field is `OFF`"]
154    #[inline(always)]
155    pub fn is_off(&self) -> bool {
156        *self == MCC_SWITCH3_A::OFF
157    }
158    #[doc = "Checks if the value of the field is `ON`"]
159    #[inline(always)]
160    pub fn is_on(&self) -> bool {
161        *self == MCC_SWITCH3_A::ON
162    }
163}
164#[doc = "Field `MCC_SWITCH4` reader - MCC SWITCHES: 0 = OFF 1 = ON"]
165pub type MCC_SWITCH4_R = crate::BitReader<MCC_SWITCH4_A>;
166#[doc = "MCC SWITCHES: 0 = OFF 1 = ON\n\nValue on reset: 0"]
167#[derive(Clone, Copy, Debug, PartialEq, Eq)]
168pub enum MCC_SWITCH4_A {
169    #[doc = "0: Switch is off"]
170    OFF = 0,
171    #[doc = "1: Switch is on"]
172    ON = 1,
173}
174impl From<MCC_SWITCH4_A> for bool {
175    #[inline(always)]
176    fn from(variant: MCC_SWITCH4_A) -> Self {
177        variant as u8 != 0
178    }
179}
180impl MCC_SWITCH4_R {
181    #[doc = "Get enumerated values variant"]
182    #[inline(always)]
183    pub fn variant(&self) -> MCC_SWITCH4_A {
184        match self.bits {
185            false => MCC_SWITCH4_A::OFF,
186            true => MCC_SWITCH4_A::ON,
187        }
188    }
189    #[doc = "Checks if the value of the field is `OFF`"]
190    #[inline(always)]
191    pub fn is_off(&self) -> bool {
192        *self == MCC_SWITCH4_A::OFF
193    }
194    #[doc = "Checks if the value of the field is `ON`"]
195    #[inline(always)]
196    pub fn is_on(&self) -> bool {
197        *self == MCC_SWITCH4_A::ON
198    }
199}
200#[doc = "Field `MCC_SWITCH5` reader - MCC SWITCHES: 0 = OFF 1 = ON"]
201pub type MCC_SWITCH5_R = crate::BitReader<MCC_SWITCH5_A>;
202#[doc = "MCC SWITCHES: 0 = OFF 1 = ON\n\nValue on reset: 0"]
203#[derive(Clone, Copy, Debug, PartialEq, Eq)]
204pub enum MCC_SWITCH5_A {
205    #[doc = "0: Switch is off"]
206    OFF = 0,
207    #[doc = "1: Switch is on"]
208    ON = 1,
209}
210impl From<MCC_SWITCH5_A> for bool {
211    #[inline(always)]
212    fn from(variant: MCC_SWITCH5_A) -> Self {
213        variant as u8 != 0
214    }
215}
216impl MCC_SWITCH5_R {
217    #[doc = "Get enumerated values variant"]
218    #[inline(always)]
219    pub fn variant(&self) -> MCC_SWITCH5_A {
220        match self.bits {
221            false => MCC_SWITCH5_A::OFF,
222            true => MCC_SWITCH5_A::ON,
223        }
224    }
225    #[doc = "Checks if the value of the field is `OFF`"]
226    #[inline(always)]
227    pub fn is_off(&self) -> bool {
228        *self == MCC_SWITCH5_A::OFF
229    }
230    #[doc = "Checks if the value of the field is `ON`"]
231    #[inline(always)]
232    pub fn is_on(&self) -> bool {
233        *self == MCC_SWITCH5_A::ON
234    }
235}
236#[doc = "Field `MCC_SWITCH6` reader - MCC SWITCHES: 0 = OFF 1 = ON"]
237pub type MCC_SWITCH6_R = crate::BitReader<MCC_SWITCH6_A>;
238#[doc = "MCC SWITCHES: 0 = OFF 1 = ON\n\nValue on reset: 0"]
239#[derive(Clone, Copy, Debug, PartialEq, Eq)]
240pub enum MCC_SWITCH6_A {
241    #[doc = "0: Switch is off"]
242    OFF = 0,
243    #[doc = "1: Switch is on"]
244    ON = 1,
245}
246impl From<MCC_SWITCH6_A> for bool {
247    #[inline(always)]
248    fn from(variant: MCC_SWITCH6_A) -> Self {
249        variant as u8 != 0
250    }
251}
252impl MCC_SWITCH6_R {
253    #[doc = "Get enumerated values variant"]
254    #[inline(always)]
255    pub fn variant(&self) -> MCC_SWITCH6_A {
256        match self.bits {
257            false => MCC_SWITCH6_A::OFF,
258            true => MCC_SWITCH6_A::ON,
259        }
260    }
261    #[doc = "Checks if the value of the field is `OFF`"]
262    #[inline(always)]
263    pub fn is_off(&self) -> bool {
264        *self == MCC_SWITCH6_A::OFF
265    }
266    #[doc = "Checks if the value of the field is `ON`"]
267    #[inline(always)]
268    pub fn is_on(&self) -> bool {
269        *self == MCC_SWITCH6_A::ON
270    }
271}
272#[doc = "Field `MCC_SWITCH7` reader - MCC SWITCHES: 0 = OFF 1 = ON"]
273pub type MCC_SWITCH7_R = crate::BitReader<MCC_SWITCH7_A>;
274#[doc = "MCC SWITCHES: 0 = OFF 1 = ON\n\nValue on reset: 0"]
275#[derive(Clone, Copy, Debug, PartialEq, Eq)]
276pub enum MCC_SWITCH7_A {
277    #[doc = "0: Switch is off"]
278    OFF = 0,
279    #[doc = "1: Switch is on"]
280    ON = 1,
281}
282impl From<MCC_SWITCH7_A> for bool {
283    #[inline(always)]
284    fn from(variant: MCC_SWITCH7_A) -> Self {
285        variant as u8 != 0
286    }
287}
288impl MCC_SWITCH7_R {
289    #[doc = "Get enumerated values variant"]
290    #[inline(always)]
291    pub fn variant(&self) -> MCC_SWITCH7_A {
292        match self.bits {
293            false => MCC_SWITCH7_A::OFF,
294            true => MCC_SWITCH7_A::ON,
295        }
296    }
297    #[doc = "Checks if the value of the field is `OFF`"]
298    #[inline(always)]
299    pub fn is_off(&self) -> bool {
300        *self == MCC_SWITCH7_A::OFF
301    }
302    #[doc = "Checks if the value of the field is `ON`"]
303    #[inline(always)]
304    pub fn is_on(&self) -> bool {
305        *self == MCC_SWITCH7_A::ON
306    }
307}
308impl R {
309    #[doc = "Bit 0 - MCC SWITCHES: 0 = OFF 1 = ON"]
310    #[inline(always)]
311    pub fn mcc_switch0(&self) -> MCC_SWITCH0_R {
312        MCC_SWITCH0_R::new((self.bits & 1) != 0)
313    }
314    #[doc = "Bit 1 - MCC SWITCHES: 0 = OFF 1 = ON"]
315    #[inline(always)]
316    pub fn mcc_switch1(&self) -> MCC_SWITCH1_R {
317        MCC_SWITCH1_R::new(((self.bits >> 1) & 1) != 0)
318    }
319    #[doc = "Bit 2 - MCC SWITCHES: 0 = OFF 1 = ON"]
320    #[inline(always)]
321    pub fn mcc_switch2(&self) -> MCC_SWITCH2_R {
322        MCC_SWITCH2_R::new(((self.bits >> 2) & 1) != 0)
323    }
324    #[doc = "Bit 3 - MCC SWITCHES: 0 = OFF 1 = ON"]
325    #[inline(always)]
326    pub fn mcc_switch3(&self) -> MCC_SWITCH3_R {
327        MCC_SWITCH3_R::new(((self.bits >> 3) & 1) != 0)
328    }
329    #[doc = "Bit 4 - MCC SWITCHES: 0 = OFF 1 = ON"]
330    #[inline(always)]
331    pub fn mcc_switch4(&self) -> MCC_SWITCH4_R {
332        MCC_SWITCH4_R::new(((self.bits >> 4) & 1) != 0)
333    }
334    #[doc = "Bit 5 - MCC SWITCHES: 0 = OFF 1 = ON"]
335    #[inline(always)]
336    pub fn mcc_switch5(&self) -> MCC_SWITCH5_R {
337        MCC_SWITCH5_R::new(((self.bits >> 5) & 1) != 0)
338    }
339    #[doc = "Bit 6 - MCC SWITCHES: 0 = OFF 1 = ON"]
340    #[inline(always)]
341    pub fn mcc_switch6(&self) -> MCC_SWITCH6_R {
342        MCC_SWITCH6_R::new(((self.bits >> 6) & 1) != 0)
343    }
344    #[doc = "Bit 7 - MCC SWITCHES: 0 = OFF 1 = ON"]
345    #[inline(always)]
346    pub fn mcc_switch7(&self) -> MCC_SWITCH7_R {
347        MCC_SWITCH7_R::new(((self.bits >> 7) & 1) != 0)
348    }
349}
350#[doc = "\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 [cfg_reg3](index.html) module"]
351pub struct CFG_REG3_SPEC;
352impl crate::RegisterSpec for CFG_REG3_SPEC {
353    type Ux = u32;
354}
355#[doc = "`read()` method returns [cfg_reg3::R](R) reader structure"]
356impl crate::Readable for CFG_REG3_SPEC {
357    type Reader = R;
358}
359#[doc = "`reset()` method sets CFG_REG3 to value 0"]
360impl crate::Resettable for CFG_REG3_SPEC {
361    #[inline(always)]
362    fn reset_value() -> Self::Ux {
363        0
364    }
365}