stm32f1_staging/stm32f101/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 CAN_REMAP_R = crate::FieldReader;
43pub type CAN_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 ADC1_ETRGINJ_REMAP_R = crate::BitReader;
55pub type ADC1_ETRGINJ_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
57pub type ADC1_ETRGREG_REMAP_R = crate::BitReader;
59pub type ADC1_ETRGREG_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
61pub type ADC2_ETRGINJ_REMAP_R = crate::BitReader;
63pub type ADC2_ETRGINJ_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
65pub type ADC2_ETRGREG_REMAP_R = crate::BitReader;
67pub type ADC2_ETRGREG_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
69pub type SWJ_CFG_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
71impl R {
72 #[inline(always)]
74 pub fn spi1_remap(&self) -> SPI1_REMAP_R {
75 SPI1_REMAP_R::new((self.bits & 1) != 0)
76 }
77 #[inline(always)]
79 pub fn i2c1_remap(&self) -> I2C1_REMAP_R {
80 I2C1_REMAP_R::new(((self.bits >> 1) & 1) != 0)
81 }
82 #[inline(always)]
84 pub fn usart1_remap(&self) -> USART1_REMAP_R {
85 USART1_REMAP_R::new(((self.bits >> 2) & 1) != 0)
86 }
87 #[inline(always)]
89 pub fn usart2_remap(&self) -> USART2_REMAP_R {
90 USART2_REMAP_R::new(((self.bits >> 3) & 1) != 0)
91 }
92 #[inline(always)]
94 pub fn usart3_remap(&self) -> USART3_REMAP_R {
95 USART3_REMAP_R::new(((self.bits >> 4) & 3) as u8)
96 }
97 #[inline(always)]
99 pub fn tim1_remap(&self) -> TIM1_REMAP_R {
100 TIM1_REMAP_R::new(((self.bits >> 6) & 3) as u8)
101 }
102 #[inline(always)]
104 pub fn tim2_remap(&self) -> TIM2_REMAP_R {
105 TIM2_REMAP_R::new(((self.bits >> 8) & 3) as u8)
106 }
107 #[inline(always)]
109 pub fn tim3_remap(&self) -> TIM3_REMAP_R {
110 TIM3_REMAP_R::new(((self.bits >> 10) & 3) as u8)
111 }
112 #[inline(always)]
114 pub fn tim4_remap(&self) -> TIM4_REMAP_R {
115 TIM4_REMAP_R::new(((self.bits >> 12) & 1) != 0)
116 }
117 #[inline(always)]
119 pub fn can_remap(&self) -> CAN_REMAP_R {
120 CAN_REMAP_R::new(((self.bits >> 13) & 3) as u8)
121 }
122 #[inline(always)]
124 pub fn pd01_remap(&self) -> PD01_REMAP_R {
125 PD01_REMAP_R::new(((self.bits >> 15) & 1) != 0)
126 }
127 #[inline(always)]
129 pub fn tim5ch4_iremap(&self) -> TIM5CH4_IREMAP_R {
130 TIM5CH4_IREMAP_R::new(((self.bits >> 16) & 1) != 0)
131 }
132 #[inline(always)]
134 pub fn adc1_etrginj_remap(&self) -> ADC1_ETRGINJ_REMAP_R {
135 ADC1_ETRGINJ_REMAP_R::new(((self.bits >> 17) & 1) != 0)
136 }
137 #[inline(always)]
139 pub fn adc1_etrgreg_remap(&self) -> ADC1_ETRGREG_REMAP_R {
140 ADC1_ETRGREG_REMAP_R::new(((self.bits >> 18) & 1) != 0)
141 }
142 #[inline(always)]
144 pub fn adc2_etrginj_remap(&self) -> ADC2_ETRGINJ_REMAP_R {
145 ADC2_ETRGINJ_REMAP_R::new(((self.bits >> 19) & 1) != 0)
146 }
147 #[inline(always)]
149 pub fn adc2_etrgreg_remap(&self) -> ADC2_ETRGREG_REMAP_R {
150 ADC2_ETRGREG_REMAP_R::new(((self.bits >> 20) & 1) != 0)
151 }
152}
153impl core::fmt::Debug for R {
154 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
155 f.debug_struct("MAPR")
156 .field("spi1_remap", &self.spi1_remap())
157 .field("i2c1_remap", &self.i2c1_remap())
158 .field("usart1_remap", &self.usart1_remap())
159 .field("usart2_remap", &self.usart2_remap())
160 .field("usart3_remap", &self.usart3_remap())
161 .field("tim1_remap", &self.tim1_remap())
162 .field("tim2_remap", &self.tim2_remap())
163 .field("tim3_remap", &self.tim3_remap())
164 .field("tim4_remap", &self.tim4_remap())
165 .field("can_remap", &self.can_remap())
166 .field("pd01_remap", &self.pd01_remap())
167 .field("tim5ch4_iremap", &self.tim5ch4_iremap())
168 .field("adc1_etrginj_remap", &self.adc1_etrginj_remap())
169 .field("adc1_etrgreg_remap", &self.adc1_etrgreg_remap())
170 .field("adc2_etrginj_remap", &self.adc2_etrginj_remap())
171 .field("adc2_etrgreg_remap", &self.adc2_etrgreg_remap())
172 .finish()
173 }
174}
175impl W {
176 #[inline(always)]
178 pub fn spi1_remap(&mut self) -> SPI1_REMAP_W<MAPRrs> {
179 SPI1_REMAP_W::new(self, 0)
180 }
181 #[inline(always)]
183 pub fn i2c1_remap(&mut self) -> I2C1_REMAP_W<MAPRrs> {
184 I2C1_REMAP_W::new(self, 1)
185 }
186 #[inline(always)]
188 pub fn usart1_remap(&mut self) -> USART1_REMAP_W<MAPRrs> {
189 USART1_REMAP_W::new(self, 2)
190 }
191 #[inline(always)]
193 pub fn usart2_remap(&mut self) -> USART2_REMAP_W<MAPRrs> {
194 USART2_REMAP_W::new(self, 3)
195 }
196 #[inline(always)]
198 pub fn usart3_remap(&mut self) -> USART3_REMAP_W<MAPRrs> {
199 USART3_REMAP_W::new(self, 4)
200 }
201 #[inline(always)]
203 pub fn tim1_remap(&mut self) -> TIM1_REMAP_W<MAPRrs> {
204 TIM1_REMAP_W::new(self, 6)
205 }
206 #[inline(always)]
208 pub fn tim2_remap(&mut self) -> TIM2_REMAP_W<MAPRrs> {
209 TIM2_REMAP_W::new(self, 8)
210 }
211 #[inline(always)]
213 pub fn tim3_remap(&mut self) -> TIM3_REMAP_W<MAPRrs> {
214 TIM3_REMAP_W::new(self, 10)
215 }
216 #[inline(always)]
218 pub fn tim4_remap(&mut self) -> TIM4_REMAP_W<MAPRrs> {
219 TIM4_REMAP_W::new(self, 12)
220 }
221 #[inline(always)]
223 pub fn can_remap(&mut self) -> CAN_REMAP_W<MAPRrs> {
224 CAN_REMAP_W::new(self, 13)
225 }
226 #[inline(always)]
228 pub fn pd01_remap(&mut self) -> PD01_REMAP_W<MAPRrs> {
229 PD01_REMAP_W::new(self, 15)
230 }
231 #[inline(always)]
233 pub fn tim5ch4_iremap(&mut self) -> TIM5CH4_IREMAP_W<MAPRrs> {
234 TIM5CH4_IREMAP_W::new(self, 16)
235 }
236 #[inline(always)]
238 pub fn adc1_etrginj_remap(&mut self) -> ADC1_ETRGINJ_REMAP_W<MAPRrs> {
239 ADC1_ETRGINJ_REMAP_W::new(self, 17)
240 }
241 #[inline(always)]
243 pub fn adc1_etrgreg_remap(&mut self) -> ADC1_ETRGREG_REMAP_W<MAPRrs> {
244 ADC1_ETRGREG_REMAP_W::new(self, 18)
245 }
246 #[inline(always)]
248 pub fn adc2_etrginj_remap(&mut self) -> ADC2_ETRGINJ_REMAP_W<MAPRrs> {
249 ADC2_ETRGINJ_REMAP_W::new(self, 19)
250 }
251 #[inline(always)]
253 pub fn adc2_etrgreg_remap(&mut self) -> ADC2_ETRGREG_REMAP_W<MAPRrs> {
254 ADC2_ETRGREG_REMAP_W::new(self, 20)
255 }
256 #[inline(always)]
258 pub fn swj_cfg(&mut self) -> SWJ_CFG_W<MAPRrs> {
259 SWJ_CFG_W::new(self, 24)
260 }
261}
262pub struct MAPRrs;
268impl crate::RegisterSpec for MAPRrs {
269 type Ux = u32;
270}
271impl crate::Readable for MAPRrs {}
273impl crate::Writable for MAPRrs {
275 type Safety = crate::Unsafe;
276}
277impl crate::Resettable for MAPRrs {}