stm32wb_pac/tim16/
ccmr1_input.rs1#[doc = "Reader of register CCMR1_Input"]
2pub type R = crate::R<u32, super::CCMR1_INPUT>;
3#[doc = "Writer for register CCMR1_Input"]
4pub type W = crate::W<u32, super::CCMR1_INPUT>;
5#[doc = "Register CCMR1_Input `reset()`'s with value 0"]
6impl crate::ResetValue for super::CCMR1_INPUT {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Reader of field `IC1F`"]
14pub type IC1F_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `IC1F`"]
16pub struct IC1F_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> IC1F_W<'a> {
20 #[doc = r"Writes raw bits to the field"]
21 #[inline(always)]
22 pub unsafe fn bits(self, value: u8) -> &'a mut W {
23 self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4);
24 self.w
25 }
26}
27#[doc = "Reader of field `IC1PSC`"]
28pub type IC1PSC_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `IC1PSC`"]
30pub struct IC1PSC_W<'a> {
31 w: &'a mut W,
32}
33impl<'a> IC1PSC_W<'a> {
34 #[doc = r"Writes raw bits to the field"]
35 #[inline(always)]
36 pub unsafe fn bits(self, value: u8) -> &'a mut W {
37 self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2);
38 self.w
39 }
40}
41#[doc = "Reader of field `CC1S`"]
42pub type CC1S_R = crate::R<u8, u8>;
43#[doc = "Write proxy for field `CC1S`"]
44pub struct CC1S_W<'a> {
45 w: &'a mut W,
46}
47impl<'a> CC1S_W<'a> {
48 #[doc = r"Writes raw bits to the field"]
49 #[inline(always)]
50 pub unsafe fn bits(self, value: u8) -> &'a mut W {
51 self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03);
52 self.w
53 }
54}
55impl R {
56 #[doc = "Bits 4:7 - Input capture 1 filter"]
57 #[inline(always)]
58 pub fn ic1f(&self) -> IC1F_R {
59 IC1F_R::new(((self.bits >> 4) & 0x0f) as u8)
60 }
61 #[doc = "Bits 2:3 - Input capture 1 prescaler"]
62 #[inline(always)]
63 pub fn ic1psc(&self) -> IC1PSC_R {
64 IC1PSC_R::new(((self.bits >> 2) & 0x03) as u8)
65 }
66 #[doc = "Bits 0:1 - Capture/Compare 1 selection"]
67 #[inline(always)]
68 pub fn cc1s(&self) -> CC1S_R {
69 CC1S_R::new((self.bits & 0x03) as u8)
70 }
71}
72impl W {
73 #[doc = "Bits 4:7 - Input capture 1 filter"]
74 #[inline(always)]
75 pub fn ic1f(&mut self) -> IC1F_W {
76 IC1F_W { w: self }
77 }
78 #[doc = "Bits 2:3 - Input capture 1 prescaler"]
79 #[inline(always)]
80 pub fn ic1psc(&mut self) -> IC1PSC_W {
81 IC1PSC_W { w: self }
82 }
83 #[doc = "Bits 0:1 - Capture/Compare 1 selection"]
84 #[inline(always)]
85 pub fn cc1s(&mut self) -> CC1S_W {
86 CC1S_W { w: self }
87 }
88}