stm32f1_staging/stm32f103/rcc/
cir.rs1pub type R = crate::R<CIRrs>;
3pub type W = crate::W<CIRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum LSIRDYFR {
11 NotInterrupted = 0,
13 Interrupted = 1,
15}
16impl From<LSIRDYFR> for bool {
17 #[inline(always)]
18 fn from(variant: LSIRDYFR) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type LSIRDYF_R = crate::BitReader<LSIRDYFR>;
24impl LSIRDYF_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> LSIRDYFR {
28 match self.bits {
29 false => LSIRDYFR::NotInterrupted,
30 true => LSIRDYFR::Interrupted,
31 }
32 }
33 #[inline(always)]
35 pub fn is_not_interrupted(&self) -> bool {
36 *self == LSIRDYFR::NotInterrupted
37 }
38 #[inline(always)]
40 pub fn is_interrupted(&self) -> bool {
41 *self == LSIRDYFR::Interrupted
42 }
43}
44pub use LSIRDYF_R as LSERDYF_R;
46pub use LSIRDYF_R as HSIRDYF_R;
48pub use LSIRDYF_R as HSERDYF_R;
50pub use LSIRDYF_R as PLLRDYF_R;
52#[cfg_attr(feature = "defmt", derive(defmt::Format))]
56#[derive(Clone, Copy, Debug, PartialEq, Eq)]
57pub enum CSSFR {
58 NotInterrupted = 0,
60 Interrupted = 1,
62}
63impl From<CSSFR> for bool {
64 #[inline(always)]
65 fn from(variant: CSSFR) -> Self {
66 variant as u8 != 0
67 }
68}
69pub type CSSF_R = crate::BitReader<CSSFR>;
71impl CSSF_R {
72 #[inline(always)]
74 pub const fn variant(&self) -> CSSFR {
75 match self.bits {
76 false => CSSFR::NotInterrupted,
77 true => CSSFR::Interrupted,
78 }
79 }
80 #[inline(always)]
82 pub fn is_not_interrupted(&self) -> bool {
83 *self == CSSFR::NotInterrupted
84 }
85 #[inline(always)]
87 pub fn is_interrupted(&self) -> bool {
88 *self == CSSFR::Interrupted
89 }
90}
91#[cfg_attr(feature = "defmt", derive(defmt::Format))]
95#[derive(Clone, Copy, Debug, PartialEq, Eq)]
96pub enum LSIRDYIE {
97 Disabled = 0,
99 Enabled = 1,
101}
102impl From<LSIRDYIE> for bool {
103 #[inline(always)]
104 fn from(variant: LSIRDYIE) -> Self {
105 variant as u8 != 0
106 }
107}
108pub type LSIRDYIE_R = crate::BitReader<LSIRDYIE>;
110impl LSIRDYIE_R {
111 #[inline(always)]
113 pub const fn variant(&self) -> LSIRDYIE {
114 match self.bits {
115 false => LSIRDYIE::Disabled,
116 true => LSIRDYIE::Enabled,
117 }
118 }
119 #[inline(always)]
121 pub fn is_disabled(&self) -> bool {
122 *self == LSIRDYIE::Disabled
123 }
124 #[inline(always)]
126 pub fn is_enabled(&self) -> bool {
127 *self == LSIRDYIE::Enabled
128 }
129}
130pub type LSIRDYIE_W<'a, REG> = crate::BitWriter<'a, REG, LSIRDYIE>;
132impl<'a, REG> LSIRDYIE_W<'a, REG>
133where
134 REG: crate::Writable + crate::RegisterSpec,
135{
136 #[inline(always)]
138 pub fn disabled(self) -> &'a mut crate::W<REG> {
139 self.variant(LSIRDYIE::Disabled)
140 }
141 #[inline(always)]
143 pub fn enabled(self) -> &'a mut crate::W<REG> {
144 self.variant(LSIRDYIE::Enabled)
145 }
146}
147pub use LSIRDYIE_R as LSERDYIE_R;
149pub use LSIRDYIE_R as HSIRDYIE_R;
151pub use LSIRDYIE_R as HSERDYIE_R;
153pub use LSIRDYIE_R as PLLRDYIE_R;
155pub use LSIRDYIE_W as LSERDYIE_W;
157pub use LSIRDYIE_W as HSIRDYIE_W;
159pub use LSIRDYIE_W as HSERDYIE_W;
161pub use LSIRDYIE_W as PLLRDYIE_W;
163#[cfg_attr(feature = "defmt", derive(defmt::Format))]
167#[derive(Clone, Copy, Debug, PartialEq, Eq)]
168pub enum LSIRDYCW {
169 Clear = 1,
171}
172impl From<LSIRDYCW> for bool {
173 #[inline(always)]
174 fn from(variant: LSIRDYCW) -> Self {
175 variant as u8 != 0
176 }
177}
178pub type LSIRDYC_W<'a, REG> = crate::BitWriter<'a, REG, LSIRDYCW>;
180impl<'a, REG> LSIRDYC_W<'a, REG>
181where
182 REG: crate::Writable + crate::RegisterSpec,
183{
184 #[inline(always)]
186 pub fn clear(self) -> &'a mut crate::W<REG> {
187 self.variant(LSIRDYCW::Clear)
188 }
189}
190pub use LSIRDYC_W as LSERDYC_W;
192pub use LSIRDYC_W as HSIRDYC_W;
194pub use LSIRDYC_W as HSERDYC_W;
196pub use LSIRDYC_W as PLLRDYC_W;
198#[cfg_attr(feature = "defmt", derive(defmt::Format))]
202#[derive(Clone, Copy, Debug, PartialEq, Eq)]
203pub enum CSSCW {
204 Clear = 1,
206}
207impl From<CSSCW> for bool {
208 #[inline(always)]
209 fn from(variant: CSSCW) -> Self {
210 variant as u8 != 0
211 }
212}
213pub type CSSC_W<'a, REG> = crate::BitWriter<'a, REG, CSSCW>;
215impl<'a, REG> CSSC_W<'a, REG>
216where
217 REG: crate::Writable + crate::RegisterSpec,
218{
219 #[inline(always)]
221 pub fn clear(self) -> &'a mut crate::W<REG> {
222 self.variant(CSSCW::Clear)
223 }
224}
225impl R {
226 #[inline(always)]
228 pub fn lsirdyf(&self) -> LSIRDYF_R {
229 LSIRDYF_R::new((self.bits & 1) != 0)
230 }
231 #[inline(always)]
233 pub fn lserdyf(&self) -> LSERDYF_R {
234 LSERDYF_R::new(((self.bits >> 1) & 1) != 0)
235 }
236 #[inline(always)]
238 pub fn hsirdyf(&self) -> HSIRDYF_R {
239 HSIRDYF_R::new(((self.bits >> 2) & 1) != 0)
240 }
241 #[inline(always)]
243 pub fn hserdyf(&self) -> HSERDYF_R {
244 HSERDYF_R::new(((self.bits >> 3) & 1) != 0)
245 }
246 #[inline(always)]
248 pub fn pllrdyf(&self) -> PLLRDYF_R {
249 PLLRDYF_R::new(((self.bits >> 4) & 1) != 0)
250 }
251 #[inline(always)]
253 pub fn cssf(&self) -> CSSF_R {
254 CSSF_R::new(((self.bits >> 7) & 1) != 0)
255 }
256 #[inline(always)]
258 pub fn lsirdyie(&self) -> LSIRDYIE_R {
259 LSIRDYIE_R::new(((self.bits >> 8) & 1) != 0)
260 }
261 #[inline(always)]
263 pub fn lserdyie(&self) -> LSERDYIE_R {
264 LSERDYIE_R::new(((self.bits >> 9) & 1) != 0)
265 }
266 #[inline(always)]
268 pub fn hsirdyie(&self) -> HSIRDYIE_R {
269 HSIRDYIE_R::new(((self.bits >> 10) & 1) != 0)
270 }
271 #[inline(always)]
273 pub fn hserdyie(&self) -> HSERDYIE_R {
274 HSERDYIE_R::new(((self.bits >> 11) & 1) != 0)
275 }
276 #[inline(always)]
278 pub fn pllrdyie(&self) -> PLLRDYIE_R {
279 PLLRDYIE_R::new(((self.bits >> 12) & 1) != 0)
280 }
281}
282impl core::fmt::Debug for R {
283 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
284 f.debug_struct("CIR")
285 .field("lsirdyf", &self.lsirdyf())
286 .field("lserdyf", &self.lserdyf())
287 .field("hsirdyf", &self.hsirdyf())
288 .field("hserdyf", &self.hserdyf())
289 .field("pllrdyf", &self.pllrdyf())
290 .field("cssf", &self.cssf())
291 .field("lsirdyie", &self.lsirdyie())
292 .field("lserdyie", &self.lserdyie())
293 .field("hsirdyie", &self.hsirdyie())
294 .field("hserdyie", &self.hserdyie())
295 .field("pllrdyie", &self.pllrdyie())
296 .finish()
297 }
298}
299impl W {
300 #[inline(always)]
302 pub fn lsirdyie(&mut self) -> LSIRDYIE_W<CIRrs> {
303 LSIRDYIE_W::new(self, 8)
304 }
305 #[inline(always)]
307 pub fn lserdyie(&mut self) -> LSERDYIE_W<CIRrs> {
308 LSERDYIE_W::new(self, 9)
309 }
310 #[inline(always)]
312 pub fn hsirdyie(&mut self) -> HSIRDYIE_W<CIRrs> {
313 HSIRDYIE_W::new(self, 10)
314 }
315 #[inline(always)]
317 pub fn hserdyie(&mut self) -> HSERDYIE_W<CIRrs> {
318 HSERDYIE_W::new(self, 11)
319 }
320 #[inline(always)]
322 pub fn pllrdyie(&mut self) -> PLLRDYIE_W<CIRrs> {
323 PLLRDYIE_W::new(self, 12)
324 }
325 #[inline(always)]
327 pub fn lsirdyc(&mut self) -> LSIRDYC_W<CIRrs> {
328 LSIRDYC_W::new(self, 16)
329 }
330 #[inline(always)]
332 pub fn lserdyc(&mut self) -> LSERDYC_W<CIRrs> {
333 LSERDYC_W::new(self, 17)
334 }
335 #[inline(always)]
337 pub fn hsirdyc(&mut self) -> HSIRDYC_W<CIRrs> {
338 HSIRDYC_W::new(self, 18)
339 }
340 #[inline(always)]
342 pub fn hserdyc(&mut self) -> HSERDYC_W<CIRrs> {
343 HSERDYC_W::new(self, 19)
344 }
345 #[inline(always)]
347 pub fn pllrdyc(&mut self) -> PLLRDYC_W<CIRrs> {
348 PLLRDYC_W::new(self, 20)
349 }
350 #[inline(always)]
352 pub fn cssc(&mut self) -> CSSC_W<CIRrs> {
353 CSSC_W::new(self, 23)
354 }
355}
356pub struct CIRrs;
362impl crate::RegisterSpec for CIRrs {
363 type Ux = u32;
364}
365impl crate::Readable for CIRrs {}
367impl crate::Writable for CIRrs {
369 type Safety = crate::Unsafe;
370}
371impl crate::Resettable for CIRrs {}