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
#[doc = "Register `AC12ERRSTAT` reader"]
pub struct R(crate::R<AC12ERRSTAT_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<AC12ERRSTAT_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<AC12ERRSTAT_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<AC12ERRSTAT_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `AC12ERRSTAT` writer"]
pub struct W(crate::W<AC12ERRSTAT_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<AC12ERRSTAT_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<AC12ERRSTAT_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<AC12ERRSTAT_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `AC12NOTEXE` reader - Auto CMD12 Not Executed"]
pub type AC12NOTEXE_R = crate::BitReader<bool>;
#[doc = "Field `AC12TOE` reader - Auto CMD12 Timeout Error"]
pub type AC12TOE_R = crate::BitReader<bool>;
#[doc = "Field `AC12CRCERR` reader - Auto CMD CRC Error"]
pub type AC12CRCERR_R = crate::BitReader<bool>;
#[doc = "Field `AC12ENDBITERR` reader - Auto CMD End Bit Error"]
pub type AC12ENDBITERR_R = crate::BitReader<bool>;
#[doc = "Field `AC12INDEXERR` reader - Auto CMD Index Error"]
pub type AC12INDEXERR_R = crate::BitReader<bool>;
#[doc = "Field `CNIBAC12ERR` reader - Command Not Issued By Auto CMD12 Error"]
pub type CNIBAC12ERR_R = crate::BitReader<bool>;
#[doc = "Field `UHSMODESEL` reader - UHS Mode Select"]
pub type UHSMODESEL_R = crate::FieldReader<u8, UHSMODESEL_A>;
#[doc = "UHS Mode Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum UHSMODESEL_A {
    #[doc = "0: SDR12"]
    SDR12 = 0,
    #[doc = "1: SDR25"]
    SDR25 = 1,
    #[doc = "2: SDR50"]
    SDR50 = 2,
    #[doc = "3: SDR104"]
    SDR104 = 3,
    #[doc = "4: DDR50"]
    DDR50 = 4,
}
impl From<UHSMODESEL_A> for u8 {
    #[inline(always)]
    fn from(variant: UHSMODESEL_A) -> Self {
        variant as _
    }
}
impl UHSMODESEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<UHSMODESEL_A> {
        match self.bits {
            0 => Some(UHSMODESEL_A::SDR12),
            1 => Some(UHSMODESEL_A::SDR25),
            2 => Some(UHSMODESEL_A::SDR50),
            3 => Some(UHSMODESEL_A::SDR104),
            4 => Some(UHSMODESEL_A::DDR50),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `SDR12`"]
    #[inline(always)]
    pub fn is_sdr12(&self) -> bool {
        *self == UHSMODESEL_A::SDR12
    }
    #[doc = "Checks if the value of the field is `SDR25`"]
    #[inline(always)]
    pub fn is_sdr25(&self) -> bool {
        *self == UHSMODESEL_A::SDR25
    }
    #[doc = "Checks if the value of the field is `SDR50`"]
    #[inline(always)]
    pub fn is_sdr50(&self) -> bool {
        *self == UHSMODESEL_A::SDR50
    }
    #[doc = "Checks if the value of the field is `SDR104`"]
    #[inline(always)]
    pub fn is_sdr104(&self) -> bool {
        *self == UHSMODESEL_A::SDR104
    }
    #[doc = "Checks if the value of the field is `DDR50`"]
    #[inline(always)]
    pub fn is_ddr50(&self) -> bool {
        *self == UHSMODESEL_A::DDR50
    }
}
#[doc = "Field `UHSMODESEL` writer - UHS Mode Select"]
pub type UHSMODESEL_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, AC12ERRSTAT_SPEC, u8, UHSMODESEL_A, 3, O>;
impl<'a, const O: u8> UHSMODESEL_W<'a, O> {
    #[doc = "SDR12"]
    #[inline(always)]
    pub fn sdr12(self) -> &'a mut W {
        self.variant(UHSMODESEL_A::SDR12)
    }
    #[doc = "SDR25"]
    #[inline(always)]
    pub fn sdr25(self) -> &'a mut W {
        self.variant(UHSMODESEL_A::SDR25)
    }
    #[doc = "SDR50"]
    #[inline(always)]
    pub fn sdr50(self) -> &'a mut W {
        self.variant(UHSMODESEL_A::SDR50)
    }
    #[doc = "SDR104"]
    #[inline(always)]
    pub fn sdr104(self) -> &'a mut W {
        self.variant(UHSMODESEL_A::SDR104)
    }
    #[doc = "DDR50"]
    #[inline(always)]
    pub fn ddr50(self) -> &'a mut W {
        self.variant(UHSMODESEL_A::DDR50)
    }
}
#[doc = "Field `SIGEN1P8V` reader - Voltage 1.8V Signal Enable"]
pub type SIGEN1P8V_R = crate::BitReader<bool>;
#[doc = "Field `SIGEN1P8V` writer - Voltage 1.8V Signal Enable"]
pub type SIGEN1P8V_W<'a, const O: u8> = crate::BitWriter<'a, u32, AC12ERRSTAT_SPEC, bool, O>;
#[doc = "Field `DRVSTNSEL` reader - Driver Strength Select"]
pub type DRVSTNSEL_R = crate::FieldReader<u8, DRVSTNSEL_A>;
#[doc = "Driver Strength Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DRVSTNSEL_A {
    #[doc = "0: Driver Type B is selected (Default)"]
    TYPEB = 0,
    #[doc = "1: Driver Type A is selected"]
    TYPEA = 1,
    #[doc = "2: Driver Type C is selected"]
    TYPEC = 2,
    #[doc = "3: Driver Type D is selected"]
    TYPED = 3,
}
impl From<DRVSTNSEL_A> for u8 {
    #[inline(always)]
    fn from(variant: DRVSTNSEL_A) -> Self {
        variant as _
    }
}
impl DRVSTNSEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DRVSTNSEL_A {
        match self.bits {
            0 => DRVSTNSEL_A::TYPEB,
            1 => DRVSTNSEL_A::TYPEA,
            2 => DRVSTNSEL_A::TYPEC,
            3 => DRVSTNSEL_A::TYPED,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TYPEB`"]
    #[inline(always)]
    pub fn is_typeb(&self) -> bool {
        *self == DRVSTNSEL_A::TYPEB
    }
    #[doc = "Checks if the value of the field is `TYPEA`"]
    #[inline(always)]
    pub fn is_typea(&self) -> bool {
        *self == DRVSTNSEL_A::TYPEA
    }
    #[doc = "Checks if the value of the field is `TYPEC`"]
    #[inline(always)]
    pub fn is_typec(&self) -> bool {
        *self == DRVSTNSEL_A::TYPEC
    }
    #[doc = "Checks if the value of the field is `TYPED`"]
    #[inline(always)]
    pub fn is_typed(&self) -> bool {
        *self == DRVSTNSEL_A::TYPED
    }
}
#[doc = "Field `DRVSTNSEL` writer - Driver Strength Select"]
pub type DRVSTNSEL_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, AC12ERRSTAT_SPEC, u8, DRVSTNSEL_A, 2, O>;
impl<'a, const O: u8> DRVSTNSEL_W<'a, O> {
    #[doc = "Driver Type B is selected (Default)"]
    #[inline(always)]
    pub fn typeb(self) -> &'a mut W {
        self.variant(DRVSTNSEL_A::TYPEB)
    }
    #[doc = "Driver Type A is selected"]
    #[inline(always)]
    pub fn typea(self) -> &'a mut W {
        self.variant(DRVSTNSEL_A::TYPEA)
    }
    #[doc = "Driver Type C is selected"]
    #[inline(always)]
    pub fn typec(self) -> &'a mut W {
        self.variant(DRVSTNSEL_A::TYPEC)
    }
    #[doc = "Driver Type D is selected"]
    #[inline(always)]
    pub fn typed(self) -> &'a mut W {
        self.variant(DRVSTNSEL_A::TYPED)
    }
}
#[doc = "Field `EXETUNING` reader - Execute Tuning"]
pub type EXETUNING_R = crate::BitReader<bool>;
#[doc = "Field `EXETUNING` writer - Execute Tuning"]
pub type EXETUNING_W<'a, const O: u8> = crate::BitWriter<'a, u32, AC12ERRSTAT_SPEC, bool, O>;
#[doc = "Field `SAMPCLKSEL` reader - Sampling Clock Select"]
pub type SAMPCLKSEL_R = crate::BitReader<bool>;
#[doc = "Field `SAMPCLKSEL` writer - Sampling Clock Select"]
pub type SAMPCLKSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, AC12ERRSTAT_SPEC, bool, O>;
#[doc = "Field `ASYNCINTEN` reader - Asynchronous Interrupt Enable"]
pub type ASYNCINTEN_R = crate::BitReader<bool>;
#[doc = "Field `ASYNCINTEN` writer - Asynchronous Interrupt Enable"]
pub type ASYNCINTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, AC12ERRSTAT_SPEC, bool, O>;
#[doc = "Field `PRSTVALEN` reader - Preset Value Enable"]
pub type PRSTVALEN_R = crate::BitReader<bool>;
#[doc = "Field `PRSTVALEN` writer - Preset Value Enable"]
pub type PRSTVALEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, AC12ERRSTAT_SPEC, bool, O>;
impl R {
    #[doc = "Bit 0 - Auto CMD12 Not Executed"]
    #[inline(always)]
    pub fn ac12notexe(&self) -> AC12NOTEXE_R {
        AC12NOTEXE_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Auto CMD12 Timeout Error"]
    #[inline(always)]
    pub fn ac12toe(&self) -> AC12TOE_R {
        AC12TOE_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Auto CMD CRC Error"]
    #[inline(always)]
    pub fn ac12crcerr(&self) -> AC12CRCERR_R {
        AC12CRCERR_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Auto CMD End Bit Error"]
    #[inline(always)]
    pub fn ac12endbiterr(&self) -> AC12ENDBITERR_R {
        AC12ENDBITERR_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Auto CMD Index Error"]
    #[inline(always)]
    pub fn ac12indexerr(&self) -> AC12INDEXERR_R {
        AC12INDEXERR_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 7 - Command Not Issued By Auto CMD12 Error"]
    #[inline(always)]
    pub fn cnibac12err(&self) -> CNIBAC12ERR_R {
        CNIBAC12ERR_R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bits 16:18 - UHS Mode Select"]
    #[inline(always)]
    pub fn uhsmodesel(&self) -> UHSMODESEL_R {
        UHSMODESEL_R::new(((self.bits >> 16) & 7) as u8)
    }
    #[doc = "Bit 19 - Voltage 1.8V Signal Enable"]
    #[inline(always)]
    pub fn sigen1p8v(&self) -> SIGEN1P8V_R {
        SIGEN1P8V_R::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bits 20:21 - Driver Strength Select"]
    #[inline(always)]
    pub fn drvstnsel(&self) -> DRVSTNSEL_R {
        DRVSTNSEL_R::new(((self.bits >> 20) & 3) as u8)
    }
    #[doc = "Bit 22 - Execute Tuning"]
    #[inline(always)]
    pub fn exetuning(&self) -> EXETUNING_R {
        EXETUNING_R::new(((self.bits >> 22) & 1) != 0)
    }
    #[doc = "Bit 23 - Sampling Clock Select"]
    #[inline(always)]
    pub fn sampclksel(&self) -> SAMPCLKSEL_R {
        SAMPCLKSEL_R::new(((self.bits >> 23) & 1) != 0)
    }
    #[doc = "Bit 30 - Asynchronous Interrupt Enable"]
    #[inline(always)]
    pub fn asyncinten(&self) -> ASYNCINTEN_R {
        ASYNCINTEN_R::new(((self.bits >> 30) & 1) != 0)
    }
    #[doc = "Bit 31 - Preset Value Enable"]
    #[inline(always)]
    pub fn prstvalen(&self) -> PRSTVALEN_R {
        PRSTVALEN_R::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 16:18 - UHS Mode Select"]
    #[inline(always)]
    #[must_use]
    pub fn uhsmodesel(&mut self) -> UHSMODESEL_W<16> {
        UHSMODESEL_W::new(self)
    }
    #[doc = "Bit 19 - Voltage 1.8V Signal Enable"]
    #[inline(always)]
    #[must_use]
    pub fn sigen1p8v(&mut self) -> SIGEN1P8V_W<19> {
        SIGEN1P8V_W::new(self)
    }
    #[doc = "Bits 20:21 - Driver Strength Select"]
    #[inline(always)]
    #[must_use]
    pub fn drvstnsel(&mut self) -> DRVSTNSEL_W<20> {
        DRVSTNSEL_W::new(self)
    }
    #[doc = "Bit 22 - Execute Tuning"]
    #[inline(always)]
    #[must_use]
    pub fn exetuning(&mut self) -> EXETUNING_W<22> {
        EXETUNING_W::new(self)
    }
    #[doc = "Bit 23 - Sampling Clock Select"]
    #[inline(always)]
    #[must_use]
    pub fn sampclksel(&mut self) -> SAMPCLKSEL_W<23> {
        SAMPCLKSEL_W::new(self)
    }
    #[doc = "Bit 30 - Asynchronous Interrupt Enable"]
    #[inline(always)]
    #[must_use]
    pub fn asyncinten(&mut self) -> ASYNCINTEN_W<30> {
        ASYNCINTEN_W::new(self)
    }
    #[doc = "Bit 31 - Preset Value Enable"]
    #[inline(always)]
    #[must_use]
    pub fn prstvalen(&mut self) -> PRSTVALEN_W<31> {
        PRSTVALEN_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 = "AUTO CMD12 Error Status and Host Control2 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 [ac12errstat](index.html) module"]
pub struct AC12ERRSTAT_SPEC;
impl crate::RegisterSpec for AC12ERRSTAT_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [ac12errstat::R](R) reader structure"]
impl crate::Readable for AC12ERRSTAT_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [ac12errstat::W](W) writer structure"]
impl crate::Writable for AC12ERRSTAT_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 AC12ERRSTAT to value 0"]
impl crate::Resettable for AC12ERRSTAT_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}