mimxrt685s-pac 0.5.0

Peripheral Access Crate for MIMXRT685s devices
Documentation
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
#[doc = "Register `C1` reader"]
pub type R = crate::R<C1Spec>;
#[doc = "Register `C1` writer"]
pub type W = crate::W<C1Spec>;
#[doc = "Field `VOSEL` reader - DAC Output Voltage Select"]
pub type VoselR = crate::FieldReader;
#[doc = "Field `VOSEL` writer - DAC Output Voltage Select"]
pub type VoselW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
#[doc = "DAC Mode Selection\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dmode {
    #[doc = "0: DAC is selected to work in low speed and low power mode."]
    Dmode0 = 0,
    #[doc = "1: DAC is selected to work in high speed high power mode."]
    Dmode1 = 1,
}
impl From<Dmode> for bool {
    #[inline(always)]
    fn from(variant: Dmode) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DMODE` reader - DAC Mode Selection"]
pub type DmodeR = crate::BitReader<Dmode>;
impl DmodeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dmode {
        match self.bits {
            false => Dmode::Dmode0,
            true => Dmode::Dmode1,
        }
    }
    #[doc = "DAC is selected to work in low speed and low power mode."]
    #[inline(always)]
    pub fn is_dmode_0(&self) -> bool {
        *self == Dmode::Dmode0
    }
    #[doc = "DAC is selected to work in high speed high power mode."]
    #[inline(always)]
    pub fn is_dmode_1(&self) -> bool {
        *self == Dmode::Dmode1
    }
}
#[doc = "Field `DMODE` writer - DAC Mode Selection"]
pub type DmodeW<'a, REG> = crate::BitWriter<'a, REG, Dmode>;
impl<'a, REG> DmodeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "DAC is selected to work in low speed and low power mode."]
    #[inline(always)]
    pub fn dmode_0(self) -> &'a mut crate::W<REG> {
        self.variant(Dmode::Dmode0)
    }
    #[doc = "DAC is selected to work in high speed high power mode."]
    #[inline(always)]
    pub fn dmode_1(self) -> &'a mut crate::W<REG> {
        self.variant(Dmode::Dmode1)
    }
}
#[doc = "Supply Voltage Reference Source Select\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Vrsel {
    #[doc = "0: Vin1 is selected as resistor ladder network supply reference Vin. Vin1 is from internal PMC."]
    Vrsel0 = 0,
    #[doc = "1: Vin2 is selected as resistor ladder network supply reference Vin. Vin2 is from PAD."]
    Vrsel1 = 1,
}
impl From<Vrsel> for bool {
    #[inline(always)]
    fn from(variant: Vrsel) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `VRSEL` reader - Supply Voltage Reference Source Select"]
pub type VrselR = crate::BitReader<Vrsel>;
impl VrselR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Vrsel {
        match self.bits {
            false => Vrsel::Vrsel0,
            true => Vrsel::Vrsel1,
        }
    }
    #[doc = "Vin1 is selected as resistor ladder network supply reference Vin. Vin1 is from internal PMC."]
    #[inline(always)]
    pub fn is_vrsel_0(&self) -> bool {
        *self == Vrsel::Vrsel0
    }
    #[doc = "Vin2 is selected as resistor ladder network supply reference Vin. Vin2 is from PAD."]
    #[inline(always)]
    pub fn is_vrsel_1(&self) -> bool {
        *self == Vrsel::Vrsel1
    }
}
#[doc = "Field `VRSEL` writer - Supply Voltage Reference Source Select"]
pub type VrselW<'a, REG> = crate::BitWriter<'a, REG, Vrsel>;
impl<'a, REG> VrselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Vin1 is selected as resistor ladder network supply reference Vin. Vin1 is from internal PMC."]
    #[inline(always)]
    pub fn vrsel_0(self) -> &'a mut crate::W<REG> {
        self.variant(Vrsel::Vrsel0)
    }
    #[doc = "Vin2 is selected as resistor ladder network supply reference Vin. Vin2 is from PAD."]
    #[inline(always)]
    pub fn vrsel_1(self) -> &'a mut crate::W<REG> {
        self.variant(Vrsel::Vrsel1)
    }
}
#[doc = "DAC Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dacen {
    #[doc = "0: DAC is disabled."]
    Dacen0 = 0,
    #[doc = "1: DAC is enabled."]
    Dacen1 = 1,
}
impl From<Dacen> for bool {
    #[inline(always)]
    fn from(variant: Dacen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DACEN` reader - DAC Enable"]
pub type DacenR = crate::BitReader<Dacen>;
impl DacenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dacen {
        match self.bits {
            false => Dacen::Dacen0,
            true => Dacen::Dacen1,
        }
    }
    #[doc = "DAC is disabled."]
    #[inline(always)]
    pub fn is_dacen_0(&self) -> bool {
        *self == Dacen::Dacen0
    }
    #[doc = "DAC is enabled."]
    #[inline(always)]
    pub fn is_dacen_1(&self) -> bool {
        *self == Dacen::Dacen1
    }
}
#[doc = "Field `DACEN` writer - DAC Enable"]
pub type DacenW<'a, REG> = crate::BitWriter<'a, REG, Dacen>;
impl<'a, REG> DacenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "DAC is disabled."]
    #[inline(always)]
    pub fn dacen_0(self) -> &'a mut crate::W<REG> {
        self.variant(Dacen::Dacen0)
    }
    #[doc = "DAC is enabled."]
    #[inline(always)]
    pub fn dacen_1(self) -> &'a mut crate::W<REG> {
        self.variant(Dacen::Dacen1)
    }
}
#[doc = "Field `CHN0` reader - Channel 0 input enable"]
pub type Chn0R = crate::BitReader;
#[doc = "Field `CHN0` writer - Channel 0 input enable"]
pub type Chn0W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `CHN1` reader - Channel 1 input enable"]
pub type Chn1R = crate::BitReader;
#[doc = "Field `CHN1` writer - Channel 1 input enable"]
pub type Chn1W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `CHN2` reader - Channel 2 input enable"]
pub type Chn2R = crate::BitReader;
#[doc = "Field `CHN2` writer - Channel 2 input enable"]
pub type Chn2W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `CHN3` reader - Channel 3 input enable"]
pub type Chn3R = crate::BitReader;
#[doc = "Field `CHN3` writer - Channel 3 input enable"]
pub type Chn3W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `CHN4` reader - Channel 4 input enable"]
pub type Chn4R = crate::BitReader;
#[doc = "Field `CHN4` writer - Channel 4 input enable"]
pub type Chn4W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `CHN5` reader - Channel 5 input enable"]
pub type Chn5R = crate::BitReader;
#[doc = "Field `CHN5` writer - Channel 5 input enable"]
pub type Chn5W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Minus Input MUX Control\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Msel {
    #[doc = "0: Internal Negative Input 0 for Minus Channel -- Internal Minus Input"]
    Msel0 = 0,
    #[doc = "1: External Input 1 for Minus Channel -- Reference Input 0"]
    Msel1 = 1,
    #[doc = "2: External Input 2 for Minus Channel -- Reference Input 1"]
    Msel2 = 2,
    #[doc = "3: External Input 3 for Minus Channel -- Reference Input 2"]
    Msel3 = 3,
    #[doc = "4: External Input 4 for Minus Channel -- Reference Input 3"]
    Msel4 = 4,
    #[doc = "5: External Input 5 for Minus Channel -- Reference Input 4"]
    Msel5 = 5,
    #[doc = "6: External Input 6 for Minus Channel -- Reference Input 5"]
    Msel6 = 6,
    #[doc = "7: Internal 8b DAC output"]
    Msel7 = 7,
}
impl From<Msel> for u8 {
    #[inline(always)]
    fn from(variant: Msel) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Msel {
    type Ux = u8;
}
impl crate::IsEnum for Msel {}
#[doc = "Field `MSEL` reader - Minus Input MUX Control"]
pub type MselR = crate::FieldReader<Msel>;
impl MselR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Msel {
        match self.bits {
            0 => Msel::Msel0,
            1 => Msel::Msel1,
            2 => Msel::Msel2,
            3 => Msel::Msel3,
            4 => Msel::Msel4,
            5 => Msel::Msel5,
            6 => Msel::Msel6,
            7 => Msel::Msel7,
            _ => unreachable!(),
        }
    }
    #[doc = "Internal Negative Input 0 for Minus Channel -- Internal Minus Input"]
    #[inline(always)]
    pub fn is_msel_0(&self) -> bool {
        *self == Msel::Msel0
    }
    #[doc = "External Input 1 for Minus Channel -- Reference Input 0"]
    #[inline(always)]
    pub fn is_msel_1(&self) -> bool {
        *self == Msel::Msel1
    }
    #[doc = "External Input 2 for Minus Channel -- Reference Input 1"]
    #[inline(always)]
    pub fn is_msel_2(&self) -> bool {
        *self == Msel::Msel2
    }
    #[doc = "External Input 3 for Minus Channel -- Reference Input 2"]
    #[inline(always)]
    pub fn is_msel_3(&self) -> bool {
        *self == Msel::Msel3
    }
    #[doc = "External Input 4 for Minus Channel -- Reference Input 3"]
    #[inline(always)]
    pub fn is_msel_4(&self) -> bool {
        *self == Msel::Msel4
    }
    #[doc = "External Input 5 for Minus Channel -- Reference Input 4"]
    #[inline(always)]
    pub fn is_msel_5(&self) -> bool {
        *self == Msel::Msel5
    }
    #[doc = "External Input 6 for Minus Channel -- Reference Input 5"]
    #[inline(always)]
    pub fn is_msel_6(&self) -> bool {
        *self == Msel::Msel6
    }
    #[doc = "Internal 8b DAC output"]
    #[inline(always)]
    pub fn is_msel_7(&self) -> bool {
        *self == Msel::Msel7
    }
}
#[doc = "Field `MSEL` writer - Minus Input MUX Control"]
pub type MselW<'a, REG> = crate::FieldWriter<'a, REG, 3, Msel, crate::Safe>;
impl<'a, REG> MselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Internal Negative Input 0 for Minus Channel -- Internal Minus Input"]
    #[inline(always)]
    pub fn msel_0(self) -> &'a mut crate::W<REG> {
        self.variant(Msel::Msel0)
    }
    #[doc = "External Input 1 for Minus Channel -- Reference Input 0"]
    #[inline(always)]
    pub fn msel_1(self) -> &'a mut crate::W<REG> {
        self.variant(Msel::Msel1)
    }
    #[doc = "External Input 2 for Minus Channel -- Reference Input 1"]
    #[inline(always)]
    pub fn msel_2(self) -> &'a mut crate::W<REG> {
        self.variant(Msel::Msel2)
    }
    #[doc = "External Input 3 for Minus Channel -- Reference Input 2"]
    #[inline(always)]
    pub fn msel_3(self) -> &'a mut crate::W<REG> {
        self.variant(Msel::Msel3)
    }
    #[doc = "External Input 4 for Minus Channel -- Reference Input 3"]
    #[inline(always)]
    pub fn msel_4(self) -> &'a mut crate::W<REG> {
        self.variant(Msel::Msel4)
    }
    #[doc = "External Input 5 for Minus Channel -- Reference Input 4"]
    #[inline(always)]
    pub fn msel_5(self) -> &'a mut crate::W<REG> {
        self.variant(Msel::Msel5)
    }
    #[doc = "External Input 6 for Minus Channel -- Reference Input 5"]
    #[inline(always)]
    pub fn msel_6(self) -> &'a mut crate::W<REG> {
        self.variant(Msel::Msel6)
    }
    #[doc = "Internal 8b DAC output"]
    #[inline(always)]
    pub fn msel_7(self) -> &'a mut crate::W<REG> {
        self.variant(Msel::Msel7)
    }
}
#[doc = "Plus Input MUX Control\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Psel {
    #[doc = "0: Internal Posivite Input 0 for Plus Channel -- Internal Minus Input"]
    Psel0 = 0,
    #[doc = "1: External Input 1 for Plus Channel -- Reference Input 0"]
    Psel1 = 1,
    #[doc = "2: External Input 2 for Plus Channel -- Reference Input 1"]
    Psel2 = 2,
    #[doc = "3: External Input 3 for Plus Channel -- Reference Input 2"]
    Psel3 = 3,
    #[doc = "4: External Input 4 for Plus Channel -- Reference Input 3"]
    Psel4 = 4,
    #[doc = "5: External Input 4 for Plus Channel -- Reference Input 4"]
    Psel5 = 5,
    #[doc = "6: External Input 4 for Plus Channel -- Reference Input 5"]
    Psel6 = 6,
    #[doc = "7: Internal 8b DAC output"]
    Psel7 = 7,
}
impl From<Psel> for u8 {
    #[inline(always)]
    fn from(variant: Psel) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Psel {
    type Ux = u8;
}
impl crate::IsEnum for Psel {}
#[doc = "Field `PSEL` reader - Plus Input MUX Control"]
pub type PselR = crate::FieldReader<Psel>;
impl PselR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Psel {
        match self.bits {
            0 => Psel::Psel0,
            1 => Psel::Psel1,
            2 => Psel::Psel2,
            3 => Psel::Psel3,
            4 => Psel::Psel4,
            5 => Psel::Psel5,
            6 => Psel::Psel6,
            7 => Psel::Psel7,
            _ => unreachable!(),
        }
    }
    #[doc = "Internal Posivite Input 0 for Plus Channel -- Internal Minus Input"]
    #[inline(always)]
    pub fn is_psel_0(&self) -> bool {
        *self == Psel::Psel0
    }
    #[doc = "External Input 1 for Plus Channel -- Reference Input 0"]
    #[inline(always)]
    pub fn is_psel_1(&self) -> bool {
        *self == Psel::Psel1
    }
    #[doc = "External Input 2 for Plus Channel -- Reference Input 1"]
    #[inline(always)]
    pub fn is_psel_2(&self) -> bool {
        *self == Psel::Psel2
    }
    #[doc = "External Input 3 for Plus Channel -- Reference Input 2"]
    #[inline(always)]
    pub fn is_psel_3(&self) -> bool {
        *self == Psel::Psel3
    }
    #[doc = "External Input 4 for Plus Channel -- Reference Input 3"]
    #[inline(always)]
    pub fn is_psel_4(&self) -> bool {
        *self == Psel::Psel4
    }
    #[doc = "External Input 4 for Plus Channel -- Reference Input 4"]
    #[inline(always)]
    pub fn is_psel_5(&self) -> bool {
        *self == Psel::Psel5
    }
    #[doc = "External Input 4 for Plus Channel -- Reference Input 5"]
    #[inline(always)]
    pub fn is_psel_6(&self) -> bool {
        *self == Psel::Psel6
    }
    #[doc = "Internal 8b DAC output"]
    #[inline(always)]
    pub fn is_psel_7(&self) -> bool {
        *self == Psel::Psel7
    }
}
#[doc = "Field `PSEL` writer - Plus Input MUX Control"]
pub type PselW<'a, REG> = crate::FieldWriter<'a, REG, 3, Psel, crate::Safe>;
impl<'a, REG> PselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Internal Posivite Input 0 for Plus Channel -- Internal Minus Input"]
    #[inline(always)]
    pub fn psel_0(self) -> &'a mut crate::W<REG> {
        self.variant(Psel::Psel0)
    }
    #[doc = "External Input 1 for Plus Channel -- Reference Input 0"]
    #[inline(always)]
    pub fn psel_1(self) -> &'a mut crate::W<REG> {
        self.variant(Psel::Psel1)
    }
    #[doc = "External Input 2 for Plus Channel -- Reference Input 1"]
    #[inline(always)]
    pub fn psel_2(self) -> &'a mut crate::W<REG> {
        self.variant(Psel::Psel2)
    }
    #[doc = "External Input 3 for Plus Channel -- Reference Input 2"]
    #[inline(always)]
    pub fn psel_3(self) -> &'a mut crate::W<REG> {
        self.variant(Psel::Psel3)
    }
    #[doc = "External Input 4 for Plus Channel -- Reference Input 3"]
    #[inline(always)]
    pub fn psel_4(self) -> &'a mut crate::W<REG> {
        self.variant(Psel::Psel4)
    }
    #[doc = "External Input 4 for Plus Channel -- Reference Input 4"]
    #[inline(always)]
    pub fn psel_5(self) -> &'a mut crate::W<REG> {
        self.variant(Psel::Psel5)
    }
    #[doc = "External Input 4 for Plus Channel -- Reference Input 5"]
    #[inline(always)]
    pub fn psel_6(self) -> &'a mut crate::W<REG> {
        self.variant(Psel::Psel6)
    }
    #[doc = "Internal 8b DAC output"]
    #[inline(always)]
    pub fn psel_7(self) -> &'a mut crate::W<REG> {
        self.variant(Psel::Psel7)
    }
}
impl R {
    #[doc = "Bits 0:7 - DAC Output Voltage Select"]
    #[inline(always)]
    pub fn vosel(&self) -> VoselR {
        VoselR::new((self.bits & 0xff) as u8)
    }
    #[doc = "Bit 8 - DAC Mode Selection"]
    #[inline(always)]
    pub fn dmode(&self) -> DmodeR {
        DmodeR::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Supply Voltage Reference Source Select"]
    #[inline(always)]
    pub fn vrsel(&self) -> VrselR {
        VrselR::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - DAC Enable"]
    #[inline(always)]
    pub fn dacen(&self) -> DacenR {
        DacenR::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 16 - Channel 0 input enable"]
    #[inline(always)]
    pub fn chn0(&self) -> Chn0R {
        Chn0R::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bit 17 - Channel 1 input enable"]
    #[inline(always)]
    pub fn chn1(&self) -> Chn1R {
        Chn1R::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bit 18 - Channel 2 input enable"]
    #[inline(always)]
    pub fn chn2(&self) -> Chn2R {
        Chn2R::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bit 19 - Channel 3 input enable"]
    #[inline(always)]
    pub fn chn3(&self) -> Chn3R {
        Chn3R::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bit 20 - Channel 4 input enable"]
    #[inline(always)]
    pub fn chn4(&self) -> Chn4R {
        Chn4R::new(((self.bits >> 20) & 1) != 0)
    }
    #[doc = "Bit 21 - Channel 5 input enable"]
    #[inline(always)]
    pub fn chn5(&self) -> Chn5R {
        Chn5R::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bits 24:26 - Minus Input MUX Control"]
    #[inline(always)]
    pub fn msel(&self) -> MselR {
        MselR::new(((self.bits >> 24) & 7) as u8)
    }
    #[doc = "Bits 28:30 - Plus Input MUX Control"]
    #[inline(always)]
    pub fn psel(&self) -> PselR {
        PselR::new(((self.bits >> 28) & 7) as u8)
    }
}
#[cfg(feature = "debug")]
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("C1")
            .field("vosel", &self.vosel())
            .field("dmode", &self.dmode())
            .field("vrsel", &self.vrsel())
            .field("dacen", &self.dacen())
            .field("chn0", &self.chn0())
            .field("chn1", &self.chn1())
            .field("chn2", &self.chn2())
            .field("chn3", &self.chn3())
            .field("chn4", &self.chn4())
            .field("chn5", &self.chn5())
            .field("msel", &self.msel())
            .field("psel", &self.psel())
            .finish()
    }
}
impl W {
    #[doc = "Bits 0:7 - DAC Output Voltage Select"]
    #[inline(always)]
    pub fn vosel(&mut self) -> VoselW<C1Spec> {
        VoselW::new(self, 0)
    }
    #[doc = "Bit 8 - DAC Mode Selection"]
    #[inline(always)]
    pub fn dmode(&mut self) -> DmodeW<C1Spec> {
        DmodeW::new(self, 8)
    }
    #[doc = "Bit 9 - Supply Voltage Reference Source Select"]
    #[inline(always)]
    pub fn vrsel(&mut self) -> VrselW<C1Spec> {
        VrselW::new(self, 9)
    }
    #[doc = "Bit 10 - DAC Enable"]
    #[inline(always)]
    pub fn dacen(&mut self) -> DacenW<C1Spec> {
        DacenW::new(self, 10)
    }
    #[doc = "Bit 16 - Channel 0 input enable"]
    #[inline(always)]
    pub fn chn0(&mut self) -> Chn0W<C1Spec> {
        Chn0W::new(self, 16)
    }
    #[doc = "Bit 17 - Channel 1 input enable"]
    #[inline(always)]
    pub fn chn1(&mut self) -> Chn1W<C1Spec> {
        Chn1W::new(self, 17)
    }
    #[doc = "Bit 18 - Channel 2 input enable"]
    #[inline(always)]
    pub fn chn2(&mut self) -> Chn2W<C1Spec> {
        Chn2W::new(self, 18)
    }
    #[doc = "Bit 19 - Channel 3 input enable"]
    #[inline(always)]
    pub fn chn3(&mut self) -> Chn3W<C1Spec> {
        Chn3W::new(self, 19)
    }
    #[doc = "Bit 20 - Channel 4 input enable"]
    #[inline(always)]
    pub fn chn4(&mut self) -> Chn4W<C1Spec> {
        Chn4W::new(self, 20)
    }
    #[doc = "Bit 21 - Channel 5 input enable"]
    #[inline(always)]
    pub fn chn5(&mut self) -> Chn5W<C1Spec> {
        Chn5W::new(self, 21)
    }
    #[doc = "Bits 24:26 - Minus Input MUX Control"]
    #[inline(always)]
    pub fn msel(&mut self) -> MselW<C1Spec> {
        MselW::new(self, 24)
    }
    #[doc = "Bits 28:30 - Plus Input MUX Control"]
    #[inline(always)]
    pub fn psel(&mut self) -> PselW<C1Spec> {
        PselW::new(self, 28)
    }
}
#[doc = "CMP Control Register 1\n\nYou can [`read`](crate::Reg::read) this register and get [`c1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`c1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct C1Spec;
impl crate::RegisterSpec for C1Spec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`c1::R`](R) reader structure"]
impl crate::Readable for C1Spec {}
#[doc = "`write(|w| ..)` method takes [`c1::W`](W) writer structure"]
impl crate::Writable for C1Spec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets C1 to value 0"]
impl crate::Resettable for C1Spec {
    const RESET_VALUE: u32 = 0;
}