stm32f1_staging/stm32f100/rcc/
apb2rstr.rs1pub type R = crate::R<APB2RSTRrs>;
3pub type W = crate::W<APB2RSTRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum AFIORST {
11 Reset = 1,
13}
14impl From<AFIORST> for bool {
15 #[inline(always)]
16 fn from(variant: AFIORST) -> Self {
17 variant as u8 != 0
18 }
19}
20pub type AFIORST_R = crate::BitReader<AFIORST>;
22impl AFIORST_R {
23 #[inline(always)]
25 pub const fn variant(&self) -> Option<AFIORST> {
26 match self.bits {
27 true => Some(AFIORST::Reset),
28 _ => None,
29 }
30 }
31 #[inline(always)]
33 pub fn is_reset(&self) -> bool {
34 *self == AFIORST::Reset
35 }
36}
37pub type AFIORST_W<'a, REG> = crate::BitWriter<'a, REG, AFIORST>;
39impl<'a, REG> AFIORST_W<'a, REG>
40where
41 REG: crate::Writable + crate::RegisterSpec,
42{
43 #[inline(always)]
45 pub fn reset(self) -> &'a mut crate::W<REG> {
46 self.variant(AFIORST::Reset)
47 }
48}
49pub use AFIORST_R as IOPARST_R;
51pub use AFIORST_R as IOPBRST_R;
53pub use AFIORST_R as IOPCRST_R;
55pub use AFIORST_R as IOPDRST_R;
57pub use AFIORST_R as IOPERST_R;
59pub use AFIORST_R as IOPFRST_R;
61pub use AFIORST_R as IOPGRST_R;
63pub use AFIORST_R as ADC1RST_R;
65pub use AFIORST_R as TIM1RST_R;
67pub use AFIORST_R as SPI1RST_R;
69pub use AFIORST_R as USART1RST_R;
71pub use AFIORST_R as TIM15RST_R;
73pub use AFIORST_R as TIM16RST_R;
75pub use AFIORST_R as TIM17RST_R;
77pub use AFIORST_W as IOPARST_W;
79pub use AFIORST_W as IOPBRST_W;
81pub use AFIORST_W as IOPCRST_W;
83pub use AFIORST_W as IOPDRST_W;
85pub use AFIORST_W as IOPERST_W;
87pub use AFIORST_W as IOPFRST_W;
89pub use AFIORST_W as IOPGRST_W;
91pub use AFIORST_W as ADC1RST_W;
93pub use AFIORST_W as TIM1RST_W;
95pub use AFIORST_W as SPI1RST_W;
97pub use AFIORST_W as USART1RST_W;
99pub use AFIORST_W as TIM15RST_W;
101pub use AFIORST_W as TIM16RST_W;
103pub use AFIORST_W as TIM17RST_W;
105impl R {
106 #[inline(always)]
108 pub fn afiorst(&self) -> AFIORST_R {
109 AFIORST_R::new((self.bits & 1) != 0)
110 }
111 #[inline(always)]
113 pub fn ioparst(&self) -> IOPARST_R {
114 IOPARST_R::new(((self.bits >> 2) & 1) != 0)
115 }
116 #[inline(always)]
118 pub fn iopbrst(&self) -> IOPBRST_R {
119 IOPBRST_R::new(((self.bits >> 3) & 1) != 0)
120 }
121 #[inline(always)]
123 pub fn iopcrst(&self) -> IOPCRST_R {
124 IOPCRST_R::new(((self.bits >> 4) & 1) != 0)
125 }
126 #[inline(always)]
128 pub fn iopdrst(&self) -> IOPDRST_R {
129 IOPDRST_R::new(((self.bits >> 5) & 1) != 0)
130 }
131 #[inline(always)]
133 pub fn ioperst(&self) -> IOPERST_R {
134 IOPERST_R::new(((self.bits >> 6) & 1) != 0)
135 }
136 #[inline(always)]
138 pub fn iopfrst(&self) -> IOPFRST_R {
139 IOPFRST_R::new(((self.bits >> 7) & 1) != 0)
140 }
141 #[inline(always)]
143 pub fn iopgrst(&self) -> IOPGRST_R {
144 IOPGRST_R::new(((self.bits >> 8) & 1) != 0)
145 }
146 #[inline(always)]
148 pub fn adc1rst(&self) -> ADC1RST_R {
149 ADC1RST_R::new(((self.bits >> 9) & 1) != 0)
150 }
151 #[inline(always)]
153 pub fn tim1rst(&self) -> TIM1RST_R {
154 TIM1RST_R::new(((self.bits >> 11) & 1) != 0)
155 }
156 #[inline(always)]
158 pub fn spi1rst(&self) -> SPI1RST_R {
159 SPI1RST_R::new(((self.bits >> 12) & 1) != 0)
160 }
161 #[inline(always)]
163 pub fn usart1rst(&self) -> USART1RST_R {
164 USART1RST_R::new(((self.bits >> 14) & 1) != 0)
165 }
166 #[inline(always)]
168 pub fn tim15rst(&self) -> TIM15RST_R {
169 TIM15RST_R::new(((self.bits >> 16) & 1) != 0)
170 }
171 #[inline(always)]
173 pub fn tim16rst(&self) -> TIM16RST_R {
174 TIM16RST_R::new(((self.bits >> 17) & 1) != 0)
175 }
176 #[inline(always)]
178 pub fn tim17rst(&self) -> TIM17RST_R {
179 TIM17RST_R::new(((self.bits >> 18) & 1) != 0)
180 }
181}
182impl core::fmt::Debug for R {
183 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
184 f.debug_struct("APB2RSTR")
185 .field("afiorst", &self.afiorst())
186 .field("ioparst", &self.ioparst())
187 .field("iopbrst", &self.iopbrst())
188 .field("iopcrst", &self.iopcrst())
189 .field("iopdrst", &self.iopdrst())
190 .field("ioperst", &self.ioperst())
191 .field("iopfrst", &self.iopfrst())
192 .field("iopgrst", &self.iopgrst())
193 .field("adc1rst", &self.adc1rst())
194 .field("tim1rst", &self.tim1rst())
195 .field("spi1rst", &self.spi1rst())
196 .field("usart1rst", &self.usart1rst())
197 .field("tim15rst", &self.tim15rst())
198 .field("tim16rst", &self.tim16rst())
199 .field("tim17rst", &self.tim17rst())
200 .finish()
201 }
202}
203impl W {
204 #[inline(always)]
206 pub fn afiorst(&mut self) -> AFIORST_W<APB2RSTRrs> {
207 AFIORST_W::new(self, 0)
208 }
209 #[inline(always)]
211 pub fn ioparst(&mut self) -> IOPARST_W<APB2RSTRrs> {
212 IOPARST_W::new(self, 2)
213 }
214 #[inline(always)]
216 pub fn iopbrst(&mut self) -> IOPBRST_W<APB2RSTRrs> {
217 IOPBRST_W::new(self, 3)
218 }
219 #[inline(always)]
221 pub fn iopcrst(&mut self) -> IOPCRST_W<APB2RSTRrs> {
222 IOPCRST_W::new(self, 4)
223 }
224 #[inline(always)]
226 pub fn iopdrst(&mut self) -> IOPDRST_W<APB2RSTRrs> {
227 IOPDRST_W::new(self, 5)
228 }
229 #[inline(always)]
231 pub fn ioperst(&mut self) -> IOPERST_W<APB2RSTRrs> {
232 IOPERST_W::new(self, 6)
233 }
234 #[inline(always)]
236 pub fn iopfrst(&mut self) -> IOPFRST_W<APB2RSTRrs> {
237 IOPFRST_W::new(self, 7)
238 }
239 #[inline(always)]
241 pub fn iopgrst(&mut self) -> IOPGRST_W<APB2RSTRrs> {
242 IOPGRST_W::new(self, 8)
243 }
244 #[inline(always)]
246 pub fn adc1rst(&mut self) -> ADC1RST_W<APB2RSTRrs> {
247 ADC1RST_W::new(self, 9)
248 }
249 #[inline(always)]
251 pub fn tim1rst(&mut self) -> TIM1RST_W<APB2RSTRrs> {
252 TIM1RST_W::new(self, 11)
253 }
254 #[inline(always)]
256 pub fn spi1rst(&mut self) -> SPI1RST_W<APB2RSTRrs> {
257 SPI1RST_W::new(self, 12)
258 }
259 #[inline(always)]
261 pub fn usart1rst(&mut self) -> USART1RST_W<APB2RSTRrs> {
262 USART1RST_W::new(self, 14)
263 }
264 #[inline(always)]
266 pub fn tim15rst(&mut self) -> TIM15RST_W<APB2RSTRrs> {
267 TIM15RST_W::new(self, 16)
268 }
269 #[inline(always)]
271 pub fn tim16rst(&mut self) -> TIM16RST_W<APB2RSTRrs> {
272 TIM16RST_W::new(self, 17)
273 }
274 #[inline(always)]
276 pub fn tim17rst(&mut self) -> TIM17RST_W<APB2RSTRrs> {
277 TIM17RST_W::new(self, 18)
278 }
279}
280pub struct APB2RSTRrs;
286impl crate::RegisterSpec for APB2RSTRrs {
287 type Ux = u32;
288}
289impl crate::Readable for APB2RSTRrs {}
291impl crate::Writable for APB2RSTRrs {
293 type Safety = crate::Unsafe;
294}
295impl crate::Resettable for APB2RSTRrs {}