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
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
#[doc = "Register `hp2` reader"]
pub struct R(crate::R<HP2_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<HP2_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<HP2_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<HP2_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `hp2` writer"]
pub struct W(crate::W<HP2_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<HP2_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<HP2_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<HP2_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `hpfb_buf_output_current` reader - Headphone Feedback Buffer Output Current Select\n\nI = 7uA"]
pub type HPFB_BUF_OUTPUT_CURRENT_R = crate::FieldReader<u8, HPFB_BUF_OUTPUT_CURRENT_A>;
#[doc = "Headphone Feedback Buffer Output Current Select\n\nI = 7uA\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum HPFB_BUF_OUTPUT_CURRENT_A {
    #[doc = "0: `0`"]
    I35 = 0,
    #[doc = "1: `1`"]
    I28 = 1,
    #[doc = "2: `10`"]
    I45 = 2,
    #[doc = "3: `11`"]
    I38 = 3,
}
impl From<HPFB_BUF_OUTPUT_CURRENT_A> for u8 {
    #[inline(always)]
    fn from(variant: HPFB_BUF_OUTPUT_CURRENT_A) -> Self {
        variant as _
    }
}
impl HPFB_BUF_OUTPUT_CURRENT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HPFB_BUF_OUTPUT_CURRENT_A {
        match self.bits {
            0 => HPFB_BUF_OUTPUT_CURRENT_A::I35,
            1 => HPFB_BUF_OUTPUT_CURRENT_A::I28,
            2 => HPFB_BUF_OUTPUT_CURRENT_A::I45,
            3 => HPFB_BUF_OUTPUT_CURRENT_A::I38,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `I35`"]
    #[inline(always)]
    pub fn is_i35(&self) -> bool {
        *self == HPFB_BUF_OUTPUT_CURRENT_A::I35
    }
    #[doc = "Checks if the value of the field is `I28`"]
    #[inline(always)]
    pub fn is_i28(&self) -> bool {
        *self == HPFB_BUF_OUTPUT_CURRENT_A::I28
    }
    #[doc = "Checks if the value of the field is `I45`"]
    #[inline(always)]
    pub fn is_i45(&self) -> bool {
        *self == HPFB_BUF_OUTPUT_CURRENT_A::I45
    }
    #[doc = "Checks if the value of the field is `I38`"]
    #[inline(always)]
    pub fn is_i38(&self) -> bool {
        *self == HPFB_BUF_OUTPUT_CURRENT_A::I38
    }
}
#[doc = "Field `hpfb_buf_output_current` writer - Headphone Feedback Buffer Output Current Select\n\nI = 7uA"]
pub type HPFB_BUF_OUTPUT_CURRENT_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, HP2_SPEC, u8, HPFB_BUF_OUTPUT_CURRENT_A, 2, O>;
impl<'a, const O: u8> HPFB_BUF_OUTPUT_CURRENT_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn i35(self) -> &'a mut W {
        self.variant(HPFB_BUF_OUTPUT_CURRENT_A::I35)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn i28(self) -> &'a mut W {
        self.variant(HPFB_BUF_OUTPUT_CURRENT_A::I28)
    }
    #[doc = "`10`"]
    #[inline(always)]
    pub fn i45(self) -> &'a mut W {
        self.variant(HPFB_BUF_OUTPUT_CURRENT_A::I45)
    }
    #[doc = "`11`"]
    #[inline(always)]
    pub fn i38(self) -> &'a mut W {
        self.variant(HPFB_BUF_OUTPUT_CURRENT_A::I38)
    }
}
#[doc = "Field `ramp_final_state_res` reader - Ramp Final State Resistor"]
pub type RAMP_FINAL_STATE_RES_R = crate::FieldReader<u8, RAMP_FINAL_STATE_RES_A>;
#[doc = "Ramp Final State Resistor\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RAMP_FINAL_STATE_RES_A {
    #[doc = "0: `0`"]
    R2500 = 0,
    #[doc = "1: `1`"]
    R5K = 1,
    #[doc = "2: `10`"]
    R10K = 2,
    #[doc = "3: `11`"]
    R20K = 3,
}
impl From<RAMP_FINAL_STATE_RES_A> for u8 {
    #[inline(always)]
    fn from(variant: RAMP_FINAL_STATE_RES_A) -> Self {
        variant as _
    }
}
impl RAMP_FINAL_STATE_RES_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RAMP_FINAL_STATE_RES_A {
        match self.bits {
            0 => RAMP_FINAL_STATE_RES_A::R2500,
            1 => RAMP_FINAL_STATE_RES_A::R5K,
            2 => RAMP_FINAL_STATE_RES_A::R10K,
            3 => RAMP_FINAL_STATE_RES_A::R20K,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `R2500`"]
    #[inline(always)]
    pub fn is_r2500(&self) -> bool {
        *self == RAMP_FINAL_STATE_RES_A::R2500
    }
    #[doc = "Checks if the value of the field is `R5K`"]
    #[inline(always)]
    pub fn is_r5k(&self) -> bool {
        *self == RAMP_FINAL_STATE_RES_A::R5K
    }
    #[doc = "Checks if the value of the field is `R10K`"]
    #[inline(always)]
    pub fn is_r10k(&self) -> bool {
        *self == RAMP_FINAL_STATE_RES_A::R10K
    }
    #[doc = "Checks if the value of the field is `R20K`"]
    #[inline(always)]
    pub fn is_r20k(&self) -> bool {
        *self == RAMP_FINAL_STATE_RES_A::R20K
    }
}
#[doc = "Field `ramp_final_state_res` writer - Ramp Final State Resistor"]
pub type RAMP_FINAL_STATE_RES_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, HP2_SPEC, u8, RAMP_FINAL_STATE_RES_A, 2, O>;
impl<'a, const O: u8> RAMP_FINAL_STATE_RES_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn r2500(self) -> &'a mut W {
        self.variant(RAMP_FINAL_STATE_RES_A::R2500)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn r5k(self) -> &'a mut W {
        self.variant(RAMP_FINAL_STATE_RES_A::R5K)
    }
    #[doc = "`10`"]
    #[inline(always)]
    pub fn r10k(self) -> &'a mut W {
        self.variant(RAMP_FINAL_STATE_RES_A::R10K)
    }
    #[doc = "`11`"]
    #[inline(always)]
    pub fn r20k(self) -> &'a mut W {
        self.variant(RAMP_FINAL_STATE_RES_A::R20K)
    }
}
#[doc = "Field `ramp_out_en` reader - Ramp Output Switch Enable"]
pub type RAMP_OUT_EN_R = crate::BitReader<RAMP_OUT_EN_A>;
#[doc = "Ramp Output Switch Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RAMP_OUT_EN_A {
    #[doc = "0: `0`"]
    DISABLE = 0,
    #[doc = "1: `1`"]
    ENABLE = 1,
}
impl From<RAMP_OUT_EN_A> for bool {
    #[inline(always)]
    fn from(variant: RAMP_OUT_EN_A) -> Self {
        variant as u8 != 0
    }
}
impl RAMP_OUT_EN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RAMP_OUT_EN_A {
        match self.bits {
            false => RAMP_OUT_EN_A::DISABLE,
            true => RAMP_OUT_EN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == RAMP_OUT_EN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == RAMP_OUT_EN_A::ENABLE
    }
}
#[doc = "Field `ramp_out_en` writer - Ramp Output Switch Enable"]
pub type RAMP_OUT_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, HP2_SPEC, RAMP_OUT_EN_A, O>;
impl<'a, const O: u8> RAMP_OUT_EN_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(RAMP_OUT_EN_A::DISABLE)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(RAMP_OUT_EN_A::ENABLE)
    }
}
#[doc = "Field `ramp_final_control` reader - Headphone Ramp Final Step Control"]
pub type RAMP_FINAL_CONTROL_R = crate::BitReader<RAMP_FINAL_CONTROL_A>;
#[doc = "Headphone Ramp Final Step Control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RAMP_FINAL_CONTROL_A {
    #[doc = "0: `0`"]
    SELECT_RAMP = 0,
    #[doc = "1: `1`"]
    SELECT_HPFB_BUFFER = 1,
}
impl From<RAMP_FINAL_CONTROL_A> for bool {
    #[inline(always)]
    fn from(variant: RAMP_FINAL_CONTROL_A) -> Self {
        variant as u8 != 0
    }
}
impl RAMP_FINAL_CONTROL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RAMP_FINAL_CONTROL_A {
        match self.bits {
            false => RAMP_FINAL_CONTROL_A::SELECT_RAMP,
            true => RAMP_FINAL_CONTROL_A::SELECT_HPFB_BUFFER,
        }
    }
    #[doc = "Checks if the value of the field is `SELECT_RAMP`"]
    #[inline(always)]
    pub fn is_select_ramp(&self) -> bool {
        *self == RAMP_FINAL_CONTROL_A::SELECT_RAMP
    }
    #[doc = "Checks if the value of the field is `SELECT_HPFB_BUFFER`"]
    #[inline(always)]
    pub fn is_select_hpfb_buffer(&self) -> bool {
        *self == RAMP_FINAL_CONTROL_A::SELECT_HPFB_BUFFER
    }
}
#[doc = "Field `ramp_final_control` writer - Headphone Ramp Final Step Control"]
pub type RAMP_FINAL_CONTROL_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, HP2_SPEC, RAMP_FINAL_CONTROL_A, O>;
impl<'a, const O: u8> RAMP_FINAL_CONTROL_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn select_ramp(self) -> &'a mut W {
        self.variant(RAMP_FINAL_CONTROL_A::SELECT_RAMP)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn select_hpfb_buffer(self) -> &'a mut W {
        self.variant(RAMP_FINAL_CONTROL_A::SELECT_HPFB_BUFFER)
    }
}
#[doc = "Field `hpfb_in_en` reader - Headphone Feedback PAD IN Switch Enable"]
pub type HPFB_IN_EN_R = crate::BitReader<HPFB_IN_EN_A>;
#[doc = "Headphone Feedback PAD IN Switch Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HPFB_IN_EN_A {
    #[doc = "0: `0`"]
    DISABLE = 0,
    #[doc = "1: `1`"]
    ENABLE = 1,
}
impl From<HPFB_IN_EN_A> for bool {
    #[inline(always)]
    fn from(variant: HPFB_IN_EN_A) -> Self {
        variant as u8 != 0
    }
}
impl HPFB_IN_EN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HPFB_IN_EN_A {
        match self.bits {
            false => HPFB_IN_EN_A::DISABLE,
            true => HPFB_IN_EN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == HPFB_IN_EN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == HPFB_IN_EN_A::ENABLE
    }
}
#[doc = "Field `hpfb_in_en` writer - Headphone Feedback PAD IN Switch Enable"]
pub type HPFB_IN_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, HP2_SPEC, HPFB_IN_EN_A, O>;
impl<'a, const O: u8> HPFB_IN_EN_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(HPFB_IN_EN_A::DISABLE)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(HPFB_IN_EN_A::ENABLE)
    }
}
#[doc = "Field `rampen` reader - Ramp DAC Enable"]
pub type RAMPEN_R = crate::BitReader<RAMPEN_A>;
#[doc = "Ramp DAC Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RAMPEN_A {
    #[doc = "0: `0`"]
    DISABLE = 0,
    #[doc = "1: `1`"]
    ENABLE = 1,
}
impl From<RAMPEN_A> for bool {
    #[inline(always)]
    fn from(variant: RAMPEN_A) -> Self {
        variant as u8 != 0
    }
}
impl RAMPEN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RAMPEN_A {
        match self.bits {
            false => RAMPEN_A::DISABLE,
            true => RAMPEN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == RAMPEN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == RAMPEN_A::ENABLE
    }
}
#[doc = "Field `rampen` writer - Ramp DAC Enable"]
pub type RAMPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, HP2_SPEC, RAMPEN_A, O>;
impl<'a, const O: u8> RAMPEN_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(RAMPEN_A::DISABLE)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(RAMPEN_A::ENABLE)
    }
}
#[doc = "Field `rswitch` reader - RSwitch"]
pub type RSWITCH_R = crate::BitReader<RSWITCH_A>;
#[doc = "RSwitch\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RSWITCH_A {
    #[doc = "0: `0`"]
    HPOUT = 0,
    #[doc = "1: `1`"]
    VRA1 = 1,
}
impl From<RSWITCH_A> for bool {
    #[inline(always)]
    fn from(variant: RSWITCH_A) -> Self {
        variant as u8 != 0
    }
}
impl RSWITCH_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RSWITCH_A {
        match self.bits {
            false => RSWITCH_A::HPOUT,
            true => RSWITCH_A::VRA1,
        }
    }
    #[doc = "Checks if the value of the field is `HPOUT`"]
    #[inline(always)]
    pub fn is_hpout(&self) -> bool {
        *self == RSWITCH_A::HPOUT
    }
    #[doc = "Checks if the value of the field is `VRA1`"]
    #[inline(always)]
    pub fn is_vra1(&self) -> bool {
        *self == RSWITCH_A::VRA1
    }
}
#[doc = "Field `rswitch` writer - RSwitch"]
pub type RSWITCH_W<'a, const O: u8> = crate::BitWriter<'a, u32, HP2_SPEC, RSWITCH_A, O>;
impl<'a, const O: u8> RSWITCH_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn hpout(self) -> &'a mut W {
        self.variant(RSWITCH_A::HPOUT)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn vra1(self) -> &'a mut W {
        self.variant(RSWITCH_A::VRA1)
    }
}
#[doc = "Field `hp_drvouten` reader - Headphone Driver Output Enable"]
pub type HP_DRVOUTEN_R = crate::BitReader<HP_DRVOUTEN_A>;
#[doc = "Headphone Driver Output Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HP_DRVOUTEN_A {
    #[doc = "0: `0`"]
    DISABLE = 0,
    #[doc = "1: `1`"]
    ENABLE = 1,
}
impl From<HP_DRVOUTEN_A> for bool {
    #[inline(always)]
    fn from(variant: HP_DRVOUTEN_A) -> Self {
        variant as u8 != 0
    }
}
impl HP_DRVOUTEN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HP_DRVOUTEN_A {
        match self.bits {
            false => HP_DRVOUTEN_A::DISABLE,
            true => HP_DRVOUTEN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == HP_DRVOUTEN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == HP_DRVOUTEN_A::ENABLE
    }
}
#[doc = "Field `hp_drvouten` writer - Headphone Driver Output Enable"]
pub type HP_DRVOUTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, HP2_SPEC, HP_DRVOUTEN_A, O>;
impl<'a, const O: u8> HP_DRVOUTEN_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(HP_DRVOUTEN_A::DISABLE)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(HP_DRVOUTEN_A::ENABLE)
    }
}
#[doc = "Field `hp_drven` reader - Headphone Driver Enable"]
pub type HP_DRVEN_R = crate::BitReader<HP_DRVEN_A>;
#[doc = "Headphone Driver Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HP_DRVEN_A {
    #[doc = "0: `0`"]
    DISABLE = 0,
    #[doc = "1: `1`"]
    ENABLE = 1,
}
impl From<HP_DRVEN_A> for bool {
    #[inline(always)]
    fn from(variant: HP_DRVEN_A) -> Self {
        variant as u8 != 0
    }
}
impl HP_DRVEN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HP_DRVEN_A {
        match self.bits {
            false => HP_DRVEN_A::DISABLE,
            true => HP_DRVEN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == HP_DRVEN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == HP_DRVEN_A::ENABLE
    }
}
#[doc = "Field `hp_drven` writer - Headphone Driver Enable"]
pub type HP_DRVEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, HP2_SPEC, HP_DRVEN_A, O>;
impl<'a, const O: u8> HP_DRVEN_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(HP_DRVEN_A::DISABLE)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(HP_DRVEN_A::ENABLE)
    }
}
#[doc = "Field `iophp` reader - Headphone L/R OP Bias Current Select"]
pub type IOPHP_R = crate::FieldReader<u8, IOPHP_A>;
#[doc = "Headphone L/R OP Bias Current Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum IOPHP_A {
    #[doc = "0: `0`"]
    C6U = 0,
    #[doc = "1: `1`"]
    C7U = 1,
    #[doc = "2: `10`"]
    C8U = 2,
    #[doc = "3: `11`"]
    C9U = 3,
}
impl From<IOPHP_A> for u8 {
    #[inline(always)]
    fn from(variant: IOPHP_A) -> Self {
        variant as _
    }
}
impl IOPHP_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IOPHP_A {
        match self.bits {
            0 => IOPHP_A::C6U,
            1 => IOPHP_A::C7U,
            2 => IOPHP_A::C8U,
            3 => IOPHP_A::C9U,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `C6U`"]
    #[inline(always)]
    pub fn is_c6u(&self) -> bool {
        *self == IOPHP_A::C6U
    }
    #[doc = "Checks if the value of the field is `C7U`"]
    #[inline(always)]
    pub fn is_c7u(&self) -> bool {
        *self == IOPHP_A::C7U
    }
    #[doc = "Checks if the value of the field is `C8U`"]
    #[inline(always)]
    pub fn is_c8u(&self) -> bool {
        *self == IOPHP_A::C8U
    }
    #[doc = "Checks if the value of the field is `C9U`"]
    #[inline(always)]
    pub fn is_c9u(&self) -> bool {
        *self == IOPHP_A::C9U
    }
}
#[doc = "Field `iophp` writer - Headphone L/R OP Bias Current Select"]
pub type IOPHP_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, HP2_SPEC, u8, IOPHP_A, 2, O>;
impl<'a, const O: u8> IOPHP_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn c6u(self) -> &'a mut W {
        self.variant(IOPHP_A::C6U)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn c7u(self) -> &'a mut W {
        self.variant(IOPHP_A::C7U)
    }
    #[doc = "`10`"]
    #[inline(always)]
    pub fn c8u(self) -> &'a mut W {
        self.variant(IOPHP_A::C8U)
    }
    #[doc = "`11`"]
    #[inline(always)]
    pub fn c9u(self) -> &'a mut W {
        self.variant(IOPHP_A::C9U)
    }
}
#[doc = "Field `opdrv_cur` reader - Headphone OP Output Stage Current Setting"]
pub type OPDRV_CUR_R = crate::FieldReader<u8, OPDRV_CUR_A>;
#[doc = "Headphone OP Output Stage Current Setting\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum OPDRV_CUR_A {
    #[doc = "0: `0`"]
    MIN = 0,
    #[doc = "3: `11`"]
    MAX = 3,
}
impl From<OPDRV_CUR_A> for u8 {
    #[inline(always)]
    fn from(variant: OPDRV_CUR_A) -> Self {
        variant as _
    }
}
impl OPDRV_CUR_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<OPDRV_CUR_A> {
        match self.bits {
            0 => Some(OPDRV_CUR_A::MIN),
            3 => Some(OPDRV_CUR_A::MAX),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `MIN`"]
    #[inline(always)]
    pub fn is_min(&self) -> bool {
        *self == OPDRV_CUR_A::MIN
    }
    #[doc = "Checks if the value of the field is `MAX`"]
    #[inline(always)]
    pub fn is_max(&self) -> bool {
        *self == OPDRV_CUR_A::MAX
    }
}
#[doc = "Field `opdrv_cur` writer - Headphone OP Output Stage Current Setting"]
pub type OPDRV_CUR_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, HP2_SPEC, u8, OPDRV_CUR_A, 2, O>;
impl<'a, const O: u8> OPDRV_CUR_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn min(self) -> &'a mut W {
        self.variant(OPDRV_CUR_A::MIN)
    }
    #[doc = "`11`"]
    #[inline(always)]
    pub fn max(self) -> &'a mut W {
        self.variant(OPDRV_CUR_A::MAX)
    }
}
#[doc = "Field `hpfb_res` reader - Headphone Feedback Big Resistor Control"]
pub type HPFB_RES_R = crate::FieldReader<u8, HPFB_RES_A>;
#[doc = "Headphone Feedback Big Resistor Control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum HPFB_RES_A {
    #[doc = "0: `0`"]
    R880K = 0,
    #[doc = "1: `1`"]
    R1000K = 1,
    #[doc = "2: `10`"]
    R1080K = 2,
    #[doc = "3: `11`"]
    R1200K = 3,
}
impl From<HPFB_RES_A> for u8 {
    #[inline(always)]
    fn from(variant: HPFB_RES_A) -> Self {
        variant as _
    }
}
impl HPFB_RES_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HPFB_RES_A {
        match self.bits {
            0 => HPFB_RES_A::R880K,
            1 => HPFB_RES_A::R1000K,
            2 => HPFB_RES_A::R1080K,
            3 => HPFB_RES_A::R1200K,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `R880K`"]
    #[inline(always)]
    pub fn is_r880k(&self) -> bool {
        *self == HPFB_RES_A::R880K
    }
    #[doc = "Checks if the value of the field is `R1000K`"]
    #[inline(always)]
    pub fn is_r1000k(&self) -> bool {
        *self == HPFB_RES_A::R1000K
    }
    #[doc = "Checks if the value of the field is `R1080K`"]
    #[inline(always)]
    pub fn is_r1080k(&self) -> bool {
        *self == HPFB_RES_A::R1080K
    }
    #[doc = "Checks if the value of the field is `R1200K`"]
    #[inline(always)]
    pub fn is_r1200k(&self) -> bool {
        *self == HPFB_RES_A::R1200K
    }
}
#[doc = "Field `hpfb_res` writer - Headphone Feedback Big Resistor Control"]
pub type HPFB_RES_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, HP2_SPEC, u8, HPFB_RES_A, 2, O>;
impl<'a, const O: u8> HPFB_RES_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn r880k(self) -> &'a mut W {
        self.variant(HPFB_RES_A::R880K)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn r1000k(self) -> &'a mut W {
        self.variant(HPFB_RES_A::R1000K)
    }
    #[doc = "`10`"]
    #[inline(always)]
    pub fn r1080k(self) -> &'a mut W {
        self.variant(HPFB_RES_A::R1080K)
    }
    #[doc = "`11`"]
    #[inline(always)]
    pub fn r1200k(self) -> &'a mut W {
        self.variant(HPFB_RES_A::R1200K)
    }
}
#[doc = "Field `headphone_gain` reader - Headphone Gain"]
pub type HEADPHONE_GAIN_R = crate::FieldReader<u8, HEADPHONE_GAIN_A>;
#[doc = "Headphone Gain\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum HEADPHONE_GAIN_A {
    #[doc = "0: `0`"]
    DB0 = 0,
    #[doc = "1: `1`"]
    DB6 = 1,
    #[doc = "2: `10`"]
    DB12 = 2,
    #[doc = "3: `11`"]
    DB18 = 3,
    #[doc = "4: `100`"]
    DB24 = 4,
    #[doc = "5: `101`"]
    DB30 = 5,
    #[doc = "6: `110`"]
    DB36 = 6,
    #[doc = "7: `111`"]
    DB42 = 7,
}
impl From<HEADPHONE_GAIN_A> for u8 {
    #[inline(always)]
    fn from(variant: HEADPHONE_GAIN_A) -> Self {
        variant as _
    }
}
impl HEADPHONE_GAIN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HEADPHONE_GAIN_A {
        match self.bits {
            0 => HEADPHONE_GAIN_A::DB0,
            1 => HEADPHONE_GAIN_A::DB6,
            2 => HEADPHONE_GAIN_A::DB12,
            3 => HEADPHONE_GAIN_A::DB18,
            4 => HEADPHONE_GAIN_A::DB24,
            5 => HEADPHONE_GAIN_A::DB30,
            6 => HEADPHONE_GAIN_A::DB36,
            7 => HEADPHONE_GAIN_A::DB42,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DB0`"]
    #[inline(always)]
    pub fn is_db0(&self) -> bool {
        *self == HEADPHONE_GAIN_A::DB0
    }
    #[doc = "Checks if the value of the field is `DB6`"]
    #[inline(always)]
    pub fn is_db6(&self) -> bool {
        *self == HEADPHONE_GAIN_A::DB6
    }
    #[doc = "Checks if the value of the field is `DB12`"]
    #[inline(always)]
    pub fn is_db12(&self) -> bool {
        *self == HEADPHONE_GAIN_A::DB12
    }
    #[doc = "Checks if the value of the field is `DB18`"]
    #[inline(always)]
    pub fn is_db18(&self) -> bool {
        *self == HEADPHONE_GAIN_A::DB18
    }
    #[doc = "Checks if the value of the field is `DB24`"]
    #[inline(always)]
    pub fn is_db24(&self) -> bool {
        *self == HEADPHONE_GAIN_A::DB24
    }
    #[doc = "Checks if the value of the field is `DB30`"]
    #[inline(always)]
    pub fn is_db30(&self) -> bool {
        *self == HEADPHONE_GAIN_A::DB30
    }
    #[doc = "Checks if the value of the field is `DB36`"]
    #[inline(always)]
    pub fn is_db36(&self) -> bool {
        *self == HEADPHONE_GAIN_A::DB36
    }
    #[doc = "Checks if the value of the field is `DB42`"]
    #[inline(always)]
    pub fn is_db42(&self) -> bool {
        *self == HEADPHONE_GAIN_A::DB42
    }
}
#[doc = "Field `headphone_gain` writer - Headphone Gain"]
pub type HEADPHONE_GAIN_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, HP2_SPEC, u8, HEADPHONE_GAIN_A, 3, O>;
impl<'a, const O: u8> HEADPHONE_GAIN_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn db0(self) -> &'a mut W {
        self.variant(HEADPHONE_GAIN_A::DB0)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn db6(self) -> &'a mut W {
        self.variant(HEADPHONE_GAIN_A::DB6)
    }
    #[doc = "`10`"]
    #[inline(always)]
    pub fn db12(self) -> &'a mut W {
        self.variant(HEADPHONE_GAIN_A::DB12)
    }
    #[doc = "`11`"]
    #[inline(always)]
    pub fn db18(self) -> &'a mut W {
        self.variant(HEADPHONE_GAIN_A::DB18)
    }
    #[doc = "`100`"]
    #[inline(always)]
    pub fn db24(self) -> &'a mut W {
        self.variant(HEADPHONE_GAIN_A::DB24)
    }
    #[doc = "`101`"]
    #[inline(always)]
    pub fn db30(self) -> &'a mut W {
        self.variant(HEADPHONE_GAIN_A::DB30)
    }
    #[doc = "`110`"]
    #[inline(always)]
    pub fn db36(self) -> &'a mut W {
        self.variant(HEADPHONE_GAIN_A::DB36)
    }
    #[doc = "`111`"]
    #[inline(always)]
    pub fn db42(self) -> &'a mut W {
        self.variant(HEADPHONE_GAIN_A::DB42)
    }
}
#[doc = "Field `hpfb_buf_en` reader - Headphone Feedback Buffer OP Enable"]
pub type HPFB_BUF_EN_R = crate::BitReader<HPFB_BUF_EN_A>;
#[doc = "Headphone Feedback Buffer OP Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HPFB_BUF_EN_A {
    #[doc = "0: `0`"]
    DISABLE = 0,
    #[doc = "1: `1`"]
    ENABLE = 1,
}
impl From<HPFB_BUF_EN_A> for bool {
    #[inline(always)]
    fn from(variant: HPFB_BUF_EN_A) -> Self {
        variant as u8 != 0
    }
}
impl HPFB_BUF_EN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HPFB_BUF_EN_A {
        match self.bits {
            false => HPFB_BUF_EN_A::DISABLE,
            true => HPFB_BUF_EN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == HPFB_BUF_EN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == HPFB_BUF_EN_A::ENABLE
    }
}
#[doc = "Field `hpfb_buf_en` writer - Headphone Feedback Buffer OP Enable"]
pub type HPFB_BUF_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, HP2_SPEC, HPFB_BUF_EN_A, O>;
impl<'a, const O: u8> HPFB_BUF_EN_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(HPFB_BUF_EN_A::DISABLE)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(HPFB_BUF_EN_A::ENABLE)
    }
}
impl R {
    #[doc = "Bits 8:9 - Headphone Feedback Buffer Output Current Select\n\nI = 7uA"]
    #[inline(always)]
    pub fn hpfb_buf_output_current(&self) -> HPFB_BUF_OUTPUT_CURRENT_R {
        HPFB_BUF_OUTPUT_CURRENT_R::new(((self.bits >> 8) & 3) as u8)
    }
    #[doc = "Bits 13:14 - Ramp Final State Resistor"]
    #[inline(always)]
    pub fn ramp_final_state_res(&self) -> RAMP_FINAL_STATE_RES_R {
        RAMP_FINAL_STATE_RES_R::new(((self.bits >> 13) & 3) as u8)
    }
    #[doc = "Bit 15 - Ramp Output Switch Enable"]
    #[inline(always)]
    pub fn ramp_out_en(&self) -> RAMP_OUT_EN_R {
        RAMP_OUT_EN_R::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bit 16 - Headphone Ramp Final Step Control"]
    #[inline(always)]
    pub fn ramp_final_control(&self) -> RAMP_FINAL_CONTROL_R {
        RAMP_FINAL_CONTROL_R::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bit 17 - Headphone Feedback PAD IN Switch Enable"]
    #[inline(always)]
    pub fn hpfb_in_en(&self) -> HPFB_IN_EN_R {
        HPFB_IN_EN_R::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bit 18 - Ramp DAC Enable"]
    #[inline(always)]
    pub fn rampen(&self) -> RAMPEN_R {
        RAMPEN_R::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bit 19 - RSwitch"]
    #[inline(always)]
    pub fn rswitch(&self) -> RSWITCH_R {
        RSWITCH_R::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bit 20 - Headphone Driver Output Enable"]
    #[inline(always)]
    pub fn hp_drvouten(&self) -> HP_DRVOUTEN_R {
        HP_DRVOUTEN_R::new(((self.bits >> 20) & 1) != 0)
    }
    #[doc = "Bit 21 - Headphone Driver Enable"]
    #[inline(always)]
    pub fn hp_drven(&self) -> HP_DRVEN_R {
        HP_DRVEN_R::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bits 22:23 - Headphone L/R OP Bias Current Select"]
    #[inline(always)]
    pub fn iophp(&self) -> IOPHP_R {
        IOPHP_R::new(((self.bits >> 22) & 3) as u8)
    }
    #[doc = "Bits 24:25 - Headphone OP Output Stage Current Setting"]
    #[inline(always)]
    pub fn opdrv_cur(&self) -> OPDRV_CUR_R {
        OPDRV_CUR_R::new(((self.bits >> 24) & 3) as u8)
    }
    #[doc = "Bits 26:27 - Headphone Feedback Big Resistor Control"]
    #[inline(always)]
    pub fn hpfb_res(&self) -> HPFB_RES_R {
        HPFB_RES_R::new(((self.bits >> 26) & 3) as u8)
    }
    #[doc = "Bits 28:30 - Headphone Gain"]
    #[inline(always)]
    pub fn headphone_gain(&self) -> HEADPHONE_GAIN_R {
        HEADPHONE_GAIN_R::new(((self.bits >> 28) & 7) as u8)
    }
    #[doc = "Bit 31 - Headphone Feedback Buffer OP Enable"]
    #[inline(always)]
    pub fn hpfb_buf_en(&self) -> HPFB_BUF_EN_R {
        HPFB_BUF_EN_R::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 8:9 - Headphone Feedback Buffer Output Current Select\n\nI = 7uA"]
    #[inline(always)]
    #[must_use]
    pub fn hpfb_buf_output_current(&mut self) -> HPFB_BUF_OUTPUT_CURRENT_W<8> {
        HPFB_BUF_OUTPUT_CURRENT_W::new(self)
    }
    #[doc = "Bits 13:14 - Ramp Final State Resistor"]
    #[inline(always)]
    #[must_use]
    pub fn ramp_final_state_res(&mut self) -> RAMP_FINAL_STATE_RES_W<13> {
        RAMP_FINAL_STATE_RES_W::new(self)
    }
    #[doc = "Bit 15 - Ramp Output Switch Enable"]
    #[inline(always)]
    #[must_use]
    pub fn ramp_out_en(&mut self) -> RAMP_OUT_EN_W<15> {
        RAMP_OUT_EN_W::new(self)
    }
    #[doc = "Bit 16 - Headphone Ramp Final Step Control"]
    #[inline(always)]
    #[must_use]
    pub fn ramp_final_control(&mut self) -> RAMP_FINAL_CONTROL_W<16> {
        RAMP_FINAL_CONTROL_W::new(self)
    }
    #[doc = "Bit 17 - Headphone Feedback PAD IN Switch Enable"]
    #[inline(always)]
    #[must_use]
    pub fn hpfb_in_en(&mut self) -> HPFB_IN_EN_W<17> {
        HPFB_IN_EN_W::new(self)
    }
    #[doc = "Bit 18 - Ramp DAC Enable"]
    #[inline(always)]
    #[must_use]
    pub fn rampen(&mut self) -> RAMPEN_W<18> {
        RAMPEN_W::new(self)
    }
    #[doc = "Bit 19 - RSwitch"]
    #[inline(always)]
    #[must_use]
    pub fn rswitch(&mut self) -> RSWITCH_W<19> {
        RSWITCH_W::new(self)
    }
    #[doc = "Bit 20 - Headphone Driver Output Enable"]
    #[inline(always)]
    #[must_use]
    pub fn hp_drvouten(&mut self) -> HP_DRVOUTEN_W<20> {
        HP_DRVOUTEN_W::new(self)
    }
    #[doc = "Bit 21 - Headphone Driver Enable"]
    #[inline(always)]
    #[must_use]
    pub fn hp_drven(&mut self) -> HP_DRVEN_W<21> {
        HP_DRVEN_W::new(self)
    }
    #[doc = "Bits 22:23 - Headphone L/R OP Bias Current Select"]
    #[inline(always)]
    #[must_use]
    pub fn iophp(&mut self) -> IOPHP_W<22> {
        IOPHP_W::new(self)
    }
    #[doc = "Bits 24:25 - Headphone OP Output Stage Current Setting"]
    #[inline(always)]
    #[must_use]
    pub fn opdrv_cur(&mut self) -> OPDRV_CUR_W<24> {
        OPDRV_CUR_W::new(self)
    }
    #[doc = "Bits 26:27 - Headphone Feedback Big Resistor Control"]
    #[inline(always)]
    #[must_use]
    pub fn hpfb_res(&mut self) -> HPFB_RES_W<26> {
        HPFB_RES_W::new(self)
    }
    #[doc = "Bits 28:30 - Headphone Gain"]
    #[inline(always)]
    #[must_use]
    pub fn headphone_gain(&mut self) -> HEADPHONE_GAIN_W<28> {
        HEADPHONE_GAIN_W::new(self)
    }
    #[doc = "Bit 31 - Headphone Feedback Buffer OP Enable"]
    #[inline(always)]
    #[must_use]
    pub fn hpfb_buf_en(&mut self) -> HPFB_BUF_EN_W<31> {
        HPFB_BUF_EN_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Headphone2 Analog Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hp2](index.html) module"]
pub struct HP2_SPEC;
impl crate::RegisterSpec for HP2_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [hp2::R](R) reader structure"]
impl crate::Readable for HP2_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [hp2::W](W) writer structure"]
impl crate::Writable for HP2_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets hp2 to value 0"]
impl crate::Resettable for HP2_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}