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
#[doc = "Register `PSR` reader"]
pub type R = crate::R<PSR_SPEC>;
#[doc = "Field `CMDINHC` reader - Command Inhibit (CMD)"]
pub type CMDINHC_R = crate::BitReader<CMDINHCSELECT_A>;
#[doc = "Command Inhibit (CMD)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CMDINHCSELECT_A {
    #[doc = "0: Can issue command using only CMD line"]
    CAN = 0,
    #[doc = "1: Cannot issue command"]
    CANNOT = 1,
}
impl From<CMDINHCSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: CMDINHCSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl CMDINHC_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> CMDINHCSELECT_A {
        match self.bits {
            false => CMDINHCSELECT_A::CAN,
            true => CMDINHCSELECT_A::CANNOT,
        }
    }
    #[doc = "Can issue command using only CMD line"]
    #[inline(always)]
    pub fn is_can(&self) -> bool {
        *self == CMDINHCSELECT_A::CAN
    }
    #[doc = "Cannot issue command"]
    #[inline(always)]
    pub fn is_cannot(&self) -> bool {
        *self == CMDINHCSELECT_A::CANNOT
    }
}
#[doc = "Field `CMDINHD` reader - Command Inhibit (DAT)"]
pub type CMDINHD_R = crate::BitReader<CMDINHDSELECT_A>;
#[doc = "Command Inhibit (DAT)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CMDINHDSELECT_A {
    #[doc = "0: Can issue command which uses the DAT line"]
    CAN = 0,
    #[doc = "1: Cannot issue command which uses the DAT line"]
    CANNOT = 1,
}
impl From<CMDINHDSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: CMDINHDSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl CMDINHD_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> CMDINHDSELECT_A {
        match self.bits {
            false => CMDINHDSELECT_A::CAN,
            true => CMDINHDSELECT_A::CANNOT,
        }
    }
    #[doc = "Can issue command which uses the DAT line"]
    #[inline(always)]
    pub fn is_can(&self) -> bool {
        *self == CMDINHDSELECT_A::CAN
    }
    #[doc = "Cannot issue command which uses the DAT line"]
    #[inline(always)]
    pub fn is_cannot(&self) -> bool {
        *self == CMDINHDSELECT_A::CANNOT
    }
}
#[doc = "Field `DLACT` reader - DAT Line Active"]
pub type DLACT_R = crate::BitReader<DLACTSELECT_A>;
#[doc = "DAT Line Active\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DLACTSELECT_A {
    #[doc = "0: DAT Line Inactive"]
    INACTIVE = 0,
    #[doc = "1: DAT Line Active"]
    ACTIVE = 1,
}
impl From<DLACTSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: DLACTSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl DLACT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> DLACTSELECT_A {
        match self.bits {
            false => DLACTSELECT_A::INACTIVE,
            true => DLACTSELECT_A::ACTIVE,
        }
    }
    #[doc = "DAT Line Inactive"]
    #[inline(always)]
    pub fn is_inactive(&self) -> bool {
        *self == DLACTSELECT_A::INACTIVE
    }
    #[doc = "DAT Line Active"]
    #[inline(always)]
    pub fn is_active(&self) -> bool {
        *self == DLACTSELECT_A::ACTIVE
    }
}
#[doc = "Field `RTREQ` reader - Re-Tuning Request"]
pub type RTREQ_R = crate::BitReader<RTREQSELECT_A>;
#[doc = "Re-Tuning Request\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RTREQSELECT_A {
    #[doc = "0: Fixed or well-tuned sampling clock"]
    OK = 0,
    #[doc = "1: Sampling clock needs re-tuning"]
    REQUIRED = 1,
}
impl From<RTREQSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: RTREQSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl RTREQ_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> RTREQSELECT_A {
        match self.bits {
            false => RTREQSELECT_A::OK,
            true => RTREQSELECT_A::REQUIRED,
        }
    }
    #[doc = "Fixed or well-tuned sampling clock"]
    #[inline(always)]
    pub fn is_ok(&self) -> bool {
        *self == RTREQSELECT_A::OK
    }
    #[doc = "Sampling clock needs re-tuning"]
    #[inline(always)]
    pub fn is_required(&self) -> bool {
        *self == RTREQSELECT_A::REQUIRED
    }
}
#[doc = "Field `WTACT` reader - Write Transfer Active"]
pub type WTACT_R = crate::BitReader<WTACTSELECT_A>;
#[doc = "Write Transfer Active\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WTACTSELECT_A {
    #[doc = "0: No valid data"]
    NO = 0,
    #[doc = "1: Transferring data"]
    YES = 1,
}
impl From<WTACTSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: WTACTSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl WTACT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> WTACTSELECT_A {
        match self.bits {
            false => WTACTSELECT_A::NO,
            true => WTACTSELECT_A::YES,
        }
    }
    #[doc = "No valid data"]
    #[inline(always)]
    pub fn is_no(&self) -> bool {
        *self == WTACTSELECT_A::NO
    }
    #[doc = "Transferring data"]
    #[inline(always)]
    pub fn is_yes(&self) -> bool {
        *self == WTACTSELECT_A::YES
    }
}
#[doc = "Field `RTACT` reader - Read Transfer Active"]
pub type RTACT_R = crate::BitReader<RTACTSELECT_A>;
#[doc = "Read Transfer Active\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RTACTSELECT_A {
    #[doc = "0: No valid data"]
    NO = 0,
    #[doc = "1: Transferring data"]
    YES = 1,
}
impl From<RTACTSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: RTACTSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl RTACT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> RTACTSELECT_A {
        match self.bits {
            false => RTACTSELECT_A::NO,
            true => RTACTSELECT_A::YES,
        }
    }
    #[doc = "No valid data"]
    #[inline(always)]
    pub fn is_no(&self) -> bool {
        *self == RTACTSELECT_A::NO
    }
    #[doc = "Transferring data"]
    #[inline(always)]
    pub fn is_yes(&self) -> bool {
        *self == RTACTSELECT_A::YES
    }
}
#[doc = "Field `BUFWREN` reader - Buffer Write Enable"]
pub type BUFWREN_R = crate::BitReader<BUFWRENSELECT_A>;
#[doc = "Buffer Write Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BUFWRENSELECT_A {
    #[doc = "0: Write disable"]
    DISABLE = 0,
    #[doc = "1: Write enable"]
    ENABLE = 1,
}
impl From<BUFWRENSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: BUFWRENSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl BUFWREN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> BUFWRENSELECT_A {
        match self.bits {
            false => BUFWRENSELECT_A::DISABLE,
            true => BUFWRENSELECT_A::ENABLE,
        }
    }
    #[doc = "Write disable"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == BUFWRENSELECT_A::DISABLE
    }
    #[doc = "Write enable"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == BUFWRENSELECT_A::ENABLE
    }
}
#[doc = "Field `BUFRDEN` reader - Buffer Read Enable"]
pub type BUFRDEN_R = crate::BitReader<BUFRDENSELECT_A>;
#[doc = "Buffer Read Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BUFRDENSELECT_A {
    #[doc = "0: Read disable"]
    DISABLE = 0,
    #[doc = "1: Read enable"]
    ENABLE = 1,
}
impl From<BUFRDENSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: BUFRDENSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl BUFRDEN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> BUFRDENSELECT_A {
        match self.bits {
            false => BUFRDENSELECT_A::DISABLE,
            true => BUFRDENSELECT_A::ENABLE,
        }
    }
    #[doc = "Read disable"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == BUFRDENSELECT_A::DISABLE
    }
    #[doc = "Read enable"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == BUFRDENSELECT_A::ENABLE
    }
}
#[doc = "Field `CARDINS` reader - Card Inserted"]
pub type CARDINS_R = crate::BitReader<CARDINSSELECT_A>;
#[doc = "Card Inserted\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CARDINSSELECT_A {
    #[doc = "0: Reset or Debouncing or No Card"]
    NO = 0,
    #[doc = "1: Card inserted"]
    YES = 1,
}
impl From<CARDINSSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: CARDINSSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl CARDINS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> CARDINSSELECT_A {
        match self.bits {
            false => CARDINSSELECT_A::NO,
            true => CARDINSSELECT_A::YES,
        }
    }
    #[doc = "Reset or Debouncing or No Card"]
    #[inline(always)]
    pub fn is_no(&self) -> bool {
        *self == CARDINSSELECT_A::NO
    }
    #[doc = "Card inserted"]
    #[inline(always)]
    pub fn is_yes(&self) -> bool {
        *self == CARDINSSELECT_A::YES
    }
}
#[doc = "Field `CARDSS` reader - Card State Stable"]
pub type CARDSS_R = crate::BitReader<CARDSSSELECT_A>;
#[doc = "Card State Stable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CARDSSSELECT_A {
    #[doc = "0: Reset or Debouncing"]
    NO = 0,
    #[doc = "1: No Card or Insered"]
    YES = 1,
}
impl From<CARDSSSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: CARDSSSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl CARDSS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> CARDSSSELECT_A {
        match self.bits {
            false => CARDSSSELECT_A::NO,
            true => CARDSSSELECT_A::YES,
        }
    }
    #[doc = "Reset or Debouncing"]
    #[inline(always)]
    pub fn is_no(&self) -> bool {
        *self == CARDSSSELECT_A::NO
    }
    #[doc = "No Card or Insered"]
    #[inline(always)]
    pub fn is_yes(&self) -> bool {
        *self == CARDSSSELECT_A::YES
    }
}
#[doc = "Field `CARDDPL` reader - Card Detect Pin Level"]
pub type CARDDPL_R = crate::BitReader<CARDDPLSELECT_A>;
#[doc = "Card Detect Pin Level\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CARDDPLSELECT_A {
    #[doc = "0: No card present (SDCD#=1)"]
    NO = 0,
    #[doc = "1: Card present (SDCD#=0)"]
    YES = 1,
}
impl From<CARDDPLSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: CARDDPLSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl CARDDPL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> CARDDPLSELECT_A {
        match self.bits {
            false => CARDDPLSELECT_A::NO,
            true => CARDDPLSELECT_A::YES,
        }
    }
    #[doc = "No card present (SDCD#=1)"]
    #[inline(always)]
    pub fn is_no(&self) -> bool {
        *self == CARDDPLSELECT_A::NO
    }
    #[doc = "Card present (SDCD#=0)"]
    #[inline(always)]
    pub fn is_yes(&self) -> bool {
        *self == CARDDPLSELECT_A::YES
    }
}
#[doc = "Field `WRPPL` reader - Write Protect Pin Level"]
pub type WRPPL_R = crate::BitReader<WRPPLSELECT_A>;
#[doc = "Write Protect Pin Level\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WRPPLSELECT_A {
    #[doc = "0: Write protected (SDWP#=0)"]
    PROTECTED = 0,
    #[doc = "1: Write enabled (SDWP#=1)"]
    ENABLED = 1,
}
impl From<WRPPLSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: WRPPLSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl WRPPL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> WRPPLSELECT_A {
        match self.bits {
            false => WRPPLSELECT_A::PROTECTED,
            true => WRPPLSELECT_A::ENABLED,
        }
    }
    #[doc = "Write protected (SDWP#=0)"]
    #[inline(always)]
    pub fn is_protected(&self) -> bool {
        *self == WRPPLSELECT_A::PROTECTED
    }
    #[doc = "Write enabled (SDWP#=1)"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == WRPPLSELECT_A::ENABLED
    }
}
#[doc = "Field `DATLL` reader - DAT\\[3:0\\]
Line Level"]
pub type DATLL_R = crate::FieldReader;
#[doc = "Field `CMDLL` reader - CMD Line Level"]
pub type CMDLL_R = crate::BitReader;
impl R {
    #[doc = "Bit 0 - Command Inhibit (CMD)"]
    #[inline(always)]
    pub fn cmdinhc(&self) -> CMDINHC_R {
        CMDINHC_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Command Inhibit (DAT)"]
    #[inline(always)]
    pub fn cmdinhd(&self) -> CMDINHD_R {
        CMDINHD_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - DAT Line Active"]
    #[inline(always)]
    pub fn dlact(&self) -> DLACT_R {
        DLACT_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Re-Tuning Request"]
    #[inline(always)]
    pub fn rtreq(&self) -> RTREQ_R {
        RTREQ_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 8 - Write Transfer Active"]
    #[inline(always)]
    pub fn wtact(&self) -> WTACT_R {
        WTACT_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Read Transfer Active"]
    #[inline(always)]
    pub fn rtact(&self) -> RTACT_R {
        RTACT_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Buffer Write Enable"]
    #[inline(always)]
    pub fn bufwren(&self) -> BUFWREN_R {
        BUFWREN_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Buffer Read Enable"]
    #[inline(always)]
    pub fn bufrden(&self) -> BUFRDEN_R {
        BUFRDEN_R::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 16 - Card Inserted"]
    #[inline(always)]
    pub fn cardins(&self) -> CARDINS_R {
        CARDINS_R::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bit 17 - Card State Stable"]
    #[inline(always)]
    pub fn cardss(&self) -> CARDSS_R {
        CARDSS_R::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bit 18 - Card Detect Pin Level"]
    #[inline(always)]
    pub fn carddpl(&self) -> CARDDPL_R {
        CARDDPL_R::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bit 19 - Write Protect Pin Level"]
    #[inline(always)]
    pub fn wrppl(&self) -> WRPPL_R {
        WRPPL_R::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bits 20:23 - DAT\\[3:0\\]
Line Level"]
    #[inline(always)]
    pub fn datll(&self) -> DATLL_R {
        DATLL_R::new(((self.bits >> 20) & 0x0f) as u8)
    }
    #[doc = "Bit 24 - CMD Line Level"]
    #[inline(always)]
    pub fn cmdll(&self) -> CMDLL_R {
        CMDLL_R::new(((self.bits >> 24) & 1) != 0)
    }
}
#[doc = "Present State\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psr::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct PSR_SPEC;
impl crate::RegisterSpec for PSR_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [`psr::R`](R) reader structure"]
impl crate::Readable for PSR_SPEC {}
#[doc = "`reset()` method sets PSR to value 0x00f8_0000"]
impl crate::Resettable for PSR_SPEC {
    const RESET_VALUE: Self::Ux = 0x00f8_0000;
}