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