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
#[doc = "Register `CAPABILITIES` reader"]
pub type R = crate::R<CapabilitiesSpec>;
#[doc = "Timeout Clock Frequency\n\nValue on reset: 48"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TimeoutClockFreq {
    #[doc = "48: 48 MHz"]
    Value1 = 48,
}
impl From<TimeoutClockFreq> for u8 {
    #[inline(always)]
    fn from(variant: TimeoutClockFreq) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for TimeoutClockFreq {
    type Ux = u8;
}
#[doc = "Field `TIMEOUT_CLOCK_FREQ` reader - Timeout Clock Frequency"]
pub type TimeoutClockFreqR = crate::FieldReader<TimeoutClockFreq>;
impl TimeoutClockFreqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<TimeoutClockFreq> {
        match self.bits {
            48 => Some(TimeoutClockFreq::Value1),
            _ => None,
        }
    }
    #[doc = "48 MHz"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == TimeoutClockFreq::Value1
    }
}
#[doc = "Timeout Clock Unit\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TimeoutClockUnit {
    #[doc = "1: MHz"]
    Value1 = 1,
}
impl From<TimeoutClockUnit> for bool {
    #[inline(always)]
    fn from(variant: TimeoutClockUnit) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `TIMEOUT_CLOCK_UNIT` reader - Timeout Clock Unit"]
pub type TimeoutClockUnitR = crate::BitReader<TimeoutClockUnit>;
impl TimeoutClockUnitR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<TimeoutClockUnit> {
        match self.bits {
            true => Some(TimeoutClockUnit::Value1),
            _ => None,
        }
    }
    #[doc = "MHz"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == TimeoutClockUnit::Value1
    }
}
#[doc = "Base Clock Frequency for SD Clock\n\nValue on reset: 48"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum BaseSdClockFreq {
    #[doc = "48: 48 MHz"]
    Value1 = 48,
}
impl From<BaseSdClockFreq> for u8 {
    #[inline(always)]
    fn from(variant: BaseSdClockFreq) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for BaseSdClockFreq {
    type Ux = u8;
}
#[doc = "Field `BASE_SD_CLOCK_FREQ` reader - Base Clock Frequency for SD Clock"]
pub type BaseSdClockFreqR = crate::FieldReader<BaseSdClockFreq>;
impl BaseSdClockFreqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<BaseSdClockFreq> {
        match self.bits {
            48 => Some(BaseSdClockFreq::Value1),
            _ => None,
        }
    }
    #[doc = "48 MHz"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == BaseSdClockFreq::Value1
    }
}
#[doc = "Max Block Length\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum MaxBlockLength {
    #[doc = "0: 512 byte"]
    Value1 = 0,
}
impl From<MaxBlockLength> for u8 {
    #[inline(always)]
    fn from(variant: MaxBlockLength) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for MaxBlockLength {
    type Ux = u8;
}
#[doc = "Field `MAX_BLOCK_LENGTH` reader - Max Block Length"]
pub type MaxBlockLengthR = crate::FieldReader<MaxBlockLength>;
impl MaxBlockLengthR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<MaxBlockLength> {
        match self.bits {
            0 => Some(MaxBlockLength::Value1),
            _ => None,
        }
    }
    #[doc = "512 byte"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == MaxBlockLength::Value1
    }
}
#[doc = "Extended Media Bus Support\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ExtMediaBusSupport {
    #[doc = "0: Extended Media Bus not supported"]
    Value1 = 0,
}
impl From<ExtMediaBusSupport> for bool {
    #[inline(always)]
    fn from(variant: ExtMediaBusSupport) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `EXT_MEDIA_BUS_SUPPORT` reader - Extended Media Bus Support"]
pub type ExtMediaBusSupportR = crate::BitReader<ExtMediaBusSupport>;
impl ExtMediaBusSupportR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<ExtMediaBusSupport> {
        match self.bits {
            false => Some(ExtMediaBusSupport::Value1),
            _ => None,
        }
    }
    #[doc = "Extended Media Bus not supported"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == ExtMediaBusSupport::Value1
    }
}
#[doc = "ADMA2 Support\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Adma2Support {
    #[doc = "0: ADMA not supported"]
    Value1 = 0,
}
impl From<Adma2Support> for bool {
    #[inline(always)]
    fn from(variant: Adma2Support) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ADMA2_SUPPORT` reader - ADMA2 Support"]
pub type Adma2SupportR = crate::BitReader<Adma2Support>;
impl Adma2SupportR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Adma2Support> {
        match self.bits {
            false => Some(Adma2Support::Value1),
            _ => None,
        }
    }
    #[doc = "ADMA not supported"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Adma2Support::Value1
    }
}
#[doc = "High Speed Support\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HighSpeedSupport {
    #[doc = "1: High Speed supported"]
    Value1 = 1,
}
impl From<HighSpeedSupport> for bool {
    #[inline(always)]
    fn from(variant: HighSpeedSupport) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `HIGH_SPEED_SUPPORT` reader - High Speed Support"]
pub type HighSpeedSupportR = crate::BitReader<HighSpeedSupport>;
impl HighSpeedSupportR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<HighSpeedSupport> {
        match self.bits {
            true => Some(HighSpeedSupport::Value1),
            _ => None,
        }
    }
    #[doc = "High Speed supported"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == HighSpeedSupport::Value1
    }
}
#[doc = "SDMA Support\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SdmaSupport {
    #[doc = "0: SDMA not supported"]
    Value1 = 0,
}
impl From<SdmaSupport> for bool {
    #[inline(always)]
    fn from(variant: SdmaSupport) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SDMA_SUPPORT` reader - SDMA Support"]
pub type SdmaSupportR = crate::BitReader<SdmaSupport>;
impl SdmaSupportR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<SdmaSupport> {
        match self.bits {
            false => Some(SdmaSupport::Value1),
            _ => None,
        }
    }
    #[doc = "SDMA not supported"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == SdmaSupport::Value1
    }
}
#[doc = "Suspend / Resume Support\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SuspendResumeSupport {
    #[doc = "1: Supported"]
    Value1 = 1,
}
impl From<SuspendResumeSupport> for bool {
    #[inline(always)]
    fn from(variant: SuspendResumeSupport) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SUSPEND_RESUME_SUPPORT` reader - Suspend / Resume Support"]
pub type SuspendResumeSupportR = crate::BitReader<SuspendResumeSupport>;
impl SuspendResumeSupportR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<SuspendResumeSupport> {
        match self.bits {
            true => Some(SuspendResumeSupport::Value1),
            _ => None,
        }
    }
    #[doc = "Supported"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == SuspendResumeSupport::Value1
    }
}
#[doc = "Voltage Support 3.3V\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VoltageSupport3_3v {
    #[doc = "1: 3.3V supported"]
    Value1 = 1,
}
impl From<VoltageSupport3_3v> for bool {
    #[inline(always)]
    fn from(variant: VoltageSupport3_3v) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `VOLTAGE_SUPPORT_3_3V` reader - Voltage Support 3.3V"]
pub type VoltageSupport3_3vR = crate::BitReader<VoltageSupport3_3v>;
impl VoltageSupport3_3vR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<VoltageSupport3_3v> {
        match self.bits {
            true => Some(VoltageSupport3_3v::Value1),
            _ => None,
        }
    }
    #[doc = "3.3V supported"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == VoltageSupport3_3v::Value1
    }
}
#[doc = "Voltage Support 3.0V\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VoltageSupport3v {
    #[doc = "0: 3.0V not supported"]
    Value1 = 0,
}
impl From<VoltageSupport3v> for bool {
    #[inline(always)]
    fn from(variant: VoltageSupport3v) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `VOLTAGE_SUPPORT_3V` reader - Voltage Support 3.0V"]
pub type VoltageSupport3vR = crate::BitReader<VoltageSupport3v>;
impl VoltageSupport3vR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<VoltageSupport3v> {
        match self.bits {
            false => Some(VoltageSupport3v::Value1),
            _ => None,
        }
    }
    #[doc = "3.0V not supported"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == VoltageSupport3v::Value1
    }
}
#[doc = "Voltage Support 1.8V\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VoltageSupport1_8v {
    #[doc = "0: 1.8V not supported"]
    Value1 = 0,
}
impl From<VoltageSupport1_8v> for bool {
    #[inline(always)]
    fn from(variant: VoltageSupport1_8v) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `VOLTAGE_SUPPORT_1_8V` reader - Voltage Support 1.8V"]
pub type VoltageSupport1_8vR = crate::BitReader<VoltageSupport1_8v>;
impl VoltageSupport1_8vR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<VoltageSupport1_8v> {
        match self.bits {
            false => Some(VoltageSupport1_8v::Value1),
            _ => None,
        }
    }
    #[doc = "1.8V not supported"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == VoltageSupport1_8v::Value1
    }
}
#[doc = "64-bit System Bus Support\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sysbus64Support {
    #[doc = "0: Does not support 64-bit system address"]
    Value1 = 0,
}
impl From<Sysbus64Support> for bool {
    #[inline(always)]
    fn from(variant: Sysbus64Support) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SYSBUS_64_SUPPORT` reader - 64-bit System Bus Support"]
pub type Sysbus64SupportR = crate::BitReader<Sysbus64Support>;
impl Sysbus64SupportR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Sysbus64Support> {
        match self.bits {
            false => Some(Sysbus64Support::Value1),
            _ => None,
        }
    }
    #[doc = "Does not support 64-bit system address"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Sysbus64Support::Value1
    }
}
#[doc = "Asynchronous Interrupt Support\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AsyncIntSupport {
    #[doc = "0: Asynchronous Interrupt not supported"]
    Value1 = 0,
}
impl From<AsyncIntSupport> for bool {
    #[inline(always)]
    fn from(variant: AsyncIntSupport) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ASYNC_INT_SUPPORT` reader - Asynchronous Interrupt Support"]
pub type AsyncIntSupportR = crate::BitReader<AsyncIntSupport>;
impl AsyncIntSupportR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<AsyncIntSupport> {
        match self.bits {
            false => Some(AsyncIntSupport::Value1),
            _ => None,
        }
    }
    #[doc = "Asynchronous Interrupt not supported"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == AsyncIntSupport::Value1
    }
}
#[doc = "Slot Type\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SlotType {
    #[doc = "0: Removable Card Slot"]
    Value1 = 0,
}
impl From<SlotType> for u8 {
    #[inline(always)]
    fn from(variant: SlotType) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for SlotType {
    type Ux = u8;
}
#[doc = "Field `SLOT_TYPE` reader - Slot Type"]
pub type SlotTypeR = crate::FieldReader<SlotType>;
impl SlotTypeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<SlotType> {
        match self.bits {
            0 => Some(SlotType::Value1),
            _ => None,
        }
    }
    #[doc = "Removable Card Slot"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == SlotType::Value1
    }
}
impl R {
    #[doc = "Bits 0:5 - Timeout Clock Frequency"]
    #[inline(always)]
    pub fn timeout_clock_freq(&self) -> TimeoutClockFreqR {
        TimeoutClockFreqR::new((self.bits & 0x3f) as u8)
    }
    #[doc = "Bit 7 - Timeout Clock Unit"]
    #[inline(always)]
    pub fn timeout_clock_unit(&self) -> TimeoutClockUnitR {
        TimeoutClockUnitR::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bits 8:15 - Base Clock Frequency for SD Clock"]
    #[inline(always)]
    pub fn base_sd_clock_freq(&self) -> BaseSdClockFreqR {
        BaseSdClockFreqR::new(((self.bits >> 8) & 0xff) as u8)
    }
    #[doc = "Bits 16:17 - Max Block Length"]
    #[inline(always)]
    pub fn max_block_length(&self) -> MaxBlockLengthR {
        MaxBlockLengthR::new(((self.bits >> 16) & 3) as u8)
    }
    #[doc = "Bit 18 - Extended Media Bus Support"]
    #[inline(always)]
    pub fn ext_media_bus_support(&self) -> ExtMediaBusSupportR {
        ExtMediaBusSupportR::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bit 19 - ADMA2 Support"]
    #[inline(always)]
    pub fn adma2_support(&self) -> Adma2SupportR {
        Adma2SupportR::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bit 21 - High Speed Support"]
    #[inline(always)]
    pub fn high_speed_support(&self) -> HighSpeedSupportR {
        HighSpeedSupportR::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bit 22 - SDMA Support"]
    #[inline(always)]
    pub fn sdma_support(&self) -> SdmaSupportR {
        SdmaSupportR::new(((self.bits >> 22) & 1) != 0)
    }
    #[doc = "Bit 23 - Suspend / Resume Support"]
    #[inline(always)]
    pub fn suspend_resume_support(&self) -> SuspendResumeSupportR {
        SuspendResumeSupportR::new(((self.bits >> 23) & 1) != 0)
    }
    #[doc = "Bit 24 - Voltage Support 3.3V"]
    #[inline(always)]
    pub fn voltage_support_3_3v(&self) -> VoltageSupport3_3vR {
        VoltageSupport3_3vR::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 25 - Voltage Support 3.0V"]
    #[inline(always)]
    pub fn voltage_support_3v(&self) -> VoltageSupport3vR {
        VoltageSupport3vR::new(((self.bits >> 25) & 1) != 0)
    }
    #[doc = "Bit 26 - Voltage Support 1.8V"]
    #[inline(always)]
    pub fn voltage_support_1_8v(&self) -> VoltageSupport1_8vR {
        VoltageSupport1_8vR::new(((self.bits >> 26) & 1) != 0)
    }
    #[doc = "Bit 28 - 64-bit System Bus Support"]
    #[inline(always)]
    pub fn sysbus_64_support(&self) -> Sysbus64SupportR {
        Sysbus64SupportR::new(((self.bits >> 28) & 1) != 0)
    }
    #[doc = "Bit 29 - Asynchronous Interrupt Support"]
    #[inline(always)]
    pub fn async_int_support(&self) -> AsyncIntSupportR {
        AsyncIntSupportR::new(((self.bits >> 29) & 1) != 0)
    }
    #[doc = "Bits 30:31 - Slot Type"]
    #[inline(always)]
    pub fn slot_type(&self) -> SlotTypeR {
        SlotTypeR::new(((self.bits >> 30) & 3) as u8)
    }
}
#[doc = "Capabilities Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`capabilities::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CapabilitiesSpec;
impl crate::RegisterSpec for CapabilitiesSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`capabilities::R`](R) reader structure"]
impl crate::Readable for CapabilitiesSpec {}
#[doc = "`reset()` method sets CAPABILITIES to value 0x01a0_30b0"]
impl crate::Resettable for CapabilitiesSpec {
    const RESET_VALUE: u32 = 0x01a0_30b0;
}