stm32f1_staging/stm32f107/tim1/
sr.rs1pub type R = crate::R<SRrs>;
3pub type W = crate::W<SRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum UIFR {
11 NoUpdateOccurred = 0,
13 UpdatePending = 1,
15}
16impl From<UIFR> for bool {
17 #[inline(always)]
18 fn from(variant: UIFR) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type UIF_R = crate::BitReader<UIFR>;
24impl UIF_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> UIFR {
28 match self.bits {
29 false => UIFR::NoUpdateOccurred,
30 true => UIFR::UpdatePending,
31 }
32 }
33 #[inline(always)]
35 pub fn is_no_update_occurred(&self) -> bool {
36 *self == UIFR::NoUpdateOccurred
37 }
38 #[inline(always)]
40 pub fn is_update_pending(&self) -> bool {
41 *self == UIFR::UpdatePending
42 }
43}
44#[cfg_attr(feature = "defmt", derive(defmt::Format))]
48#[derive(Clone, Copy, Debug, PartialEq, Eq)]
49pub enum UIFW {
50 Clear = 0,
52}
53impl From<UIFW> for bool {
54 #[inline(always)]
55 fn from(variant: UIFW) -> Self {
56 variant as u8 != 0
57 }
58}
59pub type UIF_W<'a, REG> = crate::BitWriter0C<'a, REG, UIFW>;
61impl<'a, REG> UIF_W<'a, REG>
62where
63 REG: crate::Writable + crate::RegisterSpec,
64{
65 #[inline(always)]
67 pub fn clear(self) -> &'a mut crate::W<REG> {
68 self.variant(UIFW::Clear)
69 }
70}
71#[cfg_attr(feature = "defmt", derive(defmt::Format))]
75#[derive(Clone, Copy, Debug, PartialEq, Eq)]
76pub enum CC1IFR {
77 NoMatch = 0,
79 Match = 1,
81}
82impl From<CC1IFR> for bool {
83 #[inline(always)]
84 fn from(variant: CC1IFR) -> Self {
85 variant as u8 != 0
86 }
87}
88pub type CCIF_R = crate::BitReader<CC1IFR>;
90impl CCIF_R {
91 #[inline(always)]
93 pub const fn variant(&self) -> CC1IFR {
94 match self.bits {
95 false => CC1IFR::NoMatch,
96 true => CC1IFR::Match,
97 }
98 }
99 #[inline(always)]
101 pub fn is_no_match(&self) -> bool {
102 *self == CC1IFR::NoMatch
103 }
104 #[inline(always)]
106 pub fn is_match(&self) -> bool {
107 *self == CC1IFR::Match
108 }
109}
110#[cfg_attr(feature = "defmt", derive(defmt::Format))]
114#[derive(Clone, Copy, Debug, PartialEq, Eq)]
115pub enum CC1IFW {
116 Clear = 0,
118}
119impl From<CC1IFW> for bool {
120 #[inline(always)]
121 fn from(variant: CC1IFW) -> Self {
122 variant as u8 != 0
123 }
124}
125pub type CCIF_W<'a, REG> = crate::BitWriter0C<'a, REG, CC1IFW>;
127impl<'a, REG> CCIF_W<'a, REG>
128where
129 REG: crate::Writable + crate::RegisterSpec,
130{
131 #[inline(always)]
133 pub fn clear(self) -> &'a mut crate::W<REG> {
134 self.variant(CC1IFW::Clear)
135 }
136}
137#[cfg_attr(feature = "defmt", derive(defmt::Format))]
141#[derive(Clone, Copy, Debug, PartialEq, Eq)]
142pub enum COMIFR {
143 NoCom = 0,
145 Com = 1,
147}
148impl From<COMIFR> for bool {
149 #[inline(always)]
150 fn from(variant: COMIFR) -> Self {
151 variant as u8 != 0
152 }
153}
154pub type COMIF_R = crate::BitReader<COMIFR>;
156impl COMIF_R {
157 #[inline(always)]
159 pub const fn variant(&self) -> COMIFR {
160 match self.bits {
161 false => COMIFR::NoCom,
162 true => COMIFR::Com,
163 }
164 }
165 #[inline(always)]
167 pub fn is_no_com(&self) -> bool {
168 *self == COMIFR::NoCom
169 }
170 #[inline(always)]
172 pub fn is_com(&self) -> bool {
173 *self == COMIFR::Com
174 }
175}
176#[cfg_attr(feature = "defmt", derive(defmt::Format))]
180#[derive(Clone, Copy, Debug, PartialEq, Eq)]
181pub enum COMIFW {
182 Clear = 0,
184}
185impl From<COMIFW> for bool {
186 #[inline(always)]
187 fn from(variant: COMIFW) -> Self {
188 variant as u8 != 0
189 }
190}
191pub type COMIF_W<'a, REG> = crate::BitWriter0C<'a, REG, COMIFW>;
193impl<'a, REG> COMIF_W<'a, REG>
194where
195 REG: crate::Writable + crate::RegisterSpec,
196{
197 #[inline(always)]
199 pub fn clear(self) -> &'a mut crate::W<REG> {
200 self.variant(COMIFW::Clear)
201 }
202}
203#[cfg_attr(feature = "defmt", derive(defmt::Format))]
207#[derive(Clone, Copy, Debug, PartialEq, Eq)]
208pub enum TIFR {
209 NoTrigger = 0,
211 Trigger = 1,
213}
214impl From<TIFR> for bool {
215 #[inline(always)]
216 fn from(variant: TIFR) -> Self {
217 variant as u8 != 0
218 }
219}
220pub type TIF_R = crate::BitReader<TIFR>;
222impl TIF_R {
223 #[inline(always)]
225 pub const fn variant(&self) -> TIFR {
226 match self.bits {
227 false => TIFR::NoTrigger,
228 true => TIFR::Trigger,
229 }
230 }
231 #[inline(always)]
233 pub fn is_no_trigger(&self) -> bool {
234 *self == TIFR::NoTrigger
235 }
236 #[inline(always)]
238 pub fn is_trigger(&self) -> bool {
239 *self == TIFR::Trigger
240 }
241}
242#[cfg_attr(feature = "defmt", derive(defmt::Format))]
246#[derive(Clone, Copy, Debug, PartialEq, Eq)]
247pub enum TIFW {
248 Clear = 0,
250}
251impl From<TIFW> for bool {
252 #[inline(always)]
253 fn from(variant: TIFW) -> Self {
254 variant as u8 != 0
255 }
256}
257pub type TIF_W<'a, REG> = crate::BitWriter0C<'a, REG, TIFW>;
259impl<'a, REG> TIF_W<'a, REG>
260where
261 REG: crate::Writable + crate::RegisterSpec,
262{
263 #[inline(always)]
265 pub fn clear(self) -> &'a mut crate::W<REG> {
266 self.variant(TIFW::Clear)
267 }
268}
269#[cfg_attr(feature = "defmt", derive(defmt::Format))]
273#[derive(Clone, Copy, Debug, PartialEq, Eq)]
274pub enum BIFR {
275 NoTrigger = 0,
277 Trigger = 1,
279}
280impl From<BIFR> for bool {
281 #[inline(always)]
282 fn from(variant: BIFR) -> Self {
283 variant as u8 != 0
284 }
285}
286pub type BIF_R = crate::BitReader<BIFR>;
288impl BIF_R {
289 #[inline(always)]
291 pub const fn variant(&self) -> BIFR {
292 match self.bits {
293 false => BIFR::NoTrigger,
294 true => BIFR::Trigger,
295 }
296 }
297 #[inline(always)]
299 pub fn is_no_trigger(&self) -> bool {
300 *self == BIFR::NoTrigger
301 }
302 #[inline(always)]
304 pub fn is_trigger(&self) -> bool {
305 *self == BIFR::Trigger
306 }
307}
308#[cfg_attr(feature = "defmt", derive(defmt::Format))]
312#[derive(Clone, Copy, Debug, PartialEq, Eq)]
313pub enum BIFW {
314 Clear = 0,
316}
317impl From<BIFW> for bool {
318 #[inline(always)]
319 fn from(variant: BIFW) -> Self {
320 variant as u8 != 0
321 }
322}
323pub type BIF_W<'a, REG> = crate::BitWriter0C<'a, REG, BIFW>;
325impl<'a, REG> BIF_W<'a, REG>
326where
327 REG: crate::Writable + crate::RegisterSpec,
328{
329 #[inline(always)]
331 pub fn clear(self) -> &'a mut crate::W<REG> {
332 self.variant(BIFW::Clear)
333 }
334}
335#[cfg_attr(feature = "defmt", derive(defmt::Format))]
339#[derive(Clone, Copy, Debug, PartialEq, Eq)]
340pub enum CC1OFR {
341 NoOvercapture = 0,
343 Overcapture = 1,
345}
346impl From<CC1OFR> for bool {
347 #[inline(always)]
348 fn from(variant: CC1OFR) -> Self {
349 variant as u8 != 0
350 }
351}
352pub type CCOF_R = crate::BitReader<CC1OFR>;
354impl CCOF_R {
355 #[inline(always)]
357 pub const fn variant(&self) -> CC1OFR {
358 match self.bits {
359 false => CC1OFR::NoOvercapture,
360 true => CC1OFR::Overcapture,
361 }
362 }
363 #[inline(always)]
365 pub fn is_no_overcapture(&self) -> bool {
366 *self == CC1OFR::NoOvercapture
367 }
368 #[inline(always)]
370 pub fn is_overcapture(&self) -> bool {
371 *self == CC1OFR::Overcapture
372 }
373}
374#[cfg_attr(feature = "defmt", derive(defmt::Format))]
378#[derive(Clone, Copy, Debug, PartialEq, Eq)]
379pub enum CC1OFW {
380 Clear = 0,
382}
383impl From<CC1OFW> for bool {
384 #[inline(always)]
385 fn from(variant: CC1OFW) -> Self {
386 variant as u8 != 0
387 }
388}
389pub type CCOF_W<'a, REG> = crate::BitWriter0C<'a, REG, CC1OFW>;
391impl<'a, REG> CCOF_W<'a, REG>
392where
393 REG: crate::Writable + crate::RegisterSpec,
394{
395 #[inline(always)]
397 pub fn clear(self) -> &'a mut crate::W<REG> {
398 self.variant(CC1OFW::Clear)
399 }
400}
401impl R {
402 #[inline(always)]
404 pub fn uif(&self) -> UIF_R {
405 UIF_R::new((self.bits & 1) != 0)
406 }
407 #[inline(always)]
411 pub fn ccif(&self, n: u8) -> CCIF_R {
412 #[allow(clippy::no_effect)] [(); 4][n as usize];
413 CCIF_R::new(((self.bits >> (n + 1)) & 1) != 0)
414 }
415 #[inline(always)]
418 pub fn ccif_iter(&self) -> impl Iterator<Item = CCIF_R> + '_ {
419 (0..4).map(move |n| CCIF_R::new(((self.bits >> (n + 1)) & 1) != 0))
420 }
421 #[inline(always)]
423 pub fn cc1if(&self) -> CCIF_R {
424 CCIF_R::new(((self.bits >> 1) & 1) != 0)
425 }
426 #[inline(always)]
428 pub fn cc2if(&self) -> CCIF_R {
429 CCIF_R::new(((self.bits >> 2) & 1) != 0)
430 }
431 #[inline(always)]
433 pub fn cc3if(&self) -> CCIF_R {
434 CCIF_R::new(((self.bits >> 3) & 1) != 0)
435 }
436 #[inline(always)]
438 pub fn cc4if(&self) -> CCIF_R {
439 CCIF_R::new(((self.bits >> 4) & 1) != 0)
440 }
441 #[inline(always)]
443 pub fn comif(&self) -> COMIF_R {
444 COMIF_R::new(((self.bits >> 5) & 1) != 0)
445 }
446 #[inline(always)]
448 pub fn tif(&self) -> TIF_R {
449 TIF_R::new(((self.bits >> 6) & 1) != 0)
450 }
451 #[inline(always)]
453 pub fn bif(&self) -> BIF_R {
454 BIF_R::new(((self.bits >> 7) & 1) != 0)
455 }
456 #[inline(always)]
460 pub fn ccof(&self, n: u8) -> CCOF_R {
461 #[allow(clippy::no_effect)] [(); 4][n as usize];
462 CCOF_R::new(((self.bits >> (n + 9)) & 1) != 0)
463 }
464 #[inline(always)]
467 pub fn ccof_iter(&self) -> impl Iterator<Item = CCOF_R> + '_ {
468 (0..4).map(move |n| CCOF_R::new(((self.bits >> (n + 9)) & 1) != 0))
469 }
470 #[inline(always)]
472 pub fn cc1of(&self) -> CCOF_R {
473 CCOF_R::new(((self.bits >> 9) & 1) != 0)
474 }
475 #[inline(always)]
477 pub fn cc2of(&self) -> CCOF_R {
478 CCOF_R::new(((self.bits >> 10) & 1) != 0)
479 }
480 #[inline(always)]
482 pub fn cc3of(&self) -> CCOF_R {
483 CCOF_R::new(((self.bits >> 11) & 1) != 0)
484 }
485 #[inline(always)]
487 pub fn cc4of(&self) -> CCOF_R {
488 CCOF_R::new(((self.bits >> 12) & 1) != 0)
489 }
490}
491impl core::fmt::Debug for R {
492 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
493 f.debug_struct("SR")
494 .field("cc1of", &self.cc1of())
495 .field("cc2of", &self.cc2of())
496 .field("cc3of", &self.cc3of())
497 .field("cc4of", &self.cc4of())
498 .field("bif", &self.bif())
499 .field("tif", &self.tif())
500 .field("comif", &self.comif())
501 .field("cc1if", &self.cc1if())
502 .field("cc2if", &self.cc2if())
503 .field("cc3if", &self.cc3if())
504 .field("cc4if", &self.cc4if())
505 .field("uif", &self.uif())
506 .finish()
507 }
508}
509impl W {
510 #[inline(always)]
512 pub fn uif(&mut self) -> UIF_W<SRrs> {
513 UIF_W::new(self, 0)
514 }
515 #[inline(always)]
519 pub fn ccif(&mut self, n: u8) -> CCIF_W<SRrs> {
520 #[allow(clippy::no_effect)] [(); 4][n as usize];
521 CCIF_W::new(self, n + 1)
522 }
523 #[inline(always)]
525 pub fn cc1if(&mut self) -> CCIF_W<SRrs> {
526 CCIF_W::new(self, 1)
527 }
528 #[inline(always)]
530 pub fn cc2if(&mut self) -> CCIF_W<SRrs> {
531 CCIF_W::new(self, 2)
532 }
533 #[inline(always)]
535 pub fn cc3if(&mut self) -> CCIF_W<SRrs> {
536 CCIF_W::new(self, 3)
537 }
538 #[inline(always)]
540 pub fn cc4if(&mut self) -> CCIF_W<SRrs> {
541 CCIF_W::new(self, 4)
542 }
543 #[inline(always)]
545 pub fn comif(&mut self) -> COMIF_W<SRrs> {
546 COMIF_W::new(self, 5)
547 }
548 #[inline(always)]
550 pub fn tif(&mut self) -> TIF_W<SRrs> {
551 TIF_W::new(self, 6)
552 }
553 #[inline(always)]
555 pub fn bif(&mut self) -> BIF_W<SRrs> {
556 BIF_W::new(self, 7)
557 }
558 #[inline(always)]
562 pub fn ccof(&mut self, n: u8) -> CCOF_W<SRrs> {
563 #[allow(clippy::no_effect)] [(); 4][n as usize];
564 CCOF_W::new(self, n + 9)
565 }
566 #[inline(always)]
568 pub fn cc1of(&mut self) -> CCOF_W<SRrs> {
569 CCOF_W::new(self, 9)
570 }
571 #[inline(always)]
573 pub fn cc2of(&mut self) -> CCOF_W<SRrs> {
574 CCOF_W::new(self, 10)
575 }
576 #[inline(always)]
578 pub fn cc3of(&mut self) -> CCOF_W<SRrs> {
579 CCOF_W::new(self, 11)
580 }
581 #[inline(always)]
583 pub fn cc4of(&mut self) -> CCOF_W<SRrs> {
584 CCOF_W::new(self, 12)
585 }
586}
587pub struct SRrs;
593impl crate::RegisterSpec for SRrs {
594 type Ux = u32;
595}
596impl crate::Readable for SRrs {}
598impl crate::Writable for SRrs {
600 type Safety = crate::Unsafe;
601 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x1eff;
602}
603impl crate::Resettable for SRrs {}