lpc55_pac/sdif/
cmd.rs

1#[doc = "Register `CMD` reader"]
2pub struct R(crate::R<CMD_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CMD_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CMD_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CMD_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CMD` writer"]
17pub struct W(crate::W<CMD_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CMD_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<CMD_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CMD_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `CMD_INDEX` reader - Command index."]
38pub struct CMD_INDEX_R(crate::FieldReader<u8, u8>);
39impl CMD_INDEX_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: u8) -> Self {
42        CMD_INDEX_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for CMD_INDEX_R {
46    type Target = crate::FieldReader<u8, u8>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "Field `CMD_INDEX` writer - Command index."]
53pub struct CMD_INDEX_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> CMD_INDEX_W<'a> {
57    #[doc = r"Writes raw bits to the field"]
58    #[inline(always)]
59    pub unsafe fn bits(self, value: u8) -> &'a mut W {
60        self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f);
61        self.w
62    }
63}
64#[doc = "Field `RESPONSE_EXPECT` reader - Response expect."]
65pub struct RESPONSE_EXPECT_R(crate::FieldReader<bool, bool>);
66impl RESPONSE_EXPECT_R {
67    #[inline(always)]
68    pub(crate) fn new(bits: bool) -> Self {
69        RESPONSE_EXPECT_R(crate::FieldReader::new(bits))
70    }
71}
72impl core::ops::Deref for RESPONSE_EXPECT_R {
73    type Target = crate::FieldReader<bool, bool>;
74    #[inline(always)]
75    fn deref(&self) -> &Self::Target {
76        &self.0
77    }
78}
79#[doc = "Field `RESPONSE_EXPECT` writer - Response expect."]
80pub struct RESPONSE_EXPECT_W<'a> {
81    w: &'a mut W,
82}
83impl<'a> RESPONSE_EXPECT_W<'a> {
84    #[doc = r"Sets the field bit"]
85    #[inline(always)]
86    pub fn set_bit(self) -> &'a mut W {
87        self.bit(true)
88    }
89    #[doc = r"Clears the field bit"]
90    #[inline(always)]
91    pub fn clear_bit(self) -> &'a mut W {
92        self.bit(false)
93    }
94    #[doc = r"Writes raw bits to the field"]
95    #[inline(always)]
96    pub fn bit(self, value: bool) -> &'a mut W {
97        self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
98        self.w
99    }
100}
101#[doc = "Field `RESPONSE_LENGTH` reader - Response length."]
102pub struct RESPONSE_LENGTH_R(crate::FieldReader<bool, bool>);
103impl RESPONSE_LENGTH_R {
104    #[inline(always)]
105    pub(crate) fn new(bits: bool) -> Self {
106        RESPONSE_LENGTH_R(crate::FieldReader::new(bits))
107    }
108}
109impl core::ops::Deref for RESPONSE_LENGTH_R {
110    type Target = crate::FieldReader<bool, bool>;
111    #[inline(always)]
112    fn deref(&self) -> &Self::Target {
113        &self.0
114    }
115}
116#[doc = "Field `RESPONSE_LENGTH` writer - Response length."]
117pub struct RESPONSE_LENGTH_W<'a> {
118    w: &'a mut W,
119}
120impl<'a> RESPONSE_LENGTH_W<'a> {
121    #[doc = r"Sets the field bit"]
122    #[inline(always)]
123    pub fn set_bit(self) -> &'a mut W {
124        self.bit(true)
125    }
126    #[doc = r"Clears the field bit"]
127    #[inline(always)]
128    pub fn clear_bit(self) -> &'a mut W {
129        self.bit(false)
130    }
131    #[doc = r"Writes raw bits to the field"]
132    #[inline(always)]
133    pub fn bit(self, value: bool) -> &'a mut W {
134        self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
135        self.w
136    }
137}
138#[doc = "Field `CHECK_RESPONSE_CRC` reader - Check response CRC."]
139pub struct CHECK_RESPONSE_CRC_R(crate::FieldReader<bool, bool>);
140impl CHECK_RESPONSE_CRC_R {
141    #[inline(always)]
142    pub(crate) fn new(bits: bool) -> Self {
143        CHECK_RESPONSE_CRC_R(crate::FieldReader::new(bits))
144    }
145}
146impl core::ops::Deref for CHECK_RESPONSE_CRC_R {
147    type Target = crate::FieldReader<bool, bool>;
148    #[inline(always)]
149    fn deref(&self) -> &Self::Target {
150        &self.0
151    }
152}
153#[doc = "Field `CHECK_RESPONSE_CRC` writer - Check response CRC."]
154pub struct CHECK_RESPONSE_CRC_W<'a> {
155    w: &'a mut W,
156}
157impl<'a> CHECK_RESPONSE_CRC_W<'a> {
158    #[doc = r"Sets the field bit"]
159    #[inline(always)]
160    pub fn set_bit(self) -> &'a mut W {
161        self.bit(true)
162    }
163    #[doc = r"Clears the field bit"]
164    #[inline(always)]
165    pub fn clear_bit(self) -> &'a mut W {
166        self.bit(false)
167    }
168    #[doc = r"Writes raw bits to the field"]
169    #[inline(always)]
170    pub fn bit(self, value: bool) -> &'a mut W {
171        self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
172        self.w
173    }
174}
175#[doc = "Field `DATA_EXPECTED` reader - Data expected."]
176pub struct DATA_EXPECTED_R(crate::FieldReader<bool, bool>);
177impl DATA_EXPECTED_R {
178    #[inline(always)]
179    pub(crate) fn new(bits: bool) -> Self {
180        DATA_EXPECTED_R(crate::FieldReader::new(bits))
181    }
182}
183impl core::ops::Deref for DATA_EXPECTED_R {
184    type Target = crate::FieldReader<bool, bool>;
185    #[inline(always)]
186    fn deref(&self) -> &Self::Target {
187        &self.0
188    }
189}
190#[doc = "Field `DATA_EXPECTED` writer - Data expected."]
191pub struct DATA_EXPECTED_W<'a> {
192    w: &'a mut W,
193}
194impl<'a> DATA_EXPECTED_W<'a> {
195    #[doc = r"Sets the field bit"]
196    #[inline(always)]
197    pub fn set_bit(self) -> &'a mut W {
198        self.bit(true)
199    }
200    #[doc = r"Clears the field bit"]
201    #[inline(always)]
202    pub fn clear_bit(self) -> &'a mut W {
203        self.bit(false)
204    }
205    #[doc = r"Writes raw bits to the field"]
206    #[inline(always)]
207    pub fn bit(self, value: bool) -> &'a mut W {
208        self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9);
209        self.w
210    }
211}
212#[doc = "Field `READ_WRITE` reader - read/write."]
213pub struct READ_WRITE_R(crate::FieldReader<bool, bool>);
214impl READ_WRITE_R {
215    #[inline(always)]
216    pub(crate) fn new(bits: bool) -> Self {
217        READ_WRITE_R(crate::FieldReader::new(bits))
218    }
219}
220impl core::ops::Deref for READ_WRITE_R {
221    type Target = crate::FieldReader<bool, bool>;
222    #[inline(always)]
223    fn deref(&self) -> &Self::Target {
224        &self.0
225    }
226}
227#[doc = "Field `READ_WRITE` writer - read/write."]
228pub struct READ_WRITE_W<'a> {
229    w: &'a mut W,
230}
231impl<'a> READ_WRITE_W<'a> {
232    #[doc = r"Sets the field bit"]
233    #[inline(always)]
234    pub fn set_bit(self) -> &'a mut W {
235        self.bit(true)
236    }
237    #[doc = r"Clears the field bit"]
238    #[inline(always)]
239    pub fn clear_bit(self) -> &'a mut W {
240        self.bit(false)
241    }
242    #[doc = r"Writes raw bits to the field"]
243    #[inline(always)]
244    pub fn bit(self, value: bool) -> &'a mut W {
245        self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10);
246        self.w
247    }
248}
249#[doc = "Field `TRANSFER_MODE` reader - Transfer mode."]
250pub struct TRANSFER_MODE_R(crate::FieldReader<bool, bool>);
251impl TRANSFER_MODE_R {
252    #[inline(always)]
253    pub(crate) fn new(bits: bool) -> Self {
254        TRANSFER_MODE_R(crate::FieldReader::new(bits))
255    }
256}
257impl core::ops::Deref for TRANSFER_MODE_R {
258    type Target = crate::FieldReader<bool, bool>;
259    #[inline(always)]
260    fn deref(&self) -> &Self::Target {
261        &self.0
262    }
263}
264#[doc = "Field `TRANSFER_MODE` writer - Transfer mode."]
265pub struct TRANSFER_MODE_W<'a> {
266    w: &'a mut W,
267}
268impl<'a> TRANSFER_MODE_W<'a> {
269    #[doc = r"Sets the field bit"]
270    #[inline(always)]
271    pub fn set_bit(self) -> &'a mut W {
272        self.bit(true)
273    }
274    #[doc = r"Clears the field bit"]
275    #[inline(always)]
276    pub fn clear_bit(self) -> &'a mut W {
277        self.bit(false)
278    }
279    #[doc = r"Writes raw bits to the field"]
280    #[inline(always)]
281    pub fn bit(self, value: bool) -> &'a mut W {
282        self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11);
283        self.w
284    }
285}
286#[doc = "Field `SEND_AUTO_STOP` reader - Send auto stop."]
287pub struct SEND_AUTO_STOP_R(crate::FieldReader<bool, bool>);
288impl SEND_AUTO_STOP_R {
289    #[inline(always)]
290    pub(crate) fn new(bits: bool) -> Self {
291        SEND_AUTO_STOP_R(crate::FieldReader::new(bits))
292    }
293}
294impl core::ops::Deref for SEND_AUTO_STOP_R {
295    type Target = crate::FieldReader<bool, bool>;
296    #[inline(always)]
297    fn deref(&self) -> &Self::Target {
298        &self.0
299    }
300}
301#[doc = "Field `SEND_AUTO_STOP` writer - Send auto stop."]
302pub struct SEND_AUTO_STOP_W<'a> {
303    w: &'a mut W,
304}
305impl<'a> SEND_AUTO_STOP_W<'a> {
306    #[doc = r"Sets the field bit"]
307    #[inline(always)]
308    pub fn set_bit(self) -> &'a mut W {
309        self.bit(true)
310    }
311    #[doc = r"Clears the field bit"]
312    #[inline(always)]
313    pub fn clear_bit(self) -> &'a mut W {
314        self.bit(false)
315    }
316    #[doc = r"Writes raw bits to the field"]
317    #[inline(always)]
318    pub fn bit(self, value: bool) -> &'a mut W {
319        self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12);
320        self.w
321    }
322}
323#[doc = "Field `WAIT_PRVDATA_COMPLETE` reader - Wait prvdata complete."]
324pub struct WAIT_PRVDATA_COMPLETE_R(crate::FieldReader<bool, bool>);
325impl WAIT_PRVDATA_COMPLETE_R {
326    #[inline(always)]
327    pub(crate) fn new(bits: bool) -> Self {
328        WAIT_PRVDATA_COMPLETE_R(crate::FieldReader::new(bits))
329    }
330}
331impl core::ops::Deref for WAIT_PRVDATA_COMPLETE_R {
332    type Target = crate::FieldReader<bool, bool>;
333    #[inline(always)]
334    fn deref(&self) -> &Self::Target {
335        &self.0
336    }
337}
338#[doc = "Field `WAIT_PRVDATA_COMPLETE` writer - Wait prvdata complete."]
339pub struct WAIT_PRVDATA_COMPLETE_W<'a> {
340    w: &'a mut W,
341}
342impl<'a> WAIT_PRVDATA_COMPLETE_W<'a> {
343    #[doc = r"Sets the field bit"]
344    #[inline(always)]
345    pub fn set_bit(self) -> &'a mut W {
346        self.bit(true)
347    }
348    #[doc = r"Clears the field bit"]
349    #[inline(always)]
350    pub fn clear_bit(self) -> &'a mut W {
351        self.bit(false)
352    }
353    #[doc = r"Writes raw bits to the field"]
354    #[inline(always)]
355    pub fn bit(self, value: bool) -> &'a mut W {
356        self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13);
357        self.w
358    }
359}
360#[doc = "Field `STOP_ABORT_CMD` reader - Stop abort command."]
361pub struct STOP_ABORT_CMD_R(crate::FieldReader<bool, bool>);
362impl STOP_ABORT_CMD_R {
363    #[inline(always)]
364    pub(crate) fn new(bits: bool) -> Self {
365        STOP_ABORT_CMD_R(crate::FieldReader::new(bits))
366    }
367}
368impl core::ops::Deref for STOP_ABORT_CMD_R {
369    type Target = crate::FieldReader<bool, bool>;
370    #[inline(always)]
371    fn deref(&self) -> &Self::Target {
372        &self.0
373    }
374}
375#[doc = "Field `STOP_ABORT_CMD` writer - Stop abort command."]
376pub struct STOP_ABORT_CMD_W<'a> {
377    w: &'a mut W,
378}
379impl<'a> STOP_ABORT_CMD_W<'a> {
380    #[doc = r"Sets the field bit"]
381    #[inline(always)]
382    pub fn set_bit(self) -> &'a mut W {
383        self.bit(true)
384    }
385    #[doc = r"Clears the field bit"]
386    #[inline(always)]
387    pub fn clear_bit(self) -> &'a mut W {
388        self.bit(false)
389    }
390    #[doc = r"Writes raw bits to the field"]
391    #[inline(always)]
392    pub fn bit(self, value: bool) -> &'a mut W {
393        self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14);
394        self.w
395    }
396}
397#[doc = "Field `SEND_INITIALIZATION` reader - Send initialization."]
398pub struct SEND_INITIALIZATION_R(crate::FieldReader<bool, bool>);
399impl SEND_INITIALIZATION_R {
400    #[inline(always)]
401    pub(crate) fn new(bits: bool) -> Self {
402        SEND_INITIALIZATION_R(crate::FieldReader::new(bits))
403    }
404}
405impl core::ops::Deref for SEND_INITIALIZATION_R {
406    type Target = crate::FieldReader<bool, bool>;
407    #[inline(always)]
408    fn deref(&self) -> &Self::Target {
409        &self.0
410    }
411}
412#[doc = "Field `SEND_INITIALIZATION` writer - Send initialization."]
413pub struct SEND_INITIALIZATION_W<'a> {
414    w: &'a mut W,
415}
416impl<'a> SEND_INITIALIZATION_W<'a> {
417    #[doc = r"Sets the field bit"]
418    #[inline(always)]
419    pub fn set_bit(self) -> &'a mut W {
420        self.bit(true)
421    }
422    #[doc = r"Clears the field bit"]
423    #[inline(always)]
424    pub fn clear_bit(self) -> &'a mut W {
425        self.bit(false)
426    }
427    #[doc = r"Writes raw bits to the field"]
428    #[inline(always)]
429    pub fn bit(self, value: bool) -> &'a mut W {
430        self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15);
431        self.w
432    }
433}
434#[doc = "Specifies the card number of SDCARD for which the current Command is being executed\n\nValue on reset: 0"]
435#[derive(Clone, Copy, Debug, PartialEq)]
436#[repr(u8)]
437pub enum CARD_NUMBER_A {
438    #[doc = "0: Command will be execute on SDCARD 0"]
439    CARD0 = 0,
440    #[doc = "1: Command will be execute on SDCARD 1"]
441    CARD1 = 1,
442}
443impl From<CARD_NUMBER_A> for u8 {
444    #[inline(always)]
445    fn from(variant: CARD_NUMBER_A) -> Self {
446        variant as _
447    }
448}
449#[doc = "Field `CARD_NUMBER` reader - Specifies the card number of SDCARD for which the current Command is being executed"]
450pub struct CARD_NUMBER_R(crate::FieldReader<u8, CARD_NUMBER_A>);
451impl CARD_NUMBER_R {
452    #[inline(always)]
453    pub(crate) fn new(bits: u8) -> Self {
454        CARD_NUMBER_R(crate::FieldReader::new(bits))
455    }
456    #[doc = r"Get enumerated values variant"]
457    #[inline(always)]
458    pub fn variant(&self) -> Option<CARD_NUMBER_A> {
459        match self.bits {
460            0 => Some(CARD_NUMBER_A::CARD0),
461            1 => Some(CARD_NUMBER_A::CARD1),
462            _ => None,
463        }
464    }
465    #[doc = "Checks if the value of the field is `CARD0`"]
466    #[inline(always)]
467    pub fn is_card0(&self) -> bool {
468        **self == CARD_NUMBER_A::CARD0
469    }
470    #[doc = "Checks if the value of the field is `CARD1`"]
471    #[inline(always)]
472    pub fn is_card1(&self) -> bool {
473        **self == CARD_NUMBER_A::CARD1
474    }
475}
476impl core::ops::Deref for CARD_NUMBER_R {
477    type Target = crate::FieldReader<u8, CARD_NUMBER_A>;
478    #[inline(always)]
479    fn deref(&self) -> &Self::Target {
480        &self.0
481    }
482}
483#[doc = "Field `CARD_NUMBER` writer - Specifies the card number of SDCARD for which the current Command is being executed"]
484pub struct CARD_NUMBER_W<'a> {
485    w: &'a mut W,
486}
487impl<'a> CARD_NUMBER_W<'a> {
488    #[doc = r"Writes `variant` to the field"]
489    #[inline(always)]
490    pub fn variant(self, variant: CARD_NUMBER_A) -> &'a mut W {
491        unsafe { self.bits(variant.into()) }
492    }
493    #[doc = "Command will be execute on SDCARD 0"]
494    #[inline(always)]
495    pub fn card0(self) -> &'a mut W {
496        self.variant(CARD_NUMBER_A::CARD0)
497    }
498    #[doc = "Command will be execute on SDCARD 1"]
499    #[inline(always)]
500    pub fn card1(self) -> &'a mut W {
501        self.variant(CARD_NUMBER_A::CARD1)
502    }
503    #[doc = r"Writes raw bits to the field"]
504    #[inline(always)]
505    pub unsafe fn bits(self, value: u8) -> &'a mut W {
506        self.w.bits = (self.w.bits & !(0x1f << 16)) | ((value as u32 & 0x1f) << 16);
507        self.w
508    }
509}
510#[doc = "Field `UPDATE_CLOCK_REGISTERS_ONLY` reader - Update clock registers only."]
511pub struct UPDATE_CLOCK_REGISTERS_ONLY_R(crate::FieldReader<bool, bool>);
512impl UPDATE_CLOCK_REGISTERS_ONLY_R {
513    #[inline(always)]
514    pub(crate) fn new(bits: bool) -> Self {
515        UPDATE_CLOCK_REGISTERS_ONLY_R(crate::FieldReader::new(bits))
516    }
517}
518impl core::ops::Deref for UPDATE_CLOCK_REGISTERS_ONLY_R {
519    type Target = crate::FieldReader<bool, bool>;
520    #[inline(always)]
521    fn deref(&self) -> &Self::Target {
522        &self.0
523    }
524}
525#[doc = "Field `UPDATE_CLOCK_REGISTERS_ONLY` writer - Update clock registers only."]
526pub struct UPDATE_CLOCK_REGISTERS_ONLY_W<'a> {
527    w: &'a mut W,
528}
529impl<'a> UPDATE_CLOCK_REGISTERS_ONLY_W<'a> {
530    #[doc = r"Sets the field bit"]
531    #[inline(always)]
532    pub fn set_bit(self) -> &'a mut W {
533        self.bit(true)
534    }
535    #[doc = r"Clears the field bit"]
536    #[inline(always)]
537    pub fn clear_bit(self) -> &'a mut W {
538        self.bit(false)
539    }
540    #[doc = r"Writes raw bits to the field"]
541    #[inline(always)]
542    pub fn bit(self, value: bool) -> &'a mut W {
543        self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21);
544        self.w
545    }
546}
547#[doc = "Field `READ_CEATA_DEVICE` reader - Read ceata device."]
548pub struct READ_CEATA_DEVICE_R(crate::FieldReader<bool, bool>);
549impl READ_CEATA_DEVICE_R {
550    #[inline(always)]
551    pub(crate) fn new(bits: bool) -> Self {
552        READ_CEATA_DEVICE_R(crate::FieldReader::new(bits))
553    }
554}
555impl core::ops::Deref for READ_CEATA_DEVICE_R {
556    type Target = crate::FieldReader<bool, bool>;
557    #[inline(always)]
558    fn deref(&self) -> &Self::Target {
559        &self.0
560    }
561}
562#[doc = "Field `READ_CEATA_DEVICE` writer - Read ceata device."]
563pub struct READ_CEATA_DEVICE_W<'a> {
564    w: &'a mut W,
565}
566impl<'a> READ_CEATA_DEVICE_W<'a> {
567    #[doc = r"Sets the field bit"]
568    #[inline(always)]
569    pub fn set_bit(self) -> &'a mut W {
570        self.bit(true)
571    }
572    #[doc = r"Clears the field bit"]
573    #[inline(always)]
574    pub fn clear_bit(self) -> &'a mut W {
575        self.bit(false)
576    }
577    #[doc = r"Writes raw bits to the field"]
578    #[inline(always)]
579    pub fn bit(self, value: bool) -> &'a mut W {
580        self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22);
581        self.w
582    }
583}
584#[doc = "Field `CCS_EXPECTED` reader - CCS expected."]
585pub struct CCS_EXPECTED_R(crate::FieldReader<bool, bool>);
586impl CCS_EXPECTED_R {
587    #[inline(always)]
588    pub(crate) fn new(bits: bool) -> Self {
589        CCS_EXPECTED_R(crate::FieldReader::new(bits))
590    }
591}
592impl core::ops::Deref for CCS_EXPECTED_R {
593    type Target = crate::FieldReader<bool, bool>;
594    #[inline(always)]
595    fn deref(&self) -> &Self::Target {
596        &self.0
597    }
598}
599#[doc = "Field `CCS_EXPECTED` writer - CCS expected."]
600pub struct CCS_EXPECTED_W<'a> {
601    w: &'a mut W,
602}
603impl<'a> CCS_EXPECTED_W<'a> {
604    #[doc = r"Sets the field bit"]
605    #[inline(always)]
606    pub fn set_bit(self) -> &'a mut W {
607        self.bit(true)
608    }
609    #[doc = r"Clears the field bit"]
610    #[inline(always)]
611    pub fn clear_bit(self) -> &'a mut W {
612        self.bit(false)
613    }
614    #[doc = r"Writes raw bits to the field"]
615    #[inline(always)]
616    pub fn bit(self, value: bool) -> &'a mut W {
617        self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23);
618        self.w
619    }
620}
621#[doc = "Field `ENABLE_BOOT` reader - Enable Boot - this bit should be set only for mandatory boot mode."]
622pub struct ENABLE_BOOT_R(crate::FieldReader<bool, bool>);
623impl ENABLE_BOOT_R {
624    #[inline(always)]
625    pub(crate) fn new(bits: bool) -> Self {
626        ENABLE_BOOT_R(crate::FieldReader::new(bits))
627    }
628}
629impl core::ops::Deref for ENABLE_BOOT_R {
630    type Target = crate::FieldReader<bool, bool>;
631    #[inline(always)]
632    fn deref(&self) -> &Self::Target {
633        &self.0
634    }
635}
636#[doc = "Field `ENABLE_BOOT` writer - Enable Boot - this bit should be set only for mandatory boot mode."]
637pub struct ENABLE_BOOT_W<'a> {
638    w: &'a mut W,
639}
640impl<'a> ENABLE_BOOT_W<'a> {
641    #[doc = r"Sets the field bit"]
642    #[inline(always)]
643    pub fn set_bit(self) -> &'a mut W {
644        self.bit(true)
645    }
646    #[doc = r"Clears the field bit"]
647    #[inline(always)]
648    pub fn clear_bit(self) -> &'a mut W {
649        self.bit(false)
650    }
651    #[doc = r"Writes raw bits to the field"]
652    #[inline(always)]
653    pub fn bit(self, value: bool) -> &'a mut W {
654        self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24);
655        self.w
656    }
657}
658#[doc = "Field `EXPECT_BOOT_ACK` reader - Expect Boot Acknowledge."]
659pub struct EXPECT_BOOT_ACK_R(crate::FieldReader<bool, bool>);
660impl EXPECT_BOOT_ACK_R {
661    #[inline(always)]
662    pub(crate) fn new(bits: bool) -> Self {
663        EXPECT_BOOT_ACK_R(crate::FieldReader::new(bits))
664    }
665}
666impl core::ops::Deref for EXPECT_BOOT_ACK_R {
667    type Target = crate::FieldReader<bool, bool>;
668    #[inline(always)]
669    fn deref(&self) -> &Self::Target {
670        &self.0
671    }
672}
673#[doc = "Field `EXPECT_BOOT_ACK` writer - Expect Boot Acknowledge."]
674pub struct EXPECT_BOOT_ACK_W<'a> {
675    w: &'a mut W,
676}
677impl<'a> EXPECT_BOOT_ACK_W<'a> {
678    #[doc = r"Sets the field bit"]
679    #[inline(always)]
680    pub fn set_bit(self) -> &'a mut W {
681        self.bit(true)
682    }
683    #[doc = r"Clears the field bit"]
684    #[inline(always)]
685    pub fn clear_bit(self) -> &'a mut W {
686        self.bit(false)
687    }
688    #[doc = r"Writes raw bits to the field"]
689    #[inline(always)]
690    pub fn bit(self, value: bool) -> &'a mut W {
691        self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25);
692        self.w
693    }
694}
695#[doc = "Field `DISABLE_BOOT` reader - Disable Boot."]
696pub struct DISABLE_BOOT_R(crate::FieldReader<bool, bool>);
697impl DISABLE_BOOT_R {
698    #[inline(always)]
699    pub(crate) fn new(bits: bool) -> Self {
700        DISABLE_BOOT_R(crate::FieldReader::new(bits))
701    }
702}
703impl core::ops::Deref for DISABLE_BOOT_R {
704    type Target = crate::FieldReader<bool, bool>;
705    #[inline(always)]
706    fn deref(&self) -> &Self::Target {
707        &self.0
708    }
709}
710#[doc = "Field `DISABLE_BOOT` writer - Disable Boot."]
711pub struct DISABLE_BOOT_W<'a> {
712    w: &'a mut W,
713}
714impl<'a> DISABLE_BOOT_W<'a> {
715    #[doc = r"Sets the field bit"]
716    #[inline(always)]
717    pub fn set_bit(self) -> &'a mut W {
718        self.bit(true)
719    }
720    #[doc = r"Clears the field bit"]
721    #[inline(always)]
722    pub fn clear_bit(self) -> &'a mut W {
723        self.bit(false)
724    }
725    #[doc = r"Writes raw bits to the field"]
726    #[inline(always)]
727    pub fn bit(self, value: bool) -> &'a mut W {
728        self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26);
729        self.w
730    }
731}
732#[doc = "Field `BOOT_MODE` reader - Boot Mode."]
733pub struct BOOT_MODE_R(crate::FieldReader<bool, bool>);
734impl BOOT_MODE_R {
735    #[inline(always)]
736    pub(crate) fn new(bits: bool) -> Self {
737        BOOT_MODE_R(crate::FieldReader::new(bits))
738    }
739}
740impl core::ops::Deref for BOOT_MODE_R {
741    type Target = crate::FieldReader<bool, bool>;
742    #[inline(always)]
743    fn deref(&self) -> &Self::Target {
744        &self.0
745    }
746}
747#[doc = "Field `BOOT_MODE` writer - Boot Mode."]
748pub struct BOOT_MODE_W<'a> {
749    w: &'a mut W,
750}
751impl<'a> BOOT_MODE_W<'a> {
752    #[doc = r"Sets the field bit"]
753    #[inline(always)]
754    pub fn set_bit(self) -> &'a mut W {
755        self.bit(true)
756    }
757    #[doc = r"Clears the field bit"]
758    #[inline(always)]
759    pub fn clear_bit(self) -> &'a mut W {
760        self.bit(false)
761    }
762    #[doc = r"Writes raw bits to the field"]
763    #[inline(always)]
764    pub fn bit(self, value: bool) -> &'a mut W {
765        self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27);
766        self.w
767    }
768}
769#[doc = "Field `VOLT_SWITCH` reader - Voltage switch bit."]
770pub struct VOLT_SWITCH_R(crate::FieldReader<bool, bool>);
771impl VOLT_SWITCH_R {
772    #[inline(always)]
773    pub(crate) fn new(bits: bool) -> Self {
774        VOLT_SWITCH_R(crate::FieldReader::new(bits))
775    }
776}
777impl core::ops::Deref for VOLT_SWITCH_R {
778    type Target = crate::FieldReader<bool, bool>;
779    #[inline(always)]
780    fn deref(&self) -> &Self::Target {
781        &self.0
782    }
783}
784#[doc = "Field `VOLT_SWITCH` writer - Voltage switch bit."]
785pub struct VOLT_SWITCH_W<'a> {
786    w: &'a mut W,
787}
788impl<'a> VOLT_SWITCH_W<'a> {
789    #[doc = r"Sets the field bit"]
790    #[inline(always)]
791    pub fn set_bit(self) -> &'a mut W {
792        self.bit(true)
793    }
794    #[doc = r"Clears the field bit"]
795    #[inline(always)]
796    pub fn clear_bit(self) -> &'a mut W {
797        self.bit(false)
798    }
799    #[doc = r"Writes raw bits to the field"]
800    #[inline(always)]
801    pub fn bit(self, value: bool) -> &'a mut W {
802        self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28);
803        self.w
804    }
805}
806#[doc = "Field `USE_HOLD_REG` reader - Use Hold Register."]
807pub struct USE_HOLD_REG_R(crate::FieldReader<bool, bool>);
808impl USE_HOLD_REG_R {
809    #[inline(always)]
810    pub(crate) fn new(bits: bool) -> Self {
811        USE_HOLD_REG_R(crate::FieldReader::new(bits))
812    }
813}
814impl core::ops::Deref for USE_HOLD_REG_R {
815    type Target = crate::FieldReader<bool, bool>;
816    #[inline(always)]
817    fn deref(&self) -> &Self::Target {
818        &self.0
819    }
820}
821#[doc = "Field `USE_HOLD_REG` writer - Use Hold Register."]
822pub struct USE_HOLD_REG_W<'a> {
823    w: &'a mut W,
824}
825impl<'a> USE_HOLD_REG_W<'a> {
826    #[doc = r"Sets the field bit"]
827    #[inline(always)]
828    pub fn set_bit(self) -> &'a mut W {
829        self.bit(true)
830    }
831    #[doc = r"Clears the field bit"]
832    #[inline(always)]
833    pub fn clear_bit(self) -> &'a mut W {
834        self.bit(false)
835    }
836    #[doc = r"Writes raw bits to the field"]
837    #[inline(always)]
838    pub fn bit(self, value: bool) -> &'a mut W {
839        self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29);
840        self.w
841    }
842}
843#[doc = "Field `START_CMD` reader - Start command."]
844pub struct START_CMD_R(crate::FieldReader<bool, bool>);
845impl START_CMD_R {
846    #[inline(always)]
847    pub(crate) fn new(bits: bool) -> Self {
848        START_CMD_R(crate::FieldReader::new(bits))
849    }
850}
851impl core::ops::Deref for START_CMD_R {
852    type Target = crate::FieldReader<bool, bool>;
853    #[inline(always)]
854    fn deref(&self) -> &Self::Target {
855        &self.0
856    }
857}
858#[doc = "Field `START_CMD` writer - Start command."]
859pub struct START_CMD_W<'a> {
860    w: &'a mut W,
861}
862impl<'a> START_CMD_W<'a> {
863    #[doc = r"Sets the field bit"]
864    #[inline(always)]
865    pub fn set_bit(self) -> &'a mut W {
866        self.bit(true)
867    }
868    #[doc = r"Clears the field bit"]
869    #[inline(always)]
870    pub fn clear_bit(self) -> &'a mut W {
871        self.bit(false)
872    }
873    #[doc = r"Writes raw bits to the field"]
874    #[inline(always)]
875    pub fn bit(self, value: bool) -> &'a mut W {
876        self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31);
877        self.w
878    }
879}
880impl R {
881    #[doc = "Bits 0:5 - Command index."]
882    #[inline(always)]
883    pub fn cmd_index(&self) -> CMD_INDEX_R {
884        CMD_INDEX_R::new((self.bits & 0x3f) as u8)
885    }
886    #[doc = "Bit 6 - Response expect."]
887    #[inline(always)]
888    pub fn response_expect(&self) -> RESPONSE_EXPECT_R {
889        RESPONSE_EXPECT_R::new(((self.bits >> 6) & 0x01) != 0)
890    }
891    #[doc = "Bit 7 - Response length."]
892    #[inline(always)]
893    pub fn response_length(&self) -> RESPONSE_LENGTH_R {
894        RESPONSE_LENGTH_R::new(((self.bits >> 7) & 0x01) != 0)
895    }
896    #[doc = "Bit 8 - Check response CRC."]
897    #[inline(always)]
898    pub fn check_response_crc(&self) -> CHECK_RESPONSE_CRC_R {
899        CHECK_RESPONSE_CRC_R::new(((self.bits >> 8) & 0x01) != 0)
900    }
901    #[doc = "Bit 9 - Data expected."]
902    #[inline(always)]
903    pub fn data_expected(&self) -> DATA_EXPECTED_R {
904        DATA_EXPECTED_R::new(((self.bits >> 9) & 0x01) != 0)
905    }
906    #[doc = "Bit 10 - read/write."]
907    #[inline(always)]
908    pub fn read_write(&self) -> READ_WRITE_R {
909        READ_WRITE_R::new(((self.bits >> 10) & 0x01) != 0)
910    }
911    #[doc = "Bit 11 - Transfer mode."]
912    #[inline(always)]
913    pub fn transfer_mode(&self) -> TRANSFER_MODE_R {
914        TRANSFER_MODE_R::new(((self.bits >> 11) & 0x01) != 0)
915    }
916    #[doc = "Bit 12 - Send auto stop."]
917    #[inline(always)]
918    pub fn send_auto_stop(&self) -> SEND_AUTO_STOP_R {
919        SEND_AUTO_STOP_R::new(((self.bits >> 12) & 0x01) != 0)
920    }
921    #[doc = "Bit 13 - Wait prvdata complete."]
922    #[inline(always)]
923    pub fn wait_prvdata_complete(&self) -> WAIT_PRVDATA_COMPLETE_R {
924        WAIT_PRVDATA_COMPLETE_R::new(((self.bits >> 13) & 0x01) != 0)
925    }
926    #[doc = "Bit 14 - Stop abort command."]
927    #[inline(always)]
928    pub fn stop_abort_cmd(&self) -> STOP_ABORT_CMD_R {
929        STOP_ABORT_CMD_R::new(((self.bits >> 14) & 0x01) != 0)
930    }
931    #[doc = "Bit 15 - Send initialization."]
932    #[inline(always)]
933    pub fn send_initialization(&self) -> SEND_INITIALIZATION_R {
934        SEND_INITIALIZATION_R::new(((self.bits >> 15) & 0x01) != 0)
935    }
936    #[doc = "Bits 16:20 - Specifies the card number of SDCARD for which the current Command is being executed"]
937    #[inline(always)]
938    pub fn card_number(&self) -> CARD_NUMBER_R {
939        CARD_NUMBER_R::new(((self.bits >> 16) & 0x1f) as u8)
940    }
941    #[doc = "Bit 21 - Update clock registers only."]
942    #[inline(always)]
943    pub fn update_clock_registers_only(&self) -> UPDATE_CLOCK_REGISTERS_ONLY_R {
944        UPDATE_CLOCK_REGISTERS_ONLY_R::new(((self.bits >> 21) & 0x01) != 0)
945    }
946    #[doc = "Bit 22 - Read ceata device."]
947    #[inline(always)]
948    pub fn read_ceata_device(&self) -> READ_CEATA_DEVICE_R {
949        READ_CEATA_DEVICE_R::new(((self.bits >> 22) & 0x01) != 0)
950    }
951    #[doc = "Bit 23 - CCS expected."]
952    #[inline(always)]
953    pub fn ccs_expected(&self) -> CCS_EXPECTED_R {
954        CCS_EXPECTED_R::new(((self.bits >> 23) & 0x01) != 0)
955    }
956    #[doc = "Bit 24 - Enable Boot - this bit should be set only for mandatory boot mode."]
957    #[inline(always)]
958    pub fn enable_boot(&self) -> ENABLE_BOOT_R {
959        ENABLE_BOOT_R::new(((self.bits >> 24) & 0x01) != 0)
960    }
961    #[doc = "Bit 25 - Expect Boot Acknowledge."]
962    #[inline(always)]
963    pub fn expect_boot_ack(&self) -> EXPECT_BOOT_ACK_R {
964        EXPECT_BOOT_ACK_R::new(((self.bits >> 25) & 0x01) != 0)
965    }
966    #[doc = "Bit 26 - Disable Boot."]
967    #[inline(always)]
968    pub fn disable_boot(&self) -> DISABLE_BOOT_R {
969        DISABLE_BOOT_R::new(((self.bits >> 26) & 0x01) != 0)
970    }
971    #[doc = "Bit 27 - Boot Mode."]
972    #[inline(always)]
973    pub fn boot_mode(&self) -> BOOT_MODE_R {
974        BOOT_MODE_R::new(((self.bits >> 27) & 0x01) != 0)
975    }
976    #[doc = "Bit 28 - Voltage switch bit."]
977    #[inline(always)]
978    pub fn volt_switch(&self) -> VOLT_SWITCH_R {
979        VOLT_SWITCH_R::new(((self.bits >> 28) & 0x01) != 0)
980    }
981    #[doc = "Bit 29 - Use Hold Register."]
982    #[inline(always)]
983    pub fn use_hold_reg(&self) -> USE_HOLD_REG_R {
984        USE_HOLD_REG_R::new(((self.bits >> 29) & 0x01) != 0)
985    }
986    #[doc = "Bit 31 - Start command."]
987    #[inline(always)]
988    pub fn start_cmd(&self) -> START_CMD_R {
989        START_CMD_R::new(((self.bits >> 31) & 0x01) != 0)
990    }
991}
992impl W {
993    #[doc = "Bits 0:5 - Command index."]
994    #[inline(always)]
995    pub fn cmd_index(&mut self) -> CMD_INDEX_W {
996        CMD_INDEX_W { w: self }
997    }
998    #[doc = "Bit 6 - Response expect."]
999    #[inline(always)]
1000    pub fn response_expect(&mut self) -> RESPONSE_EXPECT_W {
1001        RESPONSE_EXPECT_W { w: self }
1002    }
1003    #[doc = "Bit 7 - Response length."]
1004    #[inline(always)]
1005    pub fn response_length(&mut self) -> RESPONSE_LENGTH_W {
1006        RESPONSE_LENGTH_W { w: self }
1007    }
1008    #[doc = "Bit 8 - Check response CRC."]
1009    #[inline(always)]
1010    pub fn check_response_crc(&mut self) -> CHECK_RESPONSE_CRC_W {
1011        CHECK_RESPONSE_CRC_W { w: self }
1012    }
1013    #[doc = "Bit 9 - Data expected."]
1014    #[inline(always)]
1015    pub fn data_expected(&mut self) -> DATA_EXPECTED_W {
1016        DATA_EXPECTED_W { w: self }
1017    }
1018    #[doc = "Bit 10 - read/write."]
1019    #[inline(always)]
1020    pub fn read_write(&mut self) -> READ_WRITE_W {
1021        READ_WRITE_W { w: self }
1022    }
1023    #[doc = "Bit 11 - Transfer mode."]
1024    #[inline(always)]
1025    pub fn transfer_mode(&mut self) -> TRANSFER_MODE_W {
1026        TRANSFER_MODE_W { w: self }
1027    }
1028    #[doc = "Bit 12 - Send auto stop."]
1029    #[inline(always)]
1030    pub fn send_auto_stop(&mut self) -> SEND_AUTO_STOP_W {
1031        SEND_AUTO_STOP_W { w: self }
1032    }
1033    #[doc = "Bit 13 - Wait prvdata complete."]
1034    #[inline(always)]
1035    pub fn wait_prvdata_complete(&mut self) -> WAIT_PRVDATA_COMPLETE_W {
1036        WAIT_PRVDATA_COMPLETE_W { w: self }
1037    }
1038    #[doc = "Bit 14 - Stop abort command."]
1039    #[inline(always)]
1040    pub fn stop_abort_cmd(&mut self) -> STOP_ABORT_CMD_W {
1041        STOP_ABORT_CMD_W { w: self }
1042    }
1043    #[doc = "Bit 15 - Send initialization."]
1044    #[inline(always)]
1045    pub fn send_initialization(&mut self) -> SEND_INITIALIZATION_W {
1046        SEND_INITIALIZATION_W { w: self }
1047    }
1048    #[doc = "Bits 16:20 - Specifies the card number of SDCARD for which the current Command is being executed"]
1049    #[inline(always)]
1050    pub fn card_number(&mut self) -> CARD_NUMBER_W {
1051        CARD_NUMBER_W { w: self }
1052    }
1053    #[doc = "Bit 21 - Update clock registers only."]
1054    #[inline(always)]
1055    pub fn update_clock_registers_only(&mut self) -> UPDATE_CLOCK_REGISTERS_ONLY_W {
1056        UPDATE_CLOCK_REGISTERS_ONLY_W { w: self }
1057    }
1058    #[doc = "Bit 22 - Read ceata device."]
1059    #[inline(always)]
1060    pub fn read_ceata_device(&mut self) -> READ_CEATA_DEVICE_W {
1061        READ_CEATA_DEVICE_W { w: self }
1062    }
1063    #[doc = "Bit 23 - CCS expected."]
1064    #[inline(always)]
1065    pub fn ccs_expected(&mut self) -> CCS_EXPECTED_W {
1066        CCS_EXPECTED_W { w: self }
1067    }
1068    #[doc = "Bit 24 - Enable Boot - this bit should be set only for mandatory boot mode."]
1069    #[inline(always)]
1070    pub fn enable_boot(&mut self) -> ENABLE_BOOT_W {
1071        ENABLE_BOOT_W { w: self }
1072    }
1073    #[doc = "Bit 25 - Expect Boot Acknowledge."]
1074    #[inline(always)]
1075    pub fn expect_boot_ack(&mut self) -> EXPECT_BOOT_ACK_W {
1076        EXPECT_BOOT_ACK_W { w: self }
1077    }
1078    #[doc = "Bit 26 - Disable Boot."]
1079    #[inline(always)]
1080    pub fn disable_boot(&mut self) -> DISABLE_BOOT_W {
1081        DISABLE_BOOT_W { w: self }
1082    }
1083    #[doc = "Bit 27 - Boot Mode."]
1084    #[inline(always)]
1085    pub fn boot_mode(&mut self) -> BOOT_MODE_W {
1086        BOOT_MODE_W { w: self }
1087    }
1088    #[doc = "Bit 28 - Voltage switch bit."]
1089    #[inline(always)]
1090    pub fn volt_switch(&mut self) -> VOLT_SWITCH_W {
1091        VOLT_SWITCH_W { w: self }
1092    }
1093    #[doc = "Bit 29 - Use Hold Register."]
1094    #[inline(always)]
1095    pub fn use_hold_reg(&mut self) -> USE_HOLD_REG_W {
1096        USE_HOLD_REG_W { w: self }
1097    }
1098    #[doc = "Bit 31 - Start command."]
1099    #[inline(always)]
1100    pub fn start_cmd(&mut self) -> START_CMD_W {
1101        START_CMD_W { w: self }
1102    }
1103    #[doc = "Writes raw bits to the register."]
1104    #[inline(always)]
1105    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1106        self.0.bits(bits);
1107        self
1108    }
1109}
1110#[doc = "Command 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 [cmd](index.html) module"]
1111pub struct CMD_SPEC;
1112impl crate::RegisterSpec for CMD_SPEC {
1113    type Ux = u32;
1114}
1115#[doc = "`read()` method returns [cmd::R](R) reader structure"]
1116impl crate::Readable for CMD_SPEC {
1117    type Reader = R;
1118}
1119#[doc = "`write(|w| ..)` method takes [cmd::W](W) writer structure"]
1120impl crate::Writable for CMD_SPEC {
1121    type Writer = W;
1122}
1123#[doc = "`reset()` method sets CMD to value 0"]
1124impl crate::Resettable for CMD_SPEC {
1125    #[inline(always)]
1126    fn reset_value() -> Self::Ux {
1127        0
1128    }
1129}