efm32gg12b810_pac/smu/
ppufs.rs

1#[doc = "Register `PPUFS` reader"]
2pub struct R(crate::R<PPUFS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PPUFS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PPUFS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PPUFS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "\n\nValue on reset: 0"]
17#[derive(Clone, Copy, Debug, PartialEq)]
18#[repr(u8)]
19pub enum PERIPHID_A {
20    #[doc = "0: Analog Comparator 0"]
21    ACMP0 = 0,
22    #[doc = "1: Analog Comparator 1"]
23    ACMP1 = 1,
24    #[doc = "2: Analog Comparator 2"]
25    ACMP2 = 2,
26    #[doc = "3: Analog to Digital Converter 0"]
27    ADC0 = 3,
28    #[doc = "4: Analog to Digital Converter 0"]
29    ADC1 = 4,
30    #[doc = "5: CAN 0"]
31    CAN0 = 5,
32    #[doc = "6: CAN 1"]
33    CAN1 = 6,
34    #[doc = "7: Clock Management Unit"]
35    CMU = 7,
36    #[doc = "8: CRYOTIMER"]
37    CRYOTIMER = 8,
38    #[doc = "9: Advanced Encryption Standard Accelerator"]
39    CRYPTO0 = 9,
40    #[doc = "10: Capacitive touch sense module"]
41    CSEN = 10,
42    #[doc = "11: Digital to Analog Converter 0"]
43    VDAC0 = 11,
44    #[doc = "12: Peripheral Reflex System"]
45    PRS = 12,
46    #[doc = "13: External Bus Interface"]
47    EBI = 13,
48    #[doc = "14: Energy Management Unit"]
49    EMU = 14,
50    #[doc = "15: FPU Exception Handler"]
51    FPUEH = 15,
52    #[doc = "16: General Purpose CRC"]
53    GPCRC = 16,
54    #[doc = "17: General purpose Input/Output"]
55    GPIO = 17,
56    #[doc = "18: I2C 0"]
57    I2C0 = 18,
58    #[doc = "19: I2C 1"]
59    I2C1 = 19,
60    #[doc = "20: Current Digital to Analog Converter 0"]
61    IDAC0 = 20,
62    #[doc = "21: Memory System Controller"]
63    MSC = 21,
64    #[doc = "22: Liquid Crystal Display Controller"]
65    LCD = 22,
66    #[doc = "23: Linked Direct Memory Access Controller"]
67    LDMA = 23,
68    #[doc = "24: Low Energy Sensor Interface"]
69    LESENSE = 24,
70    #[doc = "25: Low Energy Timer 0"]
71    LETIMER0 = 25,
72    #[doc = "26: Low Energy Timer 1"]
73    LETIMER1 = 26,
74    #[doc = "27: Low Energy UART 0"]
75    LEUART0 = 27,
76    #[doc = "28: Low Energy UART 1"]
77    LEUART1 = 28,
78    #[doc = "32: Pulse Counter 0"]
79    PCNT0 = 32,
80    #[doc = "33: Pulse Counter 1"]
81    PCNT1 = 33,
82    #[doc = "34: Pulse Counter 2"]
83    PCNT2 = 34,
84    #[doc = "35: PDM Interface"]
85    PDM = 35,
86    #[doc = "36: Quad-SPI"]
87    QSPI0 = 36,
88    #[doc = "37: Reset Management Unit"]
89    RMU = 37,
90    #[doc = "38: Real-Time Counter"]
91    RTC = 38,
92    #[doc = "39: Real-Time Counter and Calendar"]
93    RTCC = 39,
94    #[doc = "40: SDIO Controller"]
95    SDIO = 40,
96    #[doc = "41: Security Management Unit"]
97    SMU = 41,
98    #[doc = "42: Timer 0"]
99    TIMER0 = 42,
100    #[doc = "43: Timer 1"]
101    TIMER1 = 43,
102    #[doc = "44: Timer 2"]
103    TIMER2 = 44,
104    #[doc = "45: Timer 3"]
105    TIMER3 = 45,
106    #[doc = "46: True Random Number Generator 0"]
107    TRNG0 = 46,
108    #[doc = "47: Universal Asynchronous Receiver/Transmitter 0"]
109    UART0 = 47,
110    #[doc = "48: Universal Asynchronous Receiver/Transmitter 1"]
111    UART1 = 48,
112    #[doc = "49: Universal Synchronous/Asynchronous Receiver/Transmitter 0"]
113    USART0 = 49,
114    #[doc = "50: Universal Synchronous/Asynchronous Receiver/Transmitter 1"]
115    USART1 = 50,
116    #[doc = "51: Universal Synchronous/Asynchronous Receiver/Transmitter 2"]
117    USART2 = 51,
118    #[doc = "52: Universal Synchronous/Asynchronous Receiver/Transmitter 3"]
119    USART3 = 52,
120    #[doc = "53: Universal Synchronous/Asynchronous Receiver/Transmitter 4"]
121    USART4 = 53,
122    #[doc = "54: Universal Serial Bus Interface"]
123    USB = 54,
124    #[doc = "55: Watchdog"]
125    WDOG0 = 55,
126    #[doc = "56: Watchdog"]
127    WDOG1 = 56,
128    #[doc = "57: Wide Timer 0"]
129    WTIMER0 = 57,
130    #[doc = "58: Wide Timer 0"]
131    WTIMER1 = 58,
132}
133impl From<PERIPHID_A> for u8 {
134    #[inline(always)]
135    fn from(variant: PERIPHID_A) -> Self {
136        variant as _
137    }
138}
139#[doc = "Field `PERIPHID` reader - "]
140pub type PERIPHID_R = crate::FieldReader<u8, PERIPHID_A>;
141impl PERIPHID_R {
142    #[doc = "Get enumerated values variant"]
143    #[inline(always)]
144    pub fn variant(&self) -> Option<PERIPHID_A> {
145        match self.bits {
146            0 => Some(PERIPHID_A::ACMP0),
147            1 => Some(PERIPHID_A::ACMP1),
148            2 => Some(PERIPHID_A::ACMP2),
149            3 => Some(PERIPHID_A::ADC0),
150            4 => Some(PERIPHID_A::ADC1),
151            5 => Some(PERIPHID_A::CAN0),
152            6 => Some(PERIPHID_A::CAN1),
153            7 => Some(PERIPHID_A::CMU),
154            8 => Some(PERIPHID_A::CRYOTIMER),
155            9 => Some(PERIPHID_A::CRYPTO0),
156            10 => Some(PERIPHID_A::CSEN),
157            11 => Some(PERIPHID_A::VDAC0),
158            12 => Some(PERIPHID_A::PRS),
159            13 => Some(PERIPHID_A::EBI),
160            14 => Some(PERIPHID_A::EMU),
161            15 => Some(PERIPHID_A::FPUEH),
162            16 => Some(PERIPHID_A::GPCRC),
163            17 => Some(PERIPHID_A::GPIO),
164            18 => Some(PERIPHID_A::I2C0),
165            19 => Some(PERIPHID_A::I2C1),
166            20 => Some(PERIPHID_A::IDAC0),
167            21 => Some(PERIPHID_A::MSC),
168            22 => Some(PERIPHID_A::LCD),
169            23 => Some(PERIPHID_A::LDMA),
170            24 => Some(PERIPHID_A::LESENSE),
171            25 => Some(PERIPHID_A::LETIMER0),
172            26 => Some(PERIPHID_A::LETIMER1),
173            27 => Some(PERIPHID_A::LEUART0),
174            28 => Some(PERIPHID_A::LEUART1),
175            32 => Some(PERIPHID_A::PCNT0),
176            33 => Some(PERIPHID_A::PCNT1),
177            34 => Some(PERIPHID_A::PCNT2),
178            35 => Some(PERIPHID_A::PDM),
179            36 => Some(PERIPHID_A::QSPI0),
180            37 => Some(PERIPHID_A::RMU),
181            38 => Some(PERIPHID_A::RTC),
182            39 => Some(PERIPHID_A::RTCC),
183            40 => Some(PERIPHID_A::SDIO),
184            41 => Some(PERIPHID_A::SMU),
185            42 => Some(PERIPHID_A::TIMER0),
186            43 => Some(PERIPHID_A::TIMER1),
187            44 => Some(PERIPHID_A::TIMER2),
188            45 => Some(PERIPHID_A::TIMER3),
189            46 => Some(PERIPHID_A::TRNG0),
190            47 => Some(PERIPHID_A::UART0),
191            48 => Some(PERIPHID_A::UART1),
192            49 => Some(PERIPHID_A::USART0),
193            50 => Some(PERIPHID_A::USART1),
194            51 => Some(PERIPHID_A::USART2),
195            52 => Some(PERIPHID_A::USART3),
196            53 => Some(PERIPHID_A::USART4),
197            54 => Some(PERIPHID_A::USB),
198            55 => Some(PERIPHID_A::WDOG0),
199            56 => Some(PERIPHID_A::WDOG1),
200            57 => Some(PERIPHID_A::WTIMER0),
201            58 => Some(PERIPHID_A::WTIMER1),
202            _ => None,
203        }
204    }
205    #[doc = "Checks if the value of the field is `ACMP0`"]
206    #[inline(always)]
207    pub fn is_acmp0(&self) -> bool {
208        *self == PERIPHID_A::ACMP0
209    }
210    #[doc = "Checks if the value of the field is `ACMP1`"]
211    #[inline(always)]
212    pub fn is_acmp1(&self) -> bool {
213        *self == PERIPHID_A::ACMP1
214    }
215    #[doc = "Checks if the value of the field is `ACMP2`"]
216    #[inline(always)]
217    pub fn is_acmp2(&self) -> bool {
218        *self == PERIPHID_A::ACMP2
219    }
220    #[doc = "Checks if the value of the field is `ADC0`"]
221    #[inline(always)]
222    pub fn is_adc0(&self) -> bool {
223        *self == PERIPHID_A::ADC0
224    }
225    #[doc = "Checks if the value of the field is `ADC1`"]
226    #[inline(always)]
227    pub fn is_adc1(&self) -> bool {
228        *self == PERIPHID_A::ADC1
229    }
230    #[doc = "Checks if the value of the field is `CAN0`"]
231    #[inline(always)]
232    pub fn is_can0(&self) -> bool {
233        *self == PERIPHID_A::CAN0
234    }
235    #[doc = "Checks if the value of the field is `CAN1`"]
236    #[inline(always)]
237    pub fn is_can1(&self) -> bool {
238        *self == PERIPHID_A::CAN1
239    }
240    #[doc = "Checks if the value of the field is `CMU`"]
241    #[inline(always)]
242    pub fn is_cmu(&self) -> bool {
243        *self == PERIPHID_A::CMU
244    }
245    #[doc = "Checks if the value of the field is `CRYOTIMER`"]
246    #[inline(always)]
247    pub fn is_cryotimer(&self) -> bool {
248        *self == PERIPHID_A::CRYOTIMER
249    }
250    #[doc = "Checks if the value of the field is `CRYPTO0`"]
251    #[inline(always)]
252    pub fn is_crypto0(&self) -> bool {
253        *self == PERIPHID_A::CRYPTO0
254    }
255    #[doc = "Checks if the value of the field is `CSEN`"]
256    #[inline(always)]
257    pub fn is_csen(&self) -> bool {
258        *self == PERIPHID_A::CSEN
259    }
260    #[doc = "Checks if the value of the field is `VDAC0`"]
261    #[inline(always)]
262    pub fn is_vdac0(&self) -> bool {
263        *self == PERIPHID_A::VDAC0
264    }
265    #[doc = "Checks if the value of the field is `PRS`"]
266    #[inline(always)]
267    pub fn is_prs(&self) -> bool {
268        *self == PERIPHID_A::PRS
269    }
270    #[doc = "Checks if the value of the field is `EBI`"]
271    #[inline(always)]
272    pub fn is_ebi(&self) -> bool {
273        *self == PERIPHID_A::EBI
274    }
275    #[doc = "Checks if the value of the field is `EMU`"]
276    #[inline(always)]
277    pub fn is_emu(&self) -> bool {
278        *self == PERIPHID_A::EMU
279    }
280    #[doc = "Checks if the value of the field is `FPUEH`"]
281    #[inline(always)]
282    pub fn is_fpueh(&self) -> bool {
283        *self == PERIPHID_A::FPUEH
284    }
285    #[doc = "Checks if the value of the field is `GPCRC`"]
286    #[inline(always)]
287    pub fn is_gpcrc(&self) -> bool {
288        *self == PERIPHID_A::GPCRC
289    }
290    #[doc = "Checks if the value of the field is `GPIO`"]
291    #[inline(always)]
292    pub fn is_gpio(&self) -> bool {
293        *self == PERIPHID_A::GPIO
294    }
295    #[doc = "Checks if the value of the field is `I2C0`"]
296    #[inline(always)]
297    pub fn is_i2c0(&self) -> bool {
298        *self == PERIPHID_A::I2C0
299    }
300    #[doc = "Checks if the value of the field is `I2C1`"]
301    #[inline(always)]
302    pub fn is_i2c1(&self) -> bool {
303        *self == PERIPHID_A::I2C1
304    }
305    #[doc = "Checks if the value of the field is `IDAC0`"]
306    #[inline(always)]
307    pub fn is_idac0(&self) -> bool {
308        *self == PERIPHID_A::IDAC0
309    }
310    #[doc = "Checks if the value of the field is `MSC`"]
311    #[inline(always)]
312    pub fn is_msc(&self) -> bool {
313        *self == PERIPHID_A::MSC
314    }
315    #[doc = "Checks if the value of the field is `LCD`"]
316    #[inline(always)]
317    pub fn is_lcd(&self) -> bool {
318        *self == PERIPHID_A::LCD
319    }
320    #[doc = "Checks if the value of the field is `LDMA`"]
321    #[inline(always)]
322    pub fn is_ldma(&self) -> bool {
323        *self == PERIPHID_A::LDMA
324    }
325    #[doc = "Checks if the value of the field is `LESENSE`"]
326    #[inline(always)]
327    pub fn is_lesense(&self) -> bool {
328        *self == PERIPHID_A::LESENSE
329    }
330    #[doc = "Checks if the value of the field is `LETIMER0`"]
331    #[inline(always)]
332    pub fn is_letimer0(&self) -> bool {
333        *self == PERIPHID_A::LETIMER0
334    }
335    #[doc = "Checks if the value of the field is `LETIMER1`"]
336    #[inline(always)]
337    pub fn is_letimer1(&self) -> bool {
338        *self == PERIPHID_A::LETIMER1
339    }
340    #[doc = "Checks if the value of the field is `LEUART0`"]
341    #[inline(always)]
342    pub fn is_leuart0(&self) -> bool {
343        *self == PERIPHID_A::LEUART0
344    }
345    #[doc = "Checks if the value of the field is `LEUART1`"]
346    #[inline(always)]
347    pub fn is_leuart1(&self) -> bool {
348        *self == PERIPHID_A::LEUART1
349    }
350    #[doc = "Checks if the value of the field is `PCNT0`"]
351    #[inline(always)]
352    pub fn is_pcnt0(&self) -> bool {
353        *self == PERIPHID_A::PCNT0
354    }
355    #[doc = "Checks if the value of the field is `PCNT1`"]
356    #[inline(always)]
357    pub fn is_pcnt1(&self) -> bool {
358        *self == PERIPHID_A::PCNT1
359    }
360    #[doc = "Checks if the value of the field is `PCNT2`"]
361    #[inline(always)]
362    pub fn is_pcnt2(&self) -> bool {
363        *self == PERIPHID_A::PCNT2
364    }
365    #[doc = "Checks if the value of the field is `PDM`"]
366    #[inline(always)]
367    pub fn is_pdm(&self) -> bool {
368        *self == PERIPHID_A::PDM
369    }
370    #[doc = "Checks if the value of the field is `QSPI0`"]
371    #[inline(always)]
372    pub fn is_qspi0(&self) -> bool {
373        *self == PERIPHID_A::QSPI0
374    }
375    #[doc = "Checks if the value of the field is `RMU`"]
376    #[inline(always)]
377    pub fn is_rmu(&self) -> bool {
378        *self == PERIPHID_A::RMU
379    }
380    #[doc = "Checks if the value of the field is `RTC`"]
381    #[inline(always)]
382    pub fn is_rtc(&self) -> bool {
383        *self == PERIPHID_A::RTC
384    }
385    #[doc = "Checks if the value of the field is `RTCC`"]
386    #[inline(always)]
387    pub fn is_rtcc(&self) -> bool {
388        *self == PERIPHID_A::RTCC
389    }
390    #[doc = "Checks if the value of the field is `SDIO`"]
391    #[inline(always)]
392    pub fn is_sdio(&self) -> bool {
393        *self == PERIPHID_A::SDIO
394    }
395    #[doc = "Checks if the value of the field is `SMU`"]
396    #[inline(always)]
397    pub fn is_smu(&self) -> bool {
398        *self == PERIPHID_A::SMU
399    }
400    #[doc = "Checks if the value of the field is `TIMER0`"]
401    #[inline(always)]
402    pub fn is_timer0(&self) -> bool {
403        *self == PERIPHID_A::TIMER0
404    }
405    #[doc = "Checks if the value of the field is `TIMER1`"]
406    #[inline(always)]
407    pub fn is_timer1(&self) -> bool {
408        *self == PERIPHID_A::TIMER1
409    }
410    #[doc = "Checks if the value of the field is `TIMER2`"]
411    #[inline(always)]
412    pub fn is_timer2(&self) -> bool {
413        *self == PERIPHID_A::TIMER2
414    }
415    #[doc = "Checks if the value of the field is `TIMER3`"]
416    #[inline(always)]
417    pub fn is_timer3(&self) -> bool {
418        *self == PERIPHID_A::TIMER3
419    }
420    #[doc = "Checks if the value of the field is `TRNG0`"]
421    #[inline(always)]
422    pub fn is_trng0(&self) -> bool {
423        *self == PERIPHID_A::TRNG0
424    }
425    #[doc = "Checks if the value of the field is `UART0`"]
426    #[inline(always)]
427    pub fn is_uart0(&self) -> bool {
428        *self == PERIPHID_A::UART0
429    }
430    #[doc = "Checks if the value of the field is `UART1`"]
431    #[inline(always)]
432    pub fn is_uart1(&self) -> bool {
433        *self == PERIPHID_A::UART1
434    }
435    #[doc = "Checks if the value of the field is `USART0`"]
436    #[inline(always)]
437    pub fn is_usart0(&self) -> bool {
438        *self == PERIPHID_A::USART0
439    }
440    #[doc = "Checks if the value of the field is `USART1`"]
441    #[inline(always)]
442    pub fn is_usart1(&self) -> bool {
443        *self == PERIPHID_A::USART1
444    }
445    #[doc = "Checks if the value of the field is `USART2`"]
446    #[inline(always)]
447    pub fn is_usart2(&self) -> bool {
448        *self == PERIPHID_A::USART2
449    }
450    #[doc = "Checks if the value of the field is `USART3`"]
451    #[inline(always)]
452    pub fn is_usart3(&self) -> bool {
453        *self == PERIPHID_A::USART3
454    }
455    #[doc = "Checks if the value of the field is `USART4`"]
456    #[inline(always)]
457    pub fn is_usart4(&self) -> bool {
458        *self == PERIPHID_A::USART4
459    }
460    #[doc = "Checks if the value of the field is `USB`"]
461    #[inline(always)]
462    pub fn is_usb(&self) -> bool {
463        *self == PERIPHID_A::USB
464    }
465    #[doc = "Checks if the value of the field is `WDOG0`"]
466    #[inline(always)]
467    pub fn is_wdog0(&self) -> bool {
468        *self == PERIPHID_A::WDOG0
469    }
470    #[doc = "Checks if the value of the field is `WDOG1`"]
471    #[inline(always)]
472    pub fn is_wdog1(&self) -> bool {
473        *self == PERIPHID_A::WDOG1
474    }
475    #[doc = "Checks if the value of the field is `WTIMER0`"]
476    #[inline(always)]
477    pub fn is_wtimer0(&self) -> bool {
478        *self == PERIPHID_A::WTIMER0
479    }
480    #[doc = "Checks if the value of the field is `WTIMER1`"]
481    #[inline(always)]
482    pub fn is_wtimer1(&self) -> bool {
483        *self == PERIPHID_A::WTIMER1
484    }
485}
486impl R {
487    #[doc = "Bits 0:6"]
488    #[inline(always)]
489    pub fn periphid(&self) -> PERIPHID_R {
490        PERIPHID_R::new((self.bits & 0x7f) as u8)
491    }
492}
493#[doc = "PPU Fault Status\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 [ppufs](index.html) module"]
494pub struct PPUFS_SPEC;
495impl crate::RegisterSpec for PPUFS_SPEC {
496    type Ux = u32;
497}
498#[doc = "`read()` method returns [ppufs::R](R) reader structure"]
499impl crate::Readable for PPUFS_SPEC {
500    type Reader = R;
501}
502#[doc = "`reset()` method sets PPUFS to value 0"]
503impl crate::Resettable for PPUFS_SPEC {
504    #[inline(always)]
505    fn reset_value() -> Self::Ux {
506        0
507    }
508}