efm32pg23-pac 0.1.2

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