efm32tg11b_pac/efm32tg11b120/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 = "Field `PERIPHID` reader - "]
17pub type PERIPHID_R = crate::FieldReader<u8, PERIPHID_A>;
18#[doc = "\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20#[repr(u8)]
21pub enum PERIPHID_A {
22    #[doc = "0: Analog Comparator 0"]
23    ACMP0 = 0,
24    #[doc = "1: Analog Comparator 1"]
25    ACMP1 = 1,
26    #[doc = "2: Analog to Digital Converter 0"]
27    ADC0 = 2,
28    #[doc = "3: CAN 0"]
29    CAN0 = 3,
30    #[doc = "4: Clock Management Unit"]
31    CMU = 4,
32    #[doc = "5: CRYOTIMER"]
33    CRYOTIMER = 5,
34    #[doc = "6: Advanced Encryption Standard Accelerator"]
35    CRYPTO0 = 6,
36    #[doc = "7: Capacitive touch sense module"]
37    CSEN = 7,
38    #[doc = "8: Digital to Analog Converter 0"]
39    VDAC0 = 8,
40    #[doc = "9: Peripheral Reflex System"]
41    PRS = 9,
42    #[doc = "10: Energy Management Unit"]
43    EMU = 10,
44    #[doc = "11: General Purpose CRC"]
45    GPCRC = 11,
46    #[doc = "12: General purpose Input/Output"]
47    GPIO = 12,
48    #[doc = "13: I2C 0"]
49    I2C0 = 13,
50    #[doc = "14: I2C 1"]
51    I2C1 = 14,
52    #[doc = "15: Memory System Controller"]
53    MSC = 15,
54    #[doc = "17: Linked Direct Memory Access Controller"]
55    LDMA = 17,
56    #[doc = "18: Low Energy Sensor Interface"]
57    LESENSE = 18,
58    #[doc = "19: Low Energy Timer 0"]
59    LETIMER0 = 19,
60    #[doc = "20: Low Energy UART 0"]
61    LEUART0 = 20,
62    #[doc = "21: Pulse Counter 0"]
63    PCNT0 = 21,
64    #[doc = "22: Reset Management Unit"]
65    RMU = 22,
66    #[doc = "23: Real-Time Counter and Calendar"]
67    RTCC = 23,
68    #[doc = "24: Security Management Unit"]
69    SMU = 24,
70    #[doc = "25: Timer 0"]
71    TIMER0 = 25,
72    #[doc = "26: Timer 1"]
73    TIMER1 = 26,
74    #[doc = "27: True Random Number Generator 0"]
75    TRNG0 = 27,
76    #[doc = "28: Universal Asynchronous Receiver/Transmitter 0"]
77    UART0 = 28,
78    #[doc = "29: Universal Synchronous/Asynchronous Receiver/Transmitter 0"]
79    USART0 = 29,
80    #[doc = "30: Universal Synchronous/Asynchronous Receiver/Transmitter 1"]
81    USART1 = 30,
82    #[doc = "31: Universal Synchronous/Asynchronous Receiver/Transmitter 2"]
83    USART2 = 31,
84    #[doc = "32: Universal Synchronous/Asynchronous Receiver/Transmitter 3"]
85    USART3 = 32,
86    #[doc = "33: Watchdog"]
87    WDOG0 = 33,
88    #[doc = "34: Wide Timer 0"]
89    WTIMER0 = 34,
90    #[doc = "35: Wide Timer 1"]
91    WTIMER1 = 35,
92}
93impl From<PERIPHID_A> for u8 {
94    #[inline(always)]
95    fn from(variant: PERIPHID_A) -> Self {
96        variant as _
97    }
98}
99impl PERIPHID_R {
100    #[doc = "Get enumerated values variant"]
101    #[inline(always)]
102    pub fn variant(&self) -> Option<PERIPHID_A> {
103        match self.bits {
104            0 => Some(PERIPHID_A::ACMP0),
105            1 => Some(PERIPHID_A::ACMP1),
106            2 => Some(PERIPHID_A::ADC0),
107            3 => Some(PERIPHID_A::CAN0),
108            4 => Some(PERIPHID_A::CMU),
109            5 => Some(PERIPHID_A::CRYOTIMER),
110            6 => Some(PERIPHID_A::CRYPTO0),
111            7 => Some(PERIPHID_A::CSEN),
112            8 => Some(PERIPHID_A::VDAC0),
113            9 => Some(PERIPHID_A::PRS),
114            10 => Some(PERIPHID_A::EMU),
115            11 => Some(PERIPHID_A::GPCRC),
116            12 => Some(PERIPHID_A::GPIO),
117            13 => Some(PERIPHID_A::I2C0),
118            14 => Some(PERIPHID_A::I2C1),
119            15 => Some(PERIPHID_A::MSC),
120            17 => Some(PERIPHID_A::LDMA),
121            18 => Some(PERIPHID_A::LESENSE),
122            19 => Some(PERIPHID_A::LETIMER0),
123            20 => Some(PERIPHID_A::LEUART0),
124            21 => Some(PERIPHID_A::PCNT0),
125            22 => Some(PERIPHID_A::RMU),
126            23 => Some(PERIPHID_A::RTCC),
127            24 => Some(PERIPHID_A::SMU),
128            25 => Some(PERIPHID_A::TIMER0),
129            26 => Some(PERIPHID_A::TIMER1),
130            27 => Some(PERIPHID_A::TRNG0),
131            28 => Some(PERIPHID_A::UART0),
132            29 => Some(PERIPHID_A::USART0),
133            30 => Some(PERIPHID_A::USART1),
134            31 => Some(PERIPHID_A::USART2),
135            32 => Some(PERIPHID_A::USART3),
136            33 => Some(PERIPHID_A::WDOG0),
137            34 => Some(PERIPHID_A::WTIMER0),
138            35 => Some(PERIPHID_A::WTIMER1),
139            _ => None,
140        }
141    }
142    #[doc = "Checks if the value of the field is `ACMP0`"]
143    #[inline(always)]
144    pub fn is_acmp0(&self) -> bool {
145        *self == PERIPHID_A::ACMP0
146    }
147    #[doc = "Checks if the value of the field is `ACMP1`"]
148    #[inline(always)]
149    pub fn is_acmp1(&self) -> bool {
150        *self == PERIPHID_A::ACMP1
151    }
152    #[doc = "Checks if the value of the field is `ADC0`"]
153    #[inline(always)]
154    pub fn is_adc0(&self) -> bool {
155        *self == PERIPHID_A::ADC0
156    }
157    #[doc = "Checks if the value of the field is `CAN0`"]
158    #[inline(always)]
159    pub fn is_can0(&self) -> bool {
160        *self == PERIPHID_A::CAN0
161    }
162    #[doc = "Checks if the value of the field is `CMU`"]
163    #[inline(always)]
164    pub fn is_cmu(&self) -> bool {
165        *self == PERIPHID_A::CMU
166    }
167    #[doc = "Checks if the value of the field is `CRYOTIMER`"]
168    #[inline(always)]
169    pub fn is_cryotimer(&self) -> bool {
170        *self == PERIPHID_A::CRYOTIMER
171    }
172    #[doc = "Checks if the value of the field is `CRYPTO0`"]
173    #[inline(always)]
174    pub fn is_crypto0(&self) -> bool {
175        *self == PERIPHID_A::CRYPTO0
176    }
177    #[doc = "Checks if the value of the field is `CSEN`"]
178    #[inline(always)]
179    pub fn is_csen(&self) -> bool {
180        *self == PERIPHID_A::CSEN
181    }
182    #[doc = "Checks if the value of the field is `VDAC0`"]
183    #[inline(always)]
184    pub fn is_vdac0(&self) -> bool {
185        *self == PERIPHID_A::VDAC0
186    }
187    #[doc = "Checks if the value of the field is `PRS`"]
188    #[inline(always)]
189    pub fn is_prs(&self) -> bool {
190        *self == PERIPHID_A::PRS
191    }
192    #[doc = "Checks if the value of the field is `EMU`"]
193    #[inline(always)]
194    pub fn is_emu(&self) -> bool {
195        *self == PERIPHID_A::EMU
196    }
197    #[doc = "Checks if the value of the field is `GPCRC`"]
198    #[inline(always)]
199    pub fn is_gpcrc(&self) -> bool {
200        *self == PERIPHID_A::GPCRC
201    }
202    #[doc = "Checks if the value of the field is `GPIO`"]
203    #[inline(always)]
204    pub fn is_gpio(&self) -> bool {
205        *self == PERIPHID_A::GPIO
206    }
207    #[doc = "Checks if the value of the field is `I2C0`"]
208    #[inline(always)]
209    pub fn is_i2c0(&self) -> bool {
210        *self == PERIPHID_A::I2C0
211    }
212    #[doc = "Checks if the value of the field is `I2C1`"]
213    #[inline(always)]
214    pub fn is_i2c1(&self) -> bool {
215        *self == PERIPHID_A::I2C1
216    }
217    #[doc = "Checks if the value of the field is `MSC`"]
218    #[inline(always)]
219    pub fn is_msc(&self) -> bool {
220        *self == PERIPHID_A::MSC
221    }
222    #[doc = "Checks if the value of the field is `LDMA`"]
223    #[inline(always)]
224    pub fn is_ldma(&self) -> bool {
225        *self == PERIPHID_A::LDMA
226    }
227    #[doc = "Checks if the value of the field is `LESENSE`"]
228    #[inline(always)]
229    pub fn is_lesense(&self) -> bool {
230        *self == PERIPHID_A::LESENSE
231    }
232    #[doc = "Checks if the value of the field is `LETIMER0`"]
233    #[inline(always)]
234    pub fn is_letimer0(&self) -> bool {
235        *self == PERIPHID_A::LETIMER0
236    }
237    #[doc = "Checks if the value of the field is `LEUART0`"]
238    #[inline(always)]
239    pub fn is_leuart0(&self) -> bool {
240        *self == PERIPHID_A::LEUART0
241    }
242    #[doc = "Checks if the value of the field is `PCNT0`"]
243    #[inline(always)]
244    pub fn is_pcnt0(&self) -> bool {
245        *self == PERIPHID_A::PCNT0
246    }
247    #[doc = "Checks if the value of the field is `RMU`"]
248    #[inline(always)]
249    pub fn is_rmu(&self) -> bool {
250        *self == PERIPHID_A::RMU
251    }
252    #[doc = "Checks if the value of the field is `RTCC`"]
253    #[inline(always)]
254    pub fn is_rtcc(&self) -> bool {
255        *self == PERIPHID_A::RTCC
256    }
257    #[doc = "Checks if the value of the field is `SMU`"]
258    #[inline(always)]
259    pub fn is_smu(&self) -> bool {
260        *self == PERIPHID_A::SMU
261    }
262    #[doc = "Checks if the value of the field is `TIMER0`"]
263    #[inline(always)]
264    pub fn is_timer0(&self) -> bool {
265        *self == PERIPHID_A::TIMER0
266    }
267    #[doc = "Checks if the value of the field is `TIMER1`"]
268    #[inline(always)]
269    pub fn is_timer1(&self) -> bool {
270        *self == PERIPHID_A::TIMER1
271    }
272    #[doc = "Checks if the value of the field is `TRNG0`"]
273    #[inline(always)]
274    pub fn is_trng0(&self) -> bool {
275        *self == PERIPHID_A::TRNG0
276    }
277    #[doc = "Checks if the value of the field is `UART0`"]
278    #[inline(always)]
279    pub fn is_uart0(&self) -> bool {
280        *self == PERIPHID_A::UART0
281    }
282    #[doc = "Checks if the value of the field is `USART0`"]
283    #[inline(always)]
284    pub fn is_usart0(&self) -> bool {
285        *self == PERIPHID_A::USART0
286    }
287    #[doc = "Checks if the value of the field is `USART1`"]
288    #[inline(always)]
289    pub fn is_usart1(&self) -> bool {
290        *self == PERIPHID_A::USART1
291    }
292    #[doc = "Checks if the value of the field is `USART2`"]
293    #[inline(always)]
294    pub fn is_usart2(&self) -> bool {
295        *self == PERIPHID_A::USART2
296    }
297    #[doc = "Checks if the value of the field is `USART3`"]
298    #[inline(always)]
299    pub fn is_usart3(&self) -> bool {
300        *self == PERIPHID_A::USART3
301    }
302    #[doc = "Checks if the value of the field is `WDOG0`"]
303    #[inline(always)]
304    pub fn is_wdog0(&self) -> bool {
305        *self == PERIPHID_A::WDOG0
306    }
307    #[doc = "Checks if the value of the field is `WTIMER0`"]
308    #[inline(always)]
309    pub fn is_wtimer0(&self) -> bool {
310        *self == PERIPHID_A::WTIMER0
311    }
312    #[doc = "Checks if the value of the field is `WTIMER1`"]
313    #[inline(always)]
314    pub fn is_wtimer1(&self) -> bool {
315        *self == PERIPHID_A::WTIMER1
316    }
317}
318impl R {
319    #[doc = "Bits 0:6"]
320    #[inline(always)]
321    pub fn periphid(&self) -> PERIPHID_R {
322        PERIPHID_R::new((self.bits & 0x7f) as u8)
323    }
324}
325#[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"]
326pub struct PPUFS_SPEC;
327impl crate::RegisterSpec for PPUFS_SPEC {
328    type Ux = u32;
329}
330#[doc = "`read()` method returns [ppufs::R](R) reader structure"]
331impl crate::Readable for PPUFS_SPEC {
332    type Reader = R;
333}
334#[doc = "`reset()` method sets PPUFS to value 0"]
335impl crate::Resettable for PPUFS_SPEC {
336    const RESET_VALUE: Self::Ux = 0;
337}