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
#[doc = "Register `smhc_ntsr` reader"]
pub struct R(crate::R<SMHC_NTSR_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<SMHC_NTSR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<SMHC_NTSR_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<SMHC_NTSR_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `smhc_ntsr` writer"]
pub struct W(crate::W<SMHC_NTSR_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<SMHC_NTSR_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<SMHC_NTSR_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<SMHC_NTSR_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `hs400_new_sample_en` reader - "]
pub type HS400_NEW_SAMPLE_EN_R = crate::BitReader<HS400_NEW_SAMPLE_EN_A>;
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HS400_NEW_SAMPLE_EN_A {
    #[doc = "0: Disable hs400 new sample method"]
    DISABLE = 0,
    #[doc = "1: Enable hs400 new sample method"]
    ENABLE = 1,
}
impl From<HS400_NEW_SAMPLE_EN_A> for bool {
    #[inline(always)]
    fn from(variant: HS400_NEW_SAMPLE_EN_A) -> Self {
        variant as u8 != 0
    }
}
impl HS400_NEW_SAMPLE_EN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HS400_NEW_SAMPLE_EN_A {
        match self.bits {
            false => HS400_NEW_SAMPLE_EN_A::DISABLE,
            true => HS400_NEW_SAMPLE_EN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == HS400_NEW_SAMPLE_EN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == HS400_NEW_SAMPLE_EN_A::ENABLE
    }
}
#[doc = "Field `hs400_new_sample_en` writer - "]
pub type HS400_NEW_SAMPLE_EN_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, SMHC_NTSR_SPEC, HS400_NEW_SAMPLE_EN_A, O>;
impl<'a, const O: u8> HS400_NEW_SAMPLE_EN_W<'a, O> {
    #[doc = "Disable hs400 new sample method"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(HS400_NEW_SAMPLE_EN_A::DISABLE)
    }
    #[doc = "Enable hs400 new sample method"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(HS400_NEW_SAMPLE_EN_A::ENABLE)
    }
}
#[doc = "Field `cmd_sample_timing_phase` reader - "]
pub type CMD_SAMPLE_TIMING_PHASE_R = crate::FieldReader<u8, CMD_SAMPLE_TIMING_PHASE_A>;
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CMD_SAMPLE_TIMING_PHASE_A {
    #[doc = "0: Sample timing phase offset 90"]
    O90 = 0,
    #[doc = "1: Sample timing phase offset 180"]
    O180 = 1,
    #[doc = "2: Sample timing phase offset 270"]
    O270 = 2,
    #[doc = "3: Ignore"]
    O0 = 3,
}
impl From<CMD_SAMPLE_TIMING_PHASE_A> for u8 {
    #[inline(always)]
    fn from(variant: CMD_SAMPLE_TIMING_PHASE_A) -> Self {
        variant as _
    }
}
impl CMD_SAMPLE_TIMING_PHASE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CMD_SAMPLE_TIMING_PHASE_A {
        match self.bits {
            0 => CMD_SAMPLE_TIMING_PHASE_A::O90,
            1 => CMD_SAMPLE_TIMING_PHASE_A::O180,
            2 => CMD_SAMPLE_TIMING_PHASE_A::O270,
            3 => CMD_SAMPLE_TIMING_PHASE_A::O0,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `O90`"]
    #[inline(always)]
    pub fn is_o90(&self) -> bool {
        *self == CMD_SAMPLE_TIMING_PHASE_A::O90
    }
    #[doc = "Checks if the value of the field is `O180`"]
    #[inline(always)]
    pub fn is_o180(&self) -> bool {
        *self == CMD_SAMPLE_TIMING_PHASE_A::O180
    }
    #[doc = "Checks if the value of the field is `O270`"]
    #[inline(always)]
    pub fn is_o270(&self) -> bool {
        *self == CMD_SAMPLE_TIMING_PHASE_A::O270
    }
    #[doc = "Checks if the value of the field is `O0`"]
    #[inline(always)]
    pub fn is_o0(&self) -> bool {
        *self == CMD_SAMPLE_TIMING_PHASE_A::O0
    }
}
#[doc = "Field `cmd_sample_timing_phase` writer - "]
pub type CMD_SAMPLE_TIMING_PHASE_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, SMHC_NTSR_SPEC, u8, CMD_SAMPLE_TIMING_PHASE_A, 2, O>;
impl<'a, const O: u8> CMD_SAMPLE_TIMING_PHASE_W<'a, O> {
    #[doc = "Sample timing phase offset 90"]
    #[inline(always)]
    pub fn o90(self) -> &'a mut W {
        self.variant(CMD_SAMPLE_TIMING_PHASE_A::O90)
    }
    #[doc = "Sample timing phase offset 180"]
    #[inline(always)]
    pub fn o180(self) -> &'a mut W {
        self.variant(CMD_SAMPLE_TIMING_PHASE_A::O180)
    }
    #[doc = "Sample timing phase offset 270"]
    #[inline(always)]
    pub fn o270(self) -> &'a mut W {
        self.variant(CMD_SAMPLE_TIMING_PHASE_A::O270)
    }
    #[doc = "Ignore"]
    #[inline(always)]
    pub fn o0(self) -> &'a mut W {
        self.variant(CMD_SAMPLE_TIMING_PHASE_A::O0)
    }
}
#[doc = "Field `dat_sample_timing_phase` reader - "]
pub type DAT_SAMPLE_TIMING_PHASE_R = crate::FieldReader<u8, DAT_SAMPLE_TIMING_PHASE_A>;
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DAT_SAMPLE_TIMING_PHASE_A {
    #[doc = "0: Sample timing phase offset 90"]
    O90 = 0,
    #[doc = "1: Sample timing phase offset 180"]
    O180 = 1,
    #[doc = "2: Sample timing phase offset 270"]
    O270 = 2,
    #[doc = "3: Sample timing phase offset 0 (only for SD2 hs400 mode)"]
    O0 = 3,
}
impl From<DAT_SAMPLE_TIMING_PHASE_A> for u8 {
    #[inline(always)]
    fn from(variant: DAT_SAMPLE_TIMING_PHASE_A) -> Self {
        variant as _
    }
}
impl DAT_SAMPLE_TIMING_PHASE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DAT_SAMPLE_TIMING_PHASE_A {
        match self.bits {
            0 => DAT_SAMPLE_TIMING_PHASE_A::O90,
            1 => DAT_SAMPLE_TIMING_PHASE_A::O180,
            2 => DAT_SAMPLE_TIMING_PHASE_A::O270,
            3 => DAT_SAMPLE_TIMING_PHASE_A::O0,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `O90`"]
    #[inline(always)]
    pub fn is_o90(&self) -> bool {
        *self == DAT_SAMPLE_TIMING_PHASE_A::O90
    }
    #[doc = "Checks if the value of the field is `O180`"]
    #[inline(always)]
    pub fn is_o180(&self) -> bool {
        *self == DAT_SAMPLE_TIMING_PHASE_A::O180
    }
    #[doc = "Checks if the value of the field is `O270`"]
    #[inline(always)]
    pub fn is_o270(&self) -> bool {
        *self == DAT_SAMPLE_TIMING_PHASE_A::O270
    }
    #[doc = "Checks if the value of the field is `O0`"]
    #[inline(always)]
    pub fn is_o0(&self) -> bool {
        *self == DAT_SAMPLE_TIMING_PHASE_A::O0
    }
}
#[doc = "Field `dat_sample_timing_phase` writer - "]
pub type DAT_SAMPLE_TIMING_PHASE_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, SMHC_NTSR_SPEC, u8, DAT_SAMPLE_TIMING_PHASE_A, 2, O>;
impl<'a, const O: u8> DAT_SAMPLE_TIMING_PHASE_W<'a, O> {
    #[doc = "Sample timing phase offset 90"]
    #[inline(always)]
    pub fn o90(self) -> &'a mut W {
        self.variant(DAT_SAMPLE_TIMING_PHASE_A::O90)
    }
    #[doc = "Sample timing phase offset 180"]
    #[inline(always)]
    pub fn o180(self) -> &'a mut W {
        self.variant(DAT_SAMPLE_TIMING_PHASE_A::O180)
    }
    #[doc = "Sample timing phase offset 270"]
    #[inline(always)]
    pub fn o270(self) -> &'a mut W {
        self.variant(DAT_SAMPLE_TIMING_PHASE_A::O270)
    }
    #[doc = "Sample timing phase offset 0 (only for SD2 hs400 mode)"]
    #[inline(always)]
    pub fn o0(self) -> &'a mut W {
        self.variant(DAT_SAMPLE_TIMING_PHASE_A::O0)
    }
}
#[doc = "Field `cmd_send_rx_phase_clr` reader - Clear command rx phase before sending the command"]
pub type CMD_SEND_RX_PHASE_CLR_R = crate::BitReader<CMD_SEND_RX_PHASE_CLR_A>;
#[doc = "Clear command rx phase before sending the command\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CMD_SEND_RX_PHASE_CLR_A {
    #[doc = "0: Disabled"]
    DISABLED = 0,
    #[doc = "1: Enabled"]
    ENABLED = 1,
}
impl From<CMD_SEND_RX_PHASE_CLR_A> for bool {
    #[inline(always)]
    fn from(variant: CMD_SEND_RX_PHASE_CLR_A) -> Self {
        variant as u8 != 0
    }
}
impl CMD_SEND_RX_PHASE_CLR_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CMD_SEND_RX_PHASE_CLR_A {
        match self.bits {
            false => CMD_SEND_RX_PHASE_CLR_A::DISABLED,
            true => CMD_SEND_RX_PHASE_CLR_A::ENABLED,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLED`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == CMD_SEND_RX_PHASE_CLR_A::DISABLED
    }
    #[doc = "Checks if the value of the field is `ENABLED`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == CMD_SEND_RX_PHASE_CLR_A::ENABLED
    }
}
#[doc = "Field `cmd_send_rx_phase_clr` writer - Clear command rx phase before sending the command"]
pub type CMD_SEND_RX_PHASE_CLR_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, SMHC_NTSR_SPEC, CMD_SEND_RX_PHASE_CLR_A, O>;
impl<'a, const O: u8> CMD_SEND_RX_PHASE_CLR_W<'a, O> {
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(CMD_SEND_RX_PHASE_CLR_A::DISABLED)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(CMD_SEND_RX_PHASE_CLR_A::ENABLED)
    }
}
#[doc = "Field `dat_recv_rx_phase_clr` reader - Clear the input phase of data lines before receiving the data"]
pub type DAT_RECV_RX_PHASE_CLR_R = crate::BitReader<DAT_RECV_RX_PHASE_CLR_A>;
#[doc = "Clear the input phase of data lines before receiving the data\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DAT_RECV_RX_PHASE_CLR_A {
    #[doc = "0: Disabled"]
    DISABLED = 0,
    #[doc = "1: Enabled"]
    ENABLED = 1,
}
impl From<DAT_RECV_RX_PHASE_CLR_A> for bool {
    #[inline(always)]
    fn from(variant: DAT_RECV_RX_PHASE_CLR_A) -> Self {
        variant as u8 != 0
    }
}
impl DAT_RECV_RX_PHASE_CLR_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DAT_RECV_RX_PHASE_CLR_A {
        match self.bits {
            false => DAT_RECV_RX_PHASE_CLR_A::DISABLED,
            true => DAT_RECV_RX_PHASE_CLR_A::ENABLED,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLED`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == DAT_RECV_RX_PHASE_CLR_A::DISABLED
    }
    #[doc = "Checks if the value of the field is `ENABLED`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == DAT_RECV_RX_PHASE_CLR_A::ENABLED
    }
}
#[doc = "Field `dat_recv_rx_phase_clr` writer - Clear the input phase of data lines before receiving the data"]
pub type DAT_RECV_RX_PHASE_CLR_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, SMHC_NTSR_SPEC, DAT_RECV_RX_PHASE_CLR_A, O>;
impl<'a, const O: u8> DAT_RECV_RX_PHASE_CLR_W<'a, O> {
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(DAT_RECV_RX_PHASE_CLR_A::DISABLED)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(DAT_RECV_RX_PHASE_CLR_A::ENABLED)
    }
}
#[doc = "Field `dat_trans_rx_phase_clr` reader - Clear the input phase of data lines before transferring the data"]
pub type DAT_TRANS_RX_PHASE_CLR_R = crate::BitReader<DAT_TRANS_RX_PHASE_CLR_A>;
#[doc = "Clear the input phase of data lines before transferring the data\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DAT_TRANS_RX_PHASE_CLR_A {
    #[doc = "0: Disabled"]
    DISABLED = 0,
    #[doc = "1: Enabled"]
    ENABLED = 1,
}
impl From<DAT_TRANS_RX_PHASE_CLR_A> for bool {
    #[inline(always)]
    fn from(variant: DAT_TRANS_RX_PHASE_CLR_A) -> Self {
        variant as u8 != 0
    }
}
impl DAT_TRANS_RX_PHASE_CLR_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DAT_TRANS_RX_PHASE_CLR_A {
        match self.bits {
            false => DAT_TRANS_RX_PHASE_CLR_A::DISABLED,
            true => DAT_TRANS_RX_PHASE_CLR_A::ENABLED,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLED`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == DAT_TRANS_RX_PHASE_CLR_A::DISABLED
    }
    #[doc = "Checks if the value of the field is `ENABLED`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == DAT_TRANS_RX_PHASE_CLR_A::ENABLED
    }
}
#[doc = "Field `dat_trans_rx_phase_clr` writer - Clear the input phase of data lines before transferring the data"]
pub type DAT_TRANS_RX_PHASE_CLR_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, SMHC_NTSR_SPEC, DAT_TRANS_RX_PHASE_CLR_A, O>;
impl<'a, const O: u8> DAT_TRANS_RX_PHASE_CLR_W<'a, O> {
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(DAT_TRANS_RX_PHASE_CLR_A::DISABLED)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(DAT_TRANS_RX_PHASE_CLR_A::ENABLED)
    }
}
#[doc = "Field `dat_crc_status_rx_phase_clr` reader - Clear the input phase of data lines before receiving the CRC status"]
pub type DAT_CRC_STATUS_RX_PHASE_CLR_R = crate::BitReader<DAT_CRC_STATUS_RX_PHASE_CLR_A>;
#[doc = "Clear the input phase of data lines before receiving the CRC status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DAT_CRC_STATUS_RX_PHASE_CLR_A {
    #[doc = "0: Disabled"]
    DISABLED = 0,
    #[doc = "1: Enabled"]
    ENABLED = 1,
}
impl From<DAT_CRC_STATUS_RX_PHASE_CLR_A> for bool {
    #[inline(always)]
    fn from(variant: DAT_CRC_STATUS_RX_PHASE_CLR_A) -> Self {
        variant as u8 != 0
    }
}
impl DAT_CRC_STATUS_RX_PHASE_CLR_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DAT_CRC_STATUS_RX_PHASE_CLR_A {
        match self.bits {
            false => DAT_CRC_STATUS_RX_PHASE_CLR_A::DISABLED,
            true => DAT_CRC_STATUS_RX_PHASE_CLR_A::ENABLED,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLED`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == DAT_CRC_STATUS_RX_PHASE_CLR_A::DISABLED
    }
    #[doc = "Checks if the value of the field is `ENABLED`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == DAT_CRC_STATUS_RX_PHASE_CLR_A::ENABLED
    }
}
#[doc = "Field `dat_crc_status_rx_phase_clr` writer - Clear the input phase of data lines before receiving the CRC status"]
pub type DAT_CRC_STATUS_RX_PHASE_CLR_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, SMHC_NTSR_SPEC, DAT_CRC_STATUS_RX_PHASE_CLR_A, O>;
impl<'a, const O: u8> DAT_CRC_STATUS_RX_PHASE_CLR_W<'a, O> {
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(DAT_CRC_STATUS_RX_PHASE_CLR_A::DISABLED)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(DAT_CRC_STATUS_RX_PHASE_CLR_A::ENABLED)
    }
}
#[doc = "Field `cmd_dat_rx_phase_clr` reader - Clear the input phase of command lines and data lines during the update clock operation"]
pub type CMD_DAT_RX_PHASE_CLR_R = crate::BitReader<CMD_DAT_RX_PHASE_CLR_A>;
#[doc = "Clear the input phase of command lines and data lines during the update clock operation\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CMD_DAT_RX_PHASE_CLR_A {
    #[doc = "0: Disabled"]
    DISABLED = 0,
    #[doc = "1: Enabled"]
    ENABLED = 1,
}
impl From<CMD_DAT_RX_PHASE_CLR_A> for bool {
    #[inline(always)]
    fn from(variant: CMD_DAT_RX_PHASE_CLR_A) -> Self {
        variant as u8 != 0
    }
}
impl CMD_DAT_RX_PHASE_CLR_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CMD_DAT_RX_PHASE_CLR_A {
        match self.bits {
            false => CMD_DAT_RX_PHASE_CLR_A::DISABLED,
            true => CMD_DAT_RX_PHASE_CLR_A::ENABLED,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLED`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == CMD_DAT_RX_PHASE_CLR_A::DISABLED
    }
    #[doc = "Checks if the value of the field is `ENABLED`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == CMD_DAT_RX_PHASE_CLR_A::ENABLED
    }
}
#[doc = "Field `cmd_dat_rx_phase_clr` writer - Clear the input phase of command lines and data lines during the update clock operation"]
pub type CMD_DAT_RX_PHASE_CLR_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, SMHC_NTSR_SPEC, CMD_DAT_RX_PHASE_CLR_A, O>;
impl<'a, const O: u8> CMD_DAT_RX_PHASE_CLR_W<'a, O> {
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(CMD_DAT_RX_PHASE_CLR_A::DISABLED)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(CMD_DAT_RX_PHASE_CLR_A::ENABLED)
    }
}
#[doc = "Field `mode_select` reader - "]
pub type MODE_SELECT_R = crate::BitReader<MODE_SELECT_A>;
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MODE_SELECT_A {
    #[doc = "0: Old mode of Sample/Output Timing"]
    OLD_MODE = 0,
    #[doc = "1: New mode of Sample/Output Timing"]
    NEW_MODE = 1,
}
impl From<MODE_SELECT_A> for bool {
    #[inline(always)]
    fn from(variant: MODE_SELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl MODE_SELECT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> MODE_SELECT_A {
        match self.bits {
            false => MODE_SELECT_A::OLD_MODE,
            true => MODE_SELECT_A::NEW_MODE,
        }
    }
    #[doc = "Checks if the value of the field is `OLD_MODE`"]
    #[inline(always)]
    pub fn is_old_mode(&self) -> bool {
        *self == MODE_SELECT_A::OLD_MODE
    }
    #[doc = "Checks if the value of the field is `NEW_MODE`"]
    #[inline(always)]
    pub fn is_new_mode(&self) -> bool {
        *self == MODE_SELECT_A::NEW_MODE
    }
}
#[doc = "Field `mode_select` writer - "]
pub type MODE_SELECT_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, SMHC_NTSR_SPEC, MODE_SELECT_A, O>;
impl<'a, const O: u8> MODE_SELECT_W<'a, O> {
    #[doc = "Old mode of Sample/Output Timing"]
    #[inline(always)]
    pub fn old_mode(self) -> &'a mut W {
        self.variant(MODE_SELECT_A::OLD_MODE)
    }
    #[doc = "New mode of Sample/Output Timing"]
    #[inline(always)]
    pub fn new_mode(self) -> &'a mut W {
        self.variant(MODE_SELECT_A::NEW_MODE)
    }
}
impl R {
    #[doc = "Bit 0"]
    #[inline(always)]
    pub fn hs400_new_sample_en(&self) -> HS400_NEW_SAMPLE_EN_R {
        HS400_NEW_SAMPLE_EN_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bits 4:5"]
    #[inline(always)]
    pub fn cmd_sample_timing_phase(&self) -> CMD_SAMPLE_TIMING_PHASE_R {
        CMD_SAMPLE_TIMING_PHASE_R::new(((self.bits >> 4) & 3) as u8)
    }
    #[doc = "Bits 8:9"]
    #[inline(always)]
    pub fn dat_sample_timing_phase(&self) -> DAT_SAMPLE_TIMING_PHASE_R {
        DAT_SAMPLE_TIMING_PHASE_R::new(((self.bits >> 8) & 3) as u8)
    }
    #[doc = "Bit 16 - Clear command rx phase before sending the command"]
    #[inline(always)]
    pub fn cmd_send_rx_phase_clr(&self) -> CMD_SEND_RX_PHASE_CLR_R {
        CMD_SEND_RX_PHASE_CLR_R::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bit 20 - Clear the input phase of data lines before receiving the data"]
    #[inline(always)]
    pub fn dat_recv_rx_phase_clr(&self) -> DAT_RECV_RX_PHASE_CLR_R {
        DAT_RECV_RX_PHASE_CLR_R::new(((self.bits >> 20) & 1) != 0)
    }
    #[doc = "Bit 21 - Clear the input phase of data lines before transferring the data"]
    #[inline(always)]
    pub fn dat_trans_rx_phase_clr(&self) -> DAT_TRANS_RX_PHASE_CLR_R {
        DAT_TRANS_RX_PHASE_CLR_R::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bit 22 - Clear the input phase of data lines before receiving the CRC status"]
    #[inline(always)]
    pub fn dat_crc_status_rx_phase_clr(&self) -> DAT_CRC_STATUS_RX_PHASE_CLR_R {
        DAT_CRC_STATUS_RX_PHASE_CLR_R::new(((self.bits >> 22) & 1) != 0)
    }
    #[doc = "Bit 24 - Clear the input phase of command lines and data lines during the update clock operation"]
    #[inline(always)]
    pub fn cmd_dat_rx_phase_clr(&self) -> CMD_DAT_RX_PHASE_CLR_R {
        CMD_DAT_RX_PHASE_CLR_R::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 31"]
    #[inline(always)]
    pub fn mode_select(&self) -> MODE_SELECT_R {
        MODE_SELECT_R::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0"]
    #[inline(always)]
    #[must_use]
    pub fn hs400_new_sample_en(&mut self) -> HS400_NEW_SAMPLE_EN_W<0> {
        HS400_NEW_SAMPLE_EN_W::new(self)
    }
    #[doc = "Bits 4:5"]
    #[inline(always)]
    #[must_use]
    pub fn cmd_sample_timing_phase(&mut self) -> CMD_SAMPLE_TIMING_PHASE_W<4> {
        CMD_SAMPLE_TIMING_PHASE_W::new(self)
    }
    #[doc = "Bits 8:9"]
    #[inline(always)]
    #[must_use]
    pub fn dat_sample_timing_phase(&mut self) -> DAT_SAMPLE_TIMING_PHASE_W<8> {
        DAT_SAMPLE_TIMING_PHASE_W::new(self)
    }
    #[doc = "Bit 16 - Clear command rx phase before sending the command"]
    #[inline(always)]
    #[must_use]
    pub fn cmd_send_rx_phase_clr(&mut self) -> CMD_SEND_RX_PHASE_CLR_W<16> {
        CMD_SEND_RX_PHASE_CLR_W::new(self)
    }
    #[doc = "Bit 20 - Clear the input phase of data lines before receiving the data"]
    #[inline(always)]
    #[must_use]
    pub fn dat_recv_rx_phase_clr(&mut self) -> DAT_RECV_RX_PHASE_CLR_W<20> {
        DAT_RECV_RX_PHASE_CLR_W::new(self)
    }
    #[doc = "Bit 21 - Clear the input phase of data lines before transferring the data"]
    #[inline(always)]
    #[must_use]
    pub fn dat_trans_rx_phase_clr(&mut self) -> DAT_TRANS_RX_PHASE_CLR_W<21> {
        DAT_TRANS_RX_PHASE_CLR_W::new(self)
    }
    #[doc = "Bit 22 - Clear the input phase of data lines before receiving the CRC status"]
    #[inline(always)]
    #[must_use]
    pub fn dat_crc_status_rx_phase_clr(&mut self) -> DAT_CRC_STATUS_RX_PHASE_CLR_W<22> {
        DAT_CRC_STATUS_RX_PHASE_CLR_W::new(self)
    }
    #[doc = "Bit 24 - Clear the input phase of command lines and data lines during the update clock operation"]
    #[inline(always)]
    #[must_use]
    pub fn cmd_dat_rx_phase_clr(&mut self) -> CMD_DAT_RX_PHASE_CLR_W<24> {
        CMD_DAT_RX_PHASE_CLR_W::new(self)
    }
    #[doc = "Bit 31"]
    #[inline(always)]
    #[must_use]
    pub fn mode_select(&mut self) -> MODE_SELECT_W<31> {
        MODE_SELECT_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 = "SD New Timing Set 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 [smhc_ntsr](index.html) module"]
pub struct SMHC_NTSR_SPEC;
impl crate::RegisterSpec for SMHC_NTSR_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [smhc_ntsr::R](R) reader structure"]
impl crate::Readable for SMHC_NTSR_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [smhc_ntsr::W](W) writer structure"]
impl crate::Writable for SMHC_NTSR_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 smhc_ntsr to value 0"]
impl crate::Resettable for SMHC_NTSR_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}