atsamd51p/sdhc0/
feraces.rs

1#[doc = "Register `FERACES` writer"]
2pub type W = crate::W<FeracesSpec>;
3#[doc = "Force Event for Auto CMD12 Not Executed\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum Acmd12neselect {
6    #[doc = "0: No Interrupt"]
7    No = 0,
8    #[doc = "1: Interrupt is generated"]
9    Yes = 1,
10}
11impl From<Acmd12neselect> for bool {
12    #[inline(always)]
13    fn from(variant: Acmd12neselect) -> Self {
14        variant as u8 != 0
15    }
16}
17#[doc = "Field `ACMD12NE` writer - Force Event for Auto CMD12 Not Executed"]
18pub type Acmd12neW<'a, REG> = crate::BitWriter<'a, REG, Acmd12neselect>;
19impl<'a, REG> Acmd12neW<'a, REG>
20where
21    REG: crate::Writable + crate::RegisterSpec,
22{
23    #[doc = "No Interrupt"]
24    #[inline(always)]
25    pub fn no(self) -> &'a mut crate::W<REG> {
26        self.variant(Acmd12neselect::No)
27    }
28    #[doc = "Interrupt is generated"]
29    #[inline(always)]
30    pub fn yes(self) -> &'a mut crate::W<REG> {
31        self.variant(Acmd12neselect::Yes)
32    }
33}
34#[doc = "Force Event for Auto CMD Timeout Error\n\nValue on reset: 0"]
35#[derive(Clone, Copy, Debug, PartialEq, Eq)]
36pub enum Acmdteoselect {
37    #[doc = "0: No Interrupt"]
38    No = 0,
39    #[doc = "1: Interrupt is generated"]
40    Yes = 1,
41}
42impl From<Acmdteoselect> for bool {
43    #[inline(always)]
44    fn from(variant: Acmdteoselect) -> Self {
45        variant as u8 != 0
46    }
47}
48#[doc = "Field `ACMDTEO` writer - Force Event for Auto CMD Timeout Error"]
49pub type AcmdteoW<'a, REG> = crate::BitWriter<'a, REG, Acmdteoselect>;
50impl<'a, REG> AcmdteoW<'a, REG>
51where
52    REG: crate::Writable + crate::RegisterSpec,
53{
54    #[doc = "No Interrupt"]
55    #[inline(always)]
56    pub fn no(self) -> &'a mut crate::W<REG> {
57        self.variant(Acmdteoselect::No)
58    }
59    #[doc = "Interrupt is generated"]
60    #[inline(always)]
61    pub fn yes(self) -> &'a mut crate::W<REG> {
62        self.variant(Acmdteoselect::Yes)
63    }
64}
65#[doc = "Force Event for Auto CMD CRC Error\n\nValue on reset: 0"]
66#[derive(Clone, Copy, Debug, PartialEq, Eq)]
67pub enum Acmdcrcselect {
68    #[doc = "0: No Interrupt"]
69    No = 0,
70    #[doc = "1: Interrupt is generated"]
71    Yes = 1,
72}
73impl From<Acmdcrcselect> for bool {
74    #[inline(always)]
75    fn from(variant: Acmdcrcselect) -> Self {
76        variant as u8 != 0
77    }
78}
79#[doc = "Field `ACMDCRC` writer - Force Event for Auto CMD CRC Error"]
80pub type AcmdcrcW<'a, REG> = crate::BitWriter<'a, REG, Acmdcrcselect>;
81impl<'a, REG> AcmdcrcW<'a, REG>
82where
83    REG: crate::Writable + crate::RegisterSpec,
84{
85    #[doc = "No Interrupt"]
86    #[inline(always)]
87    pub fn no(self) -> &'a mut crate::W<REG> {
88        self.variant(Acmdcrcselect::No)
89    }
90    #[doc = "Interrupt is generated"]
91    #[inline(always)]
92    pub fn yes(self) -> &'a mut crate::W<REG> {
93        self.variant(Acmdcrcselect::Yes)
94    }
95}
96#[doc = "Force Event for Auto CMD End Bit Error\n\nValue on reset: 0"]
97#[derive(Clone, Copy, Debug, PartialEq, Eq)]
98pub enum Acmdendselect {
99    #[doc = "0: No Interrupt"]
100    No = 0,
101    #[doc = "1: Interrupt is generated"]
102    Yes = 1,
103}
104impl From<Acmdendselect> for bool {
105    #[inline(always)]
106    fn from(variant: Acmdendselect) -> Self {
107        variant as u8 != 0
108    }
109}
110#[doc = "Field `ACMDEND` writer - Force Event for Auto CMD End Bit Error"]
111pub type AcmdendW<'a, REG> = crate::BitWriter<'a, REG, Acmdendselect>;
112impl<'a, REG> AcmdendW<'a, REG>
113where
114    REG: crate::Writable + crate::RegisterSpec,
115{
116    #[doc = "No Interrupt"]
117    #[inline(always)]
118    pub fn no(self) -> &'a mut crate::W<REG> {
119        self.variant(Acmdendselect::No)
120    }
121    #[doc = "Interrupt is generated"]
122    #[inline(always)]
123    pub fn yes(self) -> &'a mut crate::W<REG> {
124        self.variant(Acmdendselect::Yes)
125    }
126}
127#[doc = "Force Event for Auto CMD Index Error\n\nValue on reset: 0"]
128#[derive(Clone, Copy, Debug, PartialEq, Eq)]
129pub enum Acmdidxselect {
130    #[doc = "0: No Interrupt"]
131    No = 0,
132    #[doc = "1: Interrupt is generated"]
133    Yes = 1,
134}
135impl From<Acmdidxselect> for bool {
136    #[inline(always)]
137    fn from(variant: Acmdidxselect) -> Self {
138        variant as u8 != 0
139    }
140}
141#[doc = "Field `ACMDIDX` writer - Force Event for Auto CMD Index Error"]
142pub type AcmdidxW<'a, REG> = crate::BitWriter<'a, REG, Acmdidxselect>;
143impl<'a, REG> AcmdidxW<'a, REG>
144where
145    REG: crate::Writable + crate::RegisterSpec,
146{
147    #[doc = "No Interrupt"]
148    #[inline(always)]
149    pub fn no(self) -> &'a mut crate::W<REG> {
150        self.variant(Acmdidxselect::No)
151    }
152    #[doc = "Interrupt is generated"]
153    #[inline(always)]
154    pub fn yes(self) -> &'a mut crate::W<REG> {
155        self.variant(Acmdidxselect::Yes)
156    }
157}
158#[doc = "Force Event for Command Not Issued By Auto CMD12 Error\n\nValue on reset: 0"]
159#[derive(Clone, Copy, Debug, PartialEq, Eq)]
160pub enum Cmdniselect {
161    #[doc = "0: No Interrupt"]
162    No = 0,
163    #[doc = "1: Interrupt is generated"]
164    Yes = 1,
165}
166impl From<Cmdniselect> for bool {
167    #[inline(always)]
168    fn from(variant: Cmdniselect) -> Self {
169        variant as u8 != 0
170    }
171}
172#[doc = "Field `CMDNI` writer - Force Event for Command Not Issued By Auto CMD12 Error"]
173pub type CmdniW<'a, REG> = crate::BitWriter<'a, REG, Cmdniselect>;
174impl<'a, REG> CmdniW<'a, REG>
175where
176    REG: crate::Writable + crate::RegisterSpec,
177{
178    #[doc = "No Interrupt"]
179    #[inline(always)]
180    pub fn no(self) -> &'a mut crate::W<REG> {
181        self.variant(Cmdniselect::No)
182    }
183    #[doc = "Interrupt is generated"]
184    #[inline(always)]
185    pub fn yes(self) -> &'a mut crate::W<REG> {
186        self.variant(Cmdniselect::Yes)
187    }
188}
189impl W {
190    #[doc = "Bit 0 - Force Event for Auto CMD12 Not Executed"]
191    #[inline(always)]
192    #[must_use]
193    pub fn acmd12ne(&mut self) -> Acmd12neW<FeracesSpec> {
194        Acmd12neW::new(self, 0)
195    }
196    #[doc = "Bit 1 - Force Event for Auto CMD Timeout Error"]
197    #[inline(always)]
198    #[must_use]
199    pub fn acmdteo(&mut self) -> AcmdteoW<FeracesSpec> {
200        AcmdteoW::new(self, 1)
201    }
202    #[doc = "Bit 2 - Force Event for Auto CMD CRC Error"]
203    #[inline(always)]
204    #[must_use]
205    pub fn acmdcrc(&mut self) -> AcmdcrcW<FeracesSpec> {
206        AcmdcrcW::new(self, 2)
207    }
208    #[doc = "Bit 3 - Force Event for Auto CMD End Bit Error"]
209    #[inline(always)]
210    #[must_use]
211    pub fn acmdend(&mut self) -> AcmdendW<FeracesSpec> {
212        AcmdendW::new(self, 3)
213    }
214    #[doc = "Bit 4 - Force Event for Auto CMD Index Error"]
215    #[inline(always)]
216    #[must_use]
217    pub fn acmdidx(&mut self) -> AcmdidxW<FeracesSpec> {
218        AcmdidxW::new(self, 4)
219    }
220    #[doc = "Bit 7 - Force Event for Command Not Issued By Auto CMD12 Error"]
221    #[inline(always)]
222    #[must_use]
223    pub fn cmdni(&mut self) -> CmdniW<FeracesSpec> {
224        CmdniW::new(self, 7)
225    }
226}
227#[doc = "Force Event for Auto CMD Error Status\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`feraces::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
228pub struct FeracesSpec;
229impl crate::RegisterSpec for FeracesSpec {
230    type Ux = u16;
231}
232#[doc = "`write(|w| ..)` method takes [`feraces::W`](W) writer structure"]
233impl crate::Writable for FeracesSpec {
234    type Safety = crate::Unsafe;
235    const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
236    const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
237}
238#[doc = "`reset()` method sets FERACES to value 0"]
239impl crate::Resettable for FeracesSpec {
240    const RESET_VALUE: u16 = 0;
241}