py32f0/py32f003/tim1/
sr.rs1pub struct R(crate::R<SR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<SR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SR_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<SR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type UIF_R = crate::BitReader<bool>;
39pub type UIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, bool, O>;
41pub type CC1IF_R = crate::BitReader<CC1IFR_A>;
43#[derive(Clone, Copy, Debug, PartialEq, Eq)]
47pub enum CC1IFR_A {
48 Match = 1,
50}
51impl From<CC1IFR_A> for bool {
52 #[inline(always)]
53 fn from(variant: CC1IFR_A) -> Self {
54 variant as u8 != 0
55 }
56}
57impl CC1IF_R {
58 #[inline(always)]
60 pub fn variant(&self) -> Option<CC1IFR_A> {
61 match self.bits {
62 true => Some(CC1IFR_A::Match),
63 _ => None,
64 }
65 }
66 #[inline(always)]
68 pub fn is_match(&self) -> bool {
69 *self == CC1IFR_A::Match
70 }
71}
72#[derive(Clone, Copy, Debug, PartialEq, Eq)]
76pub enum CC1IFW_AW {
77 Clear = 0,
79}
80impl From<CC1IFW_AW> for bool {
81 #[inline(always)]
82 fn from(variant: CC1IFW_AW) -> Self {
83 variant as u8 != 0
84 }
85}
86pub type CC1IF_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR_SPEC, CC1IFW_AW, O>;
88impl<'a, const O: u8> CC1IF_W<'a, O> {
89 #[inline(always)]
91 pub fn clear(self) -> &'a mut W {
92 self.variant(CC1IFW_AW::Clear)
93 }
94}
95pub use CC1IF_R as CC2IF_R;
97pub use CC1IF_R as CC3IF_R;
99pub use CC1IF_R as CC4IF_R;
101pub use CC1IF_W as CC2IF_W;
103pub use CC1IF_W as CC3IF_W;
105pub use CC1IF_W as CC4IF_W;
107pub type COMIF_R = crate::BitReader<bool>;
109pub type COMIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, bool, O>;
111pub type TIF_R = crate::BitReader<TIFR_A>;
113#[derive(Clone, Copy, Debug, PartialEq, Eq)]
117pub enum TIFR_A {
118 NoTrigger = 0,
120 Trigger = 1,
122}
123impl From<TIFR_A> for bool {
124 #[inline(always)]
125 fn from(variant: TIFR_A) -> Self {
126 variant as u8 != 0
127 }
128}
129impl TIF_R {
130 #[inline(always)]
132 pub fn variant(&self) -> TIFR_A {
133 match self.bits {
134 false => TIFR_A::NoTrigger,
135 true => TIFR_A::Trigger,
136 }
137 }
138 #[inline(always)]
140 pub fn is_no_trigger(&self) -> bool {
141 *self == TIFR_A::NoTrigger
142 }
143 #[inline(always)]
145 pub fn is_trigger(&self) -> bool {
146 *self == TIFR_A::Trigger
147 }
148}
149#[derive(Clone, Copy, Debug, PartialEq, Eq)]
153pub enum TIFW_AW {
154 Clear = 0,
156}
157impl From<TIFW_AW> for bool {
158 #[inline(always)]
159 fn from(variant: TIFW_AW) -> Self {
160 variant as u8 != 0
161 }
162}
163pub type TIF_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR_SPEC, TIFW_AW, O>;
165impl<'a, const O: u8> TIF_W<'a, O> {
166 #[inline(always)]
168 pub fn clear(self) -> &'a mut W {
169 self.variant(TIFW_AW::Clear)
170 }
171}
172pub type BIF_R = crate::BitReader<bool>;
174pub type BIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, bool, O>;
176pub type CC1OF_R = crate::BitReader<CC1OFR_A>;
178#[derive(Clone, Copy, Debug, PartialEq, Eq)]
182pub enum CC1OFR_A {
183 Overcapture = 1,
185}
186impl From<CC1OFR_A> for bool {
187 #[inline(always)]
188 fn from(variant: CC1OFR_A) -> Self {
189 variant as u8 != 0
190 }
191}
192impl CC1OF_R {
193 #[inline(always)]
195 pub fn variant(&self) -> Option<CC1OFR_A> {
196 match self.bits {
197 true => Some(CC1OFR_A::Overcapture),
198 _ => None,
199 }
200 }
201 #[inline(always)]
203 pub fn is_overcapture(&self) -> bool {
204 *self == CC1OFR_A::Overcapture
205 }
206}
207#[derive(Clone, Copy, Debug, PartialEq, Eq)]
211pub enum CC1OFW_AW {
212 Clear = 0,
214}
215impl From<CC1OFW_AW> for bool {
216 #[inline(always)]
217 fn from(variant: CC1OFW_AW) -> Self {
218 variant as u8 != 0
219 }
220}
221pub type CC1OF_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR_SPEC, CC1OFW_AW, O>;
223impl<'a, const O: u8> CC1OF_W<'a, O> {
224 #[inline(always)]
226 pub fn clear(self) -> &'a mut W {
227 self.variant(CC1OFW_AW::Clear)
228 }
229}
230pub use CC1OF_R as CC2OF_R;
232pub use CC1OF_R as CC3OF_R;
234pub use CC1OF_R as CC4OF_R;
236pub use CC1OF_W as CC2OF_W;
238pub use CC1OF_W as CC3OF_W;
240pub use CC1OF_W as CC4OF_W;
242impl R {
243 #[inline(always)]
245 pub fn uif(&self) -> UIF_R {
246 UIF_R::new((self.bits & 1) != 0)
247 }
248 #[inline(always)]
250 pub fn cc1if(&self) -> CC1IF_R {
251 CC1IF_R::new(((self.bits >> 1) & 1) != 0)
252 }
253 #[inline(always)]
255 pub fn cc2if(&self) -> CC2IF_R {
256 CC2IF_R::new(((self.bits >> 2) & 1) != 0)
257 }
258 #[inline(always)]
260 pub fn cc3if(&self) -> CC3IF_R {
261 CC3IF_R::new(((self.bits >> 3) & 1) != 0)
262 }
263 #[inline(always)]
265 pub fn cc4if(&self) -> CC4IF_R {
266 CC4IF_R::new(((self.bits >> 4) & 1) != 0)
267 }
268 #[inline(always)]
270 pub fn comif(&self) -> COMIF_R {
271 COMIF_R::new(((self.bits >> 5) & 1) != 0)
272 }
273 #[inline(always)]
275 pub fn tif(&self) -> TIF_R {
276 TIF_R::new(((self.bits >> 6) & 1) != 0)
277 }
278 #[inline(always)]
280 pub fn bif(&self) -> BIF_R {
281 BIF_R::new(((self.bits >> 7) & 1) != 0)
282 }
283 #[inline(always)]
285 pub fn cc1of(&self) -> CC1OF_R {
286 CC1OF_R::new(((self.bits >> 9) & 1) != 0)
287 }
288 #[inline(always)]
290 pub fn cc2of(&self) -> CC2OF_R {
291 CC2OF_R::new(((self.bits >> 10) & 1) != 0)
292 }
293 #[inline(always)]
295 pub fn cc3of(&self) -> CC3OF_R {
296 CC3OF_R::new(((self.bits >> 11) & 1) != 0)
297 }
298 #[inline(always)]
300 pub fn cc4of(&self) -> CC4OF_R {
301 CC4OF_R::new(((self.bits >> 12) & 1) != 0)
302 }
303}
304impl W {
305 #[inline(always)]
307 #[must_use]
308 pub fn uif(&mut self) -> UIF_W<0> {
309 UIF_W::new(self)
310 }
311 #[inline(always)]
313 #[must_use]
314 pub fn cc1if(&mut self) -> CC1IF_W<1> {
315 CC1IF_W::new(self)
316 }
317 #[inline(always)]
319 #[must_use]
320 pub fn cc2if(&mut self) -> CC2IF_W<2> {
321 CC2IF_W::new(self)
322 }
323 #[inline(always)]
325 #[must_use]
326 pub fn cc3if(&mut self) -> CC3IF_W<3> {
327 CC3IF_W::new(self)
328 }
329 #[inline(always)]
331 #[must_use]
332 pub fn cc4if(&mut self) -> CC4IF_W<4> {
333 CC4IF_W::new(self)
334 }
335 #[inline(always)]
337 #[must_use]
338 pub fn comif(&mut self) -> COMIF_W<5> {
339 COMIF_W::new(self)
340 }
341 #[inline(always)]
343 #[must_use]
344 pub fn tif(&mut self) -> TIF_W<6> {
345 TIF_W::new(self)
346 }
347 #[inline(always)]
349 #[must_use]
350 pub fn bif(&mut self) -> BIF_W<7> {
351 BIF_W::new(self)
352 }
353 #[inline(always)]
355 #[must_use]
356 pub fn cc1of(&mut self) -> CC1OF_W<9> {
357 CC1OF_W::new(self)
358 }
359 #[inline(always)]
361 #[must_use]
362 pub fn cc2of(&mut self) -> CC2OF_W<10> {
363 CC2OF_W::new(self)
364 }
365 #[inline(always)]
367 #[must_use]
368 pub fn cc3of(&mut self) -> CC3OF_W<11> {
369 CC3OF_W::new(self)
370 }
371 #[inline(always)]
373 #[must_use]
374 pub fn cc4of(&mut self) -> CC4OF_W<12> {
375 CC4OF_W::new(self)
376 }
377 #[inline(always)]
379 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
380 self.0.bits(bits);
381 self
382 }
383}
384pub struct SR_SPEC;
390impl crate::RegisterSpec for SR_SPEC {
391 type Ux = u32;
392}
393impl crate::Readable for SR_SPEC {
395 type Reader = R;
396}
397impl crate::Writable for SR_SPEC {
399 type Writer = W;
400 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0x1e5e;
401 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
402}
403impl crate::Resettable for SR_SPEC {
405 const RESET_VALUE: Self::Ux = 0;
406}