efm32pg1b200_pac/crypto/
cstatus.rs

1#[doc = "Register `CSTATUS` reader"]
2pub struct R(crate::R<CSTATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CSTATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CSTATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CSTATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Selected ALU Operand 0\n\nValue on reset: 1"]
17#[derive(Clone, Copy, Debug, PartialEq)]
18#[repr(u8)]
19pub enum V0_A {
20    #[doc = "0: `0`"]
21    DDATA0 = 0,
22    #[doc = "1: `1`"]
23    DDATA1 = 1,
24    #[doc = "2: `10`"]
25    DDATA2 = 2,
26    #[doc = "3: `11`"]
27    DDATA3 = 3,
28    #[doc = "4: `100`"]
29    DDATA4 = 4,
30    #[doc = "5: `101`"]
31    DATA0 = 5,
32    #[doc = "6: `110`"]
33    DATA1 = 6,
34    #[doc = "7: `111`"]
35    DATA2 = 7,
36}
37impl From<V0_A> for u8 {
38    #[inline(always)]
39    fn from(variant: V0_A) -> Self {
40        variant as _
41    }
42}
43#[doc = "Field `V0` reader - Selected ALU Operand 0"]
44pub type V0_R = crate::FieldReader<u8, V0_A>;
45impl V0_R {
46    #[doc = "Get enumerated values variant"]
47    #[inline(always)]
48    pub fn variant(&self) -> V0_A {
49        match self.bits {
50            0 => V0_A::DDATA0,
51            1 => V0_A::DDATA1,
52            2 => V0_A::DDATA2,
53            3 => V0_A::DDATA3,
54            4 => V0_A::DDATA4,
55            5 => V0_A::DATA0,
56            6 => V0_A::DATA1,
57            7 => V0_A::DATA2,
58            _ => unreachable!(),
59        }
60    }
61    #[doc = "Checks if the value of the field is `DDATA0`"]
62    #[inline(always)]
63    pub fn is_ddata0(&self) -> bool {
64        *self == V0_A::DDATA0
65    }
66    #[doc = "Checks if the value of the field is `DDATA1`"]
67    #[inline(always)]
68    pub fn is_ddata1(&self) -> bool {
69        *self == V0_A::DDATA1
70    }
71    #[doc = "Checks if the value of the field is `DDATA2`"]
72    #[inline(always)]
73    pub fn is_ddata2(&self) -> bool {
74        *self == V0_A::DDATA2
75    }
76    #[doc = "Checks if the value of the field is `DDATA3`"]
77    #[inline(always)]
78    pub fn is_ddata3(&self) -> bool {
79        *self == V0_A::DDATA3
80    }
81    #[doc = "Checks if the value of the field is `DDATA4`"]
82    #[inline(always)]
83    pub fn is_ddata4(&self) -> bool {
84        *self == V0_A::DDATA4
85    }
86    #[doc = "Checks if the value of the field is `DATA0`"]
87    #[inline(always)]
88    pub fn is_data0(&self) -> bool {
89        *self == V0_A::DATA0
90    }
91    #[doc = "Checks if the value of the field is `DATA1`"]
92    #[inline(always)]
93    pub fn is_data1(&self) -> bool {
94        *self == V0_A::DATA1
95    }
96    #[doc = "Checks if the value of the field is `DATA2`"]
97    #[inline(always)]
98    pub fn is_data2(&self) -> bool {
99        *self == V0_A::DATA2
100    }
101}
102#[doc = "Selected ALU Operand 1\n\nValue on reset: 2"]
103#[derive(Clone, Copy, Debug, PartialEq)]
104#[repr(u8)]
105pub enum V1_A {
106    #[doc = "0: `0`"]
107    DDATA0 = 0,
108    #[doc = "1: `1`"]
109    DDATA1 = 1,
110    #[doc = "2: `10`"]
111    DDATA2 = 2,
112    #[doc = "3: `11`"]
113    DDATA3 = 3,
114    #[doc = "4: `100`"]
115    DDATA4 = 4,
116    #[doc = "5: `101`"]
117    DATA0 = 5,
118    #[doc = "6: `110`"]
119    DATA1 = 6,
120    #[doc = "7: `111`"]
121    DATA2 = 7,
122}
123impl From<V1_A> for u8 {
124    #[inline(always)]
125    fn from(variant: V1_A) -> Self {
126        variant as _
127    }
128}
129#[doc = "Field `V1` reader - Selected ALU Operand 1"]
130pub type V1_R = crate::FieldReader<u8, V1_A>;
131impl V1_R {
132    #[doc = "Get enumerated values variant"]
133    #[inline(always)]
134    pub fn variant(&self) -> V1_A {
135        match self.bits {
136            0 => V1_A::DDATA0,
137            1 => V1_A::DDATA1,
138            2 => V1_A::DDATA2,
139            3 => V1_A::DDATA3,
140            4 => V1_A::DDATA4,
141            5 => V1_A::DATA0,
142            6 => V1_A::DATA1,
143            7 => V1_A::DATA2,
144            _ => unreachable!(),
145        }
146    }
147    #[doc = "Checks if the value of the field is `DDATA0`"]
148    #[inline(always)]
149    pub fn is_ddata0(&self) -> bool {
150        *self == V1_A::DDATA0
151    }
152    #[doc = "Checks if the value of the field is `DDATA1`"]
153    #[inline(always)]
154    pub fn is_ddata1(&self) -> bool {
155        *self == V1_A::DDATA1
156    }
157    #[doc = "Checks if the value of the field is `DDATA2`"]
158    #[inline(always)]
159    pub fn is_ddata2(&self) -> bool {
160        *self == V1_A::DDATA2
161    }
162    #[doc = "Checks if the value of the field is `DDATA3`"]
163    #[inline(always)]
164    pub fn is_ddata3(&self) -> bool {
165        *self == V1_A::DDATA3
166    }
167    #[doc = "Checks if the value of the field is `DDATA4`"]
168    #[inline(always)]
169    pub fn is_ddata4(&self) -> bool {
170        *self == V1_A::DDATA4
171    }
172    #[doc = "Checks if the value of the field is `DATA0`"]
173    #[inline(always)]
174    pub fn is_data0(&self) -> bool {
175        *self == V1_A::DATA0
176    }
177    #[doc = "Checks if the value of the field is `DATA1`"]
178    #[inline(always)]
179    pub fn is_data1(&self) -> bool {
180        *self == V1_A::DATA1
181    }
182    #[doc = "Checks if the value of the field is `DATA2`"]
183    #[inline(always)]
184    pub fn is_data2(&self) -> bool {
185        *self == V1_A::DATA2
186    }
187}
188#[doc = "Field `SEQPART` reader - Sequence Part"]
189pub type SEQPART_R = crate::BitReader<bool>;
190#[doc = "Field `SEQSKIP` reader - Sequence Skip Next Instruction"]
191pub type SEQSKIP_R = crate::BitReader<bool>;
192#[doc = "Field `SEQIP` reader - Sequence Next Instruction Pointer"]
193pub type SEQIP_R = crate::FieldReader<u8, u8>;
194impl R {
195    #[doc = "Bits 0:2 - Selected ALU Operand 0"]
196    #[inline(always)]
197    pub fn v0(&self) -> V0_R {
198        V0_R::new((self.bits & 7) as u8)
199    }
200    #[doc = "Bits 8:10 - Selected ALU Operand 1"]
201    #[inline(always)]
202    pub fn v1(&self) -> V1_R {
203        V1_R::new(((self.bits >> 8) & 7) as u8)
204    }
205    #[doc = "Bit 16 - Sequence Part"]
206    #[inline(always)]
207    pub fn seqpart(&self) -> SEQPART_R {
208        SEQPART_R::new(((self.bits >> 16) & 1) != 0)
209    }
210    #[doc = "Bit 17 - Sequence Skip Next Instruction"]
211    #[inline(always)]
212    pub fn seqskip(&self) -> SEQSKIP_R {
213        SEQSKIP_R::new(((self.bits >> 17) & 1) != 0)
214    }
215    #[doc = "Bits 20:24 - Sequence Next Instruction Pointer"]
216    #[inline(always)]
217    pub fn seqip(&self) -> SEQIP_R {
218        SEQIP_R::new(((self.bits >> 20) & 0x1f) as u8)
219    }
220}
221#[doc = "Control Status Register\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 [cstatus](index.html) module"]
222pub struct CSTATUS_SPEC;
223impl crate::RegisterSpec for CSTATUS_SPEC {
224    type Ux = u32;
225}
226#[doc = "`read()` method returns [cstatus::R](R) reader structure"]
227impl crate::Readable for CSTATUS_SPEC {
228    type Reader = R;
229}
230#[doc = "`reset()` method sets CSTATUS to value 0x0201"]
231impl crate::Resettable for CSTATUS_SPEC {
232    #[inline(always)]
233    fn reset_value() -> Self::Ux {
234        0x0201
235    }
236}