efm32pg22_pac/efm32pg22c200/devinfo/
swcapa0.rs

1#[doc = "Register `SWCAPA0` reader"]
2pub struct R(crate::R<SWCAPA0_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SWCAPA0_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SWCAPA0_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SWCAPA0_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `ZIGBEE` reader - Zigbee Capability"]
17pub type ZIGBEE_R = crate::FieldReader<u8, ZIGBEE_A>;
18#[doc = "Zigbee Capability\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20#[repr(u8)]
21pub enum ZIGBEE_A {
22    #[doc = "0: Zigbee stack capability not available"]
23    LEVEL0 = 0,
24    #[doc = "1: Green Power only"]
25    LEVEL1 = 1,
26    #[doc = "2: Zigbee and Green Power"]
27    LEVEL2 = 2,
28    #[doc = "3: Zigbee Only"]
29    LEVEL3 = 3,
30}
31impl From<ZIGBEE_A> for u8 {
32    #[inline(always)]
33    fn from(variant: ZIGBEE_A) -> Self {
34        variant as _
35    }
36}
37impl ZIGBEE_R {
38    #[doc = "Get enumerated values variant"]
39    #[inline(always)]
40    pub fn variant(&self) -> ZIGBEE_A {
41        match self.bits {
42            0 => ZIGBEE_A::LEVEL0,
43            1 => ZIGBEE_A::LEVEL1,
44            2 => ZIGBEE_A::LEVEL2,
45            3 => ZIGBEE_A::LEVEL3,
46            _ => unreachable!(),
47        }
48    }
49    #[doc = "Checks if the value of the field is `LEVEL0`"]
50    #[inline(always)]
51    pub fn is_level0(&self) -> bool {
52        *self == ZIGBEE_A::LEVEL0
53    }
54    #[doc = "Checks if the value of the field is `LEVEL1`"]
55    #[inline(always)]
56    pub fn is_level1(&self) -> bool {
57        *self == ZIGBEE_A::LEVEL1
58    }
59    #[doc = "Checks if the value of the field is `LEVEL2`"]
60    #[inline(always)]
61    pub fn is_level2(&self) -> bool {
62        *self == ZIGBEE_A::LEVEL2
63    }
64    #[doc = "Checks if the value of the field is `LEVEL3`"]
65    #[inline(always)]
66    pub fn is_level3(&self) -> bool {
67        *self == ZIGBEE_A::LEVEL3
68    }
69}
70#[doc = "Field `THREAD` reader - Thread Capability"]
71pub type THREAD_R = crate::FieldReader<u8, THREAD_A>;
72#[doc = "Thread Capability\n\nValue on reset: 0"]
73#[derive(Clone, Copy, Debug, PartialEq, Eq)]
74#[repr(u8)]
75pub enum THREAD_A {
76    #[doc = "0: Thread stack capability not available"]
77    LEVEL0 = 0,
78    #[doc = "1: Thread stack enabled"]
79    LEVEL1 = 1,
80    #[doc = "2: N/A"]
81    LEVEL2 = 2,
82    #[doc = "3: N/A"]
83    LEVEL3 = 3,
84}
85impl From<THREAD_A> for u8 {
86    #[inline(always)]
87    fn from(variant: THREAD_A) -> Self {
88        variant as _
89    }
90}
91impl THREAD_R {
92    #[doc = "Get enumerated values variant"]
93    #[inline(always)]
94    pub fn variant(&self) -> THREAD_A {
95        match self.bits {
96            0 => THREAD_A::LEVEL0,
97            1 => THREAD_A::LEVEL1,
98            2 => THREAD_A::LEVEL2,
99            3 => THREAD_A::LEVEL3,
100            _ => unreachable!(),
101        }
102    }
103    #[doc = "Checks if the value of the field is `LEVEL0`"]
104    #[inline(always)]
105    pub fn is_level0(&self) -> bool {
106        *self == THREAD_A::LEVEL0
107    }
108    #[doc = "Checks if the value of the field is `LEVEL1`"]
109    #[inline(always)]
110    pub fn is_level1(&self) -> bool {
111        *self == THREAD_A::LEVEL1
112    }
113    #[doc = "Checks if the value of the field is `LEVEL2`"]
114    #[inline(always)]
115    pub fn is_level2(&self) -> bool {
116        *self == THREAD_A::LEVEL2
117    }
118    #[doc = "Checks if the value of the field is `LEVEL3`"]
119    #[inline(always)]
120    pub fn is_level3(&self) -> bool {
121        *self == THREAD_A::LEVEL3
122    }
123}
124#[doc = "Field `RF4CE` reader - RF4CE Capability"]
125pub type RF4CE_R = crate::FieldReader<u8, RF4CE_A>;
126#[doc = "RF4CE Capability\n\nValue on reset: 0"]
127#[derive(Clone, Copy, Debug, PartialEq, Eq)]
128#[repr(u8)]
129pub enum RF4CE_A {
130    #[doc = "0: RF4CE stack capability not available"]
131    LEVEL0 = 0,
132    #[doc = "1: RF4CE stack enabled"]
133    LEVEL1 = 1,
134    #[doc = "2: N/A"]
135    LEVEL2 = 2,
136    #[doc = "3: N/A"]
137    LEVEL3 = 3,
138}
139impl From<RF4CE_A> for u8 {
140    #[inline(always)]
141    fn from(variant: RF4CE_A) -> Self {
142        variant as _
143    }
144}
145impl RF4CE_R {
146    #[doc = "Get enumerated values variant"]
147    #[inline(always)]
148    pub fn variant(&self) -> RF4CE_A {
149        match self.bits {
150            0 => RF4CE_A::LEVEL0,
151            1 => RF4CE_A::LEVEL1,
152            2 => RF4CE_A::LEVEL2,
153            3 => RF4CE_A::LEVEL3,
154            _ => unreachable!(),
155        }
156    }
157    #[doc = "Checks if the value of the field is `LEVEL0`"]
158    #[inline(always)]
159    pub fn is_level0(&self) -> bool {
160        *self == RF4CE_A::LEVEL0
161    }
162    #[doc = "Checks if the value of the field is `LEVEL1`"]
163    #[inline(always)]
164    pub fn is_level1(&self) -> bool {
165        *self == RF4CE_A::LEVEL1
166    }
167    #[doc = "Checks if the value of the field is `LEVEL2`"]
168    #[inline(always)]
169    pub fn is_level2(&self) -> bool {
170        *self == RF4CE_A::LEVEL2
171    }
172    #[doc = "Checks if the value of the field is `LEVEL3`"]
173    #[inline(always)]
174    pub fn is_level3(&self) -> bool {
175        *self == RF4CE_A::LEVEL3
176    }
177}
178#[doc = "Field `BTSMART` reader - Bluetooth Smart Capability"]
179pub type BTSMART_R = crate::FieldReader<u8, BTSMART_A>;
180#[doc = "Bluetooth Smart Capability\n\nValue on reset: 0"]
181#[derive(Clone, Copy, Debug, PartialEq, Eq)]
182#[repr(u8)]
183pub enum BTSMART_A {
184    #[doc = "0: Bluetooth SMART stack capability not available"]
185    LEVEL0 = 0,
186    #[doc = "1: Bluetooth SMART enabled"]
187    LEVEL1 = 1,
188    #[doc = "2: N/A"]
189    LEVEL2 = 2,
190    #[doc = "3: N/A"]
191    LEVEL3 = 3,
192}
193impl From<BTSMART_A> for u8 {
194    #[inline(always)]
195    fn from(variant: BTSMART_A) -> Self {
196        variant as _
197    }
198}
199impl BTSMART_R {
200    #[doc = "Get enumerated values variant"]
201    #[inline(always)]
202    pub fn variant(&self) -> BTSMART_A {
203        match self.bits {
204            0 => BTSMART_A::LEVEL0,
205            1 => BTSMART_A::LEVEL1,
206            2 => BTSMART_A::LEVEL2,
207            3 => BTSMART_A::LEVEL3,
208            _ => unreachable!(),
209        }
210    }
211    #[doc = "Checks if the value of the field is `LEVEL0`"]
212    #[inline(always)]
213    pub fn is_level0(&self) -> bool {
214        *self == BTSMART_A::LEVEL0
215    }
216    #[doc = "Checks if the value of the field is `LEVEL1`"]
217    #[inline(always)]
218    pub fn is_level1(&self) -> bool {
219        *self == BTSMART_A::LEVEL1
220    }
221    #[doc = "Checks if the value of the field is `LEVEL2`"]
222    #[inline(always)]
223    pub fn is_level2(&self) -> bool {
224        *self == BTSMART_A::LEVEL2
225    }
226    #[doc = "Checks if the value of the field is `LEVEL3`"]
227    #[inline(always)]
228    pub fn is_level3(&self) -> bool {
229        *self == BTSMART_A::LEVEL3
230    }
231}
232#[doc = "Field `CONNECT` reader - Connect Capability"]
233pub type CONNECT_R = crate::FieldReader<u8, CONNECT_A>;
234#[doc = "Connect Capability\n\nValue on reset: 0"]
235#[derive(Clone, Copy, Debug, PartialEq, Eq)]
236#[repr(u8)]
237pub enum CONNECT_A {
238    #[doc = "0: Connect stack capability not available"]
239    LEVEL0 = 0,
240    #[doc = "1: Connect enabled"]
241    LEVEL1 = 1,
242    #[doc = "2: N/A"]
243    LEVEL2 = 2,
244    #[doc = "3: N/A"]
245    LEVEL3 = 3,
246}
247impl From<CONNECT_A> for u8 {
248    #[inline(always)]
249    fn from(variant: CONNECT_A) -> Self {
250        variant as _
251    }
252}
253impl CONNECT_R {
254    #[doc = "Get enumerated values variant"]
255    #[inline(always)]
256    pub fn variant(&self) -> CONNECT_A {
257        match self.bits {
258            0 => CONNECT_A::LEVEL0,
259            1 => CONNECT_A::LEVEL1,
260            2 => CONNECT_A::LEVEL2,
261            3 => CONNECT_A::LEVEL3,
262            _ => unreachable!(),
263        }
264    }
265    #[doc = "Checks if the value of the field is `LEVEL0`"]
266    #[inline(always)]
267    pub fn is_level0(&self) -> bool {
268        *self == CONNECT_A::LEVEL0
269    }
270    #[doc = "Checks if the value of the field is `LEVEL1`"]
271    #[inline(always)]
272    pub fn is_level1(&self) -> bool {
273        *self == CONNECT_A::LEVEL1
274    }
275    #[doc = "Checks if the value of the field is `LEVEL2`"]
276    #[inline(always)]
277    pub fn is_level2(&self) -> bool {
278        *self == CONNECT_A::LEVEL2
279    }
280    #[doc = "Checks if the value of the field is `LEVEL3`"]
281    #[inline(always)]
282    pub fn is_level3(&self) -> bool {
283        *self == CONNECT_A::LEVEL3
284    }
285}
286#[doc = "Field `SRI` reader - RAIL Capability"]
287pub type SRI_R = crate::FieldReader<u8, SRI_A>;
288#[doc = "RAIL Capability\n\nValue on reset: 0"]
289#[derive(Clone, Copy, Debug, PartialEq, Eq)]
290#[repr(u8)]
291pub enum SRI_A {
292    #[doc = "0: RAIL capability not available"]
293    LEVEL0 = 0,
294    #[doc = "1: RAIL enabled"]
295    LEVEL1 = 1,
296    #[doc = "2: N/A"]
297    LEVEL2 = 2,
298    #[doc = "3: N/A"]
299    LEVEL3 = 3,
300}
301impl From<SRI_A> for u8 {
302    #[inline(always)]
303    fn from(variant: SRI_A) -> Self {
304        variant as _
305    }
306}
307impl SRI_R {
308    #[doc = "Get enumerated values variant"]
309    #[inline(always)]
310    pub fn variant(&self) -> SRI_A {
311        match self.bits {
312            0 => SRI_A::LEVEL0,
313            1 => SRI_A::LEVEL1,
314            2 => SRI_A::LEVEL2,
315            3 => SRI_A::LEVEL3,
316            _ => unreachable!(),
317        }
318    }
319    #[doc = "Checks if the value of the field is `LEVEL0`"]
320    #[inline(always)]
321    pub fn is_level0(&self) -> bool {
322        *self == SRI_A::LEVEL0
323    }
324    #[doc = "Checks if the value of the field is `LEVEL1`"]
325    #[inline(always)]
326    pub fn is_level1(&self) -> bool {
327        *self == SRI_A::LEVEL1
328    }
329    #[doc = "Checks if the value of the field is `LEVEL2`"]
330    #[inline(always)]
331    pub fn is_level2(&self) -> bool {
332        *self == SRI_A::LEVEL2
333    }
334    #[doc = "Checks if the value of the field is `LEVEL3`"]
335    #[inline(always)]
336    pub fn is_level3(&self) -> bool {
337        *self == SRI_A::LEVEL3
338    }
339}
340impl R {
341    #[doc = "Bits 0:1 - Zigbee Capability"]
342    #[inline(always)]
343    pub fn zigbee(&self) -> ZIGBEE_R {
344        ZIGBEE_R::new((self.bits & 3) as u8)
345    }
346    #[doc = "Bits 4:5 - Thread Capability"]
347    #[inline(always)]
348    pub fn thread(&self) -> THREAD_R {
349        THREAD_R::new(((self.bits >> 4) & 3) as u8)
350    }
351    #[doc = "Bits 8:9 - RF4CE Capability"]
352    #[inline(always)]
353    pub fn rf4ce(&self) -> RF4CE_R {
354        RF4CE_R::new(((self.bits >> 8) & 3) as u8)
355    }
356    #[doc = "Bits 12:13 - Bluetooth Smart Capability"]
357    #[inline(always)]
358    pub fn btsmart(&self) -> BTSMART_R {
359        BTSMART_R::new(((self.bits >> 12) & 3) as u8)
360    }
361    #[doc = "Bits 16:17 - Connect Capability"]
362    #[inline(always)]
363    pub fn connect(&self) -> CONNECT_R {
364        CONNECT_R::new(((self.bits >> 16) & 3) as u8)
365    }
366    #[doc = "Bits 20:21 - RAIL Capability"]
367    #[inline(always)]
368    pub fn sri(&self) -> SRI_R {
369        SRI_R::new(((self.bits >> 20) & 3) as u8)
370    }
371}
372#[doc = "Software Capability Vector 0\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 [swcapa0](index.html) module"]
373pub struct SWCAPA0_SPEC;
374impl crate::RegisterSpec for SWCAPA0_SPEC {
375    type Ux = u32;
376}
377#[doc = "`read()` method returns [swcapa0::R](R) reader structure"]
378impl crate::Readable for SWCAPA0_SPEC {
379    type Reader = R;
380}
381#[doc = "`reset()` method sets SWCAPA0 to value 0"]
382impl crate::Resettable for SWCAPA0_SPEC {
383    const RESET_VALUE: Self::Ux = 0;
384}