stm32f1/stm32f103/tim6/
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}
71impl R {
72 #[inline(always)]
74 pub fn uif(&self) -> UIF_R {
75 UIF_R::new((self.bits & 1) != 0)
76 }
77}
78impl core::fmt::Debug for R {
79 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
80 f.debug_struct("SR").field("uif", &self.uif()).finish()
81 }
82}
83impl W {
84 #[inline(always)]
86 pub fn uif(&mut self) -> UIF_W<SRrs> {
87 UIF_W::new(self, 0)
88 }
89}
90pub struct SRrs;
96impl crate::RegisterSpec for SRrs {
97 type Ux = u32;
98}
99impl crate::Readable for SRrs {}
101impl crate::Writable for SRrs {
103 type Safety = crate::Unsafe;
104 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x01;
105}
106impl crate::Resettable for SRrs {}