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
#[doc = "Reader of register ANACTRL"]
pub type R = crate::R<u32, super::ANACTRL>;
#[doc = "Writer for register ANACTRL"]
pub type W = crate::W<u32, super::ANACTRL>;
#[doc = "Register ANACTRL `reset()`'s with value 0x0402"]
impl crate::ResetValue for super::ANACTRL {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0x0402
    }
}
#[doc = "Reader of field `TESTCLK_SEL`"]
pub type TESTCLK_SEL_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TESTCLK_SEL`"]
pub struct TESTCLK_SEL_W<'a> {
    w: &'a mut W,
}
impl<'a> TESTCLK_SEL_W<'a> {
    #[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 = "This bit field controls clock gating (disabling) for the PFD pfd_clk output for power savings when the PFD is not used\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PFD_CLKGATE_A {
    #[doc = "0: PFD clock output is enabled"]
    _0,
    #[doc = "1: PFD clock output is gated (Default)"]
    _1,
}
impl From<PFD_CLKGATE_A> for bool {
    #[inline(always)]
    fn from(variant: PFD_CLKGATE_A) -> Self {
        match variant {
            PFD_CLKGATE_A::_0 => false,
            PFD_CLKGATE_A::_1 => true,
        }
    }
}
#[doc = "Reader of field `PFD_CLKGATE`"]
pub type PFD_CLKGATE_R = crate::R<bool, PFD_CLKGATE_A>;
impl PFD_CLKGATE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PFD_CLKGATE_A {
        match self.bits {
            false => PFD_CLKGATE_A::_0,
            true => PFD_CLKGATE_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == PFD_CLKGATE_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == PFD_CLKGATE_A::_1
    }
}
#[doc = "Write proxy for field `PFD_CLKGATE`"]
pub struct PFD_CLKGATE_W<'a> {
    w: &'a mut W,
}
impl<'a> PFD_CLKGATE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: PFD_CLKGATE_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "PFD clock output is enabled"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(PFD_CLKGATE_A::_0)
    }
    #[doc = "PFD clock output is gated (Default)"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(PFD_CLKGATE_A::_1)
    }
    #[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 << 1)) | (((value as u32) & 0x01) << 1);
        self.w
    }
}
#[doc = "This bit field for the PFD selects the frequency relationship between the local pfd_clk output and the exported USB1PFDCLK\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PFD_CLK_SEL_A {
    #[doc = "0: USB1PFDCLK is the same frequency as the xtal clock (Default)"]
    _00,
    #[doc = "1: USB1PFDCLK frequency is pfd_clk divided by 4"]
    _01,
    #[doc = "2: USB1PFDCLK frequency is pfd_clk divided by 2"]
    _10,
    #[doc = "3: USB1PFDCLK frequency is the same as pfd_clk frequency"]
    _11,
}
impl From<PFD_CLK_SEL_A> for u8 {
    #[inline(always)]
    fn from(variant: PFD_CLK_SEL_A) -> Self {
        match variant {
            PFD_CLK_SEL_A::_00 => 0,
            PFD_CLK_SEL_A::_01 => 1,
            PFD_CLK_SEL_A::_10 => 2,
            PFD_CLK_SEL_A::_11 => 3,
        }
    }
}
#[doc = "Reader of field `PFD_CLK_SEL`"]
pub type PFD_CLK_SEL_R = crate::R<u8, PFD_CLK_SEL_A>;
impl PFD_CLK_SEL_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PFD_CLK_SEL_A {
        match self.bits {
            0 => PFD_CLK_SEL_A::_00,
            1 => PFD_CLK_SEL_A::_01,
            2 => PFD_CLK_SEL_A::_10,
            3 => PFD_CLK_SEL_A::_11,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_00`"]
    #[inline(always)]
    pub fn is_00(&self) -> bool {
        *self == PFD_CLK_SEL_A::_00
    }
    #[doc = "Checks if the value of the field is `_01`"]
    #[inline(always)]
    pub fn is_01(&self) -> bool {
        *self == PFD_CLK_SEL_A::_01
    }
    #[doc = "Checks if the value of the field is `_10`"]
    #[inline(always)]
    pub fn is_10(&self) -> bool {
        *self == PFD_CLK_SEL_A::_10
    }
    #[doc = "Checks if the value of the field is `_11`"]
    #[inline(always)]
    pub fn is_11(&self) -> bool {
        *self == PFD_CLK_SEL_A::_11
    }
}
#[doc = "Write proxy for field `PFD_CLK_SEL`"]
pub struct PFD_CLK_SEL_W<'a> {
    w: &'a mut W,
}
impl<'a> PFD_CLK_SEL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: PFD_CLK_SEL_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "USB1PFDCLK is the same frequency as the xtal clock (Default)"]
    #[inline(always)]
    pub fn _00(self) -> &'a mut W {
        self.variant(PFD_CLK_SEL_A::_00)
    }
    #[doc = "USB1PFDCLK frequency is pfd_clk divided by 4"]
    #[inline(always)]
    pub fn _01(self) -> &'a mut W {
        self.variant(PFD_CLK_SEL_A::_01)
    }
    #[doc = "USB1PFDCLK frequency is pfd_clk divided by 2"]
    #[inline(always)]
    pub fn _10(self) -> &'a mut W {
        self.variant(PFD_CLK_SEL_A::_10)
    }
    #[doc = "USB1PFDCLK frequency is the same as pfd_clk frequency"]
    #[inline(always)]
    pub fn _11(self) -> &'a mut W {
        self.variant(PFD_CLK_SEL_A::_11)
    }
    #[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 << 2)) | (((value as u32) & 0x03) << 2);
        self.w
    }
}
#[doc = "Reader of field `PFD_FRAC`"]
pub type PFD_FRAC_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `PFD_FRAC`"]
pub struct PFD_FRAC_W<'a> {
    w: &'a mut W,
}
impl<'a> PFD_FRAC_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x3f << 4)) | (((value as u32) & 0x3f) << 4);
        self.w
    }
}
#[doc = "Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DEV_PULLDOWN_A {
    #[doc = "0: The 15kohm nominal pulldowns on the USB_DP and USB_DM pinsare disabled in device mode."]
    _0,
    #[doc = "1: The 15kohm nominal pulldowns on the USB_DP and USB_DM pinsare enabled in device mode."]
    _1,
}
impl From<DEV_PULLDOWN_A> for bool {
    #[inline(always)]
    fn from(variant: DEV_PULLDOWN_A) -> Self {
        match variant {
            DEV_PULLDOWN_A::_0 => false,
            DEV_PULLDOWN_A::_1 => true,
        }
    }
}
#[doc = "Reader of field `DEV_PULLDOWN`"]
pub type DEV_PULLDOWN_R = crate::R<bool, DEV_PULLDOWN_A>;
impl DEV_PULLDOWN_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DEV_PULLDOWN_A {
        match self.bits {
            false => DEV_PULLDOWN_A::_0,
            true => DEV_PULLDOWN_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == DEV_PULLDOWN_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == DEV_PULLDOWN_A::_1
    }
}
#[doc = "Write proxy for field `DEV_PULLDOWN`"]
pub struct DEV_PULLDOWN_W<'a> {
    w: &'a mut W,
}
impl<'a> DEV_PULLDOWN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DEV_PULLDOWN_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "The 15kohm nominal pulldowns on the USB_DP and USB_DM pinsare disabled in device mode."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(DEV_PULLDOWN_A::_0)
    }
    #[doc = "The 15kohm nominal pulldowns on the USB_DP and USB_DM pinsare enabled in device mode."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(DEV_PULLDOWN_A::_1)
    }
    #[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 << 10)) | (((value as u32) & 0x01) << 10);
        self.w
    }
}
#[doc = "Controls pre-emphasis time duration for the High Speed TX drivers after each data transition when the USBPHY_ANACTRL\\[EMPH_EN\\] bit is set high to 1'b1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EMPH_PULSE_CTRL_A {
    #[doc = "0: Minimum duration of pre-emphasis current after each data transition"]
    _00,
    #[doc = "3: Maximum duration of pre-emphasis current after each data transition"]
    _11,
}
impl From<EMPH_PULSE_CTRL_A> for u8 {
    #[inline(always)]
    fn from(variant: EMPH_PULSE_CTRL_A) -> Self {
        match variant {
            EMPH_PULSE_CTRL_A::_00 => 0,
            EMPH_PULSE_CTRL_A::_11 => 3,
        }
    }
}
#[doc = "Reader of field `EMPH_PULSE_CTRL`"]
pub type EMPH_PULSE_CTRL_R = crate::R<u8, EMPH_PULSE_CTRL_A>;
impl EMPH_PULSE_CTRL_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, EMPH_PULSE_CTRL_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(EMPH_PULSE_CTRL_A::_00),
            3 => Val(EMPH_PULSE_CTRL_A::_11),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `_00`"]
    #[inline(always)]
    pub fn is_00(&self) -> bool {
        *self == EMPH_PULSE_CTRL_A::_00
    }
    #[doc = "Checks if the value of the field is `_11`"]
    #[inline(always)]
    pub fn is_11(&self) -> bool {
        *self == EMPH_PULSE_CTRL_A::_11
    }
}
#[doc = "Write proxy for field `EMPH_PULSE_CTRL`"]
pub struct EMPH_PULSE_CTRL_W<'a> {
    w: &'a mut W,
}
impl<'a> EMPH_PULSE_CTRL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: EMPH_PULSE_CTRL_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "Minimum duration of pre-emphasis current after each data transition"]
    #[inline(always)]
    pub fn _00(self) -> &'a mut W {
        self.variant(EMPH_PULSE_CTRL_A::_00)
    }
    #[doc = "Maximum duration of pre-emphasis current after each data transition"]
    #[inline(always)]
    pub fn _11(self) -> &'a mut W {
        self.variant(EMPH_PULSE_CTRL_A::_11)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 11)) | (((value as u32) & 0x03) << 11);
        self.w
    }
}
#[doc = "Enables pre-emphasis for the High-Speed TX drivers\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EMPH_EN_A {
    #[doc = "0: No pre-emphasis is used on HS TX output drivers"]
    _0,
    #[doc = "1: Enables pre-emphasis for HS TX output drivers"]
    _1,
}
impl From<EMPH_EN_A> for bool {
    #[inline(always)]
    fn from(variant: EMPH_EN_A) -> Self {
        match variant {
            EMPH_EN_A::_0 => false,
            EMPH_EN_A::_1 => true,
        }
    }
}
#[doc = "Reader of field `EMPH_EN`"]
pub type EMPH_EN_R = crate::R<bool, EMPH_EN_A>;
impl EMPH_EN_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> EMPH_EN_A {
        match self.bits {
            false => EMPH_EN_A::_0,
            true => EMPH_EN_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == EMPH_EN_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == EMPH_EN_A::_1
    }
}
#[doc = "Write proxy for field `EMPH_EN`"]
pub struct EMPH_EN_W<'a> {
    w: &'a mut W,
}
impl<'a> EMPH_EN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: EMPH_EN_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "No pre-emphasis is used on HS TX output drivers"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(EMPH_EN_A::_0)
    }
    #[doc = "Enables pre-emphasis for HS TX output drivers"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(EMPH_EN_A::_1)
    }
    #[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 = "Controls the amount of pre-emphasis current added for the High-Speed TX drivers after each data transition when the USBPHY_ANACTRL\\[EMPH_EN\\] bit is set high to 1'b1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EMPH_CUR_CTRL_A {
    #[doc = "0: No pre-emphasis current is enabled for the HS TX drivers"]
    _00,
    #[doc = "1: One unit of pre-emphasis current is enabled for the HS TX drivers"]
    _01,
    #[doc = "2: Two units of pre-emphasis current are enabled for the HS TX drivers"]
    _10,
    #[doc = "3: Three units of pre-emphasis current are enabled for the HS TX drivers"]
    _11,
}
impl From<EMPH_CUR_CTRL_A> for u8 {
    #[inline(always)]
    fn from(variant: EMPH_CUR_CTRL_A) -> Self {
        match variant {
            EMPH_CUR_CTRL_A::_00 => 0,
            EMPH_CUR_CTRL_A::_01 => 1,
            EMPH_CUR_CTRL_A::_10 => 2,
            EMPH_CUR_CTRL_A::_11 => 3,
        }
    }
}
#[doc = "Reader of field `EMPH_CUR_CTRL`"]
pub type EMPH_CUR_CTRL_R = crate::R<u8, EMPH_CUR_CTRL_A>;
impl EMPH_CUR_CTRL_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> EMPH_CUR_CTRL_A {
        match self.bits {
            0 => EMPH_CUR_CTRL_A::_00,
            1 => EMPH_CUR_CTRL_A::_01,
            2 => EMPH_CUR_CTRL_A::_10,
            3 => EMPH_CUR_CTRL_A::_11,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_00`"]
    #[inline(always)]
    pub fn is_00(&self) -> bool {
        *self == EMPH_CUR_CTRL_A::_00
    }
    #[doc = "Checks if the value of the field is `_01`"]
    #[inline(always)]
    pub fn is_01(&self) -> bool {
        *self == EMPH_CUR_CTRL_A::_01
    }
    #[doc = "Checks if the value of the field is `_10`"]
    #[inline(always)]
    pub fn is_10(&self) -> bool {
        *self == EMPH_CUR_CTRL_A::_10
    }
    #[doc = "Checks if the value of the field is `_11`"]
    #[inline(always)]
    pub fn is_11(&self) -> bool {
        *self == EMPH_CUR_CTRL_A::_11
    }
}
#[doc = "Write proxy for field `EMPH_CUR_CTRL`"]
pub struct EMPH_CUR_CTRL_W<'a> {
    w: &'a mut W,
}
impl<'a> EMPH_CUR_CTRL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: EMPH_CUR_CTRL_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "No pre-emphasis current is enabled for the HS TX drivers"]
    #[inline(always)]
    pub fn _00(self) -> &'a mut W {
        self.variant(EMPH_CUR_CTRL_A::_00)
    }
    #[doc = "One unit of pre-emphasis current is enabled for the HS TX drivers"]
    #[inline(always)]
    pub fn _01(self) -> &'a mut W {
        self.variant(EMPH_CUR_CTRL_A::_01)
    }
    #[doc = "Two units of pre-emphasis current are enabled for the HS TX drivers"]
    #[inline(always)]
    pub fn _10(self) -> &'a mut W {
        self.variant(EMPH_CUR_CTRL_A::_10)
    }
    #[doc = "Three units of pre-emphasis current are enabled for the HS TX drivers"]
    #[inline(always)]
    pub fn _11(self) -> &'a mut W {
        self.variant(EMPH_CUR_CTRL_A::_11)
    }
    #[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 = "Reader of field `PFD_STABLE`"]
pub type PFD_STABLE_R = crate::R<bool, bool>;
impl R {
    #[doc = "Bit 0 - Test clock selection to analog test"]
    #[inline(always)]
    pub fn testclk_sel(&self) -> TESTCLK_SEL_R {
        TESTCLK_SEL_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bit 1 - This bit field controls clock gating (disabling) for the PFD pfd_clk output for power savings when the PFD is not used"]
    #[inline(always)]
    pub fn pfd_clkgate(&self) -> PFD_CLKGATE_R {
        PFD_CLKGATE_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bits 2:3 - This bit field for the PFD selects the frequency relationship between the local pfd_clk output and the exported USB1PFDCLK"]
    #[inline(always)]
    pub fn pfd_clk_sel(&self) -> PFD_CLK_SEL_R {
        PFD_CLK_SEL_R::new(((self.bits >> 2) & 0x03) as u8)
    }
    #[doc = "Bits 4:9 - PFD fractional divider setting used to select the pfd_clk output frequency"]
    #[inline(always)]
    pub fn pfd_frac(&self) -> PFD_FRAC_R {
        PFD_FRAC_R::new(((self.bits >> 4) & 0x3f) as u8)
    }
    #[doc = "Bit 10 - Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins"]
    #[inline(always)]
    pub fn dev_pulldown(&self) -> DEV_PULLDOWN_R {
        DEV_PULLDOWN_R::new(((self.bits >> 10) & 0x01) != 0)
    }
    #[doc = "Bits 11:12 - Controls pre-emphasis time duration for the High Speed TX drivers after each data transition when the USBPHY_ANACTRL\\[EMPH_EN\\] bit is set high to 1'b1"]
    #[inline(always)]
    pub fn emph_pulse_ctrl(&self) -> EMPH_PULSE_CTRL_R {
        EMPH_PULSE_CTRL_R::new(((self.bits >> 11) & 0x03) as u8)
    }
    #[doc = "Bit 13 - Enables pre-emphasis for the High-Speed TX drivers"]
    #[inline(always)]
    pub fn emph_en(&self) -> EMPH_EN_R {
        EMPH_EN_R::new(((self.bits >> 13) & 0x01) != 0)
    }
    #[doc = "Bits 14:15 - Controls the amount of pre-emphasis current added for the High-Speed TX drivers after each data transition when the USBPHY_ANACTRL\\[EMPH_EN\\] bit is set high to 1'b1"]
    #[inline(always)]
    pub fn emph_cur_ctrl(&self) -> EMPH_CUR_CTRL_R {
        EMPH_CUR_CTRL_R::new(((self.bits >> 14) & 0x03) as u8)
    }
    #[doc = "Bit 31 - PFD stable signal from the Phase Fractional Divider."]
    #[inline(always)]
    pub fn pfd_stable(&self) -> PFD_STABLE_R {
        PFD_STABLE_R::new(((self.bits >> 31) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Test clock selection to analog test"]
    #[inline(always)]
    pub fn testclk_sel(&mut self) -> TESTCLK_SEL_W {
        TESTCLK_SEL_W { w: self }
    }
    #[doc = "Bit 1 - This bit field controls clock gating (disabling) for the PFD pfd_clk output for power savings when the PFD is not used"]
    #[inline(always)]
    pub fn pfd_clkgate(&mut self) -> PFD_CLKGATE_W {
        PFD_CLKGATE_W { w: self }
    }
    #[doc = "Bits 2:3 - This bit field for the PFD selects the frequency relationship between the local pfd_clk output and the exported USB1PFDCLK"]
    #[inline(always)]
    pub fn pfd_clk_sel(&mut self) -> PFD_CLK_SEL_W {
        PFD_CLK_SEL_W { w: self }
    }
    #[doc = "Bits 4:9 - PFD fractional divider setting used to select the pfd_clk output frequency"]
    #[inline(always)]
    pub fn pfd_frac(&mut self) -> PFD_FRAC_W {
        PFD_FRAC_W { w: self }
    }
    #[doc = "Bit 10 - Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins"]
    #[inline(always)]
    pub fn dev_pulldown(&mut self) -> DEV_PULLDOWN_W {
        DEV_PULLDOWN_W { w: self }
    }
    #[doc = "Bits 11:12 - Controls pre-emphasis time duration for the High Speed TX drivers after each data transition when the USBPHY_ANACTRL\\[EMPH_EN\\] bit is set high to 1'b1"]
    #[inline(always)]
    pub fn emph_pulse_ctrl(&mut self) -> EMPH_PULSE_CTRL_W {
        EMPH_PULSE_CTRL_W { w: self }
    }
    #[doc = "Bit 13 - Enables pre-emphasis for the High-Speed TX drivers"]
    #[inline(always)]
    pub fn emph_en(&mut self) -> EMPH_EN_W {
        EMPH_EN_W { w: self }
    }
    #[doc = "Bits 14:15 - Controls the amount of pre-emphasis current added for the High-Speed TX drivers after each data transition when the USBPHY_ANACTRL\\[EMPH_EN\\] bit is set high to 1'b1"]
    #[inline(always)]
    pub fn emph_cur_ctrl(&mut self) -> EMPH_CUR_CTRL_W {
        EMPH_CUR_CTRL_W { w: self }
    }
}