1pub type R = crate::R<CMDrs>;
3pub type W = crate::W<CMDrs>;
5pub type CMDINDEX_R = crate::FieldReader;
7pub type CMDINDEX_W<'a, REG> = crate::FieldWriter<'a, REG, 6, u8, crate::Safe>;
9#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13#[derive(Clone, Copy, Debug, PartialEq, Eq)]
14#[repr(u8)]
15pub enum WAITRESP {
16 NoResponse = 0,
18 ShortResponse = 1,
20 NoResponse2 = 2,
22 LongResponse = 3,
24}
25impl From<WAITRESP> for u8 {
26 #[inline(always)]
27 fn from(variant: WAITRESP) -> Self {
28 variant as _
29 }
30}
31impl crate::FieldSpec for WAITRESP {
32 type Ux = u8;
33}
34impl crate::IsEnum for WAITRESP {}
35pub type WAITRESP_R = crate::FieldReader<WAITRESP>;
37impl WAITRESP_R {
38 #[inline(always)]
40 pub const fn variant(&self) -> WAITRESP {
41 match self.bits {
42 0 => WAITRESP::NoResponse,
43 1 => WAITRESP::ShortResponse,
44 2 => WAITRESP::NoResponse2,
45 3 => WAITRESP::LongResponse,
46 _ => unreachable!(),
47 }
48 }
49 #[inline(always)]
51 pub fn is_no_response(&self) -> bool {
52 *self == WAITRESP::NoResponse
53 }
54 #[inline(always)]
56 pub fn is_short_response(&self) -> bool {
57 *self == WAITRESP::ShortResponse
58 }
59 #[inline(always)]
61 pub fn is_no_response2(&self) -> bool {
62 *self == WAITRESP::NoResponse2
63 }
64 #[inline(always)]
66 pub fn is_long_response(&self) -> bool {
67 *self == WAITRESP::LongResponse
68 }
69}
70pub type WAITRESP_W<'a, REG> = crate::FieldWriter<'a, REG, 2, WAITRESP, crate::Safe>;
72impl<'a, REG> WAITRESP_W<'a, REG>
73where
74 REG: crate::Writable + crate::RegisterSpec,
75 REG::Ux: From<u8>,
76{
77 #[inline(always)]
79 pub fn no_response(self) -> &'a mut crate::W<REG> {
80 self.variant(WAITRESP::NoResponse)
81 }
82 #[inline(always)]
84 pub fn short_response(self) -> &'a mut crate::W<REG> {
85 self.variant(WAITRESP::ShortResponse)
86 }
87 #[inline(always)]
89 pub fn no_response2(self) -> &'a mut crate::W<REG> {
90 self.variant(WAITRESP::NoResponse2)
91 }
92 #[inline(always)]
94 pub fn long_response(self) -> &'a mut crate::W<REG> {
95 self.variant(WAITRESP::LongResponse)
96 }
97}
98#[cfg_attr(feature = "defmt", derive(defmt::Format))]
102#[derive(Clone, Copy, Debug, PartialEq, Eq)]
103pub enum WAITINT {
104 Disabled = 0,
106 Enabled = 1,
108}
109impl From<WAITINT> for bool {
110 #[inline(always)]
111 fn from(variant: WAITINT) -> Self {
112 variant as u8 != 0
113 }
114}
115pub type WAITINT_R = crate::BitReader<WAITINT>;
117impl WAITINT_R {
118 #[inline(always)]
120 pub const fn variant(&self) -> WAITINT {
121 match self.bits {
122 false => WAITINT::Disabled,
123 true => WAITINT::Enabled,
124 }
125 }
126 #[inline(always)]
128 pub fn is_disabled(&self) -> bool {
129 *self == WAITINT::Disabled
130 }
131 #[inline(always)]
133 pub fn is_enabled(&self) -> bool {
134 *self == WAITINT::Enabled
135 }
136}
137pub type WAITINT_W<'a, REG> = crate::BitWriter<'a, REG, WAITINT>;
139impl<'a, REG> WAITINT_W<'a, REG>
140where
141 REG: crate::Writable + crate::RegisterSpec,
142{
143 #[inline(always)]
145 pub fn disabled(self) -> &'a mut crate::W<REG> {
146 self.variant(WAITINT::Disabled)
147 }
148 #[inline(always)]
150 pub fn enabled(self) -> &'a mut crate::W<REG> {
151 self.variant(WAITINT::Enabled)
152 }
153}
154#[cfg_attr(feature = "defmt", derive(defmt::Format))]
158#[derive(Clone, Copy, Debug, PartialEq, Eq)]
159pub enum WAITPEND {
160 Disabled = 0,
162 Enabled = 1,
164}
165impl From<WAITPEND> for bool {
166 #[inline(always)]
167 fn from(variant: WAITPEND) -> Self {
168 variant as u8 != 0
169 }
170}
171pub type WAITPEND_R = crate::BitReader<WAITPEND>;
173impl WAITPEND_R {
174 #[inline(always)]
176 pub const fn variant(&self) -> WAITPEND {
177 match self.bits {
178 false => WAITPEND::Disabled,
179 true => WAITPEND::Enabled,
180 }
181 }
182 #[inline(always)]
184 pub fn is_disabled(&self) -> bool {
185 *self == WAITPEND::Disabled
186 }
187 #[inline(always)]
189 pub fn is_enabled(&self) -> bool {
190 *self == WAITPEND::Enabled
191 }
192}
193pub type WAITPEND_W<'a, REG> = crate::BitWriter<'a, REG, WAITPEND>;
195impl<'a, REG> WAITPEND_W<'a, REG>
196where
197 REG: crate::Writable + crate::RegisterSpec,
198{
199 #[inline(always)]
201 pub fn disabled(self) -> &'a mut crate::W<REG> {
202 self.variant(WAITPEND::Disabled)
203 }
204 #[inline(always)]
206 pub fn enabled(self) -> &'a mut crate::W<REG> {
207 self.variant(WAITPEND::Enabled)
208 }
209}
210#[cfg_attr(feature = "defmt", derive(defmt::Format))]
214#[derive(Clone, Copy, Debug, PartialEq, Eq)]
215pub enum CPSMEN {
216 Disabled = 0,
218 Enabled = 1,
220}
221impl From<CPSMEN> for bool {
222 #[inline(always)]
223 fn from(variant: CPSMEN) -> Self {
224 variant as u8 != 0
225 }
226}
227pub type CPSMEN_R = crate::BitReader<CPSMEN>;
229impl CPSMEN_R {
230 #[inline(always)]
232 pub const fn variant(&self) -> CPSMEN {
233 match self.bits {
234 false => CPSMEN::Disabled,
235 true => CPSMEN::Enabled,
236 }
237 }
238 #[inline(always)]
240 pub fn is_disabled(&self) -> bool {
241 *self == CPSMEN::Disabled
242 }
243 #[inline(always)]
245 pub fn is_enabled(&self) -> bool {
246 *self == CPSMEN::Enabled
247 }
248}
249pub type CPSMEN_W<'a, REG> = crate::BitWriter<'a, REG, CPSMEN>;
251impl<'a, REG> CPSMEN_W<'a, REG>
252where
253 REG: crate::Writable + crate::RegisterSpec,
254{
255 #[inline(always)]
257 pub fn disabled(self) -> &'a mut crate::W<REG> {
258 self.variant(CPSMEN::Disabled)
259 }
260 #[inline(always)]
262 pub fn enabled(self) -> &'a mut crate::W<REG> {
263 self.variant(CPSMEN::Enabled)
264 }
265}
266#[cfg_attr(feature = "defmt", derive(defmt::Format))]
270#[derive(Clone, Copy, Debug, PartialEq, Eq)]
271pub enum SDIOSUSPEND {
272 Disabled = 0,
274 Enabled = 1,
276}
277impl From<SDIOSUSPEND> for bool {
278 #[inline(always)]
279 fn from(variant: SDIOSUSPEND) -> Self {
280 variant as u8 != 0
281 }
282}
283pub type SDIOSUSPEND_R = crate::BitReader<SDIOSUSPEND>;
285impl SDIOSUSPEND_R {
286 #[inline(always)]
288 pub const fn variant(&self) -> SDIOSUSPEND {
289 match self.bits {
290 false => SDIOSUSPEND::Disabled,
291 true => SDIOSUSPEND::Enabled,
292 }
293 }
294 #[inline(always)]
296 pub fn is_disabled(&self) -> bool {
297 *self == SDIOSUSPEND::Disabled
298 }
299 #[inline(always)]
301 pub fn is_enabled(&self) -> bool {
302 *self == SDIOSUSPEND::Enabled
303 }
304}
305pub type SDIOSUSPEND_W<'a, REG> = crate::BitWriter<'a, REG, SDIOSUSPEND>;
307impl<'a, REG> SDIOSUSPEND_W<'a, REG>
308where
309 REG: crate::Writable + crate::RegisterSpec,
310{
311 #[inline(always)]
313 pub fn disabled(self) -> &'a mut crate::W<REG> {
314 self.variant(SDIOSUSPEND::Disabled)
315 }
316 #[inline(always)]
318 pub fn enabled(self) -> &'a mut crate::W<REG> {
319 self.variant(SDIOSUSPEND::Enabled)
320 }
321}
322#[cfg_attr(feature = "defmt", derive(defmt::Format))]
326#[derive(Clone, Copy, Debug, PartialEq, Eq)]
327pub enum ENCMDCOMPL {
328 Disabled = 0,
330 Enabled = 1,
332}
333impl From<ENCMDCOMPL> for bool {
334 #[inline(always)]
335 fn from(variant: ENCMDCOMPL) -> Self {
336 variant as u8 != 0
337 }
338}
339pub type ENCMDCOMPL_R = crate::BitReader<ENCMDCOMPL>;
341impl ENCMDCOMPL_R {
342 #[inline(always)]
344 pub const fn variant(&self) -> ENCMDCOMPL {
345 match self.bits {
346 false => ENCMDCOMPL::Disabled,
347 true => ENCMDCOMPL::Enabled,
348 }
349 }
350 #[inline(always)]
352 pub fn is_disabled(&self) -> bool {
353 *self == ENCMDCOMPL::Disabled
354 }
355 #[inline(always)]
357 pub fn is_enabled(&self) -> bool {
358 *self == ENCMDCOMPL::Enabled
359 }
360}
361pub type ENCMDCOMPL_W<'a, REG> = crate::BitWriter<'a, REG, ENCMDCOMPL>;
363impl<'a, REG> ENCMDCOMPL_W<'a, REG>
364where
365 REG: crate::Writable + crate::RegisterSpec,
366{
367 #[inline(always)]
369 pub fn disabled(self) -> &'a mut crate::W<REG> {
370 self.variant(ENCMDCOMPL::Disabled)
371 }
372 #[inline(always)]
374 pub fn enabled(self) -> &'a mut crate::W<REG> {
375 self.variant(ENCMDCOMPL::Enabled)
376 }
377}
378#[cfg_attr(feature = "defmt", derive(defmt::Format))]
382#[derive(Clone, Copy, Debug, PartialEq, Eq)]
383pub enum N_IEN {
384 Disabled = 0,
386 Enabled = 1,
388}
389impl From<N_IEN> for bool {
390 #[inline(always)]
391 fn from(variant: N_IEN) -> Self {
392 variant as u8 != 0
393 }
394}
395pub type N_IEN_R = crate::BitReader<N_IEN>;
397impl N_IEN_R {
398 #[inline(always)]
400 pub const fn variant(&self) -> N_IEN {
401 match self.bits {
402 false => N_IEN::Disabled,
403 true => N_IEN::Enabled,
404 }
405 }
406 #[inline(always)]
408 pub fn is_disabled(&self) -> bool {
409 *self == N_IEN::Disabled
410 }
411 #[inline(always)]
413 pub fn is_enabled(&self) -> bool {
414 *self == N_IEN::Enabled
415 }
416}
417pub type N_IEN_W<'a, REG> = crate::BitWriter<'a, REG, N_IEN>;
419impl<'a, REG> N_IEN_W<'a, REG>
420where
421 REG: crate::Writable + crate::RegisterSpec,
422{
423 #[inline(always)]
425 pub fn disabled(self) -> &'a mut crate::W<REG> {
426 self.variant(N_IEN::Disabled)
427 }
428 #[inline(always)]
430 pub fn enabled(self) -> &'a mut crate::W<REG> {
431 self.variant(N_IEN::Enabled)
432 }
433}
434#[cfg_attr(feature = "defmt", derive(defmt::Format))]
438#[derive(Clone, Copy, Debug, PartialEq, Eq)]
439pub enum CE_ATACMD {
440 Disabled = 0,
442 Enabled = 1,
444}
445impl From<CE_ATACMD> for bool {
446 #[inline(always)]
447 fn from(variant: CE_ATACMD) -> Self {
448 variant as u8 != 0
449 }
450}
451pub type CE_ATACMD_R = crate::BitReader<CE_ATACMD>;
453impl CE_ATACMD_R {
454 #[inline(always)]
456 pub const fn variant(&self) -> CE_ATACMD {
457 match self.bits {
458 false => CE_ATACMD::Disabled,
459 true => CE_ATACMD::Enabled,
460 }
461 }
462 #[inline(always)]
464 pub fn is_disabled(&self) -> bool {
465 *self == CE_ATACMD::Disabled
466 }
467 #[inline(always)]
469 pub fn is_enabled(&self) -> bool {
470 *self == CE_ATACMD::Enabled
471 }
472}
473pub type CE_ATACMD_W<'a, REG> = crate::BitWriter<'a, REG, CE_ATACMD>;
475impl<'a, REG> CE_ATACMD_W<'a, REG>
476where
477 REG: crate::Writable + crate::RegisterSpec,
478{
479 #[inline(always)]
481 pub fn disabled(self) -> &'a mut crate::W<REG> {
482 self.variant(CE_ATACMD::Disabled)
483 }
484 #[inline(always)]
486 pub fn enabled(self) -> &'a mut crate::W<REG> {
487 self.variant(CE_ATACMD::Enabled)
488 }
489}
490impl R {
491 #[inline(always)]
493 pub fn cmdindex(&self) -> CMDINDEX_R {
494 CMDINDEX_R::new((self.bits & 0x3f) as u8)
495 }
496 #[inline(always)]
498 pub fn waitresp(&self) -> WAITRESP_R {
499 WAITRESP_R::new(((self.bits >> 6) & 3) as u8)
500 }
501 #[inline(always)]
503 pub fn waitint(&self) -> WAITINT_R {
504 WAITINT_R::new(((self.bits >> 8) & 1) != 0)
505 }
506 #[inline(always)]
508 pub fn waitpend(&self) -> WAITPEND_R {
509 WAITPEND_R::new(((self.bits >> 9) & 1) != 0)
510 }
511 #[inline(always)]
513 pub fn cpsmen(&self) -> CPSMEN_R {
514 CPSMEN_R::new(((self.bits >> 10) & 1) != 0)
515 }
516 #[inline(always)]
518 pub fn sdiosuspend(&self) -> SDIOSUSPEND_R {
519 SDIOSUSPEND_R::new(((self.bits >> 11) & 1) != 0)
520 }
521 #[inline(always)]
523 pub fn encmdcompl(&self) -> ENCMDCOMPL_R {
524 ENCMDCOMPL_R::new(((self.bits >> 12) & 1) != 0)
525 }
526 #[inline(always)]
528 pub fn n_ien(&self) -> N_IEN_R {
529 N_IEN_R::new(((self.bits >> 13) & 1) != 0)
530 }
531 #[inline(always)]
533 pub fn ce_atacmd(&self) -> CE_ATACMD_R {
534 CE_ATACMD_R::new(((self.bits >> 14) & 1) != 0)
535 }
536}
537impl core::fmt::Debug for R {
538 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
539 f.debug_struct("CMD")
540 .field("cmdindex", &self.cmdindex())
541 .field("waitresp", &self.waitresp())
542 .field("waitint", &self.waitint())
543 .field("waitpend", &self.waitpend())
544 .field("cpsmen", &self.cpsmen())
545 .field("sdiosuspend", &self.sdiosuspend())
546 .field("encmdcompl", &self.encmdcompl())
547 .field("n_ien", &self.n_ien())
548 .field("ce_atacmd", &self.ce_atacmd())
549 .finish()
550 }
551}
552impl W {
553 #[inline(always)]
555 pub fn cmdindex(&mut self) -> CMDINDEX_W<CMDrs> {
556 CMDINDEX_W::new(self, 0)
557 }
558 #[inline(always)]
560 pub fn waitresp(&mut self) -> WAITRESP_W<CMDrs> {
561 WAITRESP_W::new(self, 6)
562 }
563 #[inline(always)]
565 pub fn waitint(&mut self) -> WAITINT_W<CMDrs> {
566 WAITINT_W::new(self, 8)
567 }
568 #[inline(always)]
570 pub fn waitpend(&mut self) -> WAITPEND_W<CMDrs> {
571 WAITPEND_W::new(self, 9)
572 }
573 #[inline(always)]
575 pub fn cpsmen(&mut self) -> CPSMEN_W<CMDrs> {
576 CPSMEN_W::new(self, 10)
577 }
578 #[inline(always)]
580 pub fn sdiosuspend(&mut self) -> SDIOSUSPEND_W<CMDrs> {
581 SDIOSUSPEND_W::new(self, 11)
582 }
583 #[inline(always)]
585 pub fn encmdcompl(&mut self) -> ENCMDCOMPL_W<CMDrs> {
586 ENCMDCOMPL_W::new(self, 12)
587 }
588 #[inline(always)]
590 pub fn n_ien(&mut self) -> N_IEN_W<CMDrs> {
591 N_IEN_W::new(self, 13)
592 }
593 #[inline(always)]
595 pub fn ce_atacmd(&mut self) -> CE_ATACMD_W<CMDrs> {
596 CE_ATACMD_W::new(self, 14)
597 }
598}
599pub struct CMDrs;
605impl crate::RegisterSpec for CMDrs {
606 type Ux = u32;
607}
608impl crate::Readable for CMDrs {}
610impl crate::Writable for CMDrs {
612 type Safety = crate::Unsafe;
613}
614impl crate::Resettable for CMDrs {}