stm32f1_staging/stm32f101/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 SPI1RST_R;
67pub use AFIORST_R as USART1RST_R;
69pub use AFIORST_R as TIM9RST_R;
71pub use AFIORST_R as TIM10RST_R;
73pub use AFIORST_R as TIM11RST_R;
75pub use AFIORST_W as IOPARST_W;
77pub use AFIORST_W as IOPBRST_W;
79pub use AFIORST_W as IOPCRST_W;
81pub use AFIORST_W as IOPDRST_W;
83pub use AFIORST_W as IOPERST_W;
85pub use AFIORST_W as IOPFRST_W;
87pub use AFIORST_W as IOPGRST_W;
89pub use AFIORST_W as ADC1RST_W;
91pub use AFIORST_W as SPI1RST_W;
93pub use AFIORST_W as USART1RST_W;
95pub use AFIORST_W as TIM9RST_W;
97pub use AFIORST_W as TIM10RST_W;
99pub use AFIORST_W as TIM11RST_W;
101impl R {
102 #[inline(always)]
104 pub fn afiorst(&self) -> AFIORST_R {
105 AFIORST_R::new((self.bits & 1) != 0)
106 }
107 #[inline(always)]
109 pub fn ioparst(&self) -> IOPARST_R {
110 IOPARST_R::new(((self.bits >> 2) & 1) != 0)
111 }
112 #[inline(always)]
114 pub fn iopbrst(&self) -> IOPBRST_R {
115 IOPBRST_R::new(((self.bits >> 3) & 1) != 0)
116 }
117 #[inline(always)]
119 pub fn iopcrst(&self) -> IOPCRST_R {
120 IOPCRST_R::new(((self.bits >> 4) & 1) != 0)
121 }
122 #[inline(always)]
124 pub fn iopdrst(&self) -> IOPDRST_R {
125 IOPDRST_R::new(((self.bits >> 5) & 1) != 0)
126 }
127 #[inline(always)]
129 pub fn ioperst(&self) -> IOPERST_R {
130 IOPERST_R::new(((self.bits >> 6) & 1) != 0)
131 }
132 #[inline(always)]
134 pub fn iopfrst(&self) -> IOPFRST_R {
135 IOPFRST_R::new(((self.bits >> 7) & 1) != 0)
136 }
137 #[inline(always)]
139 pub fn iopgrst(&self) -> IOPGRST_R {
140 IOPGRST_R::new(((self.bits >> 8) & 1) != 0)
141 }
142 #[inline(always)]
144 pub fn adc1rst(&self) -> ADC1RST_R {
145 ADC1RST_R::new(((self.bits >> 9) & 1) != 0)
146 }
147 #[inline(always)]
149 pub fn spi1rst(&self) -> SPI1RST_R {
150 SPI1RST_R::new(((self.bits >> 12) & 1) != 0)
151 }
152 #[inline(always)]
154 pub fn usart1rst(&self) -> USART1RST_R {
155 USART1RST_R::new(((self.bits >> 14) & 1) != 0)
156 }
157 #[inline(always)]
159 pub fn tim9rst(&self) -> TIM9RST_R {
160 TIM9RST_R::new(((self.bits >> 19) & 1) != 0)
161 }
162 #[inline(always)]
164 pub fn tim10rst(&self) -> TIM10RST_R {
165 TIM10RST_R::new(((self.bits >> 20) & 1) != 0)
166 }
167 #[inline(always)]
169 pub fn tim11rst(&self) -> TIM11RST_R {
170 TIM11RST_R::new(((self.bits >> 21) & 1) != 0)
171 }
172}
173impl core::fmt::Debug for R {
174 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
175 f.debug_struct("APB2RSTR")
176 .field("afiorst", &self.afiorst())
177 .field("ioparst", &self.ioparst())
178 .field("iopbrst", &self.iopbrst())
179 .field("iopcrst", &self.iopcrst())
180 .field("iopdrst", &self.iopdrst())
181 .field("ioperst", &self.ioperst())
182 .field("adc1rst", &self.adc1rst())
183 .field("spi1rst", &self.spi1rst())
184 .field("usart1rst", &self.usart1rst())
185 .field("tim9rst", &self.tim9rst())
186 .field("tim10rst", &self.tim10rst())
187 .field("tim11rst", &self.tim11rst())
188 .field("iopfrst", &self.iopfrst())
189 .field("iopgrst", &self.iopgrst())
190 .finish()
191 }
192}
193impl W {
194 #[inline(always)]
196 pub fn afiorst(&mut self) -> AFIORST_W<APB2RSTRrs> {
197 AFIORST_W::new(self, 0)
198 }
199 #[inline(always)]
201 pub fn ioparst(&mut self) -> IOPARST_W<APB2RSTRrs> {
202 IOPARST_W::new(self, 2)
203 }
204 #[inline(always)]
206 pub fn iopbrst(&mut self) -> IOPBRST_W<APB2RSTRrs> {
207 IOPBRST_W::new(self, 3)
208 }
209 #[inline(always)]
211 pub fn iopcrst(&mut self) -> IOPCRST_W<APB2RSTRrs> {
212 IOPCRST_W::new(self, 4)
213 }
214 #[inline(always)]
216 pub fn iopdrst(&mut self) -> IOPDRST_W<APB2RSTRrs> {
217 IOPDRST_W::new(self, 5)
218 }
219 #[inline(always)]
221 pub fn ioperst(&mut self) -> IOPERST_W<APB2RSTRrs> {
222 IOPERST_W::new(self, 6)
223 }
224 #[inline(always)]
226 pub fn iopfrst(&mut self) -> IOPFRST_W<APB2RSTRrs> {
227 IOPFRST_W::new(self, 7)
228 }
229 #[inline(always)]
231 pub fn iopgrst(&mut self) -> IOPGRST_W<APB2RSTRrs> {
232 IOPGRST_W::new(self, 8)
233 }
234 #[inline(always)]
236 pub fn adc1rst(&mut self) -> ADC1RST_W<APB2RSTRrs> {
237 ADC1RST_W::new(self, 9)
238 }
239 #[inline(always)]
241 pub fn spi1rst(&mut self) -> SPI1RST_W<APB2RSTRrs> {
242 SPI1RST_W::new(self, 12)
243 }
244 #[inline(always)]
246 pub fn usart1rst(&mut self) -> USART1RST_W<APB2RSTRrs> {
247 USART1RST_W::new(self, 14)
248 }
249 #[inline(always)]
251 pub fn tim9rst(&mut self) -> TIM9RST_W<APB2RSTRrs> {
252 TIM9RST_W::new(self, 19)
253 }
254 #[inline(always)]
256 pub fn tim10rst(&mut self) -> TIM10RST_W<APB2RSTRrs> {
257 TIM10RST_W::new(self, 20)
258 }
259 #[inline(always)]
261 pub fn tim11rst(&mut self) -> TIM11RST_W<APB2RSTRrs> {
262 TIM11RST_W::new(self, 21)
263 }
264}
265pub struct APB2RSTRrs;
271impl crate::RegisterSpec for APB2RSTRrs {
272 type Ux = u32;
273}
274impl crate::Readable for APB2RSTRrs {}
276impl crate::Writable for APB2RSTRrs {
278 type Safety = crate::Unsafe;
279}
280impl crate::Resettable for APB2RSTRrs {}