stm32f1/stm32f107/flash/
cr.rs1pub type R = crate::R<CRrs>;
3pub type W = crate::W<CRrs>;
5pub type PG_R = crate::BitReader;
7pub type PG_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type PER_R = crate::BitReader;
11pub type PER_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type MER_R = crate::BitReader;
15pub type MER_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type OPTPG_R = crate::BitReader;
19pub type OPTPG_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type OPTER_R = crate::BitReader;
23pub type OPTER_W<'a, REG> = crate::BitWriter<'a, REG>;
25pub type STRT_R = crate::BitReader;
27pub type STRT_W<'a, REG> = crate::BitWriter<'a, REG>;
29pub type LOCK_R = crate::BitReader;
31pub type LOCK_W<'a, REG> = crate::BitWriter<'a, REG>;
33pub type OPTWRE_R = crate::BitReader;
35pub type OPTWRE_W<'a, REG> = crate::BitWriter<'a, REG>;
37pub type ERRIE_R = crate::BitReader;
39pub type ERRIE_W<'a, REG> = crate::BitWriter<'a, REG>;
41pub type EOPIE_R = crate::BitReader;
43pub type EOPIE_W<'a, REG> = crate::BitWriter<'a, REG>;
45impl R {
46 #[inline(always)]
48 pub fn pg(&self) -> PG_R {
49 PG_R::new((self.bits & 1) != 0)
50 }
51 #[inline(always)]
53 pub fn per(&self) -> PER_R {
54 PER_R::new(((self.bits >> 1) & 1) != 0)
55 }
56 #[inline(always)]
58 pub fn mer(&self) -> MER_R {
59 MER_R::new(((self.bits >> 2) & 1) != 0)
60 }
61 #[inline(always)]
63 pub fn optpg(&self) -> OPTPG_R {
64 OPTPG_R::new(((self.bits >> 4) & 1) != 0)
65 }
66 #[inline(always)]
68 pub fn opter(&self) -> OPTER_R {
69 OPTER_R::new(((self.bits >> 5) & 1) != 0)
70 }
71 #[inline(always)]
73 pub fn strt(&self) -> STRT_R {
74 STRT_R::new(((self.bits >> 6) & 1) != 0)
75 }
76 #[inline(always)]
78 pub fn lock(&self) -> LOCK_R {
79 LOCK_R::new(((self.bits >> 7) & 1) != 0)
80 }
81 #[inline(always)]
83 pub fn optwre(&self) -> OPTWRE_R {
84 OPTWRE_R::new(((self.bits >> 9) & 1) != 0)
85 }
86 #[inline(always)]
88 pub fn errie(&self) -> ERRIE_R {
89 ERRIE_R::new(((self.bits >> 10) & 1) != 0)
90 }
91 #[inline(always)]
93 pub fn eopie(&self) -> EOPIE_R {
94 EOPIE_R::new(((self.bits >> 12) & 1) != 0)
95 }
96}
97impl core::fmt::Debug for R {
98 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
99 f.debug_struct("CR")
100 .field("pg", &self.pg())
101 .field("per", &self.per())
102 .field("mer", &self.mer())
103 .field("optpg", &self.optpg())
104 .field("opter", &self.opter())
105 .field("strt", &self.strt())
106 .field("lock", &self.lock())
107 .field("optwre", &self.optwre())
108 .field("errie", &self.errie())
109 .field("eopie", &self.eopie())
110 .finish()
111 }
112}
113impl W {
114 #[inline(always)]
116 pub fn pg(&mut self) -> PG_W<CRrs> {
117 PG_W::new(self, 0)
118 }
119 #[inline(always)]
121 pub fn per(&mut self) -> PER_W<CRrs> {
122 PER_W::new(self, 1)
123 }
124 #[inline(always)]
126 pub fn mer(&mut self) -> MER_W<CRrs> {
127 MER_W::new(self, 2)
128 }
129 #[inline(always)]
131 pub fn optpg(&mut self) -> OPTPG_W<CRrs> {
132 OPTPG_W::new(self, 4)
133 }
134 #[inline(always)]
136 pub fn opter(&mut self) -> OPTER_W<CRrs> {
137 OPTER_W::new(self, 5)
138 }
139 #[inline(always)]
141 pub fn strt(&mut self) -> STRT_W<CRrs> {
142 STRT_W::new(self, 6)
143 }
144 #[inline(always)]
146 pub fn lock(&mut self) -> LOCK_W<CRrs> {
147 LOCK_W::new(self, 7)
148 }
149 #[inline(always)]
151 pub fn optwre(&mut self) -> OPTWRE_W<CRrs> {
152 OPTWRE_W::new(self, 9)
153 }
154 #[inline(always)]
156 pub fn errie(&mut self) -> ERRIE_W<CRrs> {
157 ERRIE_W::new(self, 10)
158 }
159 #[inline(always)]
161 pub fn eopie(&mut self) -> EOPIE_W<CRrs> {
162 EOPIE_W::new(self, 12)
163 }
164}
165pub struct CRrs;
171impl crate::RegisterSpec for CRrs {
172 type Ux = u32;
173}
174impl crate::Readable for CRrs {}
176impl crate::Writable for CRrs {
178 type Safety = crate::Unsafe;
179}
180impl crate::Resettable for CRrs {
182 const RESET_VALUE: u32 = 0x80;
183}