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;
102pub type UART4SEL_R = crate::FieldReader;
104pub type UART4SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
106pub type UART5SEL_R = crate::FieldReader;
108pub type UART5SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
110#[cfg_attr(feature = "defmt", derive(defmt::Format))]
114#[derive(Clone, Copy, Debug, PartialEq, Eq)]
115#[repr(u8)]
116pub enum LPUART1SEL {
117 Pclk = 0,
119 Sysclk = 1,
121 Hsi16 = 2,
123 Lse = 3,
125}
126impl From<LPUART1SEL> for u8 {
127 #[inline(always)]
128 fn from(variant: LPUART1SEL) -> Self {
129 variant as _
130 }
131}
132impl crate::FieldSpec for LPUART1SEL {
133 type Ux = u8;
134}
135impl crate::IsEnum for LPUART1SEL {}
136pub type LPUART1SEL_R = crate::FieldReader<LPUART1SEL>;
138impl LPUART1SEL_R {
139 #[inline(always)]
141 pub const fn variant(&self) -> LPUART1SEL {
142 match self.bits {
143 0 => LPUART1SEL::Pclk,
144 1 => LPUART1SEL::Sysclk,
145 2 => LPUART1SEL::Hsi16,
146 3 => LPUART1SEL::Lse,
147 _ => unreachable!(),
148 }
149 }
150 #[inline(always)]
152 pub fn is_pclk(&self) -> bool {
153 *self == LPUART1SEL::Pclk
154 }
155 #[inline(always)]
157 pub fn is_sysclk(&self) -> bool {
158 *self == LPUART1SEL::Sysclk
159 }
160 #[inline(always)]
162 pub fn is_hsi16(&self) -> bool {
163 *self == LPUART1SEL::Hsi16
164 }
165 #[inline(always)]
167 pub fn is_lse(&self) -> bool {
168 *self == LPUART1SEL::Lse
169 }
170}
171pub type LPUART1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, LPUART1SEL, crate::Safe>;
173impl<'a, REG> LPUART1SEL_W<'a, REG>
174where
175 REG: crate::Writable + crate::RegisterSpec,
176 REG::Ux: From<u8>,
177{
178 #[inline(always)]
180 pub fn pclk(self) -> &'a mut crate::W<REG> {
181 self.variant(LPUART1SEL::Pclk)
182 }
183 #[inline(always)]
185 pub fn sysclk(self) -> &'a mut crate::W<REG> {
186 self.variant(LPUART1SEL::Sysclk)
187 }
188 #[inline(always)]
190 pub fn hsi16(self) -> &'a mut crate::W<REG> {
191 self.variant(LPUART1SEL::Hsi16)
192 }
193 #[inline(always)]
195 pub fn lse(self) -> &'a mut crate::W<REG> {
196 self.variant(LPUART1SEL::Lse)
197 }
198}
199#[cfg_attr(feature = "defmt", derive(defmt::Format))]
203#[derive(Clone, Copy, Debug, PartialEq, Eq)]
204#[repr(u8)]
205pub enum I2C1SEL {
206 Pclk = 0,
208 Sysclk = 1,
210 Hsi16 = 2,
212}
213impl From<I2C1SEL> for u8 {
214 #[inline(always)]
215 fn from(variant: I2C1SEL) -> Self {
216 variant as _
217 }
218}
219impl crate::FieldSpec for I2C1SEL {
220 type Ux = u8;
221}
222impl crate::IsEnum for I2C1SEL {}
223pub type I2C1SEL_R = crate::FieldReader<I2C1SEL>;
225impl I2C1SEL_R {
226 #[inline(always)]
228 pub const fn variant(&self) -> Option<I2C1SEL> {
229 match self.bits {
230 0 => Some(I2C1SEL::Pclk),
231 1 => Some(I2C1SEL::Sysclk),
232 2 => Some(I2C1SEL::Hsi16),
233 _ => None,
234 }
235 }
236 #[inline(always)]
238 pub fn is_pclk(&self) -> bool {
239 *self == I2C1SEL::Pclk
240 }
241 #[inline(always)]
243 pub fn is_sysclk(&self) -> bool {
244 *self == I2C1SEL::Sysclk
245 }
246 #[inline(always)]
248 pub fn is_hsi16(&self) -> bool {
249 *self == I2C1SEL::Hsi16
250 }
251}
252pub type I2C1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, I2C1SEL>;
254impl<'a, REG> I2C1SEL_W<'a, REG>
255where
256 REG: crate::Writable + crate::RegisterSpec,
257 REG::Ux: From<u8>,
258{
259 #[inline(always)]
261 pub fn pclk(self) -> &'a mut crate::W<REG> {
262 self.variant(I2C1SEL::Pclk)
263 }
264 #[inline(always)]
266 pub fn sysclk(self) -> &'a mut crate::W<REG> {
267 self.variant(I2C1SEL::Sysclk)
268 }
269 #[inline(always)]
271 pub fn hsi16(self) -> &'a mut crate::W<REG> {
272 self.variant(I2C1SEL::Hsi16)
273 }
274}
275pub use I2C1SEL_R as I2C2SEL_R;
277pub use I2C1SEL_R as I2C3SEL_R;
279pub use I2C1SEL_W as I2C2SEL_W;
281pub use I2C1SEL_W as I2C3SEL_W;
283#[cfg_attr(feature = "defmt", derive(defmt::Format))]
287#[derive(Clone, Copy, Debug, PartialEq, Eq)]
288#[repr(u8)]
289pub enum LPTIM1SEL {
290 Pclk = 0,
292 Lsi = 1,
294 Hsi16 = 2,
296 Lse = 3,
298}
299impl From<LPTIM1SEL> for u8 {
300 #[inline(always)]
301 fn from(variant: LPTIM1SEL) -> Self {
302 variant as _
303 }
304}
305impl crate::FieldSpec for LPTIM1SEL {
306 type Ux = u8;
307}
308impl crate::IsEnum for LPTIM1SEL {}
309pub type LPTIM1SEL_R = crate::FieldReader<LPTIM1SEL>;
311impl LPTIM1SEL_R {
312 #[inline(always)]
314 pub const fn variant(&self) -> LPTIM1SEL {
315 match self.bits {
316 0 => LPTIM1SEL::Pclk,
317 1 => LPTIM1SEL::Lsi,
318 2 => LPTIM1SEL::Hsi16,
319 3 => LPTIM1SEL::Lse,
320 _ => unreachable!(),
321 }
322 }
323 #[inline(always)]
325 pub fn is_pclk(&self) -> bool {
326 *self == LPTIM1SEL::Pclk
327 }
328 #[inline(always)]
330 pub fn is_lsi(&self) -> bool {
331 *self == LPTIM1SEL::Lsi
332 }
333 #[inline(always)]
335 pub fn is_hsi16(&self) -> bool {
336 *self == LPTIM1SEL::Hsi16
337 }
338 #[inline(always)]
340 pub fn is_lse(&self) -> bool {
341 *self == LPTIM1SEL::Lse
342 }
343}
344pub type LPTIM1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, LPTIM1SEL, crate::Safe>;
346impl<'a, REG> LPTIM1SEL_W<'a, REG>
347where
348 REG: crate::Writable + crate::RegisterSpec,
349 REG::Ux: From<u8>,
350{
351 #[inline(always)]
353 pub fn pclk(self) -> &'a mut crate::W<REG> {
354 self.variant(LPTIM1SEL::Pclk)
355 }
356 #[inline(always)]
358 pub fn lsi(self) -> &'a mut crate::W<REG> {
359 self.variant(LPTIM1SEL::Lsi)
360 }
361 #[inline(always)]
363 pub fn hsi16(self) -> &'a mut crate::W<REG> {
364 self.variant(LPTIM1SEL::Hsi16)
365 }
366 #[inline(always)]
368 pub fn lse(self) -> &'a mut crate::W<REG> {
369 self.variant(LPTIM1SEL::Lse)
370 }
371}
372pub use LPTIM1SEL_R as LPTIM2SEL_R;
374pub use LPTIM1SEL_W as LPTIM2SEL_W;
376pub type SAI1SEL_R = crate::FieldReader;
378pub type SAI1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
380pub type SAI2SEL_R = crate::FieldReader;
382pub type SAI2SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
384#[cfg_attr(feature = "defmt", derive(defmt::Format))]
388#[derive(Clone, Copy, Debug, PartialEq, Eq)]
389#[repr(u8)]
390pub enum CLK48SEL {
391 Hsi48 = 0,
393 Pllsai1 = 1,
395 Pll = 2,
397 Msi = 3,
399}
400impl From<CLK48SEL> for u8 {
401 #[inline(always)]
402 fn from(variant: CLK48SEL) -> Self {
403 variant as _
404 }
405}
406impl crate::FieldSpec for CLK48SEL {
407 type Ux = u8;
408}
409impl crate::IsEnum for CLK48SEL {}
410pub type CLK48SEL_R = crate::FieldReader<CLK48SEL>;
412impl CLK48SEL_R {
413 #[inline(always)]
415 pub const fn variant(&self) -> CLK48SEL {
416 match self.bits {
417 0 => CLK48SEL::Hsi48,
418 1 => CLK48SEL::Pllsai1,
419 2 => CLK48SEL::Pll,
420 3 => CLK48SEL::Msi,
421 _ => unreachable!(),
422 }
423 }
424 #[inline(always)]
426 pub fn is_hsi48(&self) -> bool {
427 *self == CLK48SEL::Hsi48
428 }
429 #[inline(always)]
431 pub fn is_pllsai1(&self) -> bool {
432 *self == CLK48SEL::Pllsai1
433 }
434 #[inline(always)]
436 pub fn is_pll(&self) -> bool {
437 *self == CLK48SEL::Pll
438 }
439 #[inline(always)]
441 pub fn is_msi(&self) -> bool {
442 *self == CLK48SEL::Msi
443 }
444}
445pub type CLK48SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CLK48SEL, crate::Safe>;
447impl<'a, REG> CLK48SEL_W<'a, REG>
448where
449 REG: crate::Writable + crate::RegisterSpec,
450 REG::Ux: From<u8>,
451{
452 #[inline(always)]
454 pub fn hsi48(self) -> &'a mut crate::W<REG> {
455 self.variant(CLK48SEL::Hsi48)
456 }
457 #[inline(always)]
459 pub fn pllsai1(self) -> &'a mut crate::W<REG> {
460 self.variant(CLK48SEL::Pllsai1)
461 }
462 #[inline(always)]
464 pub fn pll(self) -> &'a mut crate::W<REG> {
465 self.variant(CLK48SEL::Pll)
466 }
467 #[inline(always)]
469 pub fn msi(self) -> &'a mut crate::W<REG> {
470 self.variant(CLK48SEL::Msi)
471 }
472}
473#[cfg_attr(feature = "defmt", derive(defmt::Format))]
477#[derive(Clone, Copy, Debug, PartialEq, Eq)]
478#[repr(u8)]
479pub enum ADCSEL {
480 NoClock = 0,
482 Pllsai1 = 1,
484 Pllsai2 = 2,
486 Sysclk = 3,
488}
489impl From<ADCSEL> for u8 {
490 #[inline(always)]
491 fn from(variant: ADCSEL) -> Self {
492 variant as _
493 }
494}
495impl crate::FieldSpec for ADCSEL {
496 type Ux = u8;
497}
498impl crate::IsEnum for ADCSEL {}
499pub type ADCSEL_R = crate::FieldReader<ADCSEL>;
501impl ADCSEL_R {
502 #[inline(always)]
504 pub const fn variant(&self) -> ADCSEL {
505 match self.bits {
506 0 => ADCSEL::NoClock,
507 1 => ADCSEL::Pllsai1,
508 2 => ADCSEL::Pllsai2,
509 3 => ADCSEL::Sysclk,
510 _ => unreachable!(),
511 }
512 }
513 #[inline(always)]
515 pub fn is_no_clock(&self) -> bool {
516 *self == ADCSEL::NoClock
517 }
518 #[inline(always)]
520 pub fn is_pllsai1(&self) -> bool {
521 *self == ADCSEL::Pllsai1
522 }
523 #[inline(always)]
525 pub fn is_pllsai2(&self) -> bool {
526 *self == ADCSEL::Pllsai2
527 }
528 #[inline(always)]
530 pub fn is_sysclk(&self) -> bool {
531 *self == ADCSEL::Sysclk
532 }
533}
534pub type ADCSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ADCSEL, crate::Safe>;
536impl<'a, REG> ADCSEL_W<'a, REG>
537where
538 REG: crate::Writable + crate::RegisterSpec,
539 REG::Ux: From<u8>,
540{
541 #[inline(always)]
543 pub fn no_clock(self) -> &'a mut crate::W<REG> {
544 self.variant(ADCSEL::NoClock)
545 }
546 #[inline(always)]
548 pub fn pllsai1(self) -> &'a mut crate::W<REG> {
549 self.variant(ADCSEL::Pllsai1)
550 }
551 #[inline(always)]
553 pub fn pllsai2(self) -> &'a mut crate::W<REG> {
554 self.variant(ADCSEL::Pllsai2)
555 }
556 #[inline(always)]
558 pub fn sysclk(self) -> &'a mut crate::W<REG> {
559 self.variant(ADCSEL::Sysclk)
560 }
561}
562pub type SWPMI1SEL_R = crate::BitReader;
564pub type SWPMI1SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
566pub type DFSDMSEL_R = crate::BitReader;
568pub type DFSDMSEL_W<'a, REG> = crate::BitWriter<'a, REG>;
570impl R {
571 #[inline(always)]
573 pub fn usart1sel(&self) -> USART1SEL_R {
574 USART1SEL_R::new((self.bits & 3) as u8)
575 }
576 #[inline(always)]
578 pub fn usart2sel(&self) -> USART2SEL_R {
579 USART2SEL_R::new(((self.bits >> 2) & 3) as u8)
580 }
581 #[inline(always)]
583 pub fn usart3sel(&self) -> USART3SEL_R {
584 USART3SEL_R::new(((self.bits >> 4) & 3) as u8)
585 }
586 #[inline(always)]
588 pub fn uart4sel(&self) -> UART4SEL_R {
589 UART4SEL_R::new(((self.bits >> 6) & 3) as u8)
590 }
591 #[inline(always)]
593 pub fn uart5sel(&self) -> UART5SEL_R {
594 UART5SEL_R::new(((self.bits >> 8) & 3) as u8)
595 }
596 #[inline(always)]
598 pub fn lpuart1sel(&self) -> LPUART1SEL_R {
599 LPUART1SEL_R::new(((self.bits >> 10) & 3) as u8)
600 }
601 #[inline(always)]
603 pub fn i2c1sel(&self) -> I2C1SEL_R {
604 I2C1SEL_R::new(((self.bits >> 12) & 3) as u8)
605 }
606 #[inline(always)]
608 pub fn i2c2sel(&self) -> I2C2SEL_R {
609 I2C2SEL_R::new(((self.bits >> 14) & 3) as u8)
610 }
611 #[inline(always)]
613 pub fn i2c3sel(&self) -> I2C3SEL_R {
614 I2C3SEL_R::new(((self.bits >> 16) & 3) as u8)
615 }
616 #[inline(always)]
618 pub fn lptim1sel(&self) -> LPTIM1SEL_R {
619 LPTIM1SEL_R::new(((self.bits >> 18) & 3) as u8)
620 }
621 #[inline(always)]
623 pub fn lptim2sel(&self) -> LPTIM2SEL_R {
624 LPTIM2SEL_R::new(((self.bits >> 20) & 3) as u8)
625 }
626 #[inline(always)]
628 pub fn sai1sel(&self) -> SAI1SEL_R {
629 SAI1SEL_R::new(((self.bits >> 22) & 3) as u8)
630 }
631 #[inline(always)]
633 pub fn sai2sel(&self) -> SAI2SEL_R {
634 SAI2SEL_R::new(((self.bits >> 24) & 3) as u8)
635 }
636 #[inline(always)]
638 pub fn clk48sel(&self) -> CLK48SEL_R {
639 CLK48SEL_R::new(((self.bits >> 26) & 3) as u8)
640 }
641 #[inline(always)]
643 pub fn adcsel(&self) -> ADCSEL_R {
644 ADCSEL_R::new(((self.bits >> 28) & 3) as u8)
645 }
646 #[inline(always)]
648 pub fn swpmi1sel(&self) -> SWPMI1SEL_R {
649 SWPMI1SEL_R::new(((self.bits >> 30) & 1) != 0)
650 }
651 #[inline(always)]
653 pub fn dfsdmsel(&self) -> DFSDMSEL_R {
654 DFSDMSEL_R::new(((self.bits >> 31) & 1) != 0)
655 }
656}
657impl core::fmt::Debug for R {
658 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
659 f.debug_struct("CCIPR")
660 .field("dfsdmsel", &self.dfsdmsel())
661 .field("swpmi1sel", &self.swpmi1sel())
662 .field("adcsel", &self.adcsel())
663 .field("clk48sel", &self.clk48sel())
664 .field("sai2sel", &self.sai2sel())
665 .field("sai1sel", &self.sai1sel())
666 .field("lptim1sel", &self.lptim1sel())
667 .field("lptim2sel", &self.lptim2sel())
668 .field("i2c1sel", &self.i2c1sel())
669 .field("i2c3sel", &self.i2c3sel())
670 .field("i2c2sel", &self.i2c2sel())
671 .field("lpuart1sel", &self.lpuart1sel())
672 .field("uart5sel", &self.uart5sel())
673 .field("uart4sel", &self.uart4sel())
674 .field("usart1sel", &self.usart1sel())
675 .field("usart3sel", &self.usart3sel())
676 .field("usart2sel", &self.usart2sel())
677 .finish()
678 }
679}
680impl W {
681 #[inline(always)]
683 pub fn usart1sel(&mut self) -> USART1SEL_W<CCIPRrs> {
684 USART1SEL_W::new(self, 0)
685 }
686 #[inline(always)]
688 pub fn usart2sel(&mut self) -> USART2SEL_W<CCIPRrs> {
689 USART2SEL_W::new(self, 2)
690 }
691 #[inline(always)]
693 pub fn usart3sel(&mut self) -> USART3SEL_W<CCIPRrs> {
694 USART3SEL_W::new(self, 4)
695 }
696 #[inline(always)]
698 pub fn uart4sel(&mut self) -> UART4SEL_W<CCIPRrs> {
699 UART4SEL_W::new(self, 6)
700 }
701 #[inline(always)]
703 pub fn uart5sel(&mut self) -> UART5SEL_W<CCIPRrs> {
704 UART5SEL_W::new(self, 8)
705 }
706 #[inline(always)]
708 pub fn lpuart1sel(&mut self) -> LPUART1SEL_W<CCIPRrs> {
709 LPUART1SEL_W::new(self, 10)
710 }
711 #[inline(always)]
713 pub fn i2c1sel(&mut self) -> I2C1SEL_W<CCIPRrs> {
714 I2C1SEL_W::new(self, 12)
715 }
716 #[inline(always)]
718 pub fn i2c2sel(&mut self) -> I2C2SEL_W<CCIPRrs> {
719 I2C2SEL_W::new(self, 14)
720 }
721 #[inline(always)]
723 pub fn i2c3sel(&mut self) -> I2C3SEL_W<CCIPRrs> {
724 I2C3SEL_W::new(self, 16)
725 }
726 #[inline(always)]
728 pub fn lptim1sel(&mut self) -> LPTIM1SEL_W<CCIPRrs> {
729 LPTIM1SEL_W::new(self, 18)
730 }
731 #[inline(always)]
733 pub fn lptim2sel(&mut self) -> LPTIM2SEL_W<CCIPRrs> {
734 LPTIM2SEL_W::new(self, 20)
735 }
736 #[inline(always)]
738 pub fn sai1sel(&mut self) -> SAI1SEL_W<CCIPRrs> {
739 SAI1SEL_W::new(self, 22)
740 }
741 #[inline(always)]
743 pub fn sai2sel(&mut self) -> SAI2SEL_W<CCIPRrs> {
744 SAI2SEL_W::new(self, 24)
745 }
746 #[inline(always)]
748 pub fn clk48sel(&mut self) -> CLK48SEL_W<CCIPRrs> {
749 CLK48SEL_W::new(self, 26)
750 }
751 #[inline(always)]
753 pub fn adcsel(&mut self) -> ADCSEL_W<CCIPRrs> {
754 ADCSEL_W::new(self, 28)
755 }
756 #[inline(always)]
758 pub fn swpmi1sel(&mut self) -> SWPMI1SEL_W<CCIPRrs> {
759 SWPMI1SEL_W::new(self, 30)
760 }
761 #[inline(always)]
763 pub fn dfsdmsel(&mut self) -> DFSDMSEL_W<CCIPRrs> {
764 DFSDMSEL_W::new(self, 31)
765 }
766}
767pub struct CCIPRrs;
773impl crate::RegisterSpec for CCIPRrs {
774 type Ux = u32;
775}
776impl crate::Readable for CCIPRrs {}
778impl crate::Writable for CCIPRrs {
780 type Safety = crate::Unsafe;
781}
782impl crate::Resettable for CCIPRrs {}