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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
#[doc = "Register `ESC_DL_STATUS` reader"]
pub type R = crate::R<EscDlStatusSpec>;
#[doc = "PDI operational/EEPROM loaded correctly\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PdiEeprom {
    #[doc = "0: EEPROM not loaded, PDI not operational (no access to Process Data RAM)"]
    Value1 = 0,
    #[doc = "1: EEPROM loaded correctly, PDI operational (access to Process Data RAM)"]
    Value2 = 1,
}
impl From<PdiEeprom> for bool {
    #[inline(always)]
    fn from(variant: PdiEeprom) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `PDI_EEPROM` reader - PDI operational/EEPROM loaded correctly"]
pub type PdiEepromR = crate::BitReader<PdiEeprom>;
impl PdiEepromR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> PdiEeprom {
        match self.bits {
            false => PdiEeprom::Value1,
            true => PdiEeprom::Value2,
        }
    }
    #[doc = "EEPROM not loaded, PDI not operational (no access to Process Data RAM)"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == PdiEeprom::Value1
    }
    #[doc = "EEPROM loaded correctly, PDI operational (access to Process Data RAM)"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == PdiEeprom::Value2
    }
}
#[doc = "PDI Watchdog Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PdiWdtS {
    #[doc = "0: Watchdog expired"]
    Value1 = 0,
    #[doc = "1: Watchdog reloaded"]
    Value2 = 1,
}
impl From<PdiWdtS> for bool {
    #[inline(always)]
    fn from(variant: PdiWdtS) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `PDI_WDT_S` reader - PDI Watchdog Status"]
pub type PdiWdtSR = crate::BitReader<PdiWdtS>;
impl PdiWdtSR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> PdiWdtS {
        match self.bits {
            false => PdiWdtS::Value1,
            true => PdiWdtS::Value2,
        }
    }
    #[doc = "Watchdog expired"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == PdiWdtS::Value1
    }
    #[doc = "Watchdog reloaded"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == PdiWdtS::Value2
    }
}
#[doc = "Enhanced Link detection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Eld {
    #[doc = "0: Deactivated for all ports"]
    Value1 = 0,
    #[doc = "1: Activated for at least one port"]
    Value2 = 1,
}
impl From<Eld> for bool {
    #[inline(always)]
    fn from(variant: Eld) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ELD` reader - Enhanced Link detection"]
pub type EldR = crate::BitReader<Eld>;
impl EldR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Eld {
        match self.bits {
            false => Eld::Value1,
            true => Eld::Value2,
        }
    }
    #[doc = "Deactivated for all ports"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Eld::Value1
    }
    #[doc = "Activated for at least one port"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Eld::Value2
    }
}
#[doc = "Physical link on Port 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LinkP0 {
    #[doc = "0: No link"]
    Value1 = 0,
    #[doc = "1: Link detected"]
    Value2 = 1,
}
impl From<LinkP0> for bool {
    #[inline(always)]
    fn from(variant: LinkP0) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LINK_P0` reader - Physical link on Port 0"]
pub type LinkP0R = crate::BitReader<LinkP0>;
impl LinkP0R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> LinkP0 {
        match self.bits {
            false => LinkP0::Value1,
            true => LinkP0::Value2,
        }
    }
    #[doc = "No link"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == LinkP0::Value1
    }
    #[doc = "Link detected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == LinkP0::Value2
    }
}
#[doc = "Physical link on Port 1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LinkP1 {
    #[doc = "0: No link"]
    Value1 = 0,
    #[doc = "1: Link detected"]
    Value2 = 1,
}
impl From<LinkP1> for bool {
    #[inline(always)]
    fn from(variant: LinkP1) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LINK_P1` reader - Physical link on Port 1"]
pub type LinkP1R = crate::BitReader<LinkP1>;
impl LinkP1R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> LinkP1 {
        match self.bits {
            false => LinkP1::Value1,
            true => LinkP1::Value2,
        }
    }
    #[doc = "No link"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == LinkP1::Value1
    }
    #[doc = "Link detected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == LinkP1::Value2
    }
}
#[doc = "Physical link on Port 2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LinkP2 {
    #[doc = "0: No link"]
    Value1 = 0,
    #[doc = "1: Link detected"]
    Value2 = 1,
}
impl From<LinkP2> for bool {
    #[inline(always)]
    fn from(variant: LinkP2) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LINK_P2` reader - Physical link on Port 2"]
pub type LinkP2R = crate::BitReader<LinkP2>;
impl LinkP2R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> LinkP2 {
        match self.bits {
            false => LinkP2::Value1,
            true => LinkP2::Value2,
        }
    }
    #[doc = "No link"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == LinkP2::Value1
    }
    #[doc = "Link detected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == LinkP2::Value2
    }
}
#[doc = "Physical link on Port 3\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LinkP3 {
    #[doc = "0: No link"]
    Value1 = 0,
    #[doc = "1: Link detected"]
    Value2 = 1,
}
impl From<LinkP3> for bool {
    #[inline(always)]
    fn from(variant: LinkP3) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LINK_P3` reader - Physical link on Port 3"]
pub type LinkP3R = crate::BitReader<LinkP3>;
impl LinkP3R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> LinkP3 {
        match self.bits {
            false => LinkP3::Value1,
            true => LinkP3::Value2,
        }
    }
    #[doc = "No link"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == LinkP3::Value1
    }
    #[doc = "Link detected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == LinkP3::Value2
    }
}
#[doc = "Loop Port 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lp0 {
    #[doc = "0: Open"]
    Value1 = 0,
    #[doc = "1: Closed"]
    Value2 = 1,
}
impl From<Lp0> for bool {
    #[inline(always)]
    fn from(variant: Lp0) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LP0` reader - Loop Port 0"]
pub type Lp0R = crate::BitReader<Lp0>;
impl Lp0R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lp0 {
        match self.bits {
            false => Lp0::Value1,
            true => Lp0::Value2,
        }
    }
    #[doc = "Open"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Lp0::Value1
    }
    #[doc = "Closed"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Lp0::Value2
    }
}
#[doc = "Communication on Port 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ComP0 {
    #[doc = "0: No stable communication"]
    Value1 = 0,
    #[doc = "1: Communication established"]
    Value2 = 1,
}
impl From<ComP0> for bool {
    #[inline(always)]
    fn from(variant: ComP0) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `COM_P0` reader - Communication on Port 0"]
pub type ComP0R = crate::BitReader<ComP0>;
impl ComP0R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> ComP0 {
        match self.bits {
            false => ComP0::Value1,
            true => ComP0::Value2,
        }
    }
    #[doc = "No stable communication"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == ComP0::Value1
    }
    #[doc = "Communication established"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == ComP0::Value2
    }
}
#[doc = "Loop Port 1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lp1 {
    #[doc = "0: Open"]
    Value1 = 0,
    #[doc = "1: Closed"]
    Value2 = 1,
}
impl From<Lp1> for bool {
    #[inline(always)]
    fn from(variant: Lp1) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LP1` reader - Loop Port 1"]
pub type Lp1R = crate::BitReader<Lp1>;
impl Lp1R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lp1 {
        match self.bits {
            false => Lp1::Value1,
            true => Lp1::Value2,
        }
    }
    #[doc = "Open"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Lp1::Value1
    }
    #[doc = "Closed"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Lp1::Value2
    }
}
#[doc = "Communication on Port 1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ComP1 {
    #[doc = "0: No stable communication"]
    Value1 = 0,
    #[doc = "1: Communication established"]
    Value2 = 1,
}
impl From<ComP1> for bool {
    #[inline(always)]
    fn from(variant: ComP1) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `COM_P1` reader - Communication on Port 1"]
pub type ComP1R = crate::BitReader<ComP1>;
impl ComP1R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> ComP1 {
        match self.bits {
            false => ComP1::Value1,
            true => ComP1::Value2,
        }
    }
    #[doc = "No stable communication"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == ComP1::Value1
    }
    #[doc = "Communication established"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == ComP1::Value2
    }
}
#[doc = "Loop Port 2\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lp2 {
    #[doc = "0: Open"]
    Value1 = 0,
    #[doc = "1: Closed"]
    Value2 = 1,
}
impl From<Lp2> for bool {
    #[inline(always)]
    fn from(variant: Lp2) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LP2` reader - Loop Port 2"]
pub type Lp2R = crate::BitReader<Lp2>;
impl Lp2R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lp2 {
        match self.bits {
            false => Lp2::Value1,
            true => Lp2::Value2,
        }
    }
    #[doc = "Open"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Lp2::Value1
    }
    #[doc = "Closed"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Lp2::Value2
    }
}
#[doc = "Communication on Port 2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ComP2 {
    #[doc = "0: No stable communication"]
    Value1 = 0,
    #[doc = "1: Communication established"]
    Value2 = 1,
}
impl From<ComP2> for bool {
    #[inline(always)]
    fn from(variant: ComP2) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `COM_P2` reader - Communication on Port 2"]
pub type ComP2R = crate::BitReader<ComP2>;
impl ComP2R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> ComP2 {
        match self.bits {
            false => ComP2::Value1,
            true => ComP2::Value2,
        }
    }
    #[doc = "No stable communication"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == ComP2::Value1
    }
    #[doc = "Communication established"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == ComP2::Value2
    }
}
#[doc = "Loop Port 3\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lp3 {
    #[doc = "0: Open"]
    Value1 = 0,
    #[doc = "1: Closed"]
    Value2 = 1,
}
impl From<Lp3> for bool {
    #[inline(always)]
    fn from(variant: Lp3) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LP3` reader - Loop Port 3"]
pub type Lp3R = crate::BitReader<Lp3>;
impl Lp3R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lp3 {
        match self.bits {
            false => Lp3::Value1,
            true => Lp3::Value2,
        }
    }
    #[doc = "Open"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Lp3::Value1
    }
    #[doc = "Closed"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Lp3::Value2
    }
}
#[doc = "Communication on Port 3\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ComP3 {
    #[doc = "0: No stable communication"]
    Value1 = 0,
    #[doc = "1: Communication established"]
    Value2 = 1,
}
impl From<ComP3> for bool {
    #[inline(always)]
    fn from(variant: ComP3) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `COM_P3` reader - Communication on Port 3"]
pub type ComP3R = crate::BitReader<ComP3>;
impl ComP3R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> ComP3 {
        match self.bits {
            false => ComP3::Value1,
            true => ComP3::Value2,
        }
    }
    #[doc = "No stable communication"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == ComP3::Value1
    }
    #[doc = "Communication established"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == ComP3::Value2
    }
}
impl R {
    #[doc = "Bit 0 - PDI operational/EEPROM loaded correctly"]
    #[inline(always)]
    pub fn pdi_eeprom(&self) -> PdiEepromR {
        PdiEepromR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - PDI Watchdog Status"]
    #[inline(always)]
    pub fn pdi_wdt_s(&self) -> PdiWdtSR {
        PdiWdtSR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Enhanced Link detection"]
    #[inline(always)]
    pub fn eld(&self) -> EldR {
        EldR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 4 - Physical link on Port 0"]
    #[inline(always)]
    pub fn link_p0(&self) -> LinkP0R {
        LinkP0R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Physical link on Port 1"]
    #[inline(always)]
    pub fn link_p1(&self) -> LinkP1R {
        LinkP1R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - Physical link on Port 2"]
    #[inline(always)]
    pub fn link_p2(&self) -> LinkP2R {
        LinkP2R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Physical link on Port 3"]
    #[inline(always)]
    pub fn link_p3(&self) -> LinkP3R {
        LinkP3R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - Loop Port 0"]
    #[inline(always)]
    pub fn lp0(&self) -> Lp0R {
        Lp0R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Communication on Port 0"]
    #[inline(always)]
    pub fn com_p0(&self) -> ComP0R {
        ComP0R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Loop Port 1"]
    #[inline(always)]
    pub fn lp1(&self) -> Lp1R {
        Lp1R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Communication on Port 1"]
    #[inline(always)]
    pub fn com_p1(&self) -> ComP1R {
        ComP1R::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 12 - Loop Port 2"]
    #[inline(always)]
    pub fn lp2(&self) -> Lp2R {
        Lp2R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - Communication on Port 2"]
    #[inline(always)]
    pub fn com_p2(&self) -> ComP2R {
        ComP2R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - Loop Port 3"]
    #[inline(always)]
    pub fn lp3(&self) -> Lp3R {
        Lp3R::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 15 - Communication on Port 3"]
    #[inline(always)]
    pub fn com_p3(&self) -> ComP3R {
        ComP3R::new(((self.bits >> 15) & 1) != 0)
    }
}
#[doc = "ESC DL Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`esc_dl_status::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct EscDlStatusSpec;
impl crate::RegisterSpec for EscDlStatusSpec {
    type Ux = u16;
}
#[doc = "`read()` method returns [`esc_dl_status::R`](R) reader structure"]
impl crate::Readable for EscDlStatusSpec {}
#[doc = "`reset()` method sets ESC_DL_STATUS to value 0x5000"]
impl crate::Resettable for EscDlStatusSpec {
    const RESET_VALUE: u16 = 0x5000;
}