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
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
#[doc = "Reader of register SW_PAD_CTL_PAD_GPIO_EMC_40"]
pub type R = crate::R<u32, super::SW_PAD_CTL_PAD_GPIO_EMC_40>;
#[doc = "Writer for register SW_PAD_CTL_PAD_GPIO_EMC_40"]
pub type W = crate::W<u32, super::SW_PAD_CTL_PAD_GPIO_EMC_40>;
#[doc = "Register SW_PAD_CTL_PAD_GPIO_EMC_40 `reset()`'s with value 0x10b0"]
impl crate::ResetValue for super::SW_PAD_CTL_PAD_GPIO_EMC_40 {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0x10b0
    }
}
#[doc = "Slew Rate Field\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SRE_A {
    #[doc = "0: Slow Slew Rate"]
    SRE_0_SLOW_SLEW_RATE = 0,
    #[doc = "1: Fast Slew Rate"]
    SRE_1_FAST_SLEW_RATE = 1,
}
impl From<SRE_A> for bool {
    #[inline(always)]
    fn from(variant: SRE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `SRE`"]
pub type SRE_R = crate::R<bool, SRE_A>;
impl SRE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SRE_A {
        match self.bits {
            false => SRE_A::SRE_0_SLOW_SLEW_RATE,
            true => SRE_A::SRE_1_FAST_SLEW_RATE,
        }
    }
    #[doc = "Checks if the value of the field is `SRE_0_SLOW_SLEW_RATE`"]
    #[inline(always)]
    pub fn is_sre_0_slow_slew_rate(&self) -> bool {
        *self == SRE_A::SRE_0_SLOW_SLEW_RATE
    }
    #[doc = "Checks if the value of the field is `SRE_1_FAST_SLEW_RATE`"]
    #[inline(always)]
    pub fn is_sre_1_fast_slew_rate(&self) -> bool {
        *self == SRE_A::SRE_1_FAST_SLEW_RATE
    }
}
#[doc = "Write proxy for field `SRE`"]
pub struct SRE_W<'a> {
    w: &'a mut W,
}
impl<'a> SRE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: SRE_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Slow Slew Rate"]
    #[inline(always)]
    pub fn sre_0_slow_slew_rate(self) -> &'a mut W {
        self.variant(SRE_A::SRE_0_SLOW_SLEW_RATE)
    }
    #[doc = "Fast Slew Rate"]
    #[inline(always)]
    pub fn sre_1_fast_slew_rate(self) -> &'a mut W {
        self.variant(SRE_A::SRE_1_FAST_SLEW_RATE)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
        self.w
    }
}
#[doc = "Drive Strength Field\n\nValue on reset: 6"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum DSE_A {
    #[doc = "0: output driver disabled;"]
    DSE_0_OUTPUT_DRIVER_DISABLED = 0,
    #[doc = "1: R0(150 Ohm @ 3.3V, 260 Ohm@1.8V)"]
    DSE_1_R0_150_OHM_3_3V_260_OHM_1_8V = 1,
    #[doc = "2: R0/2"]
    DSE_2_R0_2 = 2,
    #[doc = "3: R0/3"]
    DSE_3_R0_3 = 3,
    #[doc = "4: R0/4"]
    DSE_4_R0_4 = 4,
    #[doc = "5: R0/5"]
    DSE_5_R0_5 = 5,
    #[doc = "6: R0/6"]
    DSE_6_R0_6 = 6,
    #[doc = "7: R0/7"]
    DSE_7_R0_7 = 7,
}
impl From<DSE_A> for u8 {
    #[inline(always)]
    fn from(variant: DSE_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `DSE`"]
pub type DSE_R = crate::R<u8, DSE_A>;
impl DSE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DSE_A {
        match self.bits {
            0 => DSE_A::DSE_0_OUTPUT_DRIVER_DISABLED,
            1 => DSE_A::DSE_1_R0_150_OHM_3_3V_260_OHM_1_8V,
            2 => DSE_A::DSE_2_R0_2,
            3 => DSE_A::DSE_3_R0_3,
            4 => DSE_A::DSE_4_R0_4,
            5 => DSE_A::DSE_5_R0_5,
            6 => DSE_A::DSE_6_R0_6,
            7 => DSE_A::DSE_7_R0_7,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DSE_0_OUTPUT_DRIVER_DISABLED`"]
    #[inline(always)]
    pub fn is_dse_0_output_driver_disabled(&self) -> bool {
        *self == DSE_A::DSE_0_OUTPUT_DRIVER_DISABLED
    }
    #[doc = "Checks if the value of the field is `DSE_1_R0_150_OHM_3_3V_260_OHM_1_8V`"]
    #[inline(always)]
    pub fn is_dse_1_r0_150_ohm_3_3v_260_ohm_1_8v(&self) -> bool {
        *self == DSE_A::DSE_1_R0_150_OHM_3_3V_260_OHM_1_8V
    }
    #[doc = "Checks if the value of the field is `DSE_2_R0_2`"]
    #[inline(always)]
    pub fn is_dse_2_r0_2(&self) -> bool {
        *self == DSE_A::DSE_2_R0_2
    }
    #[doc = "Checks if the value of the field is `DSE_3_R0_3`"]
    #[inline(always)]
    pub fn is_dse_3_r0_3(&self) -> bool {
        *self == DSE_A::DSE_3_R0_3
    }
    #[doc = "Checks if the value of the field is `DSE_4_R0_4`"]
    #[inline(always)]
    pub fn is_dse_4_r0_4(&self) -> bool {
        *self == DSE_A::DSE_4_R0_4
    }
    #[doc = "Checks if the value of the field is `DSE_5_R0_5`"]
    #[inline(always)]
    pub fn is_dse_5_r0_5(&self) -> bool {
        *self == DSE_A::DSE_5_R0_5
    }
    #[doc = "Checks if the value of the field is `DSE_6_R0_6`"]
    #[inline(always)]
    pub fn is_dse_6_r0_6(&self) -> bool {
        *self == DSE_A::DSE_6_R0_6
    }
    #[doc = "Checks if the value of the field is `DSE_7_R0_7`"]
    #[inline(always)]
    pub fn is_dse_7_r0_7(&self) -> bool {
        *self == DSE_A::DSE_7_R0_7
    }
}
#[doc = "Write proxy for field `DSE`"]
pub struct DSE_W<'a> {
    w: &'a mut W,
}
impl<'a> DSE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DSE_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "output driver disabled;"]
    #[inline(always)]
    pub fn dse_0_output_driver_disabled(self) -> &'a mut W {
        self.variant(DSE_A::DSE_0_OUTPUT_DRIVER_DISABLED)
    }
    #[doc = "R0(150 Ohm @ 3.3V, 260 Ohm@1.8V)"]
    #[inline(always)]
    pub fn dse_1_r0_150_ohm_3_3v_260_ohm_1_8v(self) -> &'a mut W {
        self.variant(DSE_A::DSE_1_R0_150_OHM_3_3V_260_OHM_1_8V)
    }
    #[doc = "R0/2"]
    #[inline(always)]
    pub fn dse_2_r0_2(self) -> &'a mut W {
        self.variant(DSE_A::DSE_2_R0_2)
    }
    #[doc = "R0/3"]
    #[inline(always)]
    pub fn dse_3_r0_3(self) -> &'a mut W {
        self.variant(DSE_A::DSE_3_R0_3)
    }
    #[doc = "R0/4"]
    #[inline(always)]
    pub fn dse_4_r0_4(self) -> &'a mut W {
        self.variant(DSE_A::DSE_4_R0_4)
    }
    #[doc = "R0/5"]
    #[inline(always)]
    pub fn dse_5_r0_5(self) -> &'a mut W {
        self.variant(DSE_A::DSE_5_R0_5)
    }
    #[doc = "R0/6"]
    #[inline(always)]
    pub fn dse_6_r0_6(self) -> &'a mut W {
        self.variant(DSE_A::DSE_6_R0_6)
    }
    #[doc = "R0/7"]
    #[inline(always)]
    pub fn dse_7_r0_7(self) -> &'a mut W {
        self.variant(DSE_A::DSE_7_R0_7)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 3)) | (((value as u32) & 0x07) << 3);
        self.w
    }
}
#[doc = "Speed Field\n\nValue on reset: 2"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum SPEED_A {
    #[doc = "0: low(50MHz)"]
    SPEED_0_LOW_50MHZ = 0,
    #[doc = "1: medium(100MHz)"]
    SPEED_1_MEDIUM_100MHZ = 1,
    #[doc = "2: medium(100MHz)"]
    SPEED_2_MEDIUM_100MHZ = 2,
    #[doc = "3: max(200MHz)"]
    SPEED_3_MAX_200MHZ = 3,
}
impl From<SPEED_A> for u8 {
    #[inline(always)]
    fn from(variant: SPEED_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `SPEED`"]
pub type SPEED_R = crate::R<u8, SPEED_A>;
impl SPEED_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SPEED_A {
        match self.bits {
            0 => SPEED_A::SPEED_0_LOW_50MHZ,
            1 => SPEED_A::SPEED_1_MEDIUM_100MHZ,
            2 => SPEED_A::SPEED_2_MEDIUM_100MHZ,
            3 => SPEED_A::SPEED_3_MAX_200MHZ,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `SPEED_0_LOW_50MHZ`"]
    #[inline(always)]
    pub fn is_speed_0_low_50mhz(&self) -> bool {
        *self == SPEED_A::SPEED_0_LOW_50MHZ
    }
    #[doc = "Checks if the value of the field is `SPEED_1_MEDIUM_100MHZ`"]
    #[inline(always)]
    pub fn is_speed_1_medium_100mhz(&self) -> bool {
        *self == SPEED_A::SPEED_1_MEDIUM_100MHZ
    }
    #[doc = "Checks if the value of the field is `SPEED_2_MEDIUM_100MHZ`"]
    #[inline(always)]
    pub fn is_speed_2_medium_100mhz(&self) -> bool {
        *self == SPEED_A::SPEED_2_MEDIUM_100MHZ
    }
    #[doc = "Checks if the value of the field is `SPEED_3_MAX_200MHZ`"]
    #[inline(always)]
    pub fn is_speed_3_max_200mhz(&self) -> bool {
        *self == SPEED_A::SPEED_3_MAX_200MHZ
    }
}
#[doc = "Write proxy for field `SPEED`"]
pub struct SPEED_W<'a> {
    w: &'a mut W,
}
impl<'a> SPEED_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: SPEED_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "low(50MHz)"]
    #[inline(always)]
    pub fn speed_0_low_50mhz(self) -> &'a mut W {
        self.variant(SPEED_A::SPEED_0_LOW_50MHZ)
    }
    #[doc = "medium(100MHz)"]
    #[inline(always)]
    pub fn speed_1_medium_100mhz(self) -> &'a mut W {
        self.variant(SPEED_A::SPEED_1_MEDIUM_100MHZ)
    }
    #[doc = "medium(100MHz)"]
    #[inline(always)]
    pub fn speed_2_medium_100mhz(self) -> &'a mut W {
        self.variant(SPEED_A::SPEED_2_MEDIUM_100MHZ)
    }
    #[doc = "max(200MHz)"]
    #[inline(always)]
    pub fn speed_3_max_200mhz(self) -> &'a mut W {
        self.variant(SPEED_A::SPEED_3_MAX_200MHZ)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6);
        self.w
    }
}
#[doc = "Open Drain Enable Field\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ODE_A {
    #[doc = "0: Open Drain Disabled"]
    ODE_0_OPEN_DRAIN_DISABLED = 0,
    #[doc = "1: Open Drain Enabled"]
    ODE_1_OPEN_DRAIN_ENABLED = 1,
}
impl From<ODE_A> for bool {
    #[inline(always)]
    fn from(variant: ODE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `ODE`"]
pub type ODE_R = crate::R<bool, ODE_A>;
impl ODE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> ODE_A {
        match self.bits {
            false => ODE_A::ODE_0_OPEN_DRAIN_DISABLED,
            true => ODE_A::ODE_1_OPEN_DRAIN_ENABLED,
        }
    }
    #[doc = "Checks if the value of the field is `ODE_0_OPEN_DRAIN_DISABLED`"]
    #[inline(always)]
    pub fn is_ode_0_open_drain_disabled(&self) -> bool {
        *self == ODE_A::ODE_0_OPEN_DRAIN_DISABLED
    }
    #[doc = "Checks if the value of the field is `ODE_1_OPEN_DRAIN_ENABLED`"]
    #[inline(always)]
    pub fn is_ode_1_open_drain_enabled(&self) -> bool {
        *self == ODE_A::ODE_1_OPEN_DRAIN_ENABLED
    }
}
#[doc = "Write proxy for field `ODE`"]
pub struct ODE_W<'a> {
    w: &'a mut W,
}
impl<'a> ODE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: ODE_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Open Drain Disabled"]
    #[inline(always)]
    pub fn ode_0_open_drain_disabled(self) -> &'a mut W {
        self.variant(ODE_A::ODE_0_OPEN_DRAIN_DISABLED)
    }
    #[doc = "Open Drain Enabled"]
    #[inline(always)]
    pub fn ode_1_open_drain_enabled(self) -> &'a mut W {
        self.variant(ODE_A::ODE_1_OPEN_DRAIN_ENABLED)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
        self.w
    }
}
#[doc = "Pull / Keep Enable Field\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PKE_A {
    #[doc = "0: Pull/Keeper Disabled"]
    PKE_0_PULL_KEEPER_DISABLED = 0,
    #[doc = "1: Pull/Keeper Enabled"]
    PKE_1_PULL_KEEPER_ENABLED = 1,
}
impl From<PKE_A> for bool {
    #[inline(always)]
    fn from(variant: PKE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `PKE`"]
pub type PKE_R = crate::R<bool, PKE_A>;
impl PKE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PKE_A {
        match self.bits {
            false => PKE_A::PKE_0_PULL_KEEPER_DISABLED,
            true => PKE_A::PKE_1_PULL_KEEPER_ENABLED,
        }
    }
    #[doc = "Checks if the value of the field is `PKE_0_PULL_KEEPER_DISABLED`"]
    #[inline(always)]
    pub fn is_pke_0_pull_keeper_disabled(&self) -> bool {
        *self == PKE_A::PKE_0_PULL_KEEPER_DISABLED
    }
    #[doc = "Checks if the value of the field is `PKE_1_PULL_KEEPER_ENABLED`"]
    #[inline(always)]
    pub fn is_pke_1_pull_keeper_enabled(&self) -> bool {
        *self == PKE_A::PKE_1_PULL_KEEPER_ENABLED
    }
}
#[doc = "Write proxy for field `PKE`"]
pub struct PKE_W<'a> {
    w: &'a mut W,
}
impl<'a> PKE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: PKE_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Pull/Keeper Disabled"]
    #[inline(always)]
    pub fn pke_0_pull_keeper_disabled(self) -> &'a mut W {
        self.variant(PKE_A::PKE_0_PULL_KEEPER_DISABLED)
    }
    #[doc = "Pull/Keeper Enabled"]
    #[inline(always)]
    pub fn pke_1_pull_keeper_enabled(self) -> &'a mut W {
        self.variant(PKE_A::PKE_1_PULL_KEEPER_ENABLED)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
        self.w
    }
}
#[doc = "Pull / Keep Select Field\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PUE_A {
    #[doc = "0: Keeper"]
    PUE_0_KEEPER = 0,
    #[doc = "1: Pull"]
    PUE_1_PULL = 1,
}
impl From<PUE_A> for bool {
    #[inline(always)]
    fn from(variant: PUE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `PUE`"]
pub type PUE_R = crate::R<bool, PUE_A>;
impl PUE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PUE_A {
        match self.bits {
            false => PUE_A::PUE_0_KEEPER,
            true => PUE_A::PUE_1_PULL,
        }
    }
    #[doc = "Checks if the value of the field is `PUE_0_KEEPER`"]
    #[inline(always)]
    pub fn is_pue_0_keeper(&self) -> bool {
        *self == PUE_A::PUE_0_KEEPER
    }
    #[doc = "Checks if the value of the field is `PUE_1_PULL`"]
    #[inline(always)]
    pub fn is_pue_1_pull(&self) -> bool {
        *self == PUE_A::PUE_1_PULL
    }
}
#[doc = "Write proxy for field `PUE`"]
pub struct PUE_W<'a> {
    w: &'a mut W,
}
impl<'a> PUE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: PUE_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Keeper"]
    #[inline(always)]
    pub fn pue_0_keeper(self) -> &'a mut W {
        self.variant(PUE_A::PUE_0_KEEPER)
    }
    #[doc = "Pull"]
    #[inline(always)]
    pub fn pue_1_pull(self) -> &'a mut W {
        self.variant(PUE_A::PUE_1_PULL)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13);
        self.w
    }
}
#[doc = "Pull Up / Down Config. Field\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum PUS_A {
    #[doc = "0: 100K Ohm Pull Down"]
    PUS_0_100K_OHM_PULL_DOWN = 0,
    #[doc = "1: 47K Ohm Pull Up"]
    PUS_1_47K_OHM_PULL_UP = 1,
    #[doc = "2: 100K Ohm Pull Up"]
    PUS_2_100K_OHM_PULL_UP = 2,
    #[doc = "3: 22K Ohm Pull Up"]
    PUS_3_22K_OHM_PULL_UP = 3,
}
impl From<PUS_A> for u8 {
    #[inline(always)]
    fn from(variant: PUS_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `PUS`"]
pub type PUS_R = crate::R<u8, PUS_A>;
impl PUS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PUS_A {
        match self.bits {
            0 => PUS_A::PUS_0_100K_OHM_PULL_DOWN,
            1 => PUS_A::PUS_1_47K_OHM_PULL_UP,
            2 => PUS_A::PUS_2_100K_OHM_PULL_UP,
            3 => PUS_A::PUS_3_22K_OHM_PULL_UP,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `PUS_0_100K_OHM_PULL_DOWN`"]
    #[inline(always)]
    pub fn is_pus_0_100k_ohm_pull_down(&self) -> bool {
        *self == PUS_A::PUS_0_100K_OHM_PULL_DOWN
    }
    #[doc = "Checks if the value of the field is `PUS_1_47K_OHM_PULL_UP`"]
    #[inline(always)]
    pub fn is_pus_1_47k_ohm_pull_up(&self) -> bool {
        *self == PUS_A::PUS_1_47K_OHM_PULL_UP
    }
    #[doc = "Checks if the value of the field is `PUS_2_100K_OHM_PULL_UP`"]
    #[inline(always)]
    pub fn is_pus_2_100k_ohm_pull_up(&self) -> bool {
        *self == PUS_A::PUS_2_100K_OHM_PULL_UP
    }
    #[doc = "Checks if the value of the field is `PUS_3_22K_OHM_PULL_UP`"]
    #[inline(always)]
    pub fn is_pus_3_22k_ohm_pull_up(&self) -> bool {
        *self == PUS_A::PUS_3_22K_OHM_PULL_UP
    }
}
#[doc = "Write proxy for field `PUS`"]
pub struct PUS_W<'a> {
    w: &'a mut W,
}
impl<'a> PUS_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: PUS_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "100K Ohm Pull Down"]
    #[inline(always)]
    pub fn pus_0_100k_ohm_pull_down(self) -> &'a mut W {
        self.variant(PUS_A::PUS_0_100K_OHM_PULL_DOWN)
    }
    #[doc = "47K Ohm Pull Up"]
    #[inline(always)]
    pub fn pus_1_47k_ohm_pull_up(self) -> &'a mut W {
        self.variant(PUS_A::PUS_1_47K_OHM_PULL_UP)
    }
    #[doc = "100K Ohm Pull Up"]
    #[inline(always)]
    pub fn pus_2_100k_ohm_pull_up(self) -> &'a mut W {
        self.variant(PUS_A::PUS_2_100K_OHM_PULL_UP)
    }
    #[doc = "22K Ohm Pull Up"]
    #[inline(always)]
    pub fn pus_3_22k_ohm_pull_up(self) -> &'a mut W {
        self.variant(PUS_A::PUS_3_22K_OHM_PULL_UP)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14);
        self.w
    }
}
#[doc = "Hyst. Enable Field\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum HYS_A {
    #[doc = "0: Hysteresis Disabled"]
    HYS_0_HYSTERESIS_DISABLED = 0,
    #[doc = "1: Hysteresis Enabled"]
    HYS_1_HYSTERESIS_ENABLED = 1,
}
impl From<HYS_A> for bool {
    #[inline(always)]
    fn from(variant: HYS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `HYS`"]
pub type HYS_R = crate::R<bool, HYS_A>;
impl HYS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HYS_A {
        match self.bits {
            false => HYS_A::HYS_0_HYSTERESIS_DISABLED,
            true => HYS_A::HYS_1_HYSTERESIS_ENABLED,
        }
    }
    #[doc = "Checks if the value of the field is `HYS_0_HYSTERESIS_DISABLED`"]
    #[inline(always)]
    pub fn is_hys_0_hysteresis_disabled(&self) -> bool {
        *self == HYS_A::HYS_0_HYSTERESIS_DISABLED
    }
    #[doc = "Checks if the value of the field is `HYS_1_HYSTERESIS_ENABLED`"]
    #[inline(always)]
    pub fn is_hys_1_hysteresis_enabled(&self) -> bool {
        *self == HYS_A::HYS_1_HYSTERESIS_ENABLED
    }
}
#[doc = "Write proxy for field `HYS`"]
pub struct HYS_W<'a> {
    w: &'a mut W,
}
impl<'a> HYS_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: HYS_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Hysteresis Disabled"]
    #[inline(always)]
    pub fn hys_0_hysteresis_disabled(self) -> &'a mut W {
        self.variant(HYS_A::HYS_0_HYSTERESIS_DISABLED)
    }
    #[doc = "Hysteresis Enabled"]
    #[inline(always)]
    pub fn hys_1_hysteresis_enabled(self) -> &'a mut W {
        self.variant(HYS_A::HYS_1_HYSTERESIS_ENABLED)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
        self.w
    }
}
impl R {
    #[doc = "Bit 0 - Slew Rate Field"]
    #[inline(always)]
    pub fn sre(&self) -> SRE_R {
        SRE_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bits 3:5 - Drive Strength Field"]
    #[inline(always)]
    pub fn dse(&self) -> DSE_R {
        DSE_R::new(((self.bits >> 3) & 0x07) as u8)
    }
    #[doc = "Bits 6:7 - Speed Field"]
    #[inline(always)]
    pub fn speed(&self) -> SPEED_R {
        SPEED_R::new(((self.bits >> 6) & 0x03) as u8)
    }
    #[doc = "Bit 11 - Open Drain Enable Field"]
    #[inline(always)]
    pub fn ode(&self) -> ODE_R {
        ODE_R::new(((self.bits >> 11) & 0x01) != 0)
    }
    #[doc = "Bit 12 - Pull / Keep Enable Field"]
    #[inline(always)]
    pub fn pke(&self) -> PKE_R {
        PKE_R::new(((self.bits >> 12) & 0x01) != 0)
    }
    #[doc = "Bit 13 - Pull / Keep Select Field"]
    #[inline(always)]
    pub fn pue(&self) -> PUE_R {
        PUE_R::new(((self.bits >> 13) & 0x01) != 0)
    }
    #[doc = "Bits 14:15 - Pull Up / Down Config. Field"]
    #[inline(always)]
    pub fn pus(&self) -> PUS_R {
        PUS_R::new(((self.bits >> 14) & 0x03) as u8)
    }
    #[doc = "Bit 16 - Hyst. Enable Field"]
    #[inline(always)]
    pub fn hys(&self) -> HYS_R {
        HYS_R::new(((self.bits >> 16) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Slew Rate Field"]
    #[inline(always)]
    pub fn sre(&mut self) -> SRE_W {
        SRE_W { w: self }
    }
    #[doc = "Bits 3:5 - Drive Strength Field"]
    #[inline(always)]
    pub fn dse(&mut self) -> DSE_W {
        DSE_W { w: self }
    }
    #[doc = "Bits 6:7 - Speed Field"]
    #[inline(always)]
    pub fn speed(&mut self) -> SPEED_W {
        SPEED_W { w: self }
    }
    #[doc = "Bit 11 - Open Drain Enable Field"]
    #[inline(always)]
    pub fn ode(&mut self) -> ODE_W {
        ODE_W { w: self }
    }
    #[doc = "Bit 12 - Pull / Keep Enable Field"]
    #[inline(always)]
    pub fn pke(&mut self) -> PKE_W {
        PKE_W { w: self }
    }
    #[doc = "Bit 13 - Pull / Keep Select Field"]
    #[inline(always)]
    pub fn pue(&mut self) -> PUE_W {
        PUE_W { w: self }
    }
    #[doc = "Bits 14:15 - Pull Up / Down Config. Field"]
    #[inline(always)]
    pub fn pus(&mut self) -> PUS_W {
        PUS_W { w: self }
    }
    #[doc = "Bit 16 - Hyst. Enable Field"]
    #[inline(always)]
    pub fn hys(&mut self) -> HYS_W {
        HYS_W { w: self }
    }
}