stm32f1_staging/stm32f100/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 PD01_REMAP_R = crate::BitReader;
43pub type PD01_REMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
45pub type TIM5CH4_IREMAP_R = crate::BitReader;
47pub type TIM5CH4_IREMAP_W<'a, REG> = crate::BitWriter<'a, REG>;
49pub type SWJ_CFG_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
51impl R {
52 #[inline(always)]
54 pub fn spi1_remap(&self) -> SPI1_REMAP_R {
55 SPI1_REMAP_R::new((self.bits & 1) != 0)
56 }
57 #[inline(always)]
59 pub fn i2c1_remap(&self) -> I2C1_REMAP_R {
60 I2C1_REMAP_R::new(((self.bits >> 1) & 1) != 0)
61 }
62 #[inline(always)]
64 pub fn usart1_remap(&self) -> USART1_REMAP_R {
65 USART1_REMAP_R::new(((self.bits >> 2) & 1) != 0)
66 }
67 #[inline(always)]
69 pub fn usart2_remap(&self) -> USART2_REMAP_R {
70 USART2_REMAP_R::new(((self.bits >> 3) & 1) != 0)
71 }
72 #[inline(always)]
74 pub fn usart3_remap(&self) -> USART3_REMAP_R {
75 USART3_REMAP_R::new(((self.bits >> 4) & 3) as u8)
76 }
77 #[inline(always)]
79 pub fn tim1_remap(&self) -> TIM1_REMAP_R {
80 TIM1_REMAP_R::new(((self.bits >> 6) & 3) as u8)
81 }
82 #[inline(always)]
84 pub fn tim2_remap(&self) -> TIM2_REMAP_R {
85 TIM2_REMAP_R::new(((self.bits >> 8) & 3) as u8)
86 }
87 #[inline(always)]
89 pub fn tim3_remap(&self) -> TIM3_REMAP_R {
90 TIM3_REMAP_R::new(((self.bits >> 10) & 3) as u8)
91 }
92 #[inline(always)]
94 pub fn tim4_remap(&self) -> TIM4_REMAP_R {
95 TIM4_REMAP_R::new(((self.bits >> 12) & 1) != 0)
96 }
97 #[inline(always)]
99 pub fn pd01_remap(&self) -> PD01_REMAP_R {
100 PD01_REMAP_R::new(((self.bits >> 15) & 1) != 0)
101 }
102 #[inline(always)]
104 pub fn tim5ch4_iremap(&self) -> TIM5CH4_IREMAP_R {
105 TIM5CH4_IREMAP_R::new(((self.bits >> 16) & 1) != 0)
106 }
107}
108impl core::fmt::Debug for R {
109 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
110 f.debug_struct("MAPR")
111 .field("spi1_remap", &self.spi1_remap())
112 .field("i2c1_remap", &self.i2c1_remap())
113 .field("usart1_remap", &self.usart1_remap())
114 .field("usart2_remap", &self.usart2_remap())
115 .field("usart3_remap", &self.usart3_remap())
116 .field("tim1_remap", &self.tim1_remap())
117 .field("tim2_remap", &self.tim2_remap())
118 .field("tim3_remap", &self.tim3_remap())
119 .field("tim4_remap", &self.tim4_remap())
120 .field("pd01_remap", &self.pd01_remap())
121 .field("tim5ch4_iremap", &self.tim5ch4_iremap())
122 .finish()
123 }
124}
125impl W {
126 #[inline(always)]
128 pub fn spi1_remap(&mut self) -> SPI1_REMAP_W<MAPRrs> {
129 SPI1_REMAP_W::new(self, 0)
130 }
131 #[inline(always)]
133 pub fn i2c1_remap(&mut self) -> I2C1_REMAP_W<MAPRrs> {
134 I2C1_REMAP_W::new(self, 1)
135 }
136 #[inline(always)]
138 pub fn usart1_remap(&mut self) -> USART1_REMAP_W<MAPRrs> {
139 USART1_REMAP_W::new(self, 2)
140 }
141 #[inline(always)]
143 pub fn usart2_remap(&mut self) -> USART2_REMAP_W<MAPRrs> {
144 USART2_REMAP_W::new(self, 3)
145 }
146 #[inline(always)]
148 pub fn usart3_remap(&mut self) -> USART3_REMAP_W<MAPRrs> {
149 USART3_REMAP_W::new(self, 4)
150 }
151 #[inline(always)]
153 pub fn tim1_remap(&mut self) -> TIM1_REMAP_W<MAPRrs> {
154 TIM1_REMAP_W::new(self, 6)
155 }
156 #[inline(always)]
158 pub fn tim2_remap(&mut self) -> TIM2_REMAP_W<MAPRrs> {
159 TIM2_REMAP_W::new(self, 8)
160 }
161 #[inline(always)]
163 pub fn tim3_remap(&mut self) -> TIM3_REMAP_W<MAPRrs> {
164 TIM3_REMAP_W::new(self, 10)
165 }
166 #[inline(always)]
168 pub fn tim4_remap(&mut self) -> TIM4_REMAP_W<MAPRrs> {
169 TIM4_REMAP_W::new(self, 12)
170 }
171 #[inline(always)]
173 pub fn pd01_remap(&mut self) -> PD01_REMAP_W<MAPRrs> {
174 PD01_REMAP_W::new(self, 15)
175 }
176 #[inline(always)]
178 pub fn tim5ch4_iremap(&mut self) -> TIM5CH4_IREMAP_W<MAPRrs> {
179 TIM5CH4_IREMAP_W::new(self, 16)
180 }
181 #[inline(always)]
183 pub fn swj_cfg(&mut self) -> SWJ_CFG_W<MAPRrs> {
184 SWJ_CFG_W::new(self, 24)
185 }
186}
187pub struct MAPRrs;
193impl crate::RegisterSpec for MAPRrs {
194 type Ux = u32;
195}
196impl crate::Readable for MAPRrs {}
198impl crate::Writable for MAPRrs {
200 type Safety = crate::Unsafe;
201}
202impl crate::Resettable for MAPRrs {}