stm32f1_staging/stm32f103/sdio/
dctrl.rs

1///Register `DCTRL` reader
2pub type R = crate::R<DCTRLrs>;
3///Register `DCTRL` writer
4pub type W = crate::W<DCTRLrs>;
5///Field `DTEN` reader - DTEN
6pub type DTEN_R = crate::BitReader;
7///Field `DTEN` writer - DTEN
8pub type DTEN_W<'a, REG> = crate::BitWriter<'a, REG>;
9///Field `DTDIR` reader - DTDIR
10pub type DTDIR_R = crate::BitReader;
11///Field `DTDIR` writer - DTDIR
12pub type DTDIR_W<'a, REG> = crate::BitWriter<'a, REG>;
13///Field `DTMODE` reader - DTMODE
14pub type DTMODE_R = crate::BitReader;
15///Field `DTMODE` writer - DTMODE
16pub type DTMODE_W<'a, REG> = crate::BitWriter<'a, REG>;
17///Field `DMAEN` reader - DMAEN
18pub type DMAEN_R = crate::BitReader;
19///Field `DMAEN` writer - DMAEN
20pub type DMAEN_W<'a, REG> = crate::BitWriter<'a, REG>;
21///Field `DBLOCKSIZE` reader - DBLOCKSIZE
22pub type DBLOCKSIZE_R = crate::FieldReader;
23///Field `DBLOCKSIZE` writer - DBLOCKSIZE
24pub type DBLOCKSIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
25///Field `PWSTART` reader - PWSTART
26pub type PWSTART_R = crate::BitReader;
27///Field `PWSTART` writer - PWSTART
28pub type PWSTART_W<'a, REG> = crate::BitWriter<'a, REG>;
29///Field `PWSTOP` reader - PWSTOP
30pub type PWSTOP_R = crate::BitReader;
31///Field `PWSTOP` writer - PWSTOP
32pub type PWSTOP_W<'a, REG> = crate::BitWriter<'a, REG>;
33///Field `RWMOD` reader - RWMOD
34pub type RWMOD_R = crate::BitReader;
35///Field `RWMOD` writer - RWMOD
36pub type RWMOD_W<'a, REG> = crate::BitWriter<'a, REG>;
37///Field `SDIOEN` reader - SDIOEN
38pub type SDIOEN_R = crate::BitReader;
39///Field `SDIOEN` writer - SDIOEN
40pub type SDIOEN_W<'a, REG> = crate::BitWriter<'a, REG>;
41impl R {
42    ///Bit 0 - DTEN
43    #[inline(always)]
44    pub fn dten(&self) -> DTEN_R {
45        DTEN_R::new((self.bits & 1) != 0)
46    }
47    ///Bit 1 - DTDIR
48    #[inline(always)]
49    pub fn dtdir(&self) -> DTDIR_R {
50        DTDIR_R::new(((self.bits >> 1) & 1) != 0)
51    }
52    ///Bit 2 - DTMODE
53    #[inline(always)]
54    pub fn dtmode(&self) -> DTMODE_R {
55        DTMODE_R::new(((self.bits >> 2) & 1) != 0)
56    }
57    ///Bit 3 - DMAEN
58    #[inline(always)]
59    pub fn dmaen(&self) -> DMAEN_R {
60        DMAEN_R::new(((self.bits >> 3) & 1) != 0)
61    }
62    ///Bits 4:7 - DBLOCKSIZE
63    #[inline(always)]
64    pub fn dblocksize(&self) -> DBLOCKSIZE_R {
65        DBLOCKSIZE_R::new(((self.bits >> 4) & 0x0f) as u8)
66    }
67    ///Bit 8 - PWSTART
68    #[inline(always)]
69    pub fn pwstart(&self) -> PWSTART_R {
70        PWSTART_R::new(((self.bits >> 8) & 1) != 0)
71    }
72    ///Bit 9 - PWSTOP
73    #[inline(always)]
74    pub fn pwstop(&self) -> PWSTOP_R {
75        PWSTOP_R::new(((self.bits >> 9) & 1) != 0)
76    }
77    ///Bit 10 - RWMOD
78    #[inline(always)]
79    pub fn rwmod(&self) -> RWMOD_R {
80        RWMOD_R::new(((self.bits >> 10) & 1) != 0)
81    }
82    ///Bit 11 - SDIOEN
83    #[inline(always)]
84    pub fn sdioen(&self) -> SDIOEN_R {
85        SDIOEN_R::new(((self.bits >> 11) & 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("DCTRL")
91            .field("dten", &self.dten())
92            .field("dtdir", &self.dtdir())
93            .field("dtmode", &self.dtmode())
94            .field("dmaen", &self.dmaen())
95            .field("dblocksize", &self.dblocksize())
96            .field("pwstart", &self.pwstart())
97            .field("pwstop", &self.pwstop())
98            .field("rwmod", &self.rwmod())
99            .field("sdioen", &self.sdioen())
100            .finish()
101    }
102}
103impl W {
104    ///Bit 0 - DTEN
105    #[inline(always)]
106    pub fn dten(&mut self) -> DTEN_W<DCTRLrs> {
107        DTEN_W::new(self, 0)
108    }
109    ///Bit 1 - DTDIR
110    #[inline(always)]
111    pub fn dtdir(&mut self) -> DTDIR_W<DCTRLrs> {
112        DTDIR_W::new(self, 1)
113    }
114    ///Bit 2 - DTMODE
115    #[inline(always)]
116    pub fn dtmode(&mut self) -> DTMODE_W<DCTRLrs> {
117        DTMODE_W::new(self, 2)
118    }
119    ///Bit 3 - DMAEN
120    #[inline(always)]
121    pub fn dmaen(&mut self) -> DMAEN_W<DCTRLrs> {
122        DMAEN_W::new(self, 3)
123    }
124    ///Bits 4:7 - DBLOCKSIZE
125    #[inline(always)]
126    pub fn dblocksize(&mut self) -> DBLOCKSIZE_W<DCTRLrs> {
127        DBLOCKSIZE_W::new(self, 4)
128    }
129    ///Bit 8 - PWSTART
130    #[inline(always)]
131    pub fn pwstart(&mut self) -> PWSTART_W<DCTRLrs> {
132        PWSTART_W::new(self, 8)
133    }
134    ///Bit 9 - PWSTOP
135    #[inline(always)]
136    pub fn pwstop(&mut self) -> PWSTOP_W<DCTRLrs> {
137        PWSTOP_W::new(self, 9)
138    }
139    ///Bit 10 - RWMOD
140    #[inline(always)]
141    pub fn rwmod(&mut self) -> RWMOD_W<DCTRLrs> {
142        RWMOD_W::new(self, 10)
143    }
144    ///Bit 11 - SDIOEN
145    #[inline(always)]
146    pub fn sdioen(&mut self) -> SDIOEN_W<DCTRLrs> {
147        SDIOEN_W::new(self, 11)
148    }
149}
150/**SDIO data control register (SDIO_DCTRL)
151
152You can [`read`](crate::Reg::read) this register and get [`dctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dctrl::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:DCTRL)*/
155pub struct DCTRLrs;
156impl crate::RegisterSpec for DCTRLrs {
157    type Ux = u32;
158}
159///`read()` method returns [`dctrl::R`](R) reader structure
160impl crate::Readable for DCTRLrs {}
161///`write(|w| ..)` method takes [`dctrl::W`](W) writer structure
162impl crate::Writable for DCTRLrs {
163    type Safety = crate::Unsafe;
164}
165///`reset()` method sets DCTRL to value 0
166impl crate::Resettable for DCTRLrs {}