stm32wb_pac/tim1/
ccmr2_output.rs1#[doc = "Reader of register CCMR2_Output"]
2pub type R = crate::R<u32, super::CCMR2_OUTPUT>;
3#[doc = "Writer for register CCMR2_Output"]
4pub type W = crate::W<u32, super::CCMR2_OUTPUT>;
5#[doc = "Register CCMR2_Output `reset()`'s with value 0"]
6impl crate::ResetValue for super::CCMR2_OUTPUT {
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 `OC3FE`"]
28pub type OC3FE_R = crate::R<bool, bool>;
29#[doc = "Write proxy for field `OC3FE`"]
30pub struct OC3FE_W<'a> {
31 w: &'a mut W,
32}
33impl<'a> OC3FE_W<'a> {
34 #[doc = r"Sets the field bit"]
35 #[inline(always)]
36 pub fn set_bit(self) -> &'a mut W {
37 self.bit(true)
38 }
39 #[doc = r"Clears the field bit"]
40 #[inline(always)]
41 pub fn clear_bit(self) -> &'a mut W {
42 self.bit(false)
43 }
44 #[doc = r"Writes raw bits to the field"]
45 #[inline(always)]
46 pub fn bit(self, value: bool) -> &'a mut W {
47 self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
48 self.w
49 }
50}
51#[doc = "Reader of field `OC3PE`"]
52pub type OC3PE_R = crate::R<bool, bool>;
53#[doc = "Write proxy for field `OC3PE`"]
54pub struct OC3PE_W<'a> {
55 w: &'a mut W,
56}
57impl<'a> OC3PE_W<'a> {
58 #[doc = r"Sets the field bit"]
59 #[inline(always)]
60 pub fn set_bit(self) -> &'a mut W {
61 self.bit(true)
62 }
63 #[doc = r"Clears the field bit"]
64 #[inline(always)]
65 pub fn clear_bit(self) -> &'a mut W {
66 self.bit(false)
67 }
68 #[doc = r"Writes raw bits to the field"]
69 #[inline(always)]
70 pub fn bit(self, value: bool) -> &'a mut W {
71 self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
72 self.w
73 }
74}
75#[doc = "Reader of field `OC3M`"]
76pub type OC3M_R = crate::R<u8, u8>;
77#[doc = "Write proxy for field `OC3M`"]
78pub struct OC3M_W<'a> {
79 w: &'a mut W,
80}
81impl<'a> OC3M_W<'a> {
82 #[doc = r"Writes raw bits to the field"]
83 #[inline(always)]
84 pub unsafe fn bits(self, value: u8) -> &'a mut W {
85 self.w.bits = (self.w.bits & !(0x07 << 4)) | (((value as u32) & 0x07) << 4);
86 self.w
87 }
88}
89#[doc = "Reader of field `OC3CE`"]
90pub type OC3CE_R = crate::R<bool, bool>;
91#[doc = "Write proxy for field `OC3CE`"]
92pub struct OC3CE_W<'a> {
93 w: &'a mut W,
94}
95impl<'a> OC3CE_W<'a> {
96 #[doc = r"Sets the field bit"]
97 #[inline(always)]
98 pub fn set_bit(self) -> &'a mut W {
99 self.bit(true)
100 }
101 #[doc = r"Clears the field bit"]
102 #[inline(always)]
103 pub fn clear_bit(self) -> &'a mut W {
104 self.bit(false)
105 }
106 #[doc = r"Writes raw bits to the field"]
107 #[inline(always)]
108 pub fn bit(self, value: bool) -> &'a mut W {
109 self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
110 self.w
111 }
112}
113#[doc = "Reader of field `CC4S`"]
114pub type CC4S_R = crate::R<u8, u8>;
115#[doc = "Write proxy for field `CC4S`"]
116pub struct CC4S_W<'a> {
117 w: &'a mut W,
118}
119impl<'a> CC4S_W<'a> {
120 #[doc = r"Writes raw bits to the field"]
121 #[inline(always)]
122 pub unsafe fn bits(self, value: u8) -> &'a mut W {
123 self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8);
124 self.w
125 }
126}
127#[doc = "Reader of field `OC4FE`"]
128pub type OC4FE_R = crate::R<bool, bool>;
129#[doc = "Write proxy for field `OC4FE`"]
130pub struct OC4FE_W<'a> {
131 w: &'a mut W,
132}
133impl<'a> OC4FE_W<'a> {
134 #[doc = r"Sets the field bit"]
135 #[inline(always)]
136 pub fn set_bit(self) -> &'a mut W {
137 self.bit(true)
138 }
139 #[doc = r"Clears the field bit"]
140 #[inline(always)]
141 pub fn clear_bit(self) -> &'a mut W {
142 self.bit(false)
143 }
144 #[doc = r"Writes raw bits to the field"]
145 #[inline(always)]
146 pub fn bit(self, value: bool) -> &'a mut W {
147 self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
148 self.w
149 }
150}
151#[doc = "Reader of field `OC4PE`"]
152pub type OC4PE_R = crate::R<bool, bool>;
153#[doc = "Write proxy for field `OC4PE`"]
154pub struct OC4PE_W<'a> {
155 w: &'a mut W,
156}
157impl<'a> OC4PE_W<'a> {
158 #[doc = r"Sets the field bit"]
159 #[inline(always)]
160 pub fn set_bit(self) -> &'a mut W {
161 self.bit(true)
162 }
163 #[doc = r"Clears the field bit"]
164 #[inline(always)]
165 pub fn clear_bit(self) -> &'a mut W {
166 self.bit(false)
167 }
168 #[doc = r"Writes raw bits to the field"]
169 #[inline(always)]
170 pub fn bit(self, value: bool) -> &'a mut W {
171 self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
172 self.w
173 }
174}
175#[doc = "Reader of field `OC4M`"]
176pub type OC4M_R = crate::R<u8, u8>;
177#[doc = "Write proxy for field `OC4M`"]
178pub struct OC4M_W<'a> {
179 w: &'a mut W,
180}
181impl<'a> OC4M_W<'a> {
182 #[doc = r"Writes raw bits to the field"]
183 #[inline(always)]
184 pub unsafe fn bits(self, value: u8) -> &'a mut W {
185 self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12);
186 self.w
187 }
188}
189#[doc = "Reader of field `OC4CE`"]
190pub type OC4CE_R = crate::R<bool, bool>;
191#[doc = "Write proxy for field `OC4CE`"]
192pub struct OC4CE_W<'a> {
193 w: &'a mut W,
194}
195impl<'a> OC4CE_W<'a> {
196 #[doc = r"Sets the field bit"]
197 #[inline(always)]
198 pub fn set_bit(self) -> &'a mut W {
199 self.bit(true)
200 }
201 #[doc = r"Clears the field bit"]
202 #[inline(always)]
203 pub fn clear_bit(self) -> &'a mut W {
204 self.bit(false)
205 }
206 #[doc = r"Writes raw bits to the field"]
207 #[inline(always)]
208 pub fn bit(self, value: bool) -> &'a mut W {
209 self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
210 self.w
211 }
212}
213#[doc = "Reader of field `OC3M_3`"]
214pub type OC3M_3_R = crate::R<bool, bool>;
215#[doc = "Write proxy for field `OC3M_3`"]
216pub struct OC3M_3_W<'a> {
217 w: &'a mut W,
218}
219impl<'a> OC3M_3_W<'a> {
220 #[doc = r"Sets the field bit"]
221 #[inline(always)]
222 pub fn set_bit(self) -> &'a mut W {
223 self.bit(true)
224 }
225 #[doc = r"Clears the field bit"]
226 #[inline(always)]
227 pub fn clear_bit(self) -> &'a mut W {
228 self.bit(false)
229 }
230 #[doc = r"Writes raw bits to the field"]
231 #[inline(always)]
232 pub fn bit(self, value: bool) -> &'a mut W {
233 self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
234 self.w
235 }
236}
237#[doc = "Reader of field `OC4M_3`"]
238pub type OC4M_3_R = crate::R<bool, bool>;
239#[doc = "Write proxy for field `OC4M_3`"]
240pub struct OC4M_3_W<'a> {
241 w: &'a mut W,
242}
243impl<'a> OC4M_3_W<'a> {
244 #[doc = r"Sets the field bit"]
245 #[inline(always)]
246 pub fn set_bit(self) -> &'a mut W {
247 self.bit(true)
248 }
249 #[doc = r"Clears the field bit"]
250 #[inline(always)]
251 pub fn clear_bit(self) -> &'a mut W {
252 self.bit(false)
253 }
254 #[doc = r"Writes raw bits to the field"]
255 #[inline(always)]
256 pub fn bit(self, value: bool) -> &'a mut W {
257 self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24);
258 self.w
259 }
260}
261impl R {
262 #[doc = "Bits 0:1 - Capture/Compare 3 selection"]
263 #[inline(always)]
264 pub fn cc3s(&self) -> CC3S_R {
265 CC3S_R::new((self.bits & 0x03) as u8)
266 }
267 #[doc = "Bit 2 - Output compare 3 fast enable"]
268 #[inline(always)]
269 pub fn oc3fe(&self) -> OC3FE_R {
270 OC3FE_R::new(((self.bits >> 2) & 0x01) != 0)
271 }
272 #[doc = "Bit 3 - Output compare 3 preload enable"]
273 #[inline(always)]
274 pub fn oc3pe(&self) -> OC3PE_R {
275 OC3PE_R::new(((self.bits >> 3) & 0x01) != 0)
276 }
277 #[doc = "Bits 4:6 - Output compare 3 mode"]
278 #[inline(always)]
279 pub fn oc3m(&self) -> OC3M_R {
280 OC3M_R::new(((self.bits >> 4) & 0x07) as u8)
281 }
282 #[doc = "Bit 7 - Output compare 3 clear enable"]
283 #[inline(always)]
284 pub fn oc3ce(&self) -> OC3CE_R {
285 OC3CE_R::new(((self.bits >> 7) & 0x01) != 0)
286 }
287 #[doc = "Bits 8:9 - Capture/Compare 4 selection"]
288 #[inline(always)]
289 pub fn cc4s(&self) -> CC4S_R {
290 CC4S_R::new(((self.bits >> 8) & 0x03) as u8)
291 }
292 #[doc = "Bit 10 - Output compare 4 fast enable"]
293 #[inline(always)]
294 pub fn oc4fe(&self) -> OC4FE_R {
295 OC4FE_R::new(((self.bits >> 10) & 0x01) != 0)
296 }
297 #[doc = "Bit 11 - Output compare 4 preload enable"]
298 #[inline(always)]
299 pub fn oc4pe(&self) -> OC4PE_R {
300 OC4PE_R::new(((self.bits >> 11) & 0x01) != 0)
301 }
302 #[doc = "Bits 12:14 - Output compare 4 mode"]
303 #[inline(always)]
304 pub fn oc4m(&self) -> OC4M_R {
305 OC4M_R::new(((self.bits >> 12) & 0x07) as u8)
306 }
307 #[doc = "Bit 15 - Output compare 4 clear enable"]
308 #[inline(always)]
309 pub fn oc4ce(&self) -> OC4CE_R {
310 OC4CE_R::new(((self.bits >> 15) & 0x01) != 0)
311 }
312 #[doc = "Bit 16 - Output Compare 3 mode - bit 3"]
313 #[inline(always)]
314 pub fn oc3m_3(&self) -> OC3M_3_R {
315 OC3M_3_R::new(((self.bits >> 16) & 0x01) != 0)
316 }
317 #[doc = "Bit 24 - Output Compare 4 mode - bit 3"]
318 #[inline(always)]
319 pub fn oc4m_3(&self) -> OC4M_3_R {
320 OC4M_3_R::new(((self.bits >> 24) & 0x01) != 0)
321 }
322}
323impl W {
324 #[doc = "Bits 0:1 - Capture/Compare 3 selection"]
325 #[inline(always)]
326 pub fn cc3s(&mut self) -> CC3S_W {
327 CC3S_W { w: self }
328 }
329 #[doc = "Bit 2 - Output compare 3 fast enable"]
330 #[inline(always)]
331 pub fn oc3fe(&mut self) -> OC3FE_W {
332 OC3FE_W { w: self }
333 }
334 #[doc = "Bit 3 - Output compare 3 preload enable"]
335 #[inline(always)]
336 pub fn oc3pe(&mut self) -> OC3PE_W {
337 OC3PE_W { w: self }
338 }
339 #[doc = "Bits 4:6 - Output compare 3 mode"]
340 #[inline(always)]
341 pub fn oc3m(&mut self) -> OC3M_W {
342 OC3M_W { w: self }
343 }
344 #[doc = "Bit 7 - Output compare 3 clear enable"]
345 #[inline(always)]
346 pub fn oc3ce(&mut self) -> OC3CE_W {
347 OC3CE_W { w: self }
348 }
349 #[doc = "Bits 8:9 - Capture/Compare 4 selection"]
350 #[inline(always)]
351 pub fn cc4s(&mut self) -> CC4S_W {
352 CC4S_W { w: self }
353 }
354 #[doc = "Bit 10 - Output compare 4 fast enable"]
355 #[inline(always)]
356 pub fn oc4fe(&mut self) -> OC4FE_W {
357 OC4FE_W { w: self }
358 }
359 #[doc = "Bit 11 - Output compare 4 preload enable"]
360 #[inline(always)]
361 pub fn oc4pe(&mut self) -> OC4PE_W {
362 OC4PE_W { w: self }
363 }
364 #[doc = "Bits 12:14 - Output compare 4 mode"]
365 #[inline(always)]
366 pub fn oc4m(&mut self) -> OC4M_W {
367 OC4M_W { w: self }
368 }
369 #[doc = "Bit 15 - Output compare 4 clear enable"]
370 #[inline(always)]
371 pub fn oc4ce(&mut self) -> OC4CE_W {
372 OC4CE_W { w: self }
373 }
374 #[doc = "Bit 16 - Output Compare 3 mode - bit 3"]
375 #[inline(always)]
376 pub fn oc3m_3(&mut self) -> OC3M_3_W {
377 OC3M_3_W { w: self }
378 }
379 #[doc = "Bit 24 - Output Compare 4 mode - bit 3"]
380 #[inline(always)]
381 pub fn oc4m_3(&mut self) -> OC4M_3_W {
382 OC4M_3_W { w: self }
383 }
384}