stm32f1_staging/stm32f103/sdio/
cmd.rs

1///Register `CMD` reader
2pub type R = crate::R<CMDrs>;
3///Register `CMD` writer
4pub type W = crate::W<CMDrs>;
5///Field `CMDINDEX` reader - CMDINDEX
6pub type CMDINDEX_R = crate::FieldReader;
7///Field `CMDINDEX` writer - CMDINDEX
8pub type CMDINDEX_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
9///Field `WAITRESP` reader - WAITRESP
10pub type WAITRESP_R = crate::FieldReader;
11///Field `WAITRESP` writer - WAITRESP
12pub type WAITRESP_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13///Field `WAITINT` reader - WAITINT
14pub type WAITINT_R = crate::BitReader;
15///Field `WAITINT` writer - WAITINT
16pub type WAITINT_W<'a, REG> = crate::BitWriter<'a, REG>;
17///Field `WAITPEND` reader - WAITPEND
18pub type WAITPEND_R = crate::BitReader;
19///Field `WAITPEND` writer - WAITPEND
20pub type WAITPEND_W<'a, REG> = crate::BitWriter<'a, REG>;
21///Field `CPSMEN` reader - CPSMEN
22pub type CPSMEN_R = crate::BitReader;
23///Field `CPSMEN` writer - CPSMEN
24pub type CPSMEN_W<'a, REG> = crate::BitWriter<'a, REG>;
25///Field `SDIOSuspend` reader - SDIOSuspend
26pub type SDIOSUSPEND_R = crate::BitReader;
27///Field `SDIOSuspend` writer - SDIOSuspend
28pub type SDIOSUSPEND_W<'a, REG> = crate::BitWriter<'a, REG>;
29///Field `ENCMDcompl` reader - ENCMDcompl
30pub type ENCMDCOMPL_R = crate::BitReader;
31///Field `ENCMDcompl` writer - ENCMDcompl
32pub type ENCMDCOMPL_W<'a, REG> = crate::BitWriter<'a, REG>;
33///Field `nIEN` reader - nIEN
34pub type N_IEN_R = crate::BitReader;
35///Field `nIEN` writer - nIEN
36pub type N_IEN_W<'a, REG> = crate::BitWriter<'a, REG>;
37///Field `CE_ATACMD` reader - CE_ATACMD
38pub type CE_ATACMD_R = crate::BitReader;
39///Field `CE_ATACMD` writer - CE_ATACMD
40pub type CE_ATACMD_W<'a, REG> = crate::BitWriter<'a, REG>;
41impl R {
42    ///Bits 0:5 - CMDINDEX
43    #[inline(always)]
44    pub fn cmdindex(&self) -> CMDINDEX_R {
45        CMDINDEX_R::new((self.bits & 0x3f) as u8)
46    }
47    ///Bits 6:7 - WAITRESP
48    #[inline(always)]
49    pub fn waitresp(&self) -> WAITRESP_R {
50        WAITRESP_R::new(((self.bits >> 6) & 3) as u8)
51    }
52    ///Bit 8 - WAITINT
53    #[inline(always)]
54    pub fn waitint(&self) -> WAITINT_R {
55        WAITINT_R::new(((self.bits >> 8) & 1) != 0)
56    }
57    ///Bit 9 - WAITPEND
58    #[inline(always)]
59    pub fn waitpend(&self) -> WAITPEND_R {
60        WAITPEND_R::new(((self.bits >> 9) & 1) != 0)
61    }
62    ///Bit 10 - CPSMEN
63    #[inline(always)]
64    pub fn cpsmen(&self) -> CPSMEN_R {
65        CPSMEN_R::new(((self.bits >> 10) & 1) != 0)
66    }
67    ///Bit 11 - SDIOSuspend
68    #[inline(always)]
69    pub fn sdiosuspend(&self) -> SDIOSUSPEND_R {
70        SDIOSUSPEND_R::new(((self.bits >> 11) & 1) != 0)
71    }
72    ///Bit 12 - ENCMDcompl
73    #[inline(always)]
74    pub fn encmdcompl(&self) -> ENCMDCOMPL_R {
75        ENCMDCOMPL_R::new(((self.bits >> 12) & 1) != 0)
76    }
77    ///Bit 13 - nIEN
78    #[inline(always)]
79    pub fn n_ien(&self) -> N_IEN_R {
80        N_IEN_R::new(((self.bits >> 13) & 1) != 0)
81    }
82    ///Bit 14 - CE_ATACMD
83    #[inline(always)]
84    pub fn ce_atacmd(&self) -> CE_ATACMD_R {
85        CE_ATACMD_R::new(((self.bits >> 14) & 1) != 0)
86    }
87}
88impl core::fmt::Debug for R {
89    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
90        f.debug_struct("CMD")
91            .field("cmdindex", &self.cmdindex())
92            .field("waitresp", &self.waitresp())
93            .field("waitint", &self.waitint())
94            .field("waitpend", &self.waitpend())
95            .field("cpsmen", &self.cpsmen())
96            .field("sdiosuspend", &self.sdiosuspend())
97            .field("encmdcompl", &self.encmdcompl())
98            .field("n_ien", &self.n_ien())
99            .field("ce_atacmd", &self.ce_atacmd())
100            .finish()
101    }
102}
103impl W {
104    ///Bits 0:5 - CMDINDEX
105    #[inline(always)]
106    pub fn cmdindex(&mut self) -> CMDINDEX_W<CMDrs> {
107        CMDINDEX_W::new(self, 0)
108    }
109    ///Bits 6:7 - WAITRESP
110    #[inline(always)]
111    pub fn waitresp(&mut self) -> WAITRESP_W<CMDrs> {
112        WAITRESP_W::new(self, 6)
113    }
114    ///Bit 8 - WAITINT
115    #[inline(always)]
116    pub fn waitint(&mut self) -> WAITINT_W<CMDrs> {
117        WAITINT_W::new(self, 8)
118    }
119    ///Bit 9 - WAITPEND
120    #[inline(always)]
121    pub fn waitpend(&mut self) -> WAITPEND_W<CMDrs> {
122        WAITPEND_W::new(self, 9)
123    }
124    ///Bit 10 - CPSMEN
125    #[inline(always)]
126    pub fn cpsmen(&mut self) -> CPSMEN_W<CMDrs> {
127        CPSMEN_W::new(self, 10)
128    }
129    ///Bit 11 - SDIOSuspend
130    #[inline(always)]
131    pub fn sdiosuspend(&mut self) -> SDIOSUSPEND_W<CMDrs> {
132        SDIOSUSPEND_W::new(self, 11)
133    }
134    ///Bit 12 - ENCMDcompl
135    #[inline(always)]
136    pub fn encmdcompl(&mut self) -> ENCMDCOMPL_W<CMDrs> {
137        ENCMDCOMPL_W::new(self, 12)
138    }
139    ///Bit 13 - nIEN
140    #[inline(always)]
141    pub fn n_ien(&mut self) -> N_IEN_W<CMDrs> {
142        N_IEN_W::new(self, 13)
143    }
144    ///Bit 14 - CE_ATACMD
145    #[inline(always)]
146    pub fn ce_atacmd(&mut self) -> CE_ATACMD_W<CMDrs> {
147        CE_ATACMD_W::new(self, 14)
148    }
149}
150/**SDIO command register (SDIO_CMD)
151
152You can [`read`](crate::Reg::read) this register and get [`cmd::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmd::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
153
154See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F103.html#SDIO:CMD)*/
155pub struct CMDrs;
156impl crate::RegisterSpec for CMDrs {
157    type Ux = u32;
158}
159///`read()` method returns [`cmd::R`](R) reader structure
160impl crate::Readable for CMDrs {}
161///`write(|w| ..)` method takes [`cmd::W`](W) writer structure
162impl crate::Writable for CMDrs {
163    type Safety = crate::Unsafe;
164}
165///`reset()` method sets CMD to value 0
166impl crate::Resettable for CMDrs {}