1pub type R = crate::R<CCIPRrs>;
3pub type W = crate::W<CCIPRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10#[repr(u8)]
11pub enum USART1SEL {
12 Pclk = 0,
14 Sysclk = 1,
16 Hsi16 = 2,
18 Lse = 3,
20}
21impl From<USART1SEL> for u8 {
22 #[inline(always)]
23 fn from(variant: USART1SEL) -> Self {
24 variant as _
25 }
26}
27impl crate::FieldSpec for USART1SEL {
28 type Ux = u8;
29}
30impl crate::IsEnum for USART1SEL {}
31pub type USART1SEL_R = crate::FieldReader<USART1SEL>;
33impl USART1SEL_R {
34 #[inline(always)]
36 pub const fn variant(&self) -> USART1SEL {
37 match self.bits {
38 0 => USART1SEL::Pclk,
39 1 => USART1SEL::Sysclk,
40 2 => USART1SEL::Hsi16,
41 3 => USART1SEL::Lse,
42 _ => unreachable!(),
43 }
44 }
45 #[inline(always)]
47 pub fn is_pclk(&self) -> bool {
48 *self == USART1SEL::Pclk
49 }
50 #[inline(always)]
52 pub fn is_sysclk(&self) -> bool {
53 *self == USART1SEL::Sysclk
54 }
55 #[inline(always)]
57 pub fn is_hsi16(&self) -> bool {
58 *self == USART1SEL::Hsi16
59 }
60 #[inline(always)]
62 pub fn is_lse(&self) -> bool {
63 *self == USART1SEL::Lse
64 }
65}
66pub type USART1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, USART1SEL, crate::Safe>;
68impl<'a, REG> USART1SEL_W<'a, REG>
69where
70 REG: crate::Writable + crate::RegisterSpec,
71 REG::Ux: From<u8>,
72{
73 #[inline(always)]
75 pub fn pclk(self) -> &'a mut crate::W<REG> {
76 self.variant(USART1SEL::Pclk)
77 }
78 #[inline(always)]
80 pub fn sysclk(self) -> &'a mut crate::W<REG> {
81 self.variant(USART1SEL::Sysclk)
82 }
83 #[inline(always)]
85 pub fn hsi16(self) -> &'a mut crate::W<REG> {
86 self.variant(USART1SEL::Hsi16)
87 }
88 #[inline(always)]
90 pub fn lse(self) -> &'a mut crate::W<REG> {
91 self.variant(USART1SEL::Lse)
92 }
93}
94pub use USART1SEL_R as USART2SEL_R;
96pub use USART1SEL_R as USART3SEL_R;
98pub use USART1SEL_W as USART2SEL_W;
100pub use USART1SEL_W as USART3SEL_W;
102#[cfg_attr(feature = "defmt", derive(defmt::Format))]
106#[derive(Clone, Copy, Debug, PartialEq, Eq)]
107#[repr(u8)]
108pub enum I2C1SEL {
109 Pclk = 0,
111 Sysclk = 1,
113 Hsi16 = 2,
115}
116impl From<I2C1SEL> for u8 {
117 #[inline(always)]
118 fn from(variant: I2C1SEL) -> Self {
119 variant as _
120 }
121}
122impl crate::FieldSpec for I2C1SEL {
123 type Ux = u8;
124}
125impl crate::IsEnum for I2C1SEL {}
126pub type I2C1SEL_R = crate::FieldReader<I2C1SEL>;
128impl I2C1SEL_R {
129 #[inline(always)]
131 pub const fn variant(&self) -> Option<I2C1SEL> {
132 match self.bits {
133 0 => Some(I2C1SEL::Pclk),
134 1 => Some(I2C1SEL::Sysclk),
135 2 => Some(I2C1SEL::Hsi16),
136 _ => None,
137 }
138 }
139 #[inline(always)]
141 pub fn is_pclk(&self) -> bool {
142 *self == I2C1SEL::Pclk
143 }
144 #[inline(always)]
146 pub fn is_sysclk(&self) -> bool {
147 *self == I2C1SEL::Sysclk
148 }
149 #[inline(always)]
151 pub fn is_hsi16(&self) -> bool {
152 *self == I2C1SEL::Hsi16
153 }
154}
155pub type I2C1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, I2C1SEL>;
157impl<'a, REG> I2C1SEL_W<'a, REG>
158where
159 REG: crate::Writable + crate::RegisterSpec,
160 REG::Ux: From<u8>,
161{
162 #[inline(always)]
164 pub fn pclk(self) -> &'a mut crate::W<REG> {
165 self.variant(I2C1SEL::Pclk)
166 }
167 #[inline(always)]
169 pub fn sysclk(self) -> &'a mut crate::W<REG> {
170 self.variant(I2C1SEL::Sysclk)
171 }
172 #[inline(always)]
174 pub fn hsi16(self) -> &'a mut crate::W<REG> {
175 self.variant(I2C1SEL::Hsi16)
176 }
177}
178#[cfg_attr(feature = "defmt", derive(defmt::Format))]
182#[derive(Clone, Copy, Debug, PartialEq, Eq)]
183#[repr(u8)]
184pub enum I2C2SEL {
185 Pclk = 0,
187 Sysclk = 1,
189 Hsi16 = 2,
191}
192impl From<I2C2SEL> for u8 {
193 #[inline(always)]
194 fn from(variant: I2C2SEL) -> Self {
195 variant as _
196 }
197}
198impl crate::FieldSpec for I2C2SEL {
199 type Ux = u8;
200}
201impl crate::IsEnum for I2C2SEL {}
202pub type I2C2SEL_R = crate::FieldReader<I2C2SEL>;
204impl I2C2SEL_R {
205 #[inline(always)]
207 pub const fn variant(&self) -> Option<I2C2SEL> {
208 match self.bits {
209 0 => Some(I2C2SEL::Pclk),
210 1 => Some(I2C2SEL::Sysclk),
211 2 => Some(I2C2SEL::Hsi16),
212 _ => None,
213 }
214 }
215 #[inline(always)]
217 pub fn is_pclk(&self) -> bool {
218 *self == I2C2SEL::Pclk
219 }
220 #[inline(always)]
222 pub fn is_sysclk(&self) -> bool {
223 *self == I2C2SEL::Sysclk
224 }
225 #[inline(always)]
227 pub fn is_hsi16(&self) -> bool {
228 *self == I2C2SEL::Hsi16
229 }
230}
231pub type I2C2SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, I2C2SEL>;
233impl<'a, REG> I2C2SEL_W<'a, REG>
234where
235 REG: crate::Writable + crate::RegisterSpec,
236 REG::Ux: From<u8>,
237{
238 #[inline(always)]
240 pub fn pclk(self) -> &'a mut crate::W<REG> {
241 self.variant(I2C2SEL::Pclk)
242 }
243 #[inline(always)]
245 pub fn sysclk(self) -> &'a mut crate::W<REG> {
246 self.variant(I2C2SEL::Sysclk)
247 }
248 #[inline(always)]
250 pub fn hsi16(self) -> &'a mut crate::W<REG> {
251 self.variant(I2C2SEL::Hsi16)
252 }
253}
254#[cfg_attr(feature = "defmt", derive(defmt::Format))]
258#[derive(Clone, Copy, Debug, PartialEq, Eq)]
259pub enum TIM1SEL {
260 Timp = 0,
262 Pllq = 1,
264}
265impl From<TIM1SEL> for bool {
266 #[inline(always)]
267 fn from(variant: TIM1SEL) -> Self {
268 variant as u8 != 0
269 }
270}
271pub type TIM1SEL_R = crate::BitReader<TIM1SEL>;
273impl TIM1SEL_R {
274 #[inline(always)]
276 pub const fn variant(&self) -> TIM1SEL {
277 match self.bits {
278 false => TIM1SEL::Timp,
279 true => TIM1SEL::Pllq,
280 }
281 }
282 #[inline(always)]
284 pub fn is_timp(&self) -> bool {
285 *self == TIM1SEL::Timp
286 }
287 #[inline(always)]
289 pub fn is_pllq(&self) -> bool {
290 *self == TIM1SEL::Pllq
291 }
292}
293pub type TIM1SEL_W<'a, REG> = crate::BitWriter<'a, REG, TIM1SEL>;
295impl<'a, REG> TIM1SEL_W<'a, REG>
296where
297 REG: crate::Writable + crate::RegisterSpec,
298{
299 #[inline(always)]
301 pub fn timp(self) -> &'a mut crate::W<REG> {
302 self.variant(TIM1SEL::Timp)
303 }
304 #[inline(always)]
306 pub fn pllq(self) -> &'a mut crate::W<REG> {
307 self.variant(TIM1SEL::Pllq)
308 }
309}
310pub use TIM1SEL_R as TIM15SEL_R;
312pub use TIM1SEL_W as TIM15SEL_W;
314#[cfg_attr(feature = "defmt", derive(defmt::Format))]
318#[derive(Clone, Copy, Debug, PartialEq, Eq)]
319#[repr(u8)]
320pub enum ADCSEL {
321 Sysclk = 0,
323 Pllp = 1,
325 Hsi16 = 2,
327}
328impl From<ADCSEL> for u8 {
329 #[inline(always)]
330 fn from(variant: ADCSEL) -> Self {
331 variant as _
332 }
333}
334impl crate::FieldSpec for ADCSEL {
335 type Ux = u8;
336}
337impl crate::IsEnum for ADCSEL {}
338pub type ADCSEL_R = crate::FieldReader<ADCSEL>;
340impl ADCSEL_R {
341 #[inline(always)]
343 pub const fn variant(&self) -> Option<ADCSEL> {
344 match self.bits {
345 0 => Some(ADCSEL::Sysclk),
346 1 => Some(ADCSEL::Pllp),
347 2 => Some(ADCSEL::Hsi16),
348 _ => None,
349 }
350 }
351 #[inline(always)]
353 pub fn is_sysclk(&self) -> bool {
354 *self == ADCSEL::Sysclk
355 }
356 #[inline(always)]
358 pub fn is_pllp(&self) -> bool {
359 *self == ADCSEL::Pllp
360 }
361 #[inline(always)]
363 pub fn is_hsi16(&self) -> bool {
364 *self == ADCSEL::Hsi16
365 }
366}
367pub type ADCSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ADCSEL>;
369impl<'a, REG> ADCSEL_W<'a, REG>
370where
371 REG: crate::Writable + crate::RegisterSpec,
372 REG::Ux: From<u8>,
373{
374 #[inline(always)]
376 pub fn sysclk(self) -> &'a mut crate::W<REG> {
377 self.variant(ADCSEL::Sysclk)
378 }
379 #[inline(always)]
381 pub fn pllp(self) -> &'a mut crate::W<REG> {
382 self.variant(ADCSEL::Pllp)
383 }
384 #[inline(always)]
386 pub fn hsi16(self) -> &'a mut crate::W<REG> {
387 self.variant(ADCSEL::Hsi16)
388 }
389}
390impl R {
391 #[inline(always)]
393 pub fn usart1sel(&self) -> USART1SEL_R {
394 USART1SEL_R::new((self.bits & 3) as u8)
395 }
396 #[inline(always)]
398 pub fn usart2sel(&self) -> USART2SEL_R {
399 USART2SEL_R::new(((self.bits >> 2) & 3) as u8)
400 }
401 #[inline(always)]
403 pub fn usart3sel(&self) -> USART3SEL_R {
404 USART3SEL_R::new(((self.bits >> 4) & 3) as u8)
405 }
406 #[inline(always)]
408 pub fn i2c1sel(&self) -> I2C1SEL_R {
409 I2C1SEL_R::new(((self.bits >> 12) & 3) as u8)
410 }
411 #[inline(always)]
413 pub fn i2c2sel(&self) -> I2C2SEL_R {
414 I2C2SEL_R::new(((self.bits >> 14) & 3) as u8)
415 }
416 #[inline(always)]
418 pub fn tim1sel(&self) -> TIM1SEL_R {
419 TIM1SEL_R::new(((self.bits >> 22) & 1) != 0)
420 }
421 #[inline(always)]
423 pub fn tim15sel(&self) -> TIM15SEL_R {
424 TIM15SEL_R::new(((self.bits >> 24) & 1) != 0)
425 }
426 #[inline(always)]
428 pub fn adcsel(&self) -> ADCSEL_R {
429 ADCSEL_R::new(((self.bits >> 30) & 3) as u8)
430 }
431}
432impl core::fmt::Debug for R {
433 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
434 f.debug_struct("CCIPR")
435 .field("usart1sel", &self.usart1sel())
436 .field("usart2sel", &self.usart2sel())
437 .field("usart3sel", &self.usart3sel())
438 .field("i2c1sel", &self.i2c1sel())
439 .field("i2c2sel", &self.i2c2sel())
440 .field("tim1sel", &self.tim1sel())
441 .field("tim15sel", &self.tim15sel())
442 .field("adcsel", &self.adcsel())
443 .finish()
444 }
445}
446impl W {
447 #[inline(always)]
449 pub fn usart1sel(&mut self) -> USART1SEL_W<CCIPRrs> {
450 USART1SEL_W::new(self, 0)
451 }
452 #[inline(always)]
454 pub fn usart2sel(&mut self) -> USART2SEL_W<CCIPRrs> {
455 USART2SEL_W::new(self, 2)
456 }
457 #[inline(always)]
459 pub fn usart3sel(&mut self) -> USART3SEL_W<CCIPRrs> {
460 USART3SEL_W::new(self, 4)
461 }
462 #[inline(always)]
464 pub fn i2c1sel(&mut self) -> I2C1SEL_W<CCIPRrs> {
465 I2C1SEL_W::new(self, 12)
466 }
467 #[inline(always)]
469 pub fn i2c2sel(&mut self) -> I2C2SEL_W<CCIPRrs> {
470 I2C2SEL_W::new(self, 14)
471 }
472 #[inline(always)]
474 pub fn tim1sel(&mut self) -> TIM1SEL_W<CCIPRrs> {
475 TIM1SEL_W::new(self, 22)
476 }
477 #[inline(always)]
479 pub fn tim15sel(&mut self) -> TIM15SEL_W<CCIPRrs> {
480 TIM15SEL_W::new(self, 24)
481 }
482 #[inline(always)]
484 pub fn adcsel(&mut self) -> ADCSEL_W<CCIPRrs> {
485 ADCSEL_W::new(self, 30)
486 }
487}
488pub struct CCIPRrs;
494impl crate::RegisterSpec for CCIPRrs {
495 type Ux = u32;
496}
497impl crate::Readable for CCIPRrs {}
499impl crate::Writable for CCIPRrs {
501 type Safety = crate::Unsafe;
502}
503impl crate::Resettable for CCIPRrs {}