py32f0/py32f030/rcc/
ccipr.rs1pub struct R(crate::R<CCIPR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CCIPR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CCIPR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CCIPR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<CCIPR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CCIPR_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<CCIPR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CCIPR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type PVDSEL_R = crate::BitReader<bool>;
39pub type PVDSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCIPR_SPEC, bool, O>;
41pub type COMP1SEL_R = crate::BitReader<COMP1SEL_A>;
43#[derive(Clone, Copy, Debug, PartialEq, Eq)]
47pub enum COMP1SEL_A {
48 Pclk = 0,
50 Lsc = 1,
52}
53impl From<COMP1SEL_A> for bool {
54 #[inline(always)]
55 fn from(variant: COMP1SEL_A) -> Self {
56 variant as u8 != 0
57 }
58}
59impl COMP1SEL_R {
60 #[inline(always)]
62 pub fn variant(&self) -> COMP1SEL_A {
63 match self.bits {
64 false => COMP1SEL_A::Pclk,
65 true => COMP1SEL_A::Lsc,
66 }
67 }
68 #[inline(always)]
70 pub fn is_pclk(&self) -> bool {
71 *self == COMP1SEL_A::Pclk
72 }
73 #[inline(always)]
75 pub fn is_lsc(&self) -> bool {
76 *self == COMP1SEL_A::Lsc
77 }
78}
79pub type COMP1SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCIPR_SPEC, COMP1SEL_A, O>;
81impl<'a, const O: u8> COMP1SEL_W<'a, O> {
82 #[inline(always)]
84 pub fn pclk(self) -> &'a mut W {
85 self.variant(COMP1SEL_A::Pclk)
86 }
87 #[inline(always)]
89 pub fn lsc(self) -> &'a mut W {
90 self.variant(COMP1SEL_A::Lsc)
91 }
92}
93pub use COMP1SEL_R as COMP2SEL_R;
95pub use COMP1SEL_W as COMP2SEL_W;
97pub type LPTIM1SEL_R = crate::FieldReader<u8, LPTIM1SEL_A>;
99#[derive(Clone, Copy, Debug, PartialEq, Eq)]
103#[repr(u8)]
104pub enum LPTIM1SEL_A {
105 Pclk = 0,
107 Lsi = 1,
109 Lse = 3,
111}
112impl From<LPTIM1SEL_A> for u8 {
113 #[inline(always)]
114 fn from(variant: LPTIM1SEL_A) -> Self {
115 variant as _
116 }
117}
118impl LPTIM1SEL_R {
119 #[inline(always)]
121 pub fn variant(&self) -> LPTIM1SEL_A {
122 match self.bits {
123 0 => LPTIM1SEL_A::Pclk,
124 1 => LPTIM1SEL_A::Lsi,
125 3 => LPTIM1SEL_A::Lse,
126 _ => unreachable!(),
127 }
128 }
129 #[inline(always)]
131 pub fn is_pclk(&self) -> bool {
132 *self == LPTIM1SEL_A::Pclk
133 }
134 #[inline(always)]
136 pub fn is_lsi(&self) -> bool {
137 *self == LPTIM1SEL_A::Lsi
138 }
139 #[inline(always)]
141 pub fn is_lse(&self) -> bool {
142 *self == LPTIM1SEL_A::Lse
143 }
144}
145pub type LPTIM1SEL_W<'a, const O: u8> =
147 crate::FieldWriter<'a, u32, CCIPR_SPEC, u8, LPTIM1SEL_A, 2, O>;
148impl<'a, const O: u8> LPTIM1SEL_W<'a, O> {
149 #[inline(always)]
151 pub fn pclk(self) -> &'a mut W {
152 self.variant(LPTIM1SEL_A::Pclk)
153 }
154 #[inline(always)]
156 pub fn lsi(self) -> &'a mut W {
157 self.variant(LPTIM1SEL_A::Lsi)
158 }
159 #[inline(always)]
161 pub fn lse(self) -> &'a mut W {
162 self.variant(LPTIM1SEL_A::Lse)
163 }
164}
165impl R {
166 #[inline(always)]
168 pub fn pvdsel(&self) -> PVDSEL_R {
169 PVDSEL_R::new(((self.bits >> 7) & 1) != 0)
170 }
171 #[inline(always)]
173 pub fn comp1sel(&self) -> COMP1SEL_R {
174 COMP1SEL_R::new(((self.bits >> 8) & 1) != 0)
175 }
176 #[inline(always)]
178 pub fn comp2sel(&self) -> COMP2SEL_R {
179 COMP2SEL_R::new(((self.bits >> 9) & 1) != 0)
180 }
181 #[inline(always)]
183 pub fn lptim1sel(&self) -> LPTIM1SEL_R {
184 LPTIM1SEL_R::new(((self.bits >> 18) & 3) as u8)
185 }
186}
187impl W {
188 #[inline(always)]
190 #[must_use]
191 pub fn pvdsel(&mut self) -> PVDSEL_W<7> {
192 PVDSEL_W::new(self)
193 }
194 #[inline(always)]
196 #[must_use]
197 pub fn comp1sel(&mut self) -> COMP1SEL_W<8> {
198 COMP1SEL_W::new(self)
199 }
200 #[inline(always)]
202 #[must_use]
203 pub fn comp2sel(&mut self) -> COMP2SEL_W<9> {
204 COMP2SEL_W::new(self)
205 }
206 #[inline(always)]
208 #[must_use]
209 pub fn lptim1sel(&mut self) -> LPTIM1SEL_W<18> {
210 LPTIM1SEL_W::new(self)
211 }
212 #[inline(always)]
214 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
215 self.0.bits(bits);
216 self
217 }
218}
219pub struct CCIPR_SPEC;
225impl crate::RegisterSpec for CCIPR_SPEC {
226 type Ux = u32;
227}
228impl crate::Readable for CCIPR_SPEC {
230 type Reader = R;
231}
232impl crate::Writable for CCIPR_SPEC {
234 type Writer = W;
235 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
236 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
237}
238impl crate::Resettable for CCIPR_SPEC {
240 const RESET_VALUE: Self::Ux = 0;
241}