stm32wb_pac/tim2/
ccer.rs

1#[doc = "Reader of register CCER"]
2pub type R = crate::R<u32, super::CCER>;
3#[doc = "Writer for register CCER"]
4pub type W = crate::W<u32, super::CCER>;
5#[doc = "Register CCER `reset()`'s with value 0"]
6impl crate::ResetValue for super::CCER {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `CC4NP`"]
14pub type CC4NP_R = crate::R<bool, bool>;
15#[doc = "Write proxy for field `CC4NP`"]
16pub struct CC4NP_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> CC4NP_W<'a> {
20    #[doc = r"Sets the field bit"]
21    #[inline(always)]
22    pub fn set_bit(self) -> &'a mut W {
23        self.bit(true)
24    }
25    #[doc = r"Clears the field bit"]
26    #[inline(always)]
27    pub fn clear_bit(self) -> &'a mut W {
28        self.bit(false)
29    }
30    #[doc = r"Writes raw bits to the field"]
31    #[inline(always)]
32    pub fn bit(self, value: bool) -> &'a mut W {
33        self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
34        self.w
35    }
36}
37#[doc = "Reader of field `CC4P`"]
38pub type CC4P_R = crate::R<bool, bool>;
39#[doc = "Write proxy for field `CC4P`"]
40pub struct CC4P_W<'a> {
41    w: &'a mut W,
42}
43impl<'a> CC4P_W<'a> {
44    #[doc = r"Sets the field bit"]
45    #[inline(always)]
46    pub fn set_bit(self) -> &'a mut W {
47        self.bit(true)
48    }
49    #[doc = r"Clears the field bit"]
50    #[inline(always)]
51    pub fn clear_bit(self) -> &'a mut W {
52        self.bit(false)
53    }
54    #[doc = r"Writes raw bits to the field"]
55    #[inline(always)]
56    pub fn bit(self, value: bool) -> &'a mut W {
57        self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13);
58        self.w
59    }
60}
61#[doc = "Reader of field `CC4E`"]
62pub type CC4E_R = crate::R<bool, bool>;
63#[doc = "Write proxy for field `CC4E`"]
64pub struct CC4E_W<'a> {
65    w: &'a mut W,
66}
67impl<'a> CC4E_W<'a> {
68    #[doc = r"Sets the field bit"]
69    #[inline(always)]
70    pub fn set_bit(self) -> &'a mut W {
71        self.bit(true)
72    }
73    #[doc = r"Clears the field bit"]
74    #[inline(always)]
75    pub fn clear_bit(self) -> &'a mut W {
76        self.bit(false)
77    }
78    #[doc = r"Writes raw bits to the field"]
79    #[inline(always)]
80    pub fn bit(self, value: bool) -> &'a mut W {
81        self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
82        self.w
83    }
84}
85#[doc = "Reader of field `CC3NP`"]
86pub type CC3NP_R = crate::R<bool, bool>;
87#[doc = "Write proxy for field `CC3NP`"]
88pub struct CC3NP_W<'a> {
89    w: &'a mut W,
90}
91impl<'a> CC3NP_W<'a> {
92    #[doc = r"Sets the field bit"]
93    #[inline(always)]
94    pub fn set_bit(self) -> &'a mut W {
95        self.bit(true)
96    }
97    #[doc = r"Clears the field bit"]
98    #[inline(always)]
99    pub fn clear_bit(self) -> &'a mut W {
100        self.bit(false)
101    }
102    #[doc = r"Writes raw bits to the field"]
103    #[inline(always)]
104    pub fn bit(self, value: bool) -> &'a mut W {
105        self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
106        self.w
107    }
108}
109#[doc = "Reader of field `CC3P`"]
110pub type CC3P_R = crate::R<bool, bool>;
111#[doc = "Write proxy for field `CC3P`"]
112pub struct CC3P_W<'a> {
113    w: &'a mut W,
114}
115impl<'a> CC3P_W<'a> {
116    #[doc = r"Sets the field bit"]
117    #[inline(always)]
118    pub fn set_bit(self) -> &'a mut W {
119        self.bit(true)
120    }
121    #[doc = r"Clears the field bit"]
122    #[inline(always)]
123    pub fn clear_bit(self) -> &'a mut W {
124        self.bit(false)
125    }
126    #[doc = r"Writes raw bits to the field"]
127    #[inline(always)]
128    pub fn bit(self, value: bool) -> &'a mut W {
129        self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
130        self.w
131    }
132}
133#[doc = "Reader of field `CC3E`"]
134pub type CC3E_R = crate::R<bool, bool>;
135#[doc = "Write proxy for field `CC3E`"]
136pub struct CC3E_W<'a> {
137    w: &'a mut W,
138}
139impl<'a> CC3E_W<'a> {
140    #[doc = r"Sets the field bit"]
141    #[inline(always)]
142    pub fn set_bit(self) -> &'a mut W {
143        self.bit(true)
144    }
145    #[doc = r"Clears the field bit"]
146    #[inline(always)]
147    pub fn clear_bit(self) -> &'a mut W {
148        self.bit(false)
149    }
150    #[doc = r"Writes raw bits to the field"]
151    #[inline(always)]
152    pub fn bit(self, value: bool) -> &'a mut W {
153        self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
154        self.w
155    }
156}
157#[doc = "Reader of field `CC2NP`"]
158pub type CC2NP_R = crate::R<bool, bool>;
159#[doc = "Write proxy for field `CC2NP`"]
160pub struct CC2NP_W<'a> {
161    w: &'a mut W,
162}
163impl<'a> CC2NP_W<'a> {
164    #[doc = r"Sets the field bit"]
165    #[inline(always)]
166    pub fn set_bit(self) -> &'a mut W {
167        self.bit(true)
168    }
169    #[doc = r"Clears the field bit"]
170    #[inline(always)]
171    pub fn clear_bit(self) -> &'a mut W {
172        self.bit(false)
173    }
174    #[doc = r"Writes raw bits to the field"]
175    #[inline(always)]
176    pub fn bit(self, value: bool) -> &'a mut W {
177        self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
178        self.w
179    }
180}
181#[doc = "Reader of field `CC2P`"]
182pub type CC2P_R = crate::R<bool, bool>;
183#[doc = "Write proxy for field `CC2P`"]
184pub struct CC2P_W<'a> {
185    w: &'a mut W,
186}
187impl<'a> CC2P_W<'a> {
188    #[doc = r"Sets the field bit"]
189    #[inline(always)]
190    pub fn set_bit(self) -> &'a mut W {
191        self.bit(true)
192    }
193    #[doc = r"Clears the field bit"]
194    #[inline(always)]
195    pub fn clear_bit(self) -> &'a mut W {
196        self.bit(false)
197    }
198    #[doc = r"Writes raw bits to the field"]
199    #[inline(always)]
200    pub fn bit(self, value: bool) -> &'a mut W {
201        self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
202        self.w
203    }
204}
205#[doc = "Reader of field `CC2E`"]
206pub type CC2E_R = crate::R<bool, bool>;
207#[doc = "Write proxy for field `CC2E`"]
208pub struct CC2E_W<'a> {
209    w: &'a mut W,
210}
211impl<'a> CC2E_W<'a> {
212    #[doc = r"Sets the field bit"]
213    #[inline(always)]
214    pub fn set_bit(self) -> &'a mut W {
215        self.bit(true)
216    }
217    #[doc = r"Clears the field bit"]
218    #[inline(always)]
219    pub fn clear_bit(self) -> &'a mut W {
220        self.bit(false)
221    }
222    #[doc = r"Writes raw bits to the field"]
223    #[inline(always)]
224    pub fn bit(self, value: bool) -> &'a mut W {
225        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
226        self.w
227    }
228}
229#[doc = "Reader of field `CC1NP`"]
230pub type CC1NP_R = crate::R<bool, bool>;
231#[doc = "Write proxy for field `CC1NP`"]
232pub struct CC1NP_W<'a> {
233    w: &'a mut W,
234}
235impl<'a> CC1NP_W<'a> {
236    #[doc = r"Sets the field bit"]
237    #[inline(always)]
238    pub fn set_bit(self) -> &'a mut W {
239        self.bit(true)
240    }
241    #[doc = r"Clears the field bit"]
242    #[inline(always)]
243    pub fn clear_bit(self) -> &'a mut W {
244        self.bit(false)
245    }
246    #[doc = r"Writes raw bits to the field"]
247    #[inline(always)]
248    pub fn bit(self, value: bool) -> &'a mut W {
249        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
250        self.w
251    }
252}
253#[doc = "Reader of field `CC1P`"]
254pub type CC1P_R = crate::R<bool, bool>;
255#[doc = "Write proxy for field `CC1P`"]
256pub struct CC1P_W<'a> {
257    w: &'a mut W,
258}
259impl<'a> CC1P_W<'a> {
260    #[doc = r"Sets the field bit"]
261    #[inline(always)]
262    pub fn set_bit(self) -> &'a mut W {
263        self.bit(true)
264    }
265    #[doc = r"Clears the field bit"]
266    #[inline(always)]
267    pub fn clear_bit(self) -> &'a mut W {
268        self.bit(false)
269    }
270    #[doc = r"Writes raw bits to the field"]
271    #[inline(always)]
272    pub fn bit(self, value: bool) -> &'a mut W {
273        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
274        self.w
275    }
276}
277#[doc = "Reader of field `CC1E`"]
278pub type CC1E_R = crate::R<bool, bool>;
279#[doc = "Write proxy for field `CC1E`"]
280pub struct CC1E_W<'a> {
281    w: &'a mut W,
282}
283impl<'a> CC1E_W<'a> {
284    #[doc = r"Sets the field bit"]
285    #[inline(always)]
286    pub fn set_bit(self) -> &'a mut W {
287        self.bit(true)
288    }
289    #[doc = r"Clears the field bit"]
290    #[inline(always)]
291    pub fn clear_bit(self) -> &'a mut W {
292        self.bit(false)
293    }
294    #[doc = r"Writes raw bits to the field"]
295    #[inline(always)]
296    pub fn bit(self, value: bool) -> &'a mut W {
297        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
298        self.w
299    }
300}
301impl R {
302    #[doc = "Bit 15 - Capture/Compare 4 output Polarity"]
303    #[inline(always)]
304    pub fn cc4np(&self) -> CC4NP_R {
305        CC4NP_R::new(((self.bits >> 15) & 0x01) != 0)
306    }
307    #[doc = "Bit 13 - Capture/Compare 3 output Polarity"]
308    #[inline(always)]
309    pub fn cc4p(&self) -> CC4P_R {
310        CC4P_R::new(((self.bits >> 13) & 0x01) != 0)
311    }
312    #[doc = "Bit 12 - Capture/Compare 4 output enable"]
313    #[inline(always)]
314    pub fn cc4e(&self) -> CC4E_R {
315        CC4E_R::new(((self.bits >> 12) & 0x01) != 0)
316    }
317    #[doc = "Bit 11 - Capture/Compare 3 output Polarity"]
318    #[inline(always)]
319    pub fn cc3np(&self) -> CC3NP_R {
320        CC3NP_R::new(((self.bits >> 11) & 0x01) != 0)
321    }
322    #[doc = "Bit 9 - Capture/Compare 3 output Polarity"]
323    #[inline(always)]
324    pub fn cc3p(&self) -> CC3P_R {
325        CC3P_R::new(((self.bits >> 9) & 0x01) != 0)
326    }
327    #[doc = "Bit 8 - Capture/Compare 3 output enable"]
328    #[inline(always)]
329    pub fn cc3e(&self) -> CC3E_R {
330        CC3E_R::new(((self.bits >> 8) & 0x01) != 0)
331    }
332    #[doc = "Bit 7 - Capture/Compare 2 output Polarity"]
333    #[inline(always)]
334    pub fn cc2np(&self) -> CC2NP_R {
335        CC2NP_R::new(((self.bits >> 7) & 0x01) != 0)
336    }
337    #[doc = "Bit 5 - Capture/Compare 2 output Polarity"]
338    #[inline(always)]
339    pub fn cc2p(&self) -> CC2P_R {
340        CC2P_R::new(((self.bits >> 5) & 0x01) != 0)
341    }
342    #[doc = "Bit 4 - Capture/Compare 2 output enable"]
343    #[inline(always)]
344    pub fn cc2e(&self) -> CC2E_R {
345        CC2E_R::new(((self.bits >> 4) & 0x01) != 0)
346    }
347    #[doc = "Bit 3 - Capture/Compare 1 output Polarity"]
348    #[inline(always)]
349    pub fn cc1np(&self) -> CC1NP_R {
350        CC1NP_R::new(((self.bits >> 3) & 0x01) != 0)
351    }
352    #[doc = "Bit 1 - Capture/Compare 1 output Polarity"]
353    #[inline(always)]
354    pub fn cc1p(&self) -> CC1P_R {
355        CC1P_R::new(((self.bits >> 1) & 0x01) != 0)
356    }
357    #[doc = "Bit 0 - Capture/Compare 1 output enable"]
358    #[inline(always)]
359    pub fn cc1e(&self) -> CC1E_R {
360        CC1E_R::new((self.bits & 0x01) != 0)
361    }
362}
363impl W {
364    #[doc = "Bit 15 - Capture/Compare 4 output Polarity"]
365    #[inline(always)]
366    pub fn cc4np(&mut self) -> CC4NP_W {
367        CC4NP_W { w: self }
368    }
369    #[doc = "Bit 13 - Capture/Compare 3 output Polarity"]
370    #[inline(always)]
371    pub fn cc4p(&mut self) -> CC4P_W {
372        CC4P_W { w: self }
373    }
374    #[doc = "Bit 12 - Capture/Compare 4 output enable"]
375    #[inline(always)]
376    pub fn cc4e(&mut self) -> CC4E_W {
377        CC4E_W { w: self }
378    }
379    #[doc = "Bit 11 - Capture/Compare 3 output Polarity"]
380    #[inline(always)]
381    pub fn cc3np(&mut self) -> CC3NP_W {
382        CC3NP_W { w: self }
383    }
384    #[doc = "Bit 9 - Capture/Compare 3 output Polarity"]
385    #[inline(always)]
386    pub fn cc3p(&mut self) -> CC3P_W {
387        CC3P_W { w: self }
388    }
389    #[doc = "Bit 8 - Capture/Compare 3 output enable"]
390    #[inline(always)]
391    pub fn cc3e(&mut self) -> CC3E_W {
392        CC3E_W { w: self }
393    }
394    #[doc = "Bit 7 - Capture/Compare 2 output Polarity"]
395    #[inline(always)]
396    pub fn cc2np(&mut self) -> CC2NP_W {
397        CC2NP_W { w: self }
398    }
399    #[doc = "Bit 5 - Capture/Compare 2 output Polarity"]
400    #[inline(always)]
401    pub fn cc2p(&mut self) -> CC2P_W {
402        CC2P_W { w: self }
403    }
404    #[doc = "Bit 4 - Capture/Compare 2 output enable"]
405    #[inline(always)]
406    pub fn cc2e(&mut self) -> CC2E_W {
407        CC2E_W { w: self }
408    }
409    #[doc = "Bit 3 - Capture/Compare 1 output Polarity"]
410    #[inline(always)]
411    pub fn cc1np(&mut self) -> CC1NP_W {
412        CC1NP_W { w: self }
413    }
414    #[doc = "Bit 1 - Capture/Compare 1 output Polarity"]
415    #[inline(always)]
416    pub fn cc1p(&mut self) -> CC1P_W {
417        CC1P_W { w: self }
418    }
419    #[doc = "Bit 0 - Capture/Compare 1 output enable"]
420    #[inline(always)]
421    pub fn cc1e(&mut self) -> CC1E_W {
422        CC1E_W { w: self }
423    }
424}