corstone300_pac/scc/
cfg_reg1.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_REG1` reader"]
6pub struct R(crate::R<CFG_REG1_SPEC>);
7impl core::ops::Deref for R {
8    type Target = crate::R<CFG_REG1_SPEC>;
9    #[inline(always)]
10    fn deref(&self) -> &Self::Target {
11        &self.0
12    }
13}
14impl From<crate::R<CFG_REG1_SPEC>> for R {
15    #[inline(always)]
16    fn from(reader: crate::R<CFG_REG1_SPEC>) -> Self {
17        R(reader)
18    }
19}
20#[doc = "Register `CFG_REG1` writer"]
21pub struct W(crate::W<CFG_REG1_SPEC>);
22impl core::ops::Deref for W {
23    type Target = crate::W<CFG_REG1_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<CFG_REG1_SPEC>> for W {
36    #[inline(always)]
37    fn from(writer: crate::W<CFG_REG1_SPEC>) -> Self {
38        W(writer)
39    }
40}
41#[doc = "Field `MCC_LED0` reader - MCC LEDs: 0 = OFF 1 = ON"]
42pub type MCC_LED0_R = crate::BitReader<MCC_LED0_A>;
43#[doc = "MCC LEDs: 0 = OFF 1 = ON\n\nValue on reset: 0"]
44#[derive(Clone, Copy, Debug, PartialEq, Eq)]
45pub enum MCC_LED0_A {
46    #[doc = "0: LED is off"]
47    OFF = 0,
48    #[doc = "1: LED is on"]
49    ON = 1,
50}
51impl From<MCC_LED0_A> for bool {
52    #[inline(always)]
53    fn from(variant: MCC_LED0_A) -> Self {
54        variant as u8 != 0
55    }
56}
57impl MCC_LED0_R {
58    #[doc = "Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> MCC_LED0_A {
61        match self.bits {
62            false => MCC_LED0_A::OFF,
63            true => MCC_LED0_A::ON,
64        }
65    }
66    #[doc = "Checks if the value of the field is `OFF`"]
67    #[inline(always)]
68    pub fn is_off(&self) -> bool {
69        *self == MCC_LED0_A::OFF
70    }
71    #[doc = "Checks if the value of the field is `ON`"]
72    #[inline(always)]
73    pub fn is_on(&self) -> bool {
74        *self == MCC_LED0_A::ON
75    }
76}
77#[doc = "Field `MCC_LED0` writer - MCC LEDs: 0 = OFF 1 = ON"]
78pub type MCC_LED0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_REG1_SPEC, MCC_LED0_A, O>;
79impl<'a, const O: u8> MCC_LED0_W<'a, O> {
80    #[doc = "LED is off"]
81    #[inline(always)]
82    pub fn off(self) -> &'a mut W {
83        self.variant(MCC_LED0_A::OFF)
84    }
85    #[doc = "LED is on"]
86    #[inline(always)]
87    pub fn on(self) -> &'a mut W {
88        self.variant(MCC_LED0_A::ON)
89    }
90}
91#[doc = "Field `MCC_LED1` reader - MCC LEDs: 0 = OFF 1 = ON"]
92pub type MCC_LED1_R = crate::BitReader<MCC_LED1_A>;
93#[doc = "MCC LEDs: 0 = OFF 1 = ON\n\nValue on reset: 0"]
94#[derive(Clone, Copy, Debug, PartialEq, Eq)]
95pub enum MCC_LED1_A {
96    #[doc = "0: LED is off"]
97    OFF = 0,
98    #[doc = "1: LED is on"]
99    ON = 1,
100}
101impl From<MCC_LED1_A> for bool {
102    #[inline(always)]
103    fn from(variant: MCC_LED1_A) -> Self {
104        variant as u8 != 0
105    }
106}
107impl MCC_LED1_R {
108    #[doc = "Get enumerated values variant"]
109    #[inline(always)]
110    pub fn variant(&self) -> MCC_LED1_A {
111        match self.bits {
112            false => MCC_LED1_A::OFF,
113            true => MCC_LED1_A::ON,
114        }
115    }
116    #[doc = "Checks if the value of the field is `OFF`"]
117    #[inline(always)]
118    pub fn is_off(&self) -> bool {
119        *self == MCC_LED1_A::OFF
120    }
121    #[doc = "Checks if the value of the field is `ON`"]
122    #[inline(always)]
123    pub fn is_on(&self) -> bool {
124        *self == MCC_LED1_A::ON
125    }
126}
127#[doc = "Field `MCC_LED1` writer - MCC LEDs: 0 = OFF 1 = ON"]
128pub type MCC_LED1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_REG1_SPEC, MCC_LED1_A, O>;
129impl<'a, const O: u8> MCC_LED1_W<'a, O> {
130    #[doc = "LED is off"]
131    #[inline(always)]
132    pub fn off(self) -> &'a mut W {
133        self.variant(MCC_LED1_A::OFF)
134    }
135    #[doc = "LED is on"]
136    #[inline(always)]
137    pub fn on(self) -> &'a mut W {
138        self.variant(MCC_LED1_A::ON)
139    }
140}
141#[doc = "Field `MCC_LED2` reader - MCC LEDs: 0 = OFF 1 = ON"]
142pub type MCC_LED2_R = crate::BitReader<MCC_LED2_A>;
143#[doc = "MCC LEDs: 0 = OFF 1 = ON\n\nValue on reset: 0"]
144#[derive(Clone, Copy, Debug, PartialEq, Eq)]
145pub enum MCC_LED2_A {
146    #[doc = "0: LED is off"]
147    OFF = 0,
148    #[doc = "1: LED is on"]
149    ON = 1,
150}
151impl From<MCC_LED2_A> for bool {
152    #[inline(always)]
153    fn from(variant: MCC_LED2_A) -> Self {
154        variant as u8 != 0
155    }
156}
157impl MCC_LED2_R {
158    #[doc = "Get enumerated values variant"]
159    #[inline(always)]
160    pub fn variant(&self) -> MCC_LED2_A {
161        match self.bits {
162            false => MCC_LED2_A::OFF,
163            true => MCC_LED2_A::ON,
164        }
165    }
166    #[doc = "Checks if the value of the field is `OFF`"]
167    #[inline(always)]
168    pub fn is_off(&self) -> bool {
169        *self == MCC_LED2_A::OFF
170    }
171    #[doc = "Checks if the value of the field is `ON`"]
172    #[inline(always)]
173    pub fn is_on(&self) -> bool {
174        *self == MCC_LED2_A::ON
175    }
176}
177#[doc = "Field `MCC_LED2` writer - MCC LEDs: 0 = OFF 1 = ON"]
178pub type MCC_LED2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_REG1_SPEC, MCC_LED2_A, O>;
179impl<'a, const O: u8> MCC_LED2_W<'a, O> {
180    #[doc = "LED is off"]
181    #[inline(always)]
182    pub fn off(self) -> &'a mut W {
183        self.variant(MCC_LED2_A::OFF)
184    }
185    #[doc = "LED is on"]
186    #[inline(always)]
187    pub fn on(self) -> &'a mut W {
188        self.variant(MCC_LED2_A::ON)
189    }
190}
191#[doc = "Field `MCC_LED3` reader - MCC LEDs: 0 = OFF 1 = ON"]
192pub type MCC_LED3_R = crate::BitReader<MCC_LED3_A>;
193#[doc = "MCC LEDs: 0 = OFF 1 = ON\n\nValue on reset: 0"]
194#[derive(Clone, Copy, Debug, PartialEq, Eq)]
195pub enum MCC_LED3_A {
196    #[doc = "0: LED is off"]
197    OFF = 0,
198    #[doc = "1: LED is on"]
199    ON = 1,
200}
201impl From<MCC_LED3_A> for bool {
202    #[inline(always)]
203    fn from(variant: MCC_LED3_A) -> Self {
204        variant as u8 != 0
205    }
206}
207impl MCC_LED3_R {
208    #[doc = "Get enumerated values variant"]
209    #[inline(always)]
210    pub fn variant(&self) -> MCC_LED3_A {
211        match self.bits {
212            false => MCC_LED3_A::OFF,
213            true => MCC_LED3_A::ON,
214        }
215    }
216    #[doc = "Checks if the value of the field is `OFF`"]
217    #[inline(always)]
218    pub fn is_off(&self) -> bool {
219        *self == MCC_LED3_A::OFF
220    }
221    #[doc = "Checks if the value of the field is `ON`"]
222    #[inline(always)]
223    pub fn is_on(&self) -> bool {
224        *self == MCC_LED3_A::ON
225    }
226}
227#[doc = "Field `MCC_LED3` writer - MCC LEDs: 0 = OFF 1 = ON"]
228pub type MCC_LED3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_REG1_SPEC, MCC_LED3_A, O>;
229impl<'a, const O: u8> MCC_LED3_W<'a, O> {
230    #[doc = "LED is off"]
231    #[inline(always)]
232    pub fn off(self) -> &'a mut W {
233        self.variant(MCC_LED3_A::OFF)
234    }
235    #[doc = "LED is on"]
236    #[inline(always)]
237    pub fn on(self) -> &'a mut W {
238        self.variant(MCC_LED3_A::ON)
239    }
240}
241#[doc = "Field `MCC_LED4` reader - MCC LEDs: 0 = OFF 1 = ON"]
242pub type MCC_LED4_R = crate::BitReader<MCC_LED4_A>;
243#[doc = "MCC LEDs: 0 = OFF 1 = ON\n\nValue on reset: 0"]
244#[derive(Clone, Copy, Debug, PartialEq, Eq)]
245pub enum MCC_LED4_A {
246    #[doc = "0: LED is off"]
247    OFF = 0,
248    #[doc = "1: LED is on"]
249    ON = 1,
250}
251impl From<MCC_LED4_A> for bool {
252    #[inline(always)]
253    fn from(variant: MCC_LED4_A) -> Self {
254        variant as u8 != 0
255    }
256}
257impl MCC_LED4_R {
258    #[doc = "Get enumerated values variant"]
259    #[inline(always)]
260    pub fn variant(&self) -> MCC_LED4_A {
261        match self.bits {
262            false => MCC_LED4_A::OFF,
263            true => MCC_LED4_A::ON,
264        }
265    }
266    #[doc = "Checks if the value of the field is `OFF`"]
267    #[inline(always)]
268    pub fn is_off(&self) -> bool {
269        *self == MCC_LED4_A::OFF
270    }
271    #[doc = "Checks if the value of the field is `ON`"]
272    #[inline(always)]
273    pub fn is_on(&self) -> bool {
274        *self == MCC_LED4_A::ON
275    }
276}
277#[doc = "Field `MCC_LED4` writer - MCC LEDs: 0 = OFF 1 = ON"]
278pub type MCC_LED4_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_REG1_SPEC, MCC_LED4_A, O>;
279impl<'a, const O: u8> MCC_LED4_W<'a, O> {
280    #[doc = "LED is off"]
281    #[inline(always)]
282    pub fn off(self) -> &'a mut W {
283        self.variant(MCC_LED4_A::OFF)
284    }
285    #[doc = "LED is on"]
286    #[inline(always)]
287    pub fn on(self) -> &'a mut W {
288        self.variant(MCC_LED4_A::ON)
289    }
290}
291#[doc = "Field `MCC_LED5` reader - MCC LEDs: 0 = OFF 1 = ON"]
292pub type MCC_LED5_R = crate::BitReader<MCC_LED5_A>;
293#[doc = "MCC LEDs: 0 = OFF 1 = ON\n\nValue on reset: 0"]
294#[derive(Clone, Copy, Debug, PartialEq, Eq)]
295pub enum MCC_LED5_A {
296    #[doc = "0: LED is off"]
297    OFF = 0,
298    #[doc = "1: LED is on"]
299    ON = 1,
300}
301impl From<MCC_LED5_A> for bool {
302    #[inline(always)]
303    fn from(variant: MCC_LED5_A) -> Self {
304        variant as u8 != 0
305    }
306}
307impl MCC_LED5_R {
308    #[doc = "Get enumerated values variant"]
309    #[inline(always)]
310    pub fn variant(&self) -> MCC_LED5_A {
311        match self.bits {
312            false => MCC_LED5_A::OFF,
313            true => MCC_LED5_A::ON,
314        }
315    }
316    #[doc = "Checks if the value of the field is `OFF`"]
317    #[inline(always)]
318    pub fn is_off(&self) -> bool {
319        *self == MCC_LED5_A::OFF
320    }
321    #[doc = "Checks if the value of the field is `ON`"]
322    #[inline(always)]
323    pub fn is_on(&self) -> bool {
324        *self == MCC_LED5_A::ON
325    }
326}
327#[doc = "Field `MCC_LED5` writer - MCC LEDs: 0 = OFF 1 = ON"]
328pub type MCC_LED5_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_REG1_SPEC, MCC_LED5_A, O>;
329impl<'a, const O: u8> MCC_LED5_W<'a, O> {
330    #[doc = "LED is off"]
331    #[inline(always)]
332    pub fn off(self) -> &'a mut W {
333        self.variant(MCC_LED5_A::OFF)
334    }
335    #[doc = "LED is on"]
336    #[inline(always)]
337    pub fn on(self) -> &'a mut W {
338        self.variant(MCC_LED5_A::ON)
339    }
340}
341#[doc = "Field `MCC_LED6` reader - MCC LEDs: 0 = OFF 1 = ON"]
342pub type MCC_LED6_R = crate::BitReader<MCC_LED6_A>;
343#[doc = "MCC LEDs: 0 = OFF 1 = ON\n\nValue on reset: 0"]
344#[derive(Clone, Copy, Debug, PartialEq, Eq)]
345pub enum MCC_LED6_A {
346    #[doc = "0: LED is off"]
347    OFF = 0,
348    #[doc = "1: LED is on"]
349    ON = 1,
350}
351impl From<MCC_LED6_A> for bool {
352    #[inline(always)]
353    fn from(variant: MCC_LED6_A) -> Self {
354        variant as u8 != 0
355    }
356}
357impl MCC_LED6_R {
358    #[doc = "Get enumerated values variant"]
359    #[inline(always)]
360    pub fn variant(&self) -> MCC_LED6_A {
361        match self.bits {
362            false => MCC_LED6_A::OFF,
363            true => MCC_LED6_A::ON,
364        }
365    }
366    #[doc = "Checks if the value of the field is `OFF`"]
367    #[inline(always)]
368    pub fn is_off(&self) -> bool {
369        *self == MCC_LED6_A::OFF
370    }
371    #[doc = "Checks if the value of the field is `ON`"]
372    #[inline(always)]
373    pub fn is_on(&self) -> bool {
374        *self == MCC_LED6_A::ON
375    }
376}
377#[doc = "Field `MCC_LED6` writer - MCC LEDs: 0 = OFF 1 = ON"]
378pub type MCC_LED6_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_REG1_SPEC, MCC_LED6_A, O>;
379impl<'a, const O: u8> MCC_LED6_W<'a, O> {
380    #[doc = "LED is off"]
381    #[inline(always)]
382    pub fn off(self) -> &'a mut W {
383        self.variant(MCC_LED6_A::OFF)
384    }
385    #[doc = "LED is on"]
386    #[inline(always)]
387    pub fn on(self) -> &'a mut W {
388        self.variant(MCC_LED6_A::ON)
389    }
390}
391#[doc = "Field `MCC_LED7` reader - MCC LEDs: 0 = OFF 1 = ON"]
392pub type MCC_LED7_R = crate::BitReader<MCC_LED7_A>;
393#[doc = "MCC LEDs: 0 = OFF 1 = ON\n\nValue on reset: 0"]
394#[derive(Clone, Copy, Debug, PartialEq, Eq)]
395pub enum MCC_LED7_A {
396    #[doc = "0: LED is off"]
397    OFF = 0,
398    #[doc = "1: LED is on"]
399    ON = 1,
400}
401impl From<MCC_LED7_A> for bool {
402    #[inline(always)]
403    fn from(variant: MCC_LED7_A) -> Self {
404        variant as u8 != 0
405    }
406}
407impl MCC_LED7_R {
408    #[doc = "Get enumerated values variant"]
409    #[inline(always)]
410    pub fn variant(&self) -> MCC_LED7_A {
411        match self.bits {
412            false => MCC_LED7_A::OFF,
413            true => MCC_LED7_A::ON,
414        }
415    }
416    #[doc = "Checks if the value of the field is `OFF`"]
417    #[inline(always)]
418    pub fn is_off(&self) -> bool {
419        *self == MCC_LED7_A::OFF
420    }
421    #[doc = "Checks if the value of the field is `ON`"]
422    #[inline(always)]
423    pub fn is_on(&self) -> bool {
424        *self == MCC_LED7_A::ON
425    }
426}
427#[doc = "Field `MCC_LED7` writer - MCC LEDs: 0 = OFF 1 = ON"]
428pub type MCC_LED7_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_REG1_SPEC, MCC_LED7_A, O>;
429impl<'a, const O: u8> MCC_LED7_W<'a, O> {
430    #[doc = "LED is off"]
431    #[inline(always)]
432    pub fn off(self) -> &'a mut W {
433        self.variant(MCC_LED7_A::OFF)
434    }
435    #[doc = "LED is on"]
436    #[inline(always)]
437    pub fn on(self) -> &'a mut W {
438        self.variant(MCC_LED7_A::ON)
439    }
440}
441impl R {
442    #[doc = "Bit 0 - MCC LEDs: 0 = OFF 1 = ON"]
443    #[inline(always)]
444    pub fn mcc_led0(&self) -> MCC_LED0_R {
445        MCC_LED0_R::new((self.bits & 1) != 0)
446    }
447    #[doc = "Bit 1 - MCC LEDs: 0 = OFF 1 = ON"]
448    #[inline(always)]
449    pub fn mcc_led1(&self) -> MCC_LED1_R {
450        MCC_LED1_R::new(((self.bits >> 1) & 1) != 0)
451    }
452    #[doc = "Bit 2 - MCC LEDs: 0 = OFF 1 = ON"]
453    #[inline(always)]
454    pub fn mcc_led2(&self) -> MCC_LED2_R {
455        MCC_LED2_R::new(((self.bits >> 2) & 1) != 0)
456    }
457    #[doc = "Bit 3 - MCC LEDs: 0 = OFF 1 = ON"]
458    #[inline(always)]
459    pub fn mcc_led3(&self) -> MCC_LED3_R {
460        MCC_LED3_R::new(((self.bits >> 3) & 1) != 0)
461    }
462    #[doc = "Bit 4 - MCC LEDs: 0 = OFF 1 = ON"]
463    #[inline(always)]
464    pub fn mcc_led4(&self) -> MCC_LED4_R {
465        MCC_LED4_R::new(((self.bits >> 4) & 1) != 0)
466    }
467    #[doc = "Bit 5 - MCC LEDs: 0 = OFF 1 = ON"]
468    #[inline(always)]
469    pub fn mcc_led5(&self) -> MCC_LED5_R {
470        MCC_LED5_R::new(((self.bits >> 5) & 1) != 0)
471    }
472    #[doc = "Bit 6 - MCC LEDs: 0 = OFF 1 = ON"]
473    #[inline(always)]
474    pub fn mcc_led6(&self) -> MCC_LED6_R {
475        MCC_LED6_R::new(((self.bits >> 6) & 1) != 0)
476    }
477    #[doc = "Bit 7 - MCC LEDs: 0 = OFF 1 = ON"]
478    #[inline(always)]
479    pub fn mcc_led7(&self) -> MCC_LED7_R {
480        MCC_LED7_R::new(((self.bits >> 7) & 1) != 0)
481    }
482}
483impl W {
484    #[doc = "Bit 0 - MCC LEDs: 0 = OFF 1 = ON"]
485    #[inline(always)]
486    pub fn mcc_led0(&mut self) -> MCC_LED0_W<0> {
487        MCC_LED0_W::new(self)
488    }
489    #[doc = "Bit 1 - MCC LEDs: 0 = OFF 1 = ON"]
490    #[inline(always)]
491    pub fn mcc_led1(&mut self) -> MCC_LED1_W<1> {
492        MCC_LED1_W::new(self)
493    }
494    #[doc = "Bit 2 - MCC LEDs: 0 = OFF 1 = ON"]
495    #[inline(always)]
496    pub fn mcc_led2(&mut self) -> MCC_LED2_W<2> {
497        MCC_LED2_W::new(self)
498    }
499    #[doc = "Bit 3 - MCC LEDs: 0 = OFF 1 = ON"]
500    #[inline(always)]
501    pub fn mcc_led3(&mut self) -> MCC_LED3_W<3> {
502        MCC_LED3_W::new(self)
503    }
504    #[doc = "Bit 4 - MCC LEDs: 0 = OFF 1 = ON"]
505    #[inline(always)]
506    pub fn mcc_led4(&mut self) -> MCC_LED4_W<4> {
507        MCC_LED4_W::new(self)
508    }
509    #[doc = "Bit 5 - MCC LEDs: 0 = OFF 1 = ON"]
510    #[inline(always)]
511    pub fn mcc_led5(&mut self) -> MCC_LED5_W<5> {
512        MCC_LED5_W::new(self)
513    }
514    #[doc = "Bit 6 - MCC LEDs: 0 = OFF 1 = ON"]
515    #[inline(always)]
516    pub fn mcc_led6(&mut self) -> MCC_LED6_W<6> {
517        MCC_LED6_W::new(self)
518    }
519    #[doc = "Bit 7 - MCC LEDs: 0 = OFF 1 = ON"]
520    #[inline(always)]
521    pub fn mcc_led7(&mut self) -> MCC_LED7_W<7> {
522        MCC_LED7_W::new(self)
523    }
524    #[doc = "Writes raw bits to the register."]
525    #[inline(always)]
526    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
527        self.0.bits(bits);
528        self
529    }
530}
531#[doc = "\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 [cfg_reg1](index.html) module"]
532pub struct CFG_REG1_SPEC;
533impl crate::RegisterSpec for CFG_REG1_SPEC {
534    type Ux = u32;
535}
536#[doc = "`read()` method returns [cfg_reg1::R](R) reader structure"]
537impl crate::Readable for CFG_REG1_SPEC {
538    type Reader = R;
539}
540#[doc = "`write(|w| ..)` method takes [cfg_reg1::W](W) writer structure"]
541impl crate::Writable for CFG_REG1_SPEC {
542    type Writer = W;
543}
544#[doc = "`reset()` method sets CFG_REG1 to value 0"]
545impl crate::Resettable for CFG_REG1_SPEC {
546    #[inline(always)]
547    fn reset_value() -> Self::Ux {
548        0
549    }
550}