stm32f1_staging/stm32f107/afio/
mapr.rs1pub type R = crate::R<MAPRrs>;
3pub type W = crate::W<MAPRrs>;
5pub type SPI1_REMAP_R = crate::BitReader;
7pub type SPI1_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type I2C1_REMAP_R = crate::BitReader;
11pub type I2C1_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type USART1_REMAP_R = crate::BitReader;
15pub type USART1_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type USART2_REMAP_R = crate::BitReader;
19pub type USART2_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type USART3_REMAP_R = crate::FieldReader;
23pub type USART3_REMAP_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
25pub type TIM1_REMAP_R = crate::FieldReader;
27pub type TIM1_REMAP_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
29pub type TIM2_REMAP_R = crate::FieldReader;
31pub type TIM2_REMAP_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
33pub type TIM3_REMAP_R = crate::FieldReader;
35pub type TIM3_REMAP_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
37pub type TIM4_REMAP_R = crate::BitReader;
39pub type TIM4_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
41pub type CAN1_REMAP_R = crate::FieldReader;
43pub type CAN1_REMAP_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
45pub type PD01_REMAP_R = crate::BitReader;
47pub type PD01_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
49pub type TIM5CH4_IREMAP_R = crate::BitReader;
51pub type TIM5CH4_IREMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
53pub type ETH_REMAP_R = crate::BitReader;
55pub type ETH_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
57pub type CAN2_REMAP_R = crate::BitReader;
59pub type CAN2_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
61pub type MII_RMII_SEL_R = crate::BitReader;
63pub type MII_RMII_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
65pub type SWJ_CFG_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
67pub type SPI3_REMAP_R = crate::BitReader;
69pub type SPI3_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
71pub type TIM2ITR1_IREMAP_R = crate::BitReader;
73pub type TIM2ITR1_IREMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
75pub type PTP_PPS_REMAP_R = crate::BitReader;
77pub type PTP_PPS_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
79impl R {
80 #[inline(always)]
82 pub fn spi1_remap(&self) -> SPI1_REMAP_R {
83 SPI1_REMAP_R::new((self.bits & 1) != 0)
84 }
85 #[inline(always)]
87 pub fn i2c1_remap(&self) -> I2C1_REMAP_R {
88 I2C1_REMAP_R::new(((self.bits >> 1) & 1) != 0)
89 }
90 #[inline(always)]
92 pub fn usart1_remap(&self) -> USART1_REMAP_R {
93 USART1_REMAP_R::new(((self.bits >> 2) & 1) != 0)
94 }
95 #[inline(always)]
97 pub fn usart2_remap(&self) -> USART2_REMAP_R {
98 USART2_REMAP_R::new(((self.bits >> 3) & 1) != 0)
99 }
100 #[inline(always)]
102 pub fn usart3_remap(&self) -> USART3_REMAP_R {
103 USART3_REMAP_R::new(((self.bits >> 4) & 3) as u8)
104 }
105 #[inline(always)]
107 pub fn tim1_remap(&self) -> TIM1_REMAP_R {
108 TIM1_REMAP_R::new(((self.bits >> 6) & 3) as u8)
109 }
110 #[inline(always)]
112 pub fn tim2_remap(&self) -> TIM2_REMAP_R {
113 TIM2_REMAP_R::new(((self.bits >> 8) & 3) as u8)
114 }
115 #[inline(always)]
117 pub fn tim3_remap(&self) -> TIM3_REMAP_R {
118 TIM3_REMAP_R::new(((self.bits >> 10) & 3) as u8)
119 }
120 #[inline(always)]
122 pub fn tim4_remap(&self) -> TIM4_REMAP_R {
123 TIM4_REMAP_R::new(((self.bits >> 12) & 1) != 0)
124 }
125 #[inline(always)]
127 pub fn can1_remap(&self) -> CAN1_REMAP_R {
128 CAN1_REMAP_R::new(((self.bits >> 13) & 3) as u8)
129 }
130 #[inline(always)]
132 pub fn pd01_remap(&self) -> PD01_REMAP_R {
133 PD01_REMAP_R::new(((self.bits >> 15) & 1) != 0)
134 }
135 #[inline(always)]
137 pub fn tim5ch4_iremap(&self) -> TIM5CH4_IREMAP_R {
138 TIM5CH4_IREMAP_R::new(((self.bits >> 16) & 1) != 0)
139 }
140 #[inline(always)]
142 pub fn eth_remap(&self) -> ETH_REMAP_R {
143 ETH_REMAP_R::new(((self.bits >> 21) & 1) != 0)
144 }
145 #[inline(always)]
147 pub fn can2_remap(&self) -> CAN2_REMAP_R {
148 CAN2_REMAP_R::new(((self.bits >> 22) & 1) != 0)
149 }
150 #[inline(always)]
152 pub fn mii_rmii_sel(&self) -> MII_RMII_SEL_R {
153 MII_RMII_SEL_R::new(((self.bits >> 23) & 1) != 0)
154 }
155 #[inline(always)]
157 pub fn spi3_remap(&self) -> SPI3_REMAP_R {
158 SPI3_REMAP_R::new(((self.bits >> 28) & 1) != 0)
159 }
160 #[inline(always)]
162 pub fn tim2itr1_iremap(&self) -> TIM2ITR1_IREMAP_R {
163 TIM2ITR1_IREMAP_R::new(((self.bits >> 29) & 1) != 0)
164 }
165 #[inline(always)]
167 pub fn ptp_pps_remap(&self) -> PTP_PPS_REMAP_R {
168 PTP_PPS_REMAP_R::new(((self.bits >> 30) & 1) != 0)
169 }
170}
171impl core::fmt::Debug for R {
172 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
173 f.debug_struct("MAPR")
174 .field("spi1_remap", &self.spi1_remap())
175 .field("i2c1_remap", &self.i2c1_remap())
176 .field("usart1_remap", &self.usart1_remap())
177 .field("usart2_remap", &self.usart2_remap())
178 .field("usart3_remap", &self.usart3_remap())
179 .field("tim1_remap", &self.tim1_remap())
180 .field("tim2_remap", &self.tim2_remap())
181 .field("tim3_remap", &self.tim3_remap())
182 .field("tim4_remap", &self.tim4_remap())
183 .field("can1_remap", &self.can1_remap())
184 .field("pd01_remap", &self.pd01_remap())
185 .field("tim5ch4_iremap", &self.tim5ch4_iremap())
186 .field("eth_remap", &self.eth_remap())
187 .field("can2_remap", &self.can2_remap())
188 .field("mii_rmii_sel", &self.mii_rmii_sel())
189 .field("spi3_remap", &self.spi3_remap())
190 .field("tim2itr1_iremap", &self.tim2itr1_iremap())
191 .field("ptp_pps_remap", &self.ptp_pps_remap())
192 .finish()
193 }
194}
195impl W {
196 #[inline(always)]
198 pub fn spi1_remap(&mut self) -> SPI1_REMAP_W<MAPRrs> {
199 SPI1_REMAP_W::new(self, 0)
200 }
201 #[inline(always)]
203 pub fn i2c1_remap(&mut self) -> I2C1_REMAP_W<MAPRrs> {
204 I2C1_REMAP_W::new(self, 1)
205 }
206 #[inline(always)]
208 pub fn usart1_remap(&mut self) -> USART1_REMAP_W<MAPRrs> {
209 USART1_REMAP_W::new(self, 2)
210 }
211 #[inline(always)]
213 pub fn usart2_remap(&mut self) -> USART2_REMAP_W<MAPRrs> {
214 USART2_REMAP_W::new(self, 3)
215 }
216 #[inline(always)]
218 pub fn usart3_remap(&mut self) -> USART3_REMAP_W<MAPRrs> {
219 USART3_REMAP_W::new(self, 4)
220 }
221 #[inline(always)]
223 pub fn tim1_remap(&mut self) -> TIM1_REMAP_W<MAPRrs> {
224 TIM1_REMAP_W::new(self, 6)
225 }
226 #[inline(always)]
228 pub fn tim2_remap(&mut self) -> TIM2_REMAP_W<MAPRrs> {
229 TIM2_REMAP_W::new(self, 8)
230 }
231 #[inline(always)]
233 pub fn tim3_remap(&mut self) -> TIM3_REMAP_W<MAPRrs> {
234 TIM3_REMAP_W::new(self, 10)
235 }
236 #[inline(always)]
238 pub fn tim4_remap(&mut self) -> TIM4_REMAP_W<MAPRrs> {
239 TIM4_REMAP_W::new(self, 12)
240 }
241 #[inline(always)]
243 pub fn can1_remap(&mut self) -> CAN1_REMAP_W<MAPRrs> {
244 CAN1_REMAP_W::new(self, 13)
245 }
246 #[inline(always)]
248 pub fn pd01_remap(&mut self) -> PD01_REMAP_W<MAPRrs> {
249 PD01_REMAP_W::new(self, 15)
250 }
251 #[inline(always)]
253 pub fn tim5ch4_iremap(&mut self) -> TIM5CH4_IREMAP_W<MAPRrs> {
254 TIM5CH4_IREMAP_W::new(self, 16)
255 }
256 #[inline(always)]
258 pub fn eth_remap(&mut self) -> ETH_REMAP_W<MAPRrs> {
259 ETH_REMAP_W::new(self, 21)
260 }
261 #[inline(always)]
263 pub fn can2_remap(&mut self) -> CAN2_REMAP_W<MAPRrs> {
264 CAN2_REMAP_W::new(self, 22)
265 }
266 #[inline(always)]
268 pub fn mii_rmii_sel(&mut self) -> MII_RMII_SEL_W<MAPRrs> {
269 MII_RMII_SEL_W::new(self, 23)
270 }
271 #[inline(always)]
273 pub fn swj_cfg(&mut self) -> SWJ_CFG_W<MAPRrs> {
274 SWJ_CFG_W::new(self, 24)
275 }
276 #[inline(always)]
278 pub fn spi3_remap(&mut self) -> SPI3_REMAP_W<MAPRrs> {
279 SPI3_REMAP_W::new(self, 28)
280 }
281 #[inline(always)]
283 pub fn tim2itr1_iremap(&mut self) -> TIM2ITR1_IREMAP_W<MAPRrs> {
284 TIM2ITR1_IREMAP_W::new(self, 29)
285 }
286 #[inline(always)]
288 pub fn ptp_pps_remap(&mut self) -> PTP_PPS_REMAP_W<MAPRrs> {
289 PTP_PPS_REMAP_W::new(self, 30)
290 }
291}
292pub struct MAPRrs;
298impl crate::RegisterSpec for MAPRrs {
299 type Ux = u32;
300}
301impl crate::Readable for MAPRrs {}
303impl crate::Writable for MAPRrs {
305 type Safety = crate::Unsafe;
306}
307impl crate::Resettable for MAPRrs {}