stm32wb_pac/tim1/
ccmr2_input.rs1#[doc = "Reader of register CCMR2_Input"]
2pub type R = crate::R<u32, super::CCMR2_INPUT>;
3#[doc = "Writer for register CCMR2_Input"]
4pub type W = crate::W<u32, super::CCMR2_INPUT>;
5#[doc = "Register CCMR2_Input `reset()`'s with value 0"]
6impl crate::ResetValue for super::CCMR2_INPUT {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Reader of field `CC3S`"]
14pub type CC3S_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `CC3S`"]
16pub struct CC3S_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> CC3S_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 & !0x03) | ((value as u32) & 0x03);
24 self.w
25 }
26}
27#[doc = "Reader of field `C3PSC`"]
28pub type C3PSC_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `C3PSC`"]
30pub struct C3PSC_W<'a> {
31 w: &'a mut W,
32}
33impl<'a> C3PSC_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 `IC3F`"]
42pub type IC3F_R = crate::R<u8, u8>;
43#[doc = "Write proxy for field `IC3F`"]
44pub struct IC3F_W<'a> {
45 w: &'a mut W,
46}
47impl<'a> IC3F_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 & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4);
52 self.w
53 }
54}
55#[doc = "Reader of field `CC4S`"]
56pub type CC4S_R = crate::R<u8, u8>;
57#[doc = "Write proxy for field `CC4S`"]
58pub struct CC4S_W<'a> {
59 w: &'a mut W,
60}
61impl<'a> CC4S_W<'a> {
62 #[doc = r"Writes raw bits to the field"]
63 #[inline(always)]
64 pub unsafe fn bits(self, value: u8) -> &'a mut W {
65 self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8);
66 self.w
67 }
68}
69#[doc = "Reader of field `IC4PSC`"]
70pub type IC4PSC_R = crate::R<u8, u8>;
71#[doc = "Write proxy for field `IC4PSC`"]
72pub struct IC4PSC_W<'a> {
73 w: &'a mut W,
74}
75impl<'a> IC4PSC_W<'a> {
76 #[doc = r"Writes raw bits to the field"]
77 #[inline(always)]
78 pub unsafe fn bits(self, value: u8) -> &'a mut W {
79 self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10);
80 self.w
81 }
82}
83#[doc = "Reader of field `IC4F`"]
84pub type IC4F_R = crate::R<u8, u8>;
85#[doc = "Write proxy for field `IC4F`"]
86pub struct IC4F_W<'a> {
87 w: &'a mut W,
88}
89impl<'a> IC4F_W<'a> {
90 #[doc = r"Writes raw bits to the field"]
91 #[inline(always)]
92 pub unsafe fn bits(self, value: u8) -> &'a mut W {
93 self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12);
94 self.w
95 }
96}
97impl R {
98 #[doc = "Bits 0:1 - Capture/Compare 3 selection"]
99 #[inline(always)]
100 pub fn cc3s(&self) -> CC3S_R {
101 CC3S_R::new((self.bits & 0x03) as u8)
102 }
103 #[doc = "Bits 2:3 - Input capture 3 prescaler"]
104 #[inline(always)]
105 pub fn c3psc(&self) -> C3PSC_R {
106 C3PSC_R::new(((self.bits >> 2) & 0x03) as u8)
107 }
108 #[doc = "Bits 4:7 - Input capture 3 filter"]
109 #[inline(always)]
110 pub fn ic3f(&self) -> IC3F_R {
111 IC3F_R::new(((self.bits >> 4) & 0x0f) as u8)
112 }
113 #[doc = "Bits 8:9 - Capture/Compare 4 selection"]
114 #[inline(always)]
115 pub fn cc4s(&self) -> CC4S_R {
116 CC4S_R::new(((self.bits >> 8) & 0x03) as u8)
117 }
118 #[doc = "Bits 10:11 - Input capture 4 prescaler"]
119 #[inline(always)]
120 pub fn ic4psc(&self) -> IC4PSC_R {
121 IC4PSC_R::new(((self.bits >> 10) & 0x03) as u8)
122 }
123 #[doc = "Bits 12:15 - Input capture 4 filter"]
124 #[inline(always)]
125 pub fn ic4f(&self) -> IC4F_R {
126 IC4F_R::new(((self.bits >> 12) & 0x0f) as u8)
127 }
128}
129impl W {
130 #[doc = "Bits 0:1 - Capture/Compare 3 selection"]
131 #[inline(always)]
132 pub fn cc3s(&mut self) -> CC3S_W {
133 CC3S_W { w: self }
134 }
135 #[doc = "Bits 2:3 - Input capture 3 prescaler"]
136 #[inline(always)]
137 pub fn c3psc(&mut self) -> C3PSC_W {
138 C3PSC_W { w: self }
139 }
140 #[doc = "Bits 4:7 - Input capture 3 filter"]
141 #[inline(always)]
142 pub fn ic3f(&mut self) -> IC3F_W {
143 IC3F_W { w: self }
144 }
145 #[doc = "Bits 8:9 - Capture/Compare 4 selection"]
146 #[inline(always)]
147 pub fn cc4s(&mut self) -> CC4S_W {
148 CC4S_W { w: self }
149 }
150 #[doc = "Bits 10:11 - Input capture 4 prescaler"]
151 #[inline(always)]
152 pub fn ic4psc(&mut self) -> IC4PSC_W {
153 IC4PSC_W { w: self }
154 }
155 #[doc = "Bits 12:15 - Input capture 4 filter"]
156 #[inline(always)]
157 pub fn ic4f(&mut self) -> IC4F_W {
158 IC4F_W { w: self }
159 }
160}