atsamd51n/sdhc0/
acesr.rs

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
#[doc = "Register `ACESR` reader"]
pub type R = crate::R<AcesrSpec>;
#[doc = "Auto CMD12 Not Executed\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Acmd12neselect {
    #[doc = "0: Executed"]
    Exec = 0,
    #[doc = "1: Not executed"]
    NotExec = 1,
}
impl From<Acmd12neselect> for bool {
    #[inline(always)]
    fn from(variant: Acmd12neselect) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ACMD12NE` reader - Auto CMD12 Not Executed"]
pub type Acmd12neR = crate::BitReader<Acmd12neselect>;
impl Acmd12neR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Acmd12neselect {
        match self.bits {
            false => Acmd12neselect::Exec,
            true => Acmd12neselect::NotExec,
        }
    }
    #[doc = "Executed"]
    #[inline(always)]
    pub fn is_exec(&self) -> bool {
        *self == Acmd12neselect::Exec
    }
    #[doc = "Not executed"]
    #[inline(always)]
    pub fn is_not_exec(&self) -> bool {
        *self == Acmd12neselect::NotExec
    }
}
#[doc = "Auto CMD Timeout Error\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Acmdteoselect {
    #[doc = "0: No error"]
    No = 0,
    #[doc = "1: Timeout"]
    Yes = 1,
}
impl From<Acmdteoselect> for bool {
    #[inline(always)]
    fn from(variant: Acmdteoselect) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ACMDTEO` reader - Auto CMD Timeout Error"]
pub type AcmdteoR = crate::BitReader<Acmdteoselect>;
impl AcmdteoR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Acmdteoselect {
        match self.bits {
            false => Acmdteoselect::No,
            true => Acmdteoselect::Yes,
        }
    }
    #[doc = "No error"]
    #[inline(always)]
    pub fn is_no(&self) -> bool {
        *self == Acmdteoselect::No
    }
    #[doc = "Timeout"]
    #[inline(always)]
    pub fn is_yes(&self) -> bool {
        *self == Acmdteoselect::Yes
    }
}
#[doc = "Auto CMD CRC Error\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Acmdcrcselect {
    #[doc = "0: No error"]
    No = 0,
    #[doc = "1: CRC Error Generated"]
    Yes = 1,
}
impl From<Acmdcrcselect> for bool {
    #[inline(always)]
    fn from(variant: Acmdcrcselect) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ACMDCRC` reader - Auto CMD CRC Error"]
pub type AcmdcrcR = crate::BitReader<Acmdcrcselect>;
impl AcmdcrcR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Acmdcrcselect {
        match self.bits {
            false => Acmdcrcselect::No,
            true => Acmdcrcselect::Yes,
        }
    }
    #[doc = "No error"]
    #[inline(always)]
    pub fn is_no(&self) -> bool {
        *self == Acmdcrcselect::No
    }
    #[doc = "CRC Error Generated"]
    #[inline(always)]
    pub fn is_yes(&self) -> bool {
        *self == Acmdcrcselect::Yes
    }
}
#[doc = "Auto CMD End Bit Error\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Acmdendselect {
    #[doc = "0: No error"]
    No = 0,
    #[doc = "1: End Bit Error Generated"]
    Yes = 1,
}
impl From<Acmdendselect> for bool {
    #[inline(always)]
    fn from(variant: Acmdendselect) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ACMDEND` reader - Auto CMD End Bit Error"]
pub type AcmdendR = crate::BitReader<Acmdendselect>;
impl AcmdendR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Acmdendselect {
        match self.bits {
            false => Acmdendselect::No,
            true => Acmdendselect::Yes,
        }
    }
    #[doc = "No error"]
    #[inline(always)]
    pub fn is_no(&self) -> bool {
        *self == Acmdendselect::No
    }
    #[doc = "End Bit Error Generated"]
    #[inline(always)]
    pub fn is_yes(&self) -> bool {
        *self == Acmdendselect::Yes
    }
}
#[doc = "Auto CMD Index Error\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Acmdidxselect {
    #[doc = "0: No error"]
    No = 0,
    #[doc = "1: Error"]
    Yes = 1,
}
impl From<Acmdidxselect> for bool {
    #[inline(always)]
    fn from(variant: Acmdidxselect) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ACMDIDX` reader - Auto CMD Index Error"]
pub type AcmdidxR = crate::BitReader<Acmdidxselect>;
impl AcmdidxR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Acmdidxselect {
        match self.bits {
            false => Acmdidxselect::No,
            true => Acmdidxselect::Yes,
        }
    }
    #[doc = "No error"]
    #[inline(always)]
    pub fn is_no(&self) -> bool {
        *self == Acmdidxselect::No
    }
    #[doc = "Error"]
    #[inline(always)]
    pub fn is_yes(&self) -> bool {
        *self == Acmdidxselect::Yes
    }
}
#[doc = "Command not Issued By Auto CMD12 Error\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cmdniselect {
    #[doc = "0: No error"]
    Ok = 0,
    #[doc = "1: Not Issued"]
    NotIssued = 1,
}
impl From<Cmdniselect> for bool {
    #[inline(always)]
    fn from(variant: Cmdniselect) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CMDNI` reader - Command not Issued By Auto CMD12 Error"]
pub type CmdniR = crate::BitReader<Cmdniselect>;
impl CmdniR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cmdniselect {
        match self.bits {
            false => Cmdniselect::Ok,
            true => Cmdniselect::NotIssued,
        }
    }
    #[doc = "No error"]
    #[inline(always)]
    pub fn is_ok(&self) -> bool {
        *self == Cmdniselect::Ok
    }
    #[doc = "Not Issued"]
    #[inline(always)]
    pub fn is_not_issued(&self) -> bool {
        *self == Cmdniselect::NotIssued
    }
}
impl R {
    #[doc = "Bit 0 - Auto CMD12 Not Executed"]
    #[inline(always)]
    pub fn acmd12ne(&self) -> Acmd12neR {
        Acmd12neR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Auto CMD Timeout Error"]
    #[inline(always)]
    pub fn acmdteo(&self) -> AcmdteoR {
        AcmdteoR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Auto CMD CRC Error"]
    #[inline(always)]
    pub fn acmdcrc(&self) -> AcmdcrcR {
        AcmdcrcR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Auto CMD End Bit Error"]
    #[inline(always)]
    pub fn acmdend(&self) -> AcmdendR {
        AcmdendR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Auto CMD Index Error"]
    #[inline(always)]
    pub fn acmdidx(&self) -> AcmdidxR {
        AcmdidxR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 7 - Command not Issued By Auto CMD12 Error"]
    #[inline(always)]
    pub fn cmdni(&self) -> CmdniR {
        CmdniR::new(((self.bits >> 7) & 1) != 0)
    }
}
#[doc = "Auto CMD Error Status\n\nYou can [`read`](crate::Reg::read) this register and get [`acesr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct AcesrSpec;
impl crate::RegisterSpec for AcesrSpec {
    type Ux = u16;
}
#[doc = "`read()` method returns [`acesr::R`](R) reader structure"]
impl crate::Readable for AcesrSpec {}
#[doc = "`reset()` method sets ACESR to value 0"]
impl crate::Resettable for AcesrSpec {
    const RESET_VALUE: u16 = 0;
}