py32f0/py32f030/rcc/
apbrstr2.rs1pub struct R(crate::R<APBRSTR2_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<APBRSTR2_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<APBRSTR2_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<APBRSTR2_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<APBRSTR2_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<APBRSTR2_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<APBRSTR2_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<APBRSTR2_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type SYSCFGRST_R = crate::BitReader<SYSCFGRSTW_A>;
39#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum SYSCFGRSTW_A {
44 Reset = 1,
46}
47impl From<SYSCFGRSTW_A> for bool {
48 #[inline(always)]
49 fn from(variant: SYSCFGRSTW_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl SYSCFGRST_R {
54 #[inline(always)]
56 pub fn variant(&self) -> Option<SYSCFGRSTW_A> {
57 match self.bits {
58 true => Some(SYSCFGRSTW_A::Reset),
59 _ => None,
60 }
61 }
62 #[inline(always)]
64 pub fn is_reset(&self) -> bool {
65 *self == SYSCFGRSTW_A::Reset
66 }
67}
68pub type SYSCFGRST_W<'a, const O: u8> = crate::BitWriter<'a, u32, APBRSTR2_SPEC, SYSCFGRSTW_A, O>;
70impl<'a, const O: u8> SYSCFGRST_W<'a, O> {
71 #[inline(always)]
73 pub fn reset(self) -> &'a mut W {
74 self.variant(SYSCFGRSTW_A::Reset)
75 }
76}
77pub use SYSCFGRST_R as TIM1RST_R;
79pub use SYSCFGRST_R as SPI1RST_R;
81pub use SYSCFGRST_R as USART1RST_R;
83pub use SYSCFGRST_R as TIM14RST_R;
85pub use SYSCFGRST_R as TIM16RST_R;
87pub use SYSCFGRST_R as TIM17RST_R;
89pub use SYSCFGRST_R as ADCRST_R;
91pub use SYSCFGRST_R as COMP1RST_R;
93pub use SYSCFGRST_R as COMP2RST_R;
95pub use SYSCFGRST_R as LEDRST_R;
97pub use SYSCFGRST_W as TIM1RST_W;
99pub use SYSCFGRST_W as SPI1RST_W;
101pub use SYSCFGRST_W as USART1RST_W;
103pub use SYSCFGRST_W as TIM14RST_W;
105pub use SYSCFGRST_W as TIM16RST_W;
107pub use SYSCFGRST_W as TIM17RST_W;
109pub use SYSCFGRST_W as ADCRST_W;
111pub use SYSCFGRST_W as COMP1RST_W;
113pub use SYSCFGRST_W as COMP2RST_W;
115pub use SYSCFGRST_W as LEDRST_W;
117impl R {
118 #[inline(always)]
120 pub fn syscfgrst(&self) -> SYSCFGRST_R {
121 SYSCFGRST_R::new((self.bits & 1) != 0)
122 }
123 #[inline(always)]
125 pub fn tim1rst(&self) -> TIM1RST_R {
126 TIM1RST_R::new(((self.bits >> 11) & 1) != 0)
127 }
128 #[inline(always)]
130 pub fn spi1rst(&self) -> SPI1RST_R {
131 SPI1RST_R::new(((self.bits >> 12) & 1) != 0)
132 }
133 #[inline(always)]
135 pub fn usart1rst(&self) -> USART1RST_R {
136 USART1RST_R::new(((self.bits >> 14) & 1) != 0)
137 }
138 #[inline(always)]
140 pub fn tim14rst(&self) -> TIM14RST_R {
141 TIM14RST_R::new(((self.bits >> 15) & 1) != 0)
142 }
143 #[inline(always)]
145 pub fn tim16rst(&self) -> TIM16RST_R {
146 TIM16RST_R::new(((self.bits >> 17) & 1) != 0)
147 }
148 #[inline(always)]
150 pub fn tim17rst(&self) -> TIM17RST_R {
151 TIM17RST_R::new(((self.bits >> 18) & 1) != 0)
152 }
153 #[inline(always)]
155 pub fn adcrst(&self) -> ADCRST_R {
156 ADCRST_R::new(((self.bits >> 20) & 1) != 0)
157 }
158 #[inline(always)]
160 pub fn comp1rst(&self) -> COMP1RST_R {
161 COMP1RST_R::new(((self.bits >> 21) & 1) != 0)
162 }
163 #[inline(always)]
165 pub fn comp2rst(&self) -> COMP2RST_R {
166 COMP2RST_R::new(((self.bits >> 22) & 1) != 0)
167 }
168 #[inline(always)]
170 pub fn ledrst(&self) -> LEDRST_R {
171 LEDRST_R::new(((self.bits >> 23) & 1) != 0)
172 }
173}
174impl W {
175 #[inline(always)]
177 #[must_use]
178 pub fn syscfgrst(&mut self) -> SYSCFGRST_W<0> {
179 SYSCFGRST_W::new(self)
180 }
181 #[inline(always)]
183 #[must_use]
184 pub fn tim1rst(&mut self) -> TIM1RST_W<11> {
185 TIM1RST_W::new(self)
186 }
187 #[inline(always)]
189 #[must_use]
190 pub fn spi1rst(&mut self) -> SPI1RST_W<12> {
191 SPI1RST_W::new(self)
192 }
193 #[inline(always)]
195 #[must_use]
196 pub fn usart1rst(&mut self) -> USART1RST_W<14> {
197 USART1RST_W::new(self)
198 }
199 #[inline(always)]
201 #[must_use]
202 pub fn tim14rst(&mut self) -> TIM14RST_W<15> {
203 TIM14RST_W::new(self)
204 }
205 #[inline(always)]
207 #[must_use]
208 pub fn tim16rst(&mut self) -> TIM16RST_W<17> {
209 TIM16RST_W::new(self)
210 }
211 #[inline(always)]
213 #[must_use]
214 pub fn tim17rst(&mut self) -> TIM17RST_W<18> {
215 TIM17RST_W::new(self)
216 }
217 #[inline(always)]
219 #[must_use]
220 pub fn adcrst(&mut self) -> ADCRST_W<20> {
221 ADCRST_W::new(self)
222 }
223 #[inline(always)]
225 #[must_use]
226 pub fn comp1rst(&mut self) -> COMP1RST_W<21> {
227 COMP1RST_W::new(self)
228 }
229 #[inline(always)]
231 #[must_use]
232 pub fn comp2rst(&mut self) -> COMP2RST_W<22> {
233 COMP2RST_W::new(self)
234 }
235 #[inline(always)]
237 #[must_use]
238 pub fn ledrst(&mut self) -> LEDRST_W<23> {
239 LEDRST_W::new(self)
240 }
241 #[inline(always)]
243 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
244 self.0.bits(bits);
245 self
246 }
247}
248pub struct APBRSTR2_SPEC;
254impl crate::RegisterSpec for APBRSTR2_SPEC {
255 type Ux = u32;
256}
257impl crate::Readable for APBRSTR2_SPEC {
259 type Reader = R;
260}
261impl crate::Writable for APBRSTR2_SPEC {
263 type Writer = W;
264 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
265 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
266}
267impl crate::Resettable for APBRSTR2_SPEC {
269 const RESET_VALUE: Self::Ux = 0;
270}