swm341_pac/sdio/
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 `DMAEN` reader - DMAEN field"]
38pub type DMAEN_R = crate::BitReader<bool>;
39#[doc = "Field `DMAEN` writer - DMAEN field"]
40pub type DMAEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMD_SPEC, bool, O>;
41#[doc = "Field `BLKCNTEN` reader - BLKCNTEN field"]
42pub type BLKCNTEN_R = crate::BitReader<bool>;
43#[doc = "Field `BLKCNTEN` writer - BLKCNTEN field"]
44pub type BLKCNTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMD_SPEC, bool, O>;
45#[doc = "Field `AUTOCMD12` reader - AUTOCMD12 field"]
46pub type AUTOCMD12_R = crate::BitReader<bool>;
47#[doc = "Field `AUTOCMD12` writer - AUTOCMD12 field"]
48pub type AUTOCMD12_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMD_SPEC, bool, O>;
49#[doc = "Field `DIRREAD` reader - DIRREAD field"]
50pub type DIRREAD_R = crate::BitReader<bool>;
51#[doc = "Field `DIRREAD` writer - DIRREAD field"]
52pub type DIRREAD_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMD_SPEC, bool, O>;
53#[doc = "Field `MULTBLK` reader - MULTBLK field"]
54pub type MULTBLK_R = crate::BitReader<bool>;
55#[doc = "Field `MULTBLK` writer - MULTBLK field"]
56pub type MULTBLK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMD_SPEC, bool, O>;
57#[doc = "Field `RESPTYPE` reader - RESPTYPE field"]
58pub type RESPTYPE_R = crate::FieldReader<u8, u8>;
59#[doc = "Field `RESPTYPE` writer - RESPTYPE field"]
60pub type RESPTYPE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMD_SPEC, u8, u8, 2, O>;
61#[doc = "Field `CRCCHECK` reader - CRCCHECK field"]
62pub type CRCCHECK_R = crate::BitReader<bool>;
63#[doc = "Field `CRCCHECK` writer - CRCCHECK field"]
64pub type CRCCHECK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMD_SPEC, bool, O>;
65#[doc = "Field `IDXCHECK` reader - IDXCHECK field"]
66pub type IDXCHECK_R = crate::BitReader<bool>;
67#[doc = "Field `IDXCHECK` writer - IDXCHECK field"]
68pub type IDXCHECK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMD_SPEC, bool, O>;
69#[doc = "Field `HAVEDATA` reader - HAVEDATA field"]
70pub type HAVEDATA_R = crate::BitReader<bool>;
71#[doc = "Field `HAVEDATA` writer - HAVEDATA field"]
72pub type HAVEDATA_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMD_SPEC, bool, O>;
73#[doc = "Field `CMDTYPE` reader - CMDTYPE field"]
74pub type CMDTYPE_R = crate::FieldReader<u8, u8>;
75#[doc = "Field `CMDTYPE` writer - CMDTYPE field"]
76pub type CMDTYPE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMD_SPEC, u8, u8, 2, O>;
77#[doc = "Field `CMDINDX` reader - CMDINDX field"]
78pub type CMDINDX_R = crate::FieldReader<u8, u8>;
79#[doc = "Field `CMDINDX` writer - CMDINDX field"]
80pub type CMDINDX_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMD_SPEC, u8, u8, 6, O>;
81impl R {
82    #[doc = "Bit 0 - DMAEN field"]
83    #[inline(always)]
84    pub fn dmaen(&self) -> DMAEN_R {
85        DMAEN_R::new((self.bits & 1) != 0)
86    }
87    #[doc = "Bit 1 - BLKCNTEN field"]
88    #[inline(always)]
89    pub fn blkcnten(&self) -> BLKCNTEN_R {
90        BLKCNTEN_R::new(((self.bits >> 1) & 1) != 0)
91    }
92    #[doc = "Bit 2 - AUTOCMD12 field"]
93    #[inline(always)]
94    pub fn autocmd12(&self) -> AUTOCMD12_R {
95        AUTOCMD12_R::new(((self.bits >> 2) & 1) != 0)
96    }
97    #[doc = "Bit 4 - DIRREAD field"]
98    #[inline(always)]
99    pub fn dirread(&self) -> DIRREAD_R {
100        DIRREAD_R::new(((self.bits >> 4) & 1) != 0)
101    }
102    #[doc = "Bit 5 - MULTBLK field"]
103    #[inline(always)]
104    pub fn multblk(&self) -> MULTBLK_R {
105        MULTBLK_R::new(((self.bits >> 5) & 1) != 0)
106    }
107    #[doc = "Bits 16:17 - RESPTYPE field"]
108    #[inline(always)]
109    pub fn resptype(&self) -> RESPTYPE_R {
110        RESPTYPE_R::new(((self.bits >> 16) & 3) as u8)
111    }
112    #[doc = "Bit 19 - CRCCHECK field"]
113    #[inline(always)]
114    pub fn crccheck(&self) -> CRCCHECK_R {
115        CRCCHECK_R::new(((self.bits >> 19) & 1) != 0)
116    }
117    #[doc = "Bit 20 - IDXCHECK field"]
118    #[inline(always)]
119    pub fn idxcheck(&self) -> IDXCHECK_R {
120        IDXCHECK_R::new(((self.bits >> 20) & 1) != 0)
121    }
122    #[doc = "Bit 21 - HAVEDATA field"]
123    #[inline(always)]
124    pub fn havedata(&self) -> HAVEDATA_R {
125        HAVEDATA_R::new(((self.bits >> 21) & 1) != 0)
126    }
127    #[doc = "Bits 22:23 - CMDTYPE field"]
128    #[inline(always)]
129    pub fn cmdtype(&self) -> CMDTYPE_R {
130        CMDTYPE_R::new(((self.bits >> 22) & 3) as u8)
131    }
132    #[doc = "Bits 24:29 - CMDINDX field"]
133    #[inline(always)]
134    pub fn cmdindx(&self) -> CMDINDX_R {
135        CMDINDX_R::new(((self.bits >> 24) & 0x3f) as u8)
136    }
137}
138impl W {
139    #[doc = "Bit 0 - DMAEN field"]
140    #[inline(always)]
141    pub fn dmaen(&mut self) -> DMAEN_W<0> {
142        DMAEN_W::new(self)
143    }
144    #[doc = "Bit 1 - BLKCNTEN field"]
145    #[inline(always)]
146    pub fn blkcnten(&mut self) -> BLKCNTEN_W<1> {
147        BLKCNTEN_W::new(self)
148    }
149    #[doc = "Bit 2 - AUTOCMD12 field"]
150    #[inline(always)]
151    pub fn autocmd12(&mut self) -> AUTOCMD12_W<2> {
152        AUTOCMD12_W::new(self)
153    }
154    #[doc = "Bit 4 - DIRREAD field"]
155    #[inline(always)]
156    pub fn dirread(&mut self) -> DIRREAD_W<4> {
157        DIRREAD_W::new(self)
158    }
159    #[doc = "Bit 5 - MULTBLK field"]
160    #[inline(always)]
161    pub fn multblk(&mut self) -> MULTBLK_W<5> {
162        MULTBLK_W::new(self)
163    }
164    #[doc = "Bits 16:17 - RESPTYPE field"]
165    #[inline(always)]
166    pub fn resptype(&mut self) -> RESPTYPE_W<16> {
167        RESPTYPE_W::new(self)
168    }
169    #[doc = "Bit 19 - CRCCHECK field"]
170    #[inline(always)]
171    pub fn crccheck(&mut self) -> CRCCHECK_W<19> {
172        CRCCHECK_W::new(self)
173    }
174    #[doc = "Bit 20 - IDXCHECK field"]
175    #[inline(always)]
176    pub fn idxcheck(&mut self) -> IDXCHECK_W<20> {
177        IDXCHECK_W::new(self)
178    }
179    #[doc = "Bit 21 - HAVEDATA field"]
180    #[inline(always)]
181    pub fn havedata(&mut self) -> HAVEDATA_W<21> {
182        HAVEDATA_W::new(self)
183    }
184    #[doc = "Bits 22:23 - CMDTYPE field"]
185    #[inline(always)]
186    pub fn cmdtype(&mut self) -> CMDTYPE_W<22> {
187        CMDTYPE_W::new(self)
188    }
189    #[doc = "Bits 24:29 - CMDINDX field"]
190    #[inline(always)]
191    pub fn cmdindx(&mut self) -> CMDINDX_W<24> {
192        CMDINDX_W::new(self)
193    }
194    #[doc = "Writes raw bits to the register."]
195    #[inline(always)]
196    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
197        self.0.bits(bits);
198        self
199    }
200}
201#[doc = "CMD 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"]
202pub struct CMD_SPEC;
203impl crate::RegisterSpec for CMD_SPEC {
204    type Ux = u32;
205}
206#[doc = "`read()` method returns [cmd::R](R) reader structure"]
207impl crate::Readable for CMD_SPEC {
208    type Reader = R;
209}
210#[doc = "`write(|w| ..)` method takes [cmd::W](W) writer structure"]
211impl crate::Writable for CMD_SPEC {
212    type Writer = W;
213}
214#[doc = "`reset()` method sets CMD to value 0"]
215impl crate::Resettable for CMD_SPEC {
216    #[inline(always)]
217    fn reset_value() -> Self::Ux {
218        0
219    }
220}