1#[doc = "Register `ESC_DL_STATUS` reader"]
2pub type R = crate::R<ESC_DL_STATUS_SPEC>;
3#[doc = "PDI operational/EEPROM loaded correctly\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum PDI_EEPROM_A {
6 #[doc = "0: EEPROM not loaded, PDI not operational (no access to Process Data RAM)"]
7 VALUE1 = 0,
8 #[doc = "1: EEPROM loaded correctly, PDI operational (access to Process Data RAM)"]
9 VALUE2 = 1,
10}
11impl From<PDI_EEPROM_A> for bool {
12 #[inline(always)]
13 fn from(variant: PDI_EEPROM_A) -> Self {
14 variant as u8 != 0
15 }
16}
17#[doc = "Field `PDI_EEPROM` reader - PDI operational/EEPROM loaded correctly"]
18pub type PDI_EEPROM_R = crate::BitReader<PDI_EEPROM_A>;
19impl PDI_EEPROM_R {
20 #[doc = "Get enumerated values variant"]
21 #[inline(always)]
22 pub const fn variant(&self) -> PDI_EEPROM_A {
23 match self.bits {
24 false => PDI_EEPROM_A::VALUE1,
25 true => PDI_EEPROM_A::VALUE2,
26 }
27 }
28 #[doc = "EEPROM not loaded, PDI not operational (no access to Process Data RAM)"]
29 #[inline(always)]
30 pub fn is_value1(&self) -> bool {
31 *self == PDI_EEPROM_A::VALUE1
32 }
33 #[doc = "EEPROM loaded correctly, PDI operational (access to Process Data RAM)"]
34 #[inline(always)]
35 pub fn is_value2(&self) -> bool {
36 *self == PDI_EEPROM_A::VALUE2
37 }
38}
39#[doc = "PDI Watchdog Status\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum PDI_WDT_S_A {
42 #[doc = "0: Watchdog expired"]
43 VALUE1 = 0,
44 #[doc = "1: Watchdog reloaded"]
45 VALUE2 = 1,
46}
47impl From<PDI_WDT_S_A> for bool {
48 #[inline(always)]
49 fn from(variant: PDI_WDT_S_A) -> Self {
50 variant as u8 != 0
51 }
52}
53#[doc = "Field `PDI_WDT_S` reader - PDI Watchdog Status"]
54pub type PDI_WDT_S_R = crate::BitReader<PDI_WDT_S_A>;
55impl PDI_WDT_S_R {
56 #[doc = "Get enumerated values variant"]
57 #[inline(always)]
58 pub const fn variant(&self) -> PDI_WDT_S_A {
59 match self.bits {
60 false => PDI_WDT_S_A::VALUE1,
61 true => PDI_WDT_S_A::VALUE2,
62 }
63 }
64 #[doc = "Watchdog expired"]
65 #[inline(always)]
66 pub fn is_value1(&self) -> bool {
67 *self == PDI_WDT_S_A::VALUE1
68 }
69 #[doc = "Watchdog reloaded"]
70 #[inline(always)]
71 pub fn is_value2(&self) -> bool {
72 *self == PDI_WDT_S_A::VALUE2
73 }
74}
75#[doc = "Enhanced Link detection\n\nValue on reset: 0"]
76#[derive(Clone, Copy, Debug, PartialEq, Eq)]
77pub enum ELD_A {
78 #[doc = "0: Deactivated for all ports"]
79 VALUE1 = 0,
80 #[doc = "1: Activated for at least one port"]
81 VALUE2 = 1,
82}
83impl From<ELD_A> for bool {
84 #[inline(always)]
85 fn from(variant: ELD_A) -> Self {
86 variant as u8 != 0
87 }
88}
89#[doc = "Field `ELD` reader - Enhanced Link detection"]
90pub type ELD_R = crate::BitReader<ELD_A>;
91impl ELD_R {
92 #[doc = "Get enumerated values variant"]
93 #[inline(always)]
94 pub const fn variant(&self) -> ELD_A {
95 match self.bits {
96 false => ELD_A::VALUE1,
97 true => ELD_A::VALUE2,
98 }
99 }
100 #[doc = "Deactivated for all ports"]
101 #[inline(always)]
102 pub fn is_value1(&self) -> bool {
103 *self == ELD_A::VALUE1
104 }
105 #[doc = "Activated for at least one port"]
106 #[inline(always)]
107 pub fn is_value2(&self) -> bool {
108 *self == ELD_A::VALUE2
109 }
110}
111#[doc = "Physical link on Port 0\n\nValue on reset: 0"]
112#[derive(Clone, Copy, Debug, PartialEq, Eq)]
113pub enum LINK_P0_A {
114 #[doc = "0: No link"]
115 VALUE1 = 0,
116 #[doc = "1: Link detected"]
117 VALUE2 = 1,
118}
119impl From<LINK_P0_A> for bool {
120 #[inline(always)]
121 fn from(variant: LINK_P0_A) -> Self {
122 variant as u8 != 0
123 }
124}
125#[doc = "Field `LINK_P0` reader - Physical link on Port 0"]
126pub type LINK_P0_R = crate::BitReader<LINK_P0_A>;
127impl LINK_P0_R {
128 #[doc = "Get enumerated values variant"]
129 #[inline(always)]
130 pub const fn variant(&self) -> LINK_P0_A {
131 match self.bits {
132 false => LINK_P0_A::VALUE1,
133 true => LINK_P0_A::VALUE2,
134 }
135 }
136 #[doc = "No link"]
137 #[inline(always)]
138 pub fn is_value1(&self) -> bool {
139 *self == LINK_P0_A::VALUE1
140 }
141 #[doc = "Link detected"]
142 #[inline(always)]
143 pub fn is_value2(&self) -> bool {
144 *self == LINK_P0_A::VALUE2
145 }
146}
147#[doc = "Physical link on Port 1\n\nValue on reset: 0"]
148#[derive(Clone, Copy, Debug, PartialEq, Eq)]
149pub enum LINK_P1_A {
150 #[doc = "0: No link"]
151 VALUE1 = 0,
152 #[doc = "1: Link detected"]
153 VALUE2 = 1,
154}
155impl From<LINK_P1_A> for bool {
156 #[inline(always)]
157 fn from(variant: LINK_P1_A) -> Self {
158 variant as u8 != 0
159 }
160}
161#[doc = "Field `LINK_P1` reader - Physical link on Port 1"]
162pub type LINK_P1_R = crate::BitReader<LINK_P1_A>;
163impl LINK_P1_R {
164 #[doc = "Get enumerated values variant"]
165 #[inline(always)]
166 pub const fn variant(&self) -> LINK_P1_A {
167 match self.bits {
168 false => LINK_P1_A::VALUE1,
169 true => LINK_P1_A::VALUE2,
170 }
171 }
172 #[doc = "No link"]
173 #[inline(always)]
174 pub fn is_value1(&self) -> bool {
175 *self == LINK_P1_A::VALUE1
176 }
177 #[doc = "Link detected"]
178 #[inline(always)]
179 pub fn is_value2(&self) -> bool {
180 *self == LINK_P1_A::VALUE2
181 }
182}
183#[doc = "Physical link on Port 2\n\nValue on reset: 0"]
184#[derive(Clone, Copy, Debug, PartialEq, Eq)]
185pub enum LINK_P2_A {
186 #[doc = "0: No link"]
187 VALUE1 = 0,
188 #[doc = "1: Link detected"]
189 VALUE2 = 1,
190}
191impl From<LINK_P2_A> for bool {
192 #[inline(always)]
193 fn from(variant: LINK_P2_A) -> Self {
194 variant as u8 != 0
195 }
196}
197#[doc = "Field `LINK_P2` reader - Physical link on Port 2"]
198pub type LINK_P2_R = crate::BitReader<LINK_P2_A>;
199impl LINK_P2_R {
200 #[doc = "Get enumerated values variant"]
201 #[inline(always)]
202 pub const fn variant(&self) -> LINK_P2_A {
203 match self.bits {
204 false => LINK_P2_A::VALUE1,
205 true => LINK_P2_A::VALUE2,
206 }
207 }
208 #[doc = "No link"]
209 #[inline(always)]
210 pub fn is_value1(&self) -> bool {
211 *self == LINK_P2_A::VALUE1
212 }
213 #[doc = "Link detected"]
214 #[inline(always)]
215 pub fn is_value2(&self) -> bool {
216 *self == LINK_P2_A::VALUE2
217 }
218}
219#[doc = "Physical link on Port 3\n\nValue on reset: 0"]
220#[derive(Clone, Copy, Debug, PartialEq, Eq)]
221pub enum LINK_P3_A {
222 #[doc = "0: No link"]
223 VALUE1 = 0,
224 #[doc = "1: Link detected"]
225 VALUE2 = 1,
226}
227impl From<LINK_P3_A> for bool {
228 #[inline(always)]
229 fn from(variant: LINK_P3_A) -> Self {
230 variant as u8 != 0
231 }
232}
233#[doc = "Field `LINK_P3` reader - Physical link on Port 3"]
234pub type LINK_P3_R = crate::BitReader<LINK_P3_A>;
235impl LINK_P3_R {
236 #[doc = "Get enumerated values variant"]
237 #[inline(always)]
238 pub const fn variant(&self) -> LINK_P3_A {
239 match self.bits {
240 false => LINK_P3_A::VALUE1,
241 true => LINK_P3_A::VALUE2,
242 }
243 }
244 #[doc = "No link"]
245 #[inline(always)]
246 pub fn is_value1(&self) -> bool {
247 *self == LINK_P3_A::VALUE1
248 }
249 #[doc = "Link detected"]
250 #[inline(always)]
251 pub fn is_value2(&self) -> bool {
252 *self == LINK_P3_A::VALUE2
253 }
254}
255#[doc = "Loop Port 0\n\nValue on reset: 0"]
256#[derive(Clone, Copy, Debug, PartialEq, Eq)]
257pub enum LP0_A {
258 #[doc = "0: Open"]
259 VALUE1 = 0,
260 #[doc = "1: Closed"]
261 VALUE2 = 1,
262}
263impl From<LP0_A> for bool {
264 #[inline(always)]
265 fn from(variant: LP0_A) -> Self {
266 variant as u8 != 0
267 }
268}
269#[doc = "Field `LP0` reader - Loop Port 0"]
270pub type LP0_R = crate::BitReader<LP0_A>;
271impl LP0_R {
272 #[doc = "Get enumerated values variant"]
273 #[inline(always)]
274 pub const fn variant(&self) -> LP0_A {
275 match self.bits {
276 false => LP0_A::VALUE1,
277 true => LP0_A::VALUE2,
278 }
279 }
280 #[doc = "Open"]
281 #[inline(always)]
282 pub fn is_value1(&self) -> bool {
283 *self == LP0_A::VALUE1
284 }
285 #[doc = "Closed"]
286 #[inline(always)]
287 pub fn is_value2(&self) -> bool {
288 *self == LP0_A::VALUE2
289 }
290}
291#[doc = "Communication on Port 0\n\nValue on reset: 0"]
292#[derive(Clone, Copy, Debug, PartialEq, Eq)]
293pub enum COM_P0_A {
294 #[doc = "0: No stable communication"]
295 VALUE1 = 0,
296 #[doc = "1: Communication established"]
297 VALUE2 = 1,
298}
299impl From<COM_P0_A> for bool {
300 #[inline(always)]
301 fn from(variant: COM_P0_A) -> Self {
302 variant as u8 != 0
303 }
304}
305#[doc = "Field `COM_P0` reader - Communication on Port 0"]
306pub type COM_P0_R = crate::BitReader<COM_P0_A>;
307impl COM_P0_R {
308 #[doc = "Get enumerated values variant"]
309 #[inline(always)]
310 pub const fn variant(&self) -> COM_P0_A {
311 match self.bits {
312 false => COM_P0_A::VALUE1,
313 true => COM_P0_A::VALUE2,
314 }
315 }
316 #[doc = "No stable communication"]
317 #[inline(always)]
318 pub fn is_value1(&self) -> bool {
319 *self == COM_P0_A::VALUE1
320 }
321 #[doc = "Communication established"]
322 #[inline(always)]
323 pub fn is_value2(&self) -> bool {
324 *self == COM_P0_A::VALUE2
325 }
326}
327#[doc = "Loop Port 1\n\nValue on reset: 0"]
328#[derive(Clone, Copy, Debug, PartialEq, Eq)]
329pub enum LP1_A {
330 #[doc = "0: Open"]
331 VALUE1 = 0,
332 #[doc = "1: Closed"]
333 VALUE2 = 1,
334}
335impl From<LP1_A> for bool {
336 #[inline(always)]
337 fn from(variant: LP1_A) -> Self {
338 variant as u8 != 0
339 }
340}
341#[doc = "Field `LP1` reader - Loop Port 1"]
342pub type LP1_R = crate::BitReader<LP1_A>;
343impl LP1_R {
344 #[doc = "Get enumerated values variant"]
345 #[inline(always)]
346 pub const fn variant(&self) -> LP1_A {
347 match self.bits {
348 false => LP1_A::VALUE1,
349 true => LP1_A::VALUE2,
350 }
351 }
352 #[doc = "Open"]
353 #[inline(always)]
354 pub fn is_value1(&self) -> bool {
355 *self == LP1_A::VALUE1
356 }
357 #[doc = "Closed"]
358 #[inline(always)]
359 pub fn is_value2(&self) -> bool {
360 *self == LP1_A::VALUE2
361 }
362}
363#[doc = "Communication on Port 1\n\nValue on reset: 0"]
364#[derive(Clone, Copy, Debug, PartialEq, Eq)]
365pub enum COM_P1_A {
366 #[doc = "0: No stable communication"]
367 VALUE1 = 0,
368 #[doc = "1: Communication established"]
369 VALUE2 = 1,
370}
371impl From<COM_P1_A> for bool {
372 #[inline(always)]
373 fn from(variant: COM_P1_A) -> Self {
374 variant as u8 != 0
375 }
376}
377#[doc = "Field `COM_P1` reader - Communication on Port 1"]
378pub type COM_P1_R = crate::BitReader<COM_P1_A>;
379impl COM_P1_R {
380 #[doc = "Get enumerated values variant"]
381 #[inline(always)]
382 pub const fn variant(&self) -> COM_P1_A {
383 match self.bits {
384 false => COM_P1_A::VALUE1,
385 true => COM_P1_A::VALUE2,
386 }
387 }
388 #[doc = "No stable communication"]
389 #[inline(always)]
390 pub fn is_value1(&self) -> bool {
391 *self == COM_P1_A::VALUE1
392 }
393 #[doc = "Communication established"]
394 #[inline(always)]
395 pub fn is_value2(&self) -> bool {
396 *self == COM_P1_A::VALUE2
397 }
398}
399#[doc = "Loop Port 2\n\nValue on reset: 1"]
400#[derive(Clone, Copy, Debug, PartialEq, Eq)]
401pub enum LP2_A {
402 #[doc = "0: Open"]
403 VALUE1 = 0,
404 #[doc = "1: Closed"]
405 VALUE2 = 1,
406}
407impl From<LP2_A> for bool {
408 #[inline(always)]
409 fn from(variant: LP2_A) -> Self {
410 variant as u8 != 0
411 }
412}
413#[doc = "Field `LP2` reader - Loop Port 2"]
414pub type LP2_R = crate::BitReader<LP2_A>;
415impl LP2_R {
416 #[doc = "Get enumerated values variant"]
417 #[inline(always)]
418 pub const fn variant(&self) -> LP2_A {
419 match self.bits {
420 false => LP2_A::VALUE1,
421 true => LP2_A::VALUE2,
422 }
423 }
424 #[doc = "Open"]
425 #[inline(always)]
426 pub fn is_value1(&self) -> bool {
427 *self == LP2_A::VALUE1
428 }
429 #[doc = "Closed"]
430 #[inline(always)]
431 pub fn is_value2(&self) -> bool {
432 *self == LP2_A::VALUE2
433 }
434}
435#[doc = "Communication on Port 2\n\nValue on reset: 0"]
436#[derive(Clone, Copy, Debug, PartialEq, Eq)]
437pub enum COM_P2_A {
438 #[doc = "0: No stable communication"]
439 VALUE1 = 0,
440 #[doc = "1: Communication established"]
441 VALUE2 = 1,
442}
443impl From<COM_P2_A> for bool {
444 #[inline(always)]
445 fn from(variant: COM_P2_A) -> Self {
446 variant as u8 != 0
447 }
448}
449#[doc = "Field `COM_P2` reader - Communication on Port 2"]
450pub type COM_P2_R = crate::BitReader<COM_P2_A>;
451impl COM_P2_R {
452 #[doc = "Get enumerated values variant"]
453 #[inline(always)]
454 pub const fn variant(&self) -> COM_P2_A {
455 match self.bits {
456 false => COM_P2_A::VALUE1,
457 true => COM_P2_A::VALUE2,
458 }
459 }
460 #[doc = "No stable communication"]
461 #[inline(always)]
462 pub fn is_value1(&self) -> bool {
463 *self == COM_P2_A::VALUE1
464 }
465 #[doc = "Communication established"]
466 #[inline(always)]
467 pub fn is_value2(&self) -> bool {
468 *self == COM_P2_A::VALUE2
469 }
470}
471#[doc = "Loop Port 3\n\nValue on reset: 1"]
472#[derive(Clone, Copy, Debug, PartialEq, Eq)]
473pub enum LP3_A {
474 #[doc = "0: Open"]
475 VALUE1 = 0,
476 #[doc = "1: Closed"]
477 VALUE2 = 1,
478}
479impl From<LP3_A> for bool {
480 #[inline(always)]
481 fn from(variant: LP3_A) -> Self {
482 variant as u8 != 0
483 }
484}
485#[doc = "Field `LP3` reader - Loop Port 3"]
486pub type LP3_R = crate::BitReader<LP3_A>;
487impl LP3_R {
488 #[doc = "Get enumerated values variant"]
489 #[inline(always)]
490 pub const fn variant(&self) -> LP3_A {
491 match self.bits {
492 false => LP3_A::VALUE1,
493 true => LP3_A::VALUE2,
494 }
495 }
496 #[doc = "Open"]
497 #[inline(always)]
498 pub fn is_value1(&self) -> bool {
499 *self == LP3_A::VALUE1
500 }
501 #[doc = "Closed"]
502 #[inline(always)]
503 pub fn is_value2(&self) -> bool {
504 *self == LP3_A::VALUE2
505 }
506}
507#[doc = "Communication on Port 3\n\nValue on reset: 0"]
508#[derive(Clone, Copy, Debug, PartialEq, Eq)]
509pub enum COM_P3_A {
510 #[doc = "0: No stable communication"]
511 VALUE1 = 0,
512 #[doc = "1: Communication established"]
513 VALUE2 = 1,
514}
515impl From<COM_P3_A> for bool {
516 #[inline(always)]
517 fn from(variant: COM_P3_A) -> Self {
518 variant as u8 != 0
519 }
520}
521#[doc = "Field `COM_P3` reader - Communication on Port 3"]
522pub type COM_P3_R = crate::BitReader<COM_P3_A>;
523impl COM_P3_R {
524 #[doc = "Get enumerated values variant"]
525 #[inline(always)]
526 pub const fn variant(&self) -> COM_P3_A {
527 match self.bits {
528 false => COM_P3_A::VALUE1,
529 true => COM_P3_A::VALUE2,
530 }
531 }
532 #[doc = "No stable communication"]
533 #[inline(always)]
534 pub fn is_value1(&self) -> bool {
535 *self == COM_P3_A::VALUE1
536 }
537 #[doc = "Communication established"]
538 #[inline(always)]
539 pub fn is_value2(&self) -> bool {
540 *self == COM_P3_A::VALUE2
541 }
542}
543impl R {
544 #[doc = "Bit 0 - PDI operational/EEPROM loaded correctly"]
545 #[inline(always)]
546 pub fn pdi_eeprom(&self) -> PDI_EEPROM_R {
547 PDI_EEPROM_R::new((self.bits & 1) != 0)
548 }
549 #[doc = "Bit 1 - PDI Watchdog Status"]
550 #[inline(always)]
551 pub fn pdi_wdt_s(&self) -> PDI_WDT_S_R {
552 PDI_WDT_S_R::new(((self.bits >> 1) & 1) != 0)
553 }
554 #[doc = "Bit 2 - Enhanced Link detection"]
555 #[inline(always)]
556 pub fn eld(&self) -> ELD_R {
557 ELD_R::new(((self.bits >> 2) & 1) != 0)
558 }
559 #[doc = "Bit 4 - Physical link on Port 0"]
560 #[inline(always)]
561 pub fn link_p0(&self) -> LINK_P0_R {
562 LINK_P0_R::new(((self.bits >> 4) & 1) != 0)
563 }
564 #[doc = "Bit 5 - Physical link on Port 1"]
565 #[inline(always)]
566 pub fn link_p1(&self) -> LINK_P1_R {
567 LINK_P1_R::new(((self.bits >> 5) & 1) != 0)
568 }
569 #[doc = "Bit 6 - Physical link on Port 2"]
570 #[inline(always)]
571 pub fn link_p2(&self) -> LINK_P2_R {
572 LINK_P2_R::new(((self.bits >> 6) & 1) != 0)
573 }
574 #[doc = "Bit 7 - Physical link on Port 3"]
575 #[inline(always)]
576 pub fn link_p3(&self) -> LINK_P3_R {
577 LINK_P3_R::new(((self.bits >> 7) & 1) != 0)
578 }
579 #[doc = "Bit 8 - Loop Port 0"]
580 #[inline(always)]
581 pub fn lp0(&self) -> LP0_R {
582 LP0_R::new(((self.bits >> 8) & 1) != 0)
583 }
584 #[doc = "Bit 9 - Communication on Port 0"]
585 #[inline(always)]
586 pub fn com_p0(&self) -> COM_P0_R {
587 COM_P0_R::new(((self.bits >> 9) & 1) != 0)
588 }
589 #[doc = "Bit 10 - Loop Port 1"]
590 #[inline(always)]
591 pub fn lp1(&self) -> LP1_R {
592 LP1_R::new(((self.bits >> 10) & 1) != 0)
593 }
594 #[doc = "Bit 11 - Communication on Port 1"]
595 #[inline(always)]
596 pub fn com_p1(&self) -> COM_P1_R {
597 COM_P1_R::new(((self.bits >> 11) & 1) != 0)
598 }
599 #[doc = "Bit 12 - Loop Port 2"]
600 #[inline(always)]
601 pub fn lp2(&self) -> LP2_R {
602 LP2_R::new(((self.bits >> 12) & 1) != 0)
603 }
604 #[doc = "Bit 13 - Communication on Port 2"]
605 #[inline(always)]
606 pub fn com_p2(&self) -> COM_P2_R {
607 COM_P2_R::new(((self.bits >> 13) & 1) != 0)
608 }
609 #[doc = "Bit 14 - Loop Port 3"]
610 #[inline(always)]
611 pub fn lp3(&self) -> LP3_R {
612 LP3_R::new(((self.bits >> 14) & 1) != 0)
613 }
614 #[doc = "Bit 15 - Communication on Port 3"]
615 #[inline(always)]
616 pub fn com_p3(&self) -> COM_P3_R {
617 COM_P3_R::new(((self.bits >> 15) & 1) != 0)
618 }
619}
620#[doc = "ESC DL Status\n\nYou can [`read`](crate::Reg::read) this register and get [`esc_dl_status::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
621pub struct ESC_DL_STATUS_SPEC;
622impl crate::RegisterSpec for ESC_DL_STATUS_SPEC {
623 type Ux = u16;
624}
625#[doc = "`read()` method returns [`esc_dl_status::R`](R) reader structure"]
626impl crate::Readable for ESC_DL_STATUS_SPEC {}
627#[doc = "`reset()` method sets ESC_DL_STATUS to value 0x5000"]
628impl crate::Resettable for ESC_DL_STATUS_SPEC {
629 const RESET_VALUE: u16 = 0x5000;
630}