stm32g0/stm32g0c1/rcc/
cier.rs1pub type R = crate::R<CIERrs>;
3pub type W = crate::W<CIERrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum LSIRDYIE {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<LSIRDYIE> for bool {
17 #[inline(always)]
18 fn from(variant: LSIRDYIE) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type LSIRDYIE_R = crate::BitReader<LSIRDYIE>;
24impl LSIRDYIE_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> LSIRDYIE {
28 match self.bits {
29 false => LSIRDYIE::Disabled,
30 true => LSIRDYIE::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == LSIRDYIE::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == LSIRDYIE::Enabled
42 }
43}
44pub type LSIRDYIE_W<'a, REG> = crate::BitWriter<'a, REG, LSIRDYIE>;
46impl<'a, REG> LSIRDYIE_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn disabled(self) -> &'a mut crate::W<REG> {
53 self.variant(LSIRDYIE::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(LSIRDYIE::Enabled)
59 }
60}
61pub use LSIRDYIE_R as LSERDYIE_R;
63pub use LSIRDYIE_R as HSIRDYIE_R;
65pub use LSIRDYIE_R as HSERDYIE_R;
67pub use LSIRDYIE_R as PLLSYSRDYIE_R;
69pub use LSIRDYIE_W as LSERDYIE_W;
71pub use LSIRDYIE_W as HSIRDYIE_W;
73pub use LSIRDYIE_W as HSERDYIE_W;
75pub use LSIRDYIE_W as PLLSYSRDYIE_W;
77impl R {
78 #[inline(always)]
80 pub fn lsirdyie(&self) -> LSIRDYIE_R {
81 LSIRDYIE_R::new((self.bits & 1) != 0)
82 }
83 #[inline(always)]
85 pub fn lserdyie(&self) -> LSERDYIE_R {
86 LSERDYIE_R::new(((self.bits >> 1) & 1) != 0)
87 }
88 #[inline(always)]
90 pub fn hsirdyie(&self) -> HSIRDYIE_R {
91 HSIRDYIE_R::new(((self.bits >> 3) & 1) != 0)
92 }
93 #[inline(always)]
95 pub fn hserdyie(&self) -> HSERDYIE_R {
96 HSERDYIE_R::new(((self.bits >> 4) & 1) != 0)
97 }
98 #[inline(always)]
100 pub fn pllsysrdyie(&self) -> PLLSYSRDYIE_R {
101 PLLSYSRDYIE_R::new(((self.bits >> 5) & 1) != 0)
102 }
103}
104impl core::fmt::Debug for R {
105 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
106 f.debug_struct("CIER")
107 .field("lsirdyie", &self.lsirdyie())
108 .field("lserdyie", &self.lserdyie())
109 .field("hsirdyie", &self.hsirdyie())
110 .field("hserdyie", &self.hserdyie())
111 .field("pllsysrdyie", &self.pllsysrdyie())
112 .finish()
113 }
114}
115impl W {
116 #[inline(always)]
118 pub fn lsirdyie(&mut self) -> LSIRDYIE_W<CIERrs> {
119 LSIRDYIE_W::new(self, 0)
120 }
121 #[inline(always)]
123 pub fn lserdyie(&mut self) -> LSERDYIE_W<CIERrs> {
124 LSERDYIE_W::new(self, 1)
125 }
126 #[inline(always)]
128 pub fn hsirdyie(&mut self) -> HSIRDYIE_W<CIERrs> {
129 HSIRDYIE_W::new(self, 3)
130 }
131 #[inline(always)]
133 pub fn hserdyie(&mut self) -> HSERDYIE_W<CIERrs> {
134 HSERDYIE_W::new(self, 4)
135 }
136 #[inline(always)]
138 pub fn pllsysrdyie(&mut self) -> PLLSYSRDYIE_W<CIERrs> {
139 PLLSYSRDYIE_W::new(self, 5)
140 }
141}
142pub struct CIERrs;
148impl crate::RegisterSpec for CIERrs {
149 type Ux = u32;
150}
151impl crate::Readable for CIERrs {}
153impl crate::Writable for CIERrs {
155 type Safety = crate::Unsafe;
156}
157impl crate::Resettable for CIERrs {}