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
#[doc = "Reader of register HOST_CTRL_CAP"]
pub type R = crate::R<u32, super::HOST_CTRL_CAP>;
#[doc = "Writer for register HOST_CTRL_CAP"]
pub type W = crate::W<u32, super::HOST_CTRL_CAP>;
#[doc = "Register HOST_CTRL_CAP `reset()`'s with value 0x07f3_b407"]
impl crate::ResetValue for super::HOST_CTRL_CAP {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0x07f3_b407
    }
}
#[doc = "Reader of field `SDR50_SUPPORT`"]
pub type SDR50_SUPPORT_R = crate::R<bool, bool>;
#[doc = "Reader of field `SDR104_SUPPORT`"]
pub type SDR104_SUPPORT_R = crate::R<bool, bool>;
#[doc = "Reader of field `DDR50_SUPPORT`"]
pub type DDR50_SUPPORT_R = crate::R<bool, bool>;
#[doc = "Reader of field `TIME_COUNT_RETUNING`"]
pub type TIME_COUNT_RETUNING_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `TIME_COUNT_RETUNING`"]
pub struct TIME_COUNT_RETUNING_W<'a> {
    w: &'a mut W,
}
impl<'a> TIME_COUNT_RETUNING_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 & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8);
        self.w
    }
}
#[doc = "Use Tuning for SDR50\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum USE_TUNING_SDR50_A {
    #[doc = "0: SDR does not require tuning"]
    USE_TUNING_SDR50_0 = 0,
    #[doc = "1: SDR50 requires tuning"]
    USE_TUNING_SDR50_1 = 1,
}
impl From<USE_TUNING_SDR50_A> for bool {
    #[inline(always)]
    fn from(variant: USE_TUNING_SDR50_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `USE_TUNING_SDR50`"]
pub type USE_TUNING_SDR50_R = crate::R<bool, USE_TUNING_SDR50_A>;
impl USE_TUNING_SDR50_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> USE_TUNING_SDR50_A {
        match self.bits {
            false => USE_TUNING_SDR50_A::USE_TUNING_SDR50_0,
            true => USE_TUNING_SDR50_A::USE_TUNING_SDR50_1,
        }
    }
    #[doc = "Checks if the value of the field is `USE_TUNING_SDR50_0`"]
    #[inline(always)]
    pub fn is_use_tuning_sdr50_0(&self) -> bool {
        *self == USE_TUNING_SDR50_A::USE_TUNING_SDR50_0
    }
    #[doc = "Checks if the value of the field is `USE_TUNING_SDR50_1`"]
    #[inline(always)]
    pub fn is_use_tuning_sdr50_1(&self) -> bool {
        *self == USE_TUNING_SDR50_A::USE_TUNING_SDR50_1
    }
}
#[doc = "Write proxy for field `USE_TUNING_SDR50`"]
pub struct USE_TUNING_SDR50_W<'a> {
    w: &'a mut W,
}
impl<'a> USE_TUNING_SDR50_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: USE_TUNING_SDR50_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "SDR does not require tuning"]
    #[inline(always)]
    pub fn use_tuning_sdr50_0(self) -> &'a mut W {
        self.variant(USE_TUNING_SDR50_A::USE_TUNING_SDR50_0)
    }
    #[doc = "SDR50 requires tuning"]
    #[inline(always)]
    pub fn use_tuning_sdr50_1(self) -> &'a mut W {
        self.variant(USE_TUNING_SDR50_A::USE_TUNING_SDR50_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 = "Retuning Mode\n\nValue on reset: 2"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum RETUNING_MODE_A {
    #[doc = "0: Mode 1"]
    RETUNING_MODE_0 = 0,
    #[doc = "1: Mode 2"]
    RETUNING_MODE_1 = 1,
    #[doc = "2: Mode 3"]
    RETUNING_MODE_2 = 2,
}
impl From<RETUNING_MODE_A> for u8 {
    #[inline(always)]
    fn from(variant: RETUNING_MODE_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `RETUNING_MODE`"]
pub type RETUNING_MODE_R = crate::R<u8, RETUNING_MODE_A>;
impl RETUNING_MODE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, RETUNING_MODE_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(RETUNING_MODE_A::RETUNING_MODE_0),
            1 => Val(RETUNING_MODE_A::RETUNING_MODE_1),
            2 => Val(RETUNING_MODE_A::RETUNING_MODE_2),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `RETUNING_MODE_0`"]
    #[inline(always)]
    pub fn is_retuning_mode_0(&self) -> bool {
        *self == RETUNING_MODE_A::RETUNING_MODE_0
    }
    #[doc = "Checks if the value of the field is `RETUNING_MODE_1`"]
    #[inline(always)]
    pub fn is_retuning_mode_1(&self) -> bool {
        *self == RETUNING_MODE_A::RETUNING_MODE_1
    }
    #[doc = "Checks if the value of the field is `RETUNING_MODE_2`"]
    #[inline(always)]
    pub fn is_retuning_mode_2(&self) -> bool {
        *self == RETUNING_MODE_A::RETUNING_MODE_2
    }
}
#[doc = "Max Block Length\n\nValue on reset: 3"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum MBL_A {
    #[doc = "0: 512 bytes"]
    MBL_0 = 0,
    #[doc = "1: 1024 bytes"]
    MBL_1 = 1,
    #[doc = "2: 2048 bytes"]
    MBL_2 = 2,
    #[doc = "3: 4096 bytes"]
    MBL_3 = 3,
}
impl From<MBL_A> for u8 {
    #[inline(always)]
    fn from(variant: MBL_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `MBL`"]
pub type MBL_R = crate::R<u8, MBL_A>;
impl MBL_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, MBL_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(MBL_A::MBL_0),
            1 => Val(MBL_A::MBL_1),
            2 => Val(MBL_A::MBL_2),
            3 => Val(MBL_A::MBL_3),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `MBL_0`"]
    #[inline(always)]
    pub fn is_mbl_0(&self) -> bool {
        *self == MBL_A::MBL_0
    }
    #[doc = "Checks if the value of the field is `MBL_1`"]
    #[inline(always)]
    pub fn is_mbl_1(&self) -> bool {
        *self == MBL_A::MBL_1
    }
    #[doc = "Checks if the value of the field is `MBL_2`"]
    #[inline(always)]
    pub fn is_mbl_2(&self) -> bool {
        *self == MBL_A::MBL_2
    }
    #[doc = "Checks if the value of the field is `MBL_3`"]
    #[inline(always)]
    pub fn is_mbl_3(&self) -> bool {
        *self == MBL_A::MBL_3
    }
}
#[doc = "ADMA Support\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ADMAS_A {
    #[doc = "0: Advanced DMA Not supported"]
    ADMAS_0 = 0,
    #[doc = "1: Advanced DMA Supported"]
    ADMAS_1 = 1,
}
impl From<ADMAS_A> for bool {
    #[inline(always)]
    fn from(variant: ADMAS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `ADMAS`"]
pub type ADMAS_R = crate::R<bool, ADMAS_A>;
impl ADMAS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> ADMAS_A {
        match self.bits {
            false => ADMAS_A::ADMAS_0,
            true => ADMAS_A::ADMAS_1,
        }
    }
    #[doc = "Checks if the value of the field is `ADMAS_0`"]
    #[inline(always)]
    pub fn is_admas_0(&self) -> bool {
        *self == ADMAS_A::ADMAS_0
    }
    #[doc = "Checks if the value of the field is `ADMAS_1`"]
    #[inline(always)]
    pub fn is_admas_1(&self) -> bool {
        *self == ADMAS_A::ADMAS_1
    }
}
#[doc = "High Speed Support\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum HSS_A {
    #[doc = "0: High Speed Not Supported"]
    HSS_0 = 0,
    #[doc = "1: High Speed Supported"]
    HSS_1 = 1,
}
impl From<HSS_A> for bool {
    #[inline(always)]
    fn from(variant: HSS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `HSS`"]
pub type HSS_R = crate::R<bool, HSS_A>;
impl HSS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HSS_A {
        match self.bits {
            false => HSS_A::HSS_0,
            true => HSS_A::HSS_1,
        }
    }
    #[doc = "Checks if the value of the field is `HSS_0`"]
    #[inline(always)]
    pub fn is_hss_0(&self) -> bool {
        *self == HSS_A::HSS_0
    }
    #[doc = "Checks if the value of the field is `HSS_1`"]
    #[inline(always)]
    pub fn is_hss_1(&self) -> bool {
        *self == HSS_A::HSS_1
    }
}
#[doc = "DMA Support\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DMAS_A {
    #[doc = "0: DMA not supported"]
    DMAS_0 = 0,
    #[doc = "1: DMA Supported"]
    DMAS_1 = 1,
}
impl From<DMAS_A> for bool {
    #[inline(always)]
    fn from(variant: DMAS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `DMAS`"]
pub type DMAS_R = crate::R<bool, DMAS_A>;
impl DMAS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DMAS_A {
        match self.bits {
            false => DMAS_A::DMAS_0,
            true => DMAS_A::DMAS_1,
        }
    }
    #[doc = "Checks if the value of the field is `DMAS_0`"]
    #[inline(always)]
    pub fn is_dmas_0(&self) -> bool {
        *self == DMAS_A::DMAS_0
    }
    #[doc = "Checks if the value of the field is `DMAS_1`"]
    #[inline(always)]
    pub fn is_dmas_1(&self) -> bool {
        *self == DMAS_A::DMAS_1
    }
}
#[doc = "Suspend / Resume Support\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SRS_A {
    #[doc = "0: Not supported"]
    SRS_0 = 0,
    #[doc = "1: Supported"]
    SRS_1 = 1,
}
impl From<SRS_A> for bool {
    #[inline(always)]
    fn from(variant: SRS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `SRS`"]
pub type SRS_R = crate::R<bool, SRS_A>;
impl SRS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SRS_A {
        match self.bits {
            false => SRS_A::SRS_0,
            true => SRS_A::SRS_1,
        }
    }
    #[doc = "Checks if the value of the field is `SRS_0`"]
    #[inline(always)]
    pub fn is_srs_0(&self) -> bool {
        *self == SRS_A::SRS_0
    }
    #[doc = "Checks if the value of the field is `SRS_1`"]
    #[inline(always)]
    pub fn is_srs_1(&self) -> bool {
        *self == SRS_A::SRS_1
    }
}
#[doc = "Voltage Support 3.3V\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum VS33_A {
    #[doc = "0: 3.3V not supported"]
    VS33_0 = 0,
    #[doc = "1: 3.3V supported"]
    VS33_1 = 1,
}
impl From<VS33_A> for bool {
    #[inline(always)]
    fn from(variant: VS33_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `VS33`"]
pub type VS33_R = crate::R<bool, VS33_A>;
impl VS33_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> VS33_A {
        match self.bits {
            false => VS33_A::VS33_0,
            true => VS33_A::VS33_1,
        }
    }
    #[doc = "Checks if the value of the field is `VS33_0`"]
    #[inline(always)]
    pub fn is_vs33_0(&self) -> bool {
        *self == VS33_A::VS33_0
    }
    #[doc = "Checks if the value of the field is `VS33_1`"]
    #[inline(always)]
    pub fn is_vs33_1(&self) -> bool {
        *self == VS33_A::VS33_1
    }
}
#[doc = "Voltage Support 3.0 V\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum VS30_A {
    #[doc = "0: 3.0V not supported"]
    VS30_0 = 0,
    #[doc = "1: 3.0V supported"]
    VS30_1 = 1,
}
impl From<VS30_A> for bool {
    #[inline(always)]
    fn from(variant: VS30_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `VS30`"]
pub type VS30_R = crate::R<bool, VS30_A>;
impl VS30_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> VS30_A {
        match self.bits {
            false => VS30_A::VS30_0,
            true => VS30_A::VS30_1,
        }
    }
    #[doc = "Checks if the value of the field is `VS30_0`"]
    #[inline(always)]
    pub fn is_vs30_0(&self) -> bool {
        *self == VS30_A::VS30_0
    }
    #[doc = "Checks if the value of the field is `VS30_1`"]
    #[inline(always)]
    pub fn is_vs30_1(&self) -> bool {
        *self == VS30_A::VS30_1
    }
}
#[doc = "Voltage Support 1.8 V\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum VS18_A {
    #[doc = "0: 1.8V not supported"]
    VS18_0 = 0,
    #[doc = "1: 1.8V supported"]
    VS18_1 = 1,
}
impl From<VS18_A> for bool {
    #[inline(always)]
    fn from(variant: VS18_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `VS18`"]
pub type VS18_R = crate::R<bool, VS18_A>;
impl VS18_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> VS18_A {
        match self.bits {
            false => VS18_A::VS18_0,
            true => VS18_A::VS18_1,
        }
    }
    #[doc = "Checks if the value of the field is `VS18_0`"]
    #[inline(always)]
    pub fn is_vs18_0(&self) -> bool {
        *self == VS18_A::VS18_0
    }
    #[doc = "Checks if the value of the field is `VS18_1`"]
    #[inline(always)]
    pub fn is_vs18_1(&self) -> bool {
        *self == VS18_A::VS18_1
    }
}
impl R {
    #[doc = "Bit 0 - SDR50 support"]
    #[inline(always)]
    pub fn sdr50_support(&self) -> SDR50_SUPPORT_R {
        SDR50_SUPPORT_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bit 1 - SDR104 support"]
    #[inline(always)]
    pub fn sdr104_support(&self) -> SDR104_SUPPORT_R {
        SDR104_SUPPORT_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bit 2 - DDR50 support"]
    #[inline(always)]
    pub fn ddr50_support(&self) -> DDR50_SUPPORT_R {
        DDR50_SUPPORT_R::new(((self.bits >> 2) & 0x01) != 0)
    }
    #[doc = "Bits 8:11 - Time Counter for Retuning"]
    #[inline(always)]
    pub fn time_count_retuning(&self) -> TIME_COUNT_RETUNING_R {
        TIME_COUNT_RETUNING_R::new(((self.bits >> 8) & 0x0f) as u8)
    }
    #[doc = "Bit 13 - Use Tuning for SDR50"]
    #[inline(always)]
    pub fn use_tuning_sdr50(&self) -> USE_TUNING_SDR50_R {
        USE_TUNING_SDR50_R::new(((self.bits >> 13) & 0x01) != 0)
    }
    #[doc = "Bits 14:15 - Retuning Mode"]
    #[inline(always)]
    pub fn retuning_mode(&self) -> RETUNING_MODE_R {
        RETUNING_MODE_R::new(((self.bits >> 14) & 0x03) as u8)
    }
    #[doc = "Bits 16:18 - Max Block Length"]
    #[inline(always)]
    pub fn mbl(&self) -> MBL_R {
        MBL_R::new(((self.bits >> 16) & 0x07) as u8)
    }
    #[doc = "Bit 20 - ADMA Support"]
    #[inline(always)]
    pub fn admas(&self) -> ADMAS_R {
        ADMAS_R::new(((self.bits >> 20) & 0x01) != 0)
    }
    #[doc = "Bit 21 - High Speed Support"]
    #[inline(always)]
    pub fn hss(&self) -> HSS_R {
        HSS_R::new(((self.bits >> 21) & 0x01) != 0)
    }
    #[doc = "Bit 22 - DMA Support"]
    #[inline(always)]
    pub fn dmas(&self) -> DMAS_R {
        DMAS_R::new(((self.bits >> 22) & 0x01) != 0)
    }
    #[doc = "Bit 23 - Suspend / Resume Support"]
    #[inline(always)]
    pub fn srs(&self) -> SRS_R {
        SRS_R::new(((self.bits >> 23) & 0x01) != 0)
    }
    #[doc = "Bit 24 - Voltage Support 3.3V"]
    #[inline(always)]
    pub fn vs33(&self) -> VS33_R {
        VS33_R::new(((self.bits >> 24) & 0x01) != 0)
    }
    #[doc = "Bit 25 - Voltage Support 3.0 V"]
    #[inline(always)]
    pub fn vs30(&self) -> VS30_R {
        VS30_R::new(((self.bits >> 25) & 0x01) != 0)
    }
    #[doc = "Bit 26 - Voltage Support 1.8 V"]
    #[inline(always)]
    pub fn vs18(&self) -> VS18_R {
        VS18_R::new(((self.bits >> 26) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bits 8:11 - Time Counter for Retuning"]
    #[inline(always)]
    pub fn time_count_retuning(&mut self) -> TIME_COUNT_RETUNING_W {
        TIME_COUNT_RETUNING_W { w: self }
    }
    #[doc = "Bit 13 - Use Tuning for SDR50"]
    #[inline(always)]
    pub fn use_tuning_sdr50(&mut self) -> USE_TUNING_SDR50_W {
        USE_TUNING_SDR50_W { w: self }
    }
}