stm32f3_staging/stm32f303/tsc/
cr.rs1pub type R = crate::R<CRrs>;
3pub type W = crate::W<CRrs>;
5pub type TSCE_R = crate::BitReader;
7pub type TSCE_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type START_R = crate::BitReader;
11pub type START_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type AM_R = crate::BitReader;
15pub type AM_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type SYNCPOL_R = crate::BitReader;
19pub type SYNCPOL_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type IODEF_R = crate::BitReader;
23pub type IODEF_W<'a, REG> = crate::BitWriter<'a, REG>;
25pub type MCV_R = crate::FieldReader;
27pub type MCV_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
29pub type PGPSC_R = crate::FieldReader;
31pub type PGPSC_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
33pub type SSPSC_R = crate::BitReader;
35pub type SSPSC_W<'a, REG> = crate::BitWriter<'a, REG>;
37pub type SSE_R = crate::BitReader;
39pub type SSE_W<'a, REG> = crate::BitWriter<'a, REG>;
41pub type SSD_R = crate::FieldReader;
43pub type SSD_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
45pub type CTPL_R = crate::FieldReader;
47pub type CTPL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
49pub type CTPH_R = crate::FieldReader;
51pub type CTPH_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
53impl R {
54 #[inline(always)]
56 pub fn tsce(&self) -> TSCE_R {
57 TSCE_R::new((self.bits & 1) != 0)
58 }
59 #[inline(always)]
61 pub fn start(&self) -> START_R {
62 START_R::new(((self.bits >> 1) & 1) != 0)
63 }
64 #[inline(always)]
66 pub fn am(&self) -> AM_R {
67 AM_R::new(((self.bits >> 2) & 1) != 0)
68 }
69 #[inline(always)]
71 pub fn syncpol(&self) -> SYNCPOL_R {
72 SYNCPOL_R::new(((self.bits >> 3) & 1) != 0)
73 }
74 #[inline(always)]
76 pub fn iodef(&self) -> IODEF_R {
77 IODEF_R::new(((self.bits >> 4) & 1) != 0)
78 }
79 #[inline(always)]
81 pub fn mcv(&self) -> MCV_R {
82 MCV_R::new(((self.bits >> 5) & 7) as u8)
83 }
84 #[inline(always)]
86 pub fn pgpsc(&self) -> PGPSC_R {
87 PGPSC_R::new(((self.bits >> 12) & 7) as u8)
88 }
89 #[inline(always)]
91 pub fn sspsc(&self) -> SSPSC_R {
92 SSPSC_R::new(((self.bits >> 15) & 1) != 0)
93 }
94 #[inline(always)]
96 pub fn sse(&self) -> SSE_R {
97 SSE_R::new(((self.bits >> 16) & 1) != 0)
98 }
99 #[inline(always)]
101 pub fn ssd(&self) -> SSD_R {
102 SSD_R::new(((self.bits >> 17) & 0x7f) as u8)
103 }
104 #[inline(always)]
106 pub fn ctpl(&self) -> CTPL_R {
107 CTPL_R::new(((self.bits >> 24) & 0x0f) as u8)
108 }
109 #[inline(always)]
111 pub fn ctph(&self) -> CTPH_R {
112 CTPH_R::new(((self.bits >> 28) & 0x0f) as u8)
113 }
114}
115impl core::fmt::Debug for R {
116 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
117 f.debug_struct("CR")
118 .field("ctph", &self.ctph())
119 .field("ctpl", &self.ctpl())
120 .field("ssd", &self.ssd())
121 .field("sse", &self.sse())
122 .field("sspsc", &self.sspsc())
123 .field("pgpsc", &self.pgpsc())
124 .field("mcv", &self.mcv())
125 .field("iodef", &self.iodef())
126 .field("syncpol", &self.syncpol())
127 .field("am", &self.am())
128 .field("start", &self.start())
129 .field("tsce", &self.tsce())
130 .finish()
131 }
132}
133impl W {
134 #[inline(always)]
136 pub fn tsce(&mut self) -> TSCE_W<CRrs> {
137 TSCE_W::new(self, 0)
138 }
139 #[inline(always)]
141 pub fn start(&mut self) -> START_W<CRrs> {
142 START_W::new(self, 1)
143 }
144 #[inline(always)]
146 pub fn am(&mut self) -> AM_W<CRrs> {
147 AM_W::new(self, 2)
148 }
149 #[inline(always)]
151 pub fn syncpol(&mut self) -> SYNCPOL_W<CRrs> {
152 SYNCPOL_W::new(self, 3)
153 }
154 #[inline(always)]
156 pub fn iodef(&mut self) -> IODEF_W<CRrs> {
157 IODEF_W::new(self, 4)
158 }
159 #[inline(always)]
161 pub fn mcv(&mut self) -> MCV_W<CRrs> {
162 MCV_W::new(self, 5)
163 }
164 #[inline(always)]
166 pub fn pgpsc(&mut self) -> PGPSC_W<CRrs> {
167 PGPSC_W::new(self, 12)
168 }
169 #[inline(always)]
171 pub fn sspsc(&mut self) -> SSPSC_W<CRrs> {
172 SSPSC_W::new(self, 15)
173 }
174 #[inline(always)]
176 pub fn sse(&mut self) -> SSE_W<CRrs> {
177 SSE_W::new(self, 16)
178 }
179 #[inline(always)]
181 pub fn ssd(&mut self) -> SSD_W<CRrs> {
182 SSD_W::new(self, 17)
183 }
184 #[inline(always)]
186 pub fn ctpl(&mut self) -> CTPL_W<CRrs> {
187 CTPL_W::new(self, 24)
188 }
189 #[inline(always)]
191 pub fn ctph(&mut self) -> CTPH_W<CRrs> {
192 CTPH_W::new(self, 28)
193 }
194}
195pub struct CRrs;
201impl crate::RegisterSpec for CRrs {
202 type Ux = u32;
203}
204impl crate::Readable for CRrs {}
206impl crate::Writable for CRrs {
208 type Safety = crate::Unsafe;
209 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
210 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
211}
212impl crate::Resettable for CRrs {
214 const RESET_VALUE: u32 = 0;
215}