ra6e1/sdhi0/
sd_err_sts1.rs

1#[doc = "Register `SD_ERR_STS1` reader"]
2pub struct R(crate::R<SD_ERR_STS1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SD_ERR_STS1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SD_ERR_STS1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SD_ERR_STS1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `CMDE0` reader - Command Error Flag 0"]
17pub type CMDE0_R = crate::BitReader<CMDE0_A>;
18#[doc = "Command Error Flag 0\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum CMDE0_A {
21    #[doc = "0: No error exists in command index field value of a command response"]
22    _0 = 0,
23    #[doc = "1: Error exists in command index field value of a command response"]
24    _1 = 1,
25}
26impl From<CMDE0_A> for bool {
27    #[inline(always)]
28    fn from(variant: CMDE0_A) -> Self {
29        variant as u8 != 0
30    }
31}
32impl CMDE0_R {
33    #[doc = "Get enumerated values variant"]
34    #[inline(always)]
35    pub fn variant(&self) -> CMDE0_A {
36        match self.bits {
37            false => CMDE0_A::_0,
38            true => CMDE0_A::_1,
39        }
40    }
41    #[doc = "Checks if the value of the field is `_0`"]
42    #[inline(always)]
43    pub fn is_0(&self) -> bool {
44        *self == CMDE0_A::_0
45    }
46    #[doc = "Checks if the value of the field is `_1`"]
47    #[inline(always)]
48    pub fn is_1(&self) -> bool {
49        *self == CMDE0_A::_1
50    }
51}
52#[doc = "Field `CMDE1` reader - Command Error Flag 1"]
53pub type CMDE1_R = crate::BitReader<CMDE1_A>;
54#[doc = "Command Error Flag 1\n\nValue on reset: 0"]
55#[derive(Clone, Copy, Debug, PartialEq, Eq)]
56pub enum CMDE1_A {
57    #[doc = "0: No error exists in command index field value of a command response"]
58    _0 = 0,
59    #[doc = "1: Error exists in command index field value of a command response (with SD_CMD.CMDIDX\\[5:0\\]
60setting, an error that occurs with CMD12 issue is indicated in the CMDE0 flag)"]
61    _1 = 1,
62}
63impl From<CMDE1_A> for bool {
64    #[inline(always)]
65    fn from(variant: CMDE1_A) -> Self {
66        variant as u8 != 0
67    }
68}
69impl CMDE1_R {
70    #[doc = "Get enumerated values variant"]
71    #[inline(always)]
72    pub fn variant(&self) -> CMDE1_A {
73        match self.bits {
74            false => CMDE1_A::_0,
75            true => CMDE1_A::_1,
76        }
77    }
78    #[doc = "Checks if the value of the field is `_0`"]
79    #[inline(always)]
80    pub fn is_0(&self) -> bool {
81        *self == CMDE1_A::_0
82    }
83    #[doc = "Checks if the value of the field is `_1`"]
84    #[inline(always)]
85    pub fn is_1(&self) -> bool {
86        *self == CMDE1_A::_1
87    }
88}
89#[doc = "Field `RSPLENE0` reader - Response Length Error Flag 0"]
90pub type RSPLENE0_R = crate::BitReader<RSPLENE0_A>;
91#[doc = "Response Length Error Flag 0\n\nValue on reset: 0"]
92#[derive(Clone, Copy, Debug, PartialEq, Eq)]
93pub enum RSPLENE0_A {
94    #[doc = "0: No error exists in command response length"]
95    _0 = 0,
96    #[doc = "1: Error exists in command response length"]
97    _1 = 1,
98}
99impl From<RSPLENE0_A> for bool {
100    #[inline(always)]
101    fn from(variant: RSPLENE0_A) -> Self {
102        variant as u8 != 0
103    }
104}
105impl RSPLENE0_R {
106    #[doc = "Get enumerated values variant"]
107    #[inline(always)]
108    pub fn variant(&self) -> RSPLENE0_A {
109        match self.bits {
110            false => RSPLENE0_A::_0,
111            true => RSPLENE0_A::_1,
112        }
113    }
114    #[doc = "Checks if the value of the field is `_0`"]
115    #[inline(always)]
116    pub fn is_0(&self) -> bool {
117        *self == RSPLENE0_A::_0
118    }
119    #[doc = "Checks if the value of the field is `_1`"]
120    #[inline(always)]
121    pub fn is_1(&self) -> bool {
122        *self == RSPLENE0_A::_1
123    }
124}
125#[doc = "Field `RSPLENE1` reader - Response Length Error Flag 1"]
126pub type RSPLENE1_R = crate::BitReader<RSPLENE1_A>;
127#[doc = "Response Length Error Flag 1\n\nValue on reset: 0"]
128#[derive(Clone, Copy, Debug, PartialEq, Eq)]
129pub enum RSPLENE1_A {
130    #[doc = "0: No error exists in command response length"]
131    _0 = 0,
132    #[doc = "1: Error exists in command response length (with SD_CMD.CMDIDX\\[5:0\\]
133setting, an error that occurs with CMD12 issue is indicated in the RSPLENE0 flag)"]
134    _1 = 1,
135}
136impl From<RSPLENE1_A> for bool {
137    #[inline(always)]
138    fn from(variant: RSPLENE1_A) -> Self {
139        variant as u8 != 0
140    }
141}
142impl RSPLENE1_R {
143    #[doc = "Get enumerated values variant"]
144    #[inline(always)]
145    pub fn variant(&self) -> RSPLENE1_A {
146        match self.bits {
147            false => RSPLENE1_A::_0,
148            true => RSPLENE1_A::_1,
149        }
150    }
151    #[doc = "Checks if the value of the field is `_0`"]
152    #[inline(always)]
153    pub fn is_0(&self) -> bool {
154        *self == RSPLENE1_A::_0
155    }
156    #[doc = "Checks if the value of the field is `_1`"]
157    #[inline(always)]
158    pub fn is_1(&self) -> bool {
159        *self == RSPLENE1_A::_1
160    }
161}
162#[doc = "Field `RDLENE` reader - Read Data Length Error Flag"]
163pub type RDLENE_R = crate::BitReader<RDLENE_A>;
164#[doc = "Read Data Length Error Flag\n\nValue on reset: 0"]
165#[derive(Clone, Copy, Debug, PartialEq, Eq)]
166pub enum RDLENE_A {
167    #[doc = "0: No read data length error occurred"]
168    _0 = 0,
169    #[doc = "1: Read data length error occurred"]
170    _1 = 1,
171}
172impl From<RDLENE_A> for bool {
173    #[inline(always)]
174    fn from(variant: RDLENE_A) -> Self {
175        variant as u8 != 0
176    }
177}
178impl RDLENE_R {
179    #[doc = "Get enumerated values variant"]
180    #[inline(always)]
181    pub fn variant(&self) -> RDLENE_A {
182        match self.bits {
183            false => RDLENE_A::_0,
184            true => RDLENE_A::_1,
185        }
186    }
187    #[doc = "Checks if the value of the field is `_0`"]
188    #[inline(always)]
189    pub fn is_0(&self) -> bool {
190        *self == RDLENE_A::_0
191    }
192    #[doc = "Checks if the value of the field is `_1`"]
193    #[inline(always)]
194    pub fn is_1(&self) -> bool {
195        *self == RDLENE_A::_1
196    }
197}
198#[doc = "Field `CRCLENE` reader - CRC Status Token Length Error Flag"]
199pub type CRCLENE_R = crate::BitReader<CRCLENE_A>;
200#[doc = "CRC Status Token Length Error Flag\n\nValue on reset: 0"]
201#[derive(Clone, Copy, Debug, PartialEq, Eq)]
202pub enum CRCLENE_A {
203    #[doc = "0: No CRC status token length error occurred"]
204    _0 = 0,
205    #[doc = "1: CRC status token length error occurred"]
206    _1 = 1,
207}
208impl From<CRCLENE_A> for bool {
209    #[inline(always)]
210    fn from(variant: CRCLENE_A) -> Self {
211        variant as u8 != 0
212    }
213}
214impl CRCLENE_R {
215    #[doc = "Get enumerated values variant"]
216    #[inline(always)]
217    pub fn variant(&self) -> CRCLENE_A {
218        match self.bits {
219            false => CRCLENE_A::_0,
220            true => CRCLENE_A::_1,
221        }
222    }
223    #[doc = "Checks if the value of the field is `_0`"]
224    #[inline(always)]
225    pub fn is_0(&self) -> bool {
226        *self == CRCLENE_A::_0
227    }
228    #[doc = "Checks if the value of the field is `_1`"]
229    #[inline(always)]
230    pub fn is_1(&self) -> bool {
231        *self == CRCLENE_A::_1
232    }
233}
234#[doc = "Field `RSPCRCE0` reader - Response CRC Error Flag 0"]
235pub type RSPCRCE0_R = crate::BitReader<RSPCRCE0_A>;
236#[doc = "Response CRC Error Flag 0\n\nValue on reset: 0"]
237#[derive(Clone, Copy, Debug, PartialEq, Eq)]
238pub enum RSPCRCE0_A {
239    #[doc = "0: No CRC error detected in command response"]
240    _0 = 0,
241    #[doc = "1: CRC error detected in command response"]
242    _1 = 1,
243}
244impl From<RSPCRCE0_A> for bool {
245    #[inline(always)]
246    fn from(variant: RSPCRCE0_A) -> Self {
247        variant as u8 != 0
248    }
249}
250impl RSPCRCE0_R {
251    #[doc = "Get enumerated values variant"]
252    #[inline(always)]
253    pub fn variant(&self) -> RSPCRCE0_A {
254        match self.bits {
255            false => RSPCRCE0_A::_0,
256            true => RSPCRCE0_A::_1,
257        }
258    }
259    #[doc = "Checks if the value of the field is `_0`"]
260    #[inline(always)]
261    pub fn is_0(&self) -> bool {
262        *self == RSPCRCE0_A::_0
263    }
264    #[doc = "Checks if the value of the field is `_1`"]
265    #[inline(always)]
266    pub fn is_1(&self) -> bool {
267        *self == RSPCRCE0_A::_1
268    }
269}
270#[doc = "Field `RSPCRCE1` reader - Response CRC Error Flag 1"]
271pub type RSPCRCE1_R = crate::BitReader<RSPCRCE1_A>;
272#[doc = "Response CRC Error Flag 1\n\nValue on reset: 0"]
273#[derive(Clone, Copy, Debug, PartialEq, Eq)]
274pub enum RSPCRCE1_A {
275    #[doc = "0: No CRC error detected in command response (with SD_CMD.CMDIDX\\[5:0\\]
276setting, an error that occurs with CMD12 issue is indicated in the RSPCRCE0 flag)"]
277    _0 = 0,
278    #[doc = "1: CRC error detected in command response"]
279    _1 = 1,
280}
281impl From<RSPCRCE1_A> for bool {
282    #[inline(always)]
283    fn from(variant: RSPCRCE1_A) -> Self {
284        variant as u8 != 0
285    }
286}
287impl RSPCRCE1_R {
288    #[doc = "Get enumerated values variant"]
289    #[inline(always)]
290    pub fn variant(&self) -> RSPCRCE1_A {
291        match self.bits {
292            false => RSPCRCE1_A::_0,
293            true => RSPCRCE1_A::_1,
294        }
295    }
296    #[doc = "Checks if the value of the field is `_0`"]
297    #[inline(always)]
298    pub fn is_0(&self) -> bool {
299        *self == RSPCRCE1_A::_0
300    }
301    #[doc = "Checks if the value of the field is `_1`"]
302    #[inline(always)]
303    pub fn is_1(&self) -> bool {
304        *self == RSPCRCE1_A::_1
305    }
306}
307#[doc = "Field `RDCRCE` reader - Read Data CRC Error Flag"]
308pub type RDCRCE_R = crate::BitReader<RDCRCE_A>;
309#[doc = "Read Data CRC Error Flag\n\nValue on reset: 0"]
310#[derive(Clone, Copy, Debug, PartialEq, Eq)]
311pub enum RDCRCE_A {
312    #[doc = "0: No CRC error detected in read data"]
313    _0 = 0,
314    #[doc = "1: CRC error detected in read data"]
315    _1 = 1,
316}
317impl From<RDCRCE_A> for bool {
318    #[inline(always)]
319    fn from(variant: RDCRCE_A) -> Self {
320        variant as u8 != 0
321    }
322}
323impl RDCRCE_R {
324    #[doc = "Get enumerated values variant"]
325    #[inline(always)]
326    pub fn variant(&self) -> RDCRCE_A {
327        match self.bits {
328            false => RDCRCE_A::_0,
329            true => RDCRCE_A::_1,
330        }
331    }
332    #[doc = "Checks if the value of the field is `_0`"]
333    #[inline(always)]
334    pub fn is_0(&self) -> bool {
335        *self == RDCRCE_A::_0
336    }
337    #[doc = "Checks if the value of the field is `_1`"]
338    #[inline(always)]
339    pub fn is_1(&self) -> bool {
340        *self == RDCRCE_A::_1
341    }
342}
343#[doc = "Field `CRCTKE` reader - CRC Status Token Error Flag"]
344pub type CRCTKE_R = crate::BitReader<CRCTKE_A>;
345#[doc = "CRC Status Token Error Flag\n\nValue on reset: 0"]
346#[derive(Clone, Copy, Debug, PartialEq, Eq)]
347pub enum CRCTKE_A {
348    #[doc = "0: No error detected in CRC status token"]
349    _0 = 0,
350    #[doc = "1: Error detected in CRC status token"]
351    _1 = 1,
352}
353impl From<CRCTKE_A> for bool {
354    #[inline(always)]
355    fn from(variant: CRCTKE_A) -> Self {
356        variant as u8 != 0
357    }
358}
359impl CRCTKE_R {
360    #[doc = "Get enumerated values variant"]
361    #[inline(always)]
362    pub fn variant(&self) -> CRCTKE_A {
363        match self.bits {
364            false => CRCTKE_A::_0,
365            true => CRCTKE_A::_1,
366        }
367    }
368    #[doc = "Checks if the value of the field is `_0`"]
369    #[inline(always)]
370    pub fn is_0(&self) -> bool {
371        *self == CRCTKE_A::_0
372    }
373    #[doc = "Checks if the value of the field is `_1`"]
374    #[inline(always)]
375    pub fn is_1(&self) -> bool {
376        *self == CRCTKE_A::_1
377    }
378}
379#[doc = "Field `CRCTK` reader - CRC Status Token"]
380pub type CRCTK_R = crate::FieldReader<u8, u8>;
381impl R {
382    #[doc = "Bit 0 - Command Error Flag 0"]
383    #[inline(always)]
384    pub fn cmde0(&self) -> CMDE0_R {
385        CMDE0_R::new((self.bits & 1) != 0)
386    }
387    #[doc = "Bit 1 - Command Error Flag 1"]
388    #[inline(always)]
389    pub fn cmde1(&self) -> CMDE1_R {
390        CMDE1_R::new(((self.bits >> 1) & 1) != 0)
391    }
392    #[doc = "Bit 2 - Response Length Error Flag 0"]
393    #[inline(always)]
394    pub fn rsplene0(&self) -> RSPLENE0_R {
395        RSPLENE0_R::new(((self.bits >> 2) & 1) != 0)
396    }
397    #[doc = "Bit 3 - Response Length Error Flag 1"]
398    #[inline(always)]
399    pub fn rsplene1(&self) -> RSPLENE1_R {
400        RSPLENE1_R::new(((self.bits >> 3) & 1) != 0)
401    }
402    #[doc = "Bit 4 - Read Data Length Error Flag"]
403    #[inline(always)]
404    pub fn rdlene(&self) -> RDLENE_R {
405        RDLENE_R::new(((self.bits >> 4) & 1) != 0)
406    }
407    #[doc = "Bit 5 - CRC Status Token Length Error Flag"]
408    #[inline(always)]
409    pub fn crclene(&self) -> CRCLENE_R {
410        CRCLENE_R::new(((self.bits >> 5) & 1) != 0)
411    }
412    #[doc = "Bit 8 - Response CRC Error Flag 0"]
413    #[inline(always)]
414    pub fn rspcrce0(&self) -> RSPCRCE0_R {
415        RSPCRCE0_R::new(((self.bits >> 8) & 1) != 0)
416    }
417    #[doc = "Bit 9 - Response CRC Error Flag 1"]
418    #[inline(always)]
419    pub fn rspcrce1(&self) -> RSPCRCE1_R {
420        RSPCRCE1_R::new(((self.bits >> 9) & 1) != 0)
421    }
422    #[doc = "Bit 10 - Read Data CRC Error Flag"]
423    #[inline(always)]
424    pub fn rdcrce(&self) -> RDCRCE_R {
425        RDCRCE_R::new(((self.bits >> 10) & 1) != 0)
426    }
427    #[doc = "Bit 11 - CRC Status Token Error Flag"]
428    #[inline(always)]
429    pub fn crctke(&self) -> CRCTKE_R {
430        CRCTKE_R::new(((self.bits >> 11) & 1) != 0)
431    }
432    #[doc = "Bits 12:14 - CRC Status Token"]
433    #[inline(always)]
434    pub fn crctk(&self) -> CRCTK_R {
435        CRCTK_R::new(((self.bits >> 12) & 7) as u8)
436    }
437}
438#[doc = "SD Error Status Register 1\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sd_err_sts1](index.html) module"]
439pub struct SD_ERR_STS1_SPEC;
440impl crate::RegisterSpec for SD_ERR_STS1_SPEC {
441    type Ux = u32;
442}
443#[doc = "`read()` method returns [sd_err_sts1::R](R) reader structure"]
444impl crate::Readable for SD_ERR_STS1_SPEC {
445    type Reader = R;
446}
447#[doc = "`reset()` method sets SD_ERR_STS1 to value 0x2000"]
448impl crate::Resettable for SD_ERR_STS1_SPEC {
449    const RESET_VALUE: Self::Ux = 0x2000;
450}