py32f0/py32f003/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_W as TIM1RST_W;
97pub use SYSCFGRST_W as SPI1RST_W;
99pub use SYSCFGRST_W as USART1RST_W;
101pub use SYSCFGRST_W as TIM14RST_W;
103pub use SYSCFGRST_W as TIM16RST_W;
105pub use SYSCFGRST_W as TIM17RST_W;
107pub use SYSCFGRST_W as ADCRST_W;
109pub use SYSCFGRST_W as COMP1RST_W;
111pub use SYSCFGRST_W as COMP2RST_W;
113impl R {
114 #[inline(always)]
116 pub fn syscfgrst(&self) -> SYSCFGRST_R {
117 SYSCFGRST_R::new((self.bits & 1) != 0)
118 }
119 #[inline(always)]
121 pub fn tim1rst(&self) -> TIM1RST_R {
122 TIM1RST_R::new(((self.bits >> 11) & 1) != 0)
123 }
124 #[inline(always)]
126 pub fn spi1rst(&self) -> SPI1RST_R {
127 SPI1RST_R::new(((self.bits >> 12) & 1) != 0)
128 }
129 #[inline(always)]
131 pub fn usart1rst(&self) -> USART1RST_R {
132 USART1RST_R::new(((self.bits >> 14) & 1) != 0)
133 }
134 #[inline(always)]
136 pub fn tim14rst(&self) -> TIM14RST_R {
137 TIM14RST_R::new(((self.bits >> 15) & 1) != 0)
138 }
139 #[inline(always)]
141 pub fn tim16rst(&self) -> TIM16RST_R {
142 TIM16RST_R::new(((self.bits >> 17) & 1) != 0)
143 }
144 #[inline(always)]
146 pub fn tim17rst(&self) -> TIM17RST_R {
147 TIM17RST_R::new(((self.bits >> 18) & 1) != 0)
148 }
149 #[inline(always)]
151 pub fn adcrst(&self) -> ADCRST_R {
152 ADCRST_R::new(((self.bits >> 20) & 1) != 0)
153 }
154 #[inline(always)]
156 pub fn comp1rst(&self) -> COMP1RST_R {
157 COMP1RST_R::new(((self.bits >> 21) & 1) != 0)
158 }
159 #[inline(always)]
161 pub fn comp2rst(&self) -> COMP2RST_R {
162 COMP2RST_R::new(((self.bits >> 22) & 1) != 0)
163 }
164}
165impl W {
166 #[inline(always)]
168 #[must_use]
169 pub fn syscfgrst(&mut self) -> SYSCFGRST_W<0> {
170 SYSCFGRST_W::new(self)
171 }
172 #[inline(always)]
174 #[must_use]
175 pub fn tim1rst(&mut self) -> TIM1RST_W<11> {
176 TIM1RST_W::new(self)
177 }
178 #[inline(always)]
180 #[must_use]
181 pub fn spi1rst(&mut self) -> SPI1RST_W<12> {
182 SPI1RST_W::new(self)
183 }
184 #[inline(always)]
186 #[must_use]
187 pub fn usart1rst(&mut self) -> USART1RST_W<14> {
188 USART1RST_W::new(self)
189 }
190 #[inline(always)]
192 #[must_use]
193 pub fn tim14rst(&mut self) -> TIM14RST_W<15> {
194 TIM14RST_W::new(self)
195 }
196 #[inline(always)]
198 #[must_use]
199 pub fn tim16rst(&mut self) -> TIM16RST_W<17> {
200 TIM16RST_W::new(self)
201 }
202 #[inline(always)]
204 #[must_use]
205 pub fn tim17rst(&mut self) -> TIM17RST_W<18> {
206 TIM17RST_W::new(self)
207 }
208 #[inline(always)]
210 #[must_use]
211 pub fn adcrst(&mut self) -> ADCRST_W<20> {
212 ADCRST_W::new(self)
213 }
214 #[inline(always)]
216 #[must_use]
217 pub fn comp1rst(&mut self) -> COMP1RST_W<21> {
218 COMP1RST_W::new(self)
219 }
220 #[inline(always)]
222 #[must_use]
223 pub fn comp2rst(&mut self) -> COMP2RST_W<22> {
224 COMP2RST_W::new(self)
225 }
226 #[inline(always)]
228 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
229 self.0.bits(bits);
230 self
231 }
232}
233pub struct APBRSTR2_SPEC;
239impl crate::RegisterSpec for APBRSTR2_SPEC {
240 type Ux = u32;
241}
242impl crate::Readable for APBRSTR2_SPEC {
244 type Reader = R;
245}
246impl crate::Writable for APBRSTR2_SPEC {
248 type Writer = W;
249 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
250 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
251}
252impl crate::Resettable for APBRSTR2_SPEC {
254 const RESET_VALUE: Self::Ux = 0;
255}