stm32f1_staging/stm32f107/sdio/
dctrl.rs1pub type R = crate::R<DCTRLrs>;
3pub type W = crate::W<DCTRLrs>;
5pub type DTEN_R = crate::BitReader;
7pub type DTEN_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type DTDIR_R = crate::BitReader;
11pub type DTDIR_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type DTMODE_R = crate::BitReader;
15pub type DTMODE_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type DMAEN_R = crate::BitReader;
19pub type DMAEN_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type DBLOCKSIZE_R = crate::FieldReader;
23pub type DBLOCKSIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
25pub type RWSTART_R = crate::BitReader;
27pub type RWSTART_W<'a, REG> = crate::BitWriter<'a, REG>;
29pub type RWSTOP_R = crate::BitReader;
31pub type RWSTOP_W<'a, REG> = crate::BitWriter<'a, REG>;
33pub type RWMOD_R = crate::BitReader;
35pub type RWMOD_W<'a, REG> = crate::BitWriter<'a, REG>;
37pub type SDIOEN_R = crate::BitReader;
39pub type SDIOEN_W<'a, REG> = crate::BitWriter<'a, REG>;
41impl R {
42 #[inline(always)]
44 pub fn dten(&self) -> DTEN_R {
45 DTEN_R::new((self.bits & 1) != 0)
46 }
47 #[inline(always)]
49 pub fn dtdir(&self) -> DTDIR_R {
50 DTDIR_R::new(((self.bits >> 1) & 1) != 0)
51 }
52 #[inline(always)]
54 pub fn dtmode(&self) -> DTMODE_R {
55 DTMODE_R::new(((self.bits >> 2) & 1) != 0)
56 }
57 #[inline(always)]
59 pub fn dmaen(&self) -> DMAEN_R {
60 DMAEN_R::new(((self.bits >> 3) & 1) != 0)
61 }
62 #[inline(always)]
64 pub fn dblocksize(&self) -> DBLOCKSIZE_R {
65 DBLOCKSIZE_R::new(((self.bits >> 4) & 0x0f) as u8)
66 }
67 #[inline(always)]
69 pub fn rwstart(&self) -> RWSTART_R {
70 RWSTART_R::new(((self.bits >> 8) & 1) != 0)
71 }
72 #[inline(always)]
74 pub fn rwstop(&self) -> RWSTOP_R {
75 RWSTOP_R::new(((self.bits >> 9) & 1) != 0)
76 }
77 #[inline(always)]
79 pub fn rwmod(&self) -> RWMOD_R {
80 RWMOD_R::new(((self.bits >> 10) & 1) != 0)
81 }
82 #[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("sdioen", &self.sdioen())
92 .field("rwmod", &self.rwmod())
93 .field("rwstop", &self.rwstop())
94 .field("rwstart", &self.rwstart())
95 .field("dblocksize", &self.dblocksize())
96 .field("dmaen", &self.dmaen())
97 .field("dtmode", &self.dtmode())
98 .field("dtdir", &self.dtdir())
99 .field("dten", &self.dten())
100 .finish()
101 }
102}
103impl W {
104 #[inline(always)]
106 pub fn dten(&mut self) -> DTEN_W<DCTRLrs> {
107 DTEN_W::new(self, 0)
108 }
109 #[inline(always)]
111 pub fn dtdir(&mut self) -> DTDIR_W<DCTRLrs> {
112 DTDIR_W::new(self, 1)
113 }
114 #[inline(always)]
116 pub fn dtmode(&mut self) -> DTMODE_W<DCTRLrs> {
117 DTMODE_W::new(self, 2)
118 }
119 #[inline(always)]
121 pub fn dmaen(&mut self) -> DMAEN_W<DCTRLrs> {
122 DMAEN_W::new(self, 3)
123 }
124 #[inline(always)]
126 pub fn dblocksize(&mut self) -> DBLOCKSIZE_W<DCTRLrs> {
127 DBLOCKSIZE_W::new(self, 4)
128 }
129 #[inline(always)]
131 pub fn rwstart(&mut self) -> RWSTART_W<DCTRLrs> {
132 RWSTART_W::new(self, 8)
133 }
134 #[inline(always)]
136 pub fn rwstop(&mut self) -> RWSTOP_W<DCTRLrs> {
137 RWSTOP_W::new(self, 9)
138 }
139 #[inline(always)]
141 pub fn rwmod(&mut self) -> RWMOD_W<DCTRLrs> {
142 RWMOD_W::new(self, 10)
143 }
144 #[inline(always)]
146 pub fn sdioen(&mut self) -> SDIOEN_W<DCTRLrs> {
147 SDIOEN_W::new(self, 11)
148 }
149}
150pub struct DCTRLrs;
156impl crate::RegisterSpec for DCTRLrs {
157 type Ux = u32;
158}
159impl crate::Readable for DCTRLrs {}
161impl crate::Writable for DCTRLrs {
163 type Safety = crate::Unsafe;
164}
165impl crate::Resettable for DCTRLrs {}