lpc55_pac/ctimer0/
ccr.rs

1#[doc = "Register `CCR` reader"]
2pub struct R(crate::R<CCR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CCR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CCR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CCR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CCR` writer"]
17pub struct W(crate::W<CCR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CCR_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<CCR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CCR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `CAP0RE` reader - Rising edge of capture channel 0: a sequence of 0 then 1 causes CR0 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
38pub struct CAP0RE_R(crate::FieldReader<bool, bool>);
39impl CAP0RE_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: bool) -> Self {
42        CAP0RE_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for CAP0RE_R {
46    type Target = crate::FieldReader<bool, bool>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "Field `CAP0RE` writer - Rising edge of capture channel 0: a sequence of 0 then 1 causes CR0 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
53pub struct CAP0RE_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> CAP0RE_W<'a> {
57    #[doc = r"Sets the field bit"]
58    #[inline(always)]
59    pub fn set_bit(self) -> &'a mut W {
60        self.bit(true)
61    }
62    #[doc = r"Clears the field bit"]
63    #[inline(always)]
64    pub fn clear_bit(self) -> &'a mut W {
65        self.bit(false)
66    }
67    #[doc = r"Writes raw bits to the field"]
68    #[inline(always)]
69    pub fn bit(self, value: bool) -> &'a mut W {
70        self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
71        self.w
72    }
73}
74#[doc = "Field `CAP0FE` reader - Falling edge of capture channel 0: a sequence of 1 then 0 causes CR0 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
75pub struct CAP0FE_R(crate::FieldReader<bool, bool>);
76impl CAP0FE_R {
77    #[inline(always)]
78    pub(crate) fn new(bits: bool) -> Self {
79        CAP0FE_R(crate::FieldReader::new(bits))
80    }
81}
82impl core::ops::Deref for CAP0FE_R {
83    type Target = crate::FieldReader<bool, bool>;
84    #[inline(always)]
85    fn deref(&self) -> &Self::Target {
86        &self.0
87    }
88}
89#[doc = "Field `CAP0FE` writer - Falling edge of capture channel 0: a sequence of 1 then 0 causes CR0 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
90pub struct CAP0FE_W<'a> {
91    w: &'a mut W,
92}
93impl<'a> CAP0FE_W<'a> {
94    #[doc = r"Sets the field bit"]
95    #[inline(always)]
96    pub fn set_bit(self) -> &'a mut W {
97        self.bit(true)
98    }
99    #[doc = r"Clears the field bit"]
100    #[inline(always)]
101    pub fn clear_bit(self) -> &'a mut W {
102        self.bit(false)
103    }
104    #[doc = r"Writes raw bits to the field"]
105    #[inline(always)]
106    pub fn bit(self, value: bool) -> &'a mut W {
107        self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
108        self.w
109    }
110}
111#[doc = "Field `CAP0I` reader - Generate interrupt on channel 0 capture event: a CR0 load generates an interrupt."]
112pub struct CAP0I_R(crate::FieldReader<bool, bool>);
113impl CAP0I_R {
114    #[inline(always)]
115    pub(crate) fn new(bits: bool) -> Self {
116        CAP0I_R(crate::FieldReader::new(bits))
117    }
118}
119impl core::ops::Deref for CAP0I_R {
120    type Target = crate::FieldReader<bool, bool>;
121    #[inline(always)]
122    fn deref(&self) -> &Self::Target {
123        &self.0
124    }
125}
126#[doc = "Field `CAP0I` writer - Generate interrupt on channel 0 capture event: a CR0 load generates an interrupt."]
127pub struct CAP0I_W<'a> {
128    w: &'a mut W,
129}
130impl<'a> CAP0I_W<'a> {
131    #[doc = r"Sets the field bit"]
132    #[inline(always)]
133    pub fn set_bit(self) -> &'a mut W {
134        self.bit(true)
135    }
136    #[doc = r"Clears the field bit"]
137    #[inline(always)]
138    pub fn clear_bit(self) -> &'a mut W {
139        self.bit(false)
140    }
141    #[doc = r"Writes raw bits to the field"]
142    #[inline(always)]
143    pub fn bit(self, value: bool) -> &'a mut W {
144        self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
145        self.w
146    }
147}
148#[doc = "Field `CAP1RE` reader - Rising edge of capture channel 1: a sequence of 0 then 1 causes CR1 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
149pub struct CAP1RE_R(crate::FieldReader<bool, bool>);
150impl CAP1RE_R {
151    #[inline(always)]
152    pub(crate) fn new(bits: bool) -> Self {
153        CAP1RE_R(crate::FieldReader::new(bits))
154    }
155}
156impl core::ops::Deref for CAP1RE_R {
157    type Target = crate::FieldReader<bool, bool>;
158    #[inline(always)]
159    fn deref(&self) -> &Self::Target {
160        &self.0
161    }
162}
163#[doc = "Field `CAP1RE` writer - Rising edge of capture channel 1: a sequence of 0 then 1 causes CR1 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
164pub struct CAP1RE_W<'a> {
165    w: &'a mut W,
166}
167impl<'a> CAP1RE_W<'a> {
168    #[doc = r"Sets the field bit"]
169    #[inline(always)]
170    pub fn set_bit(self) -> &'a mut W {
171        self.bit(true)
172    }
173    #[doc = r"Clears the field bit"]
174    #[inline(always)]
175    pub fn clear_bit(self) -> &'a mut W {
176        self.bit(false)
177    }
178    #[doc = r"Writes raw bits to the field"]
179    #[inline(always)]
180    pub fn bit(self, value: bool) -> &'a mut W {
181        self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
182        self.w
183    }
184}
185#[doc = "Field `CAP1FE` reader - Falling edge of capture channel 1: a sequence of 1 then 0 causes CR1 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
186pub struct CAP1FE_R(crate::FieldReader<bool, bool>);
187impl CAP1FE_R {
188    #[inline(always)]
189    pub(crate) fn new(bits: bool) -> Self {
190        CAP1FE_R(crate::FieldReader::new(bits))
191    }
192}
193impl core::ops::Deref for CAP1FE_R {
194    type Target = crate::FieldReader<bool, bool>;
195    #[inline(always)]
196    fn deref(&self) -> &Self::Target {
197        &self.0
198    }
199}
200#[doc = "Field `CAP1FE` writer - Falling edge of capture channel 1: a sequence of 1 then 0 causes CR1 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
201pub struct CAP1FE_W<'a> {
202    w: &'a mut W,
203}
204impl<'a> CAP1FE_W<'a> {
205    #[doc = r"Sets the field bit"]
206    #[inline(always)]
207    pub fn set_bit(self) -> &'a mut W {
208        self.bit(true)
209    }
210    #[doc = r"Clears the field bit"]
211    #[inline(always)]
212    pub fn clear_bit(self) -> &'a mut W {
213        self.bit(false)
214    }
215    #[doc = r"Writes raw bits to the field"]
216    #[inline(always)]
217    pub fn bit(self, value: bool) -> &'a mut W {
218        self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
219        self.w
220    }
221}
222#[doc = "Field `CAP1I` reader - Generate interrupt on channel 1 capture event: a CR1 load generates an interrupt."]
223pub struct CAP1I_R(crate::FieldReader<bool, bool>);
224impl CAP1I_R {
225    #[inline(always)]
226    pub(crate) fn new(bits: bool) -> Self {
227        CAP1I_R(crate::FieldReader::new(bits))
228    }
229}
230impl core::ops::Deref for CAP1I_R {
231    type Target = crate::FieldReader<bool, bool>;
232    #[inline(always)]
233    fn deref(&self) -> &Self::Target {
234        &self.0
235    }
236}
237#[doc = "Field `CAP1I` writer - Generate interrupt on channel 1 capture event: a CR1 load generates an interrupt."]
238pub struct CAP1I_W<'a> {
239    w: &'a mut W,
240}
241impl<'a> CAP1I_W<'a> {
242    #[doc = r"Sets the field bit"]
243    #[inline(always)]
244    pub fn set_bit(self) -> &'a mut W {
245        self.bit(true)
246    }
247    #[doc = r"Clears the field bit"]
248    #[inline(always)]
249    pub fn clear_bit(self) -> &'a mut W {
250        self.bit(false)
251    }
252    #[doc = r"Writes raw bits to the field"]
253    #[inline(always)]
254    pub fn bit(self, value: bool) -> &'a mut W {
255        self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
256        self.w
257    }
258}
259#[doc = "Field `CAP2RE` reader - Rising edge of capture channel 2: a sequence of 0 then 1 causes CR2 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
260pub struct CAP2RE_R(crate::FieldReader<bool, bool>);
261impl CAP2RE_R {
262    #[inline(always)]
263    pub(crate) fn new(bits: bool) -> Self {
264        CAP2RE_R(crate::FieldReader::new(bits))
265    }
266}
267impl core::ops::Deref for CAP2RE_R {
268    type Target = crate::FieldReader<bool, bool>;
269    #[inline(always)]
270    fn deref(&self) -> &Self::Target {
271        &self.0
272    }
273}
274#[doc = "Field `CAP2RE` writer - Rising edge of capture channel 2: a sequence of 0 then 1 causes CR2 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
275pub struct CAP2RE_W<'a> {
276    w: &'a mut W,
277}
278impl<'a> CAP2RE_W<'a> {
279    #[doc = r"Sets the field bit"]
280    #[inline(always)]
281    pub fn set_bit(self) -> &'a mut W {
282        self.bit(true)
283    }
284    #[doc = r"Clears the field bit"]
285    #[inline(always)]
286    pub fn clear_bit(self) -> &'a mut W {
287        self.bit(false)
288    }
289    #[doc = r"Writes raw bits to the field"]
290    #[inline(always)]
291    pub fn bit(self, value: bool) -> &'a mut W {
292        self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
293        self.w
294    }
295}
296#[doc = "Field `CAP2FE` reader - Falling edge of capture channel 2: a sequence of 1 then 0 causes CR2 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
297pub struct CAP2FE_R(crate::FieldReader<bool, bool>);
298impl CAP2FE_R {
299    #[inline(always)]
300    pub(crate) fn new(bits: bool) -> Self {
301        CAP2FE_R(crate::FieldReader::new(bits))
302    }
303}
304impl core::ops::Deref for CAP2FE_R {
305    type Target = crate::FieldReader<bool, bool>;
306    #[inline(always)]
307    fn deref(&self) -> &Self::Target {
308        &self.0
309    }
310}
311#[doc = "Field `CAP2FE` writer - Falling edge of capture channel 2: a sequence of 1 then 0 causes CR2 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
312pub struct CAP2FE_W<'a> {
313    w: &'a mut W,
314}
315impl<'a> CAP2FE_W<'a> {
316    #[doc = r"Sets the field bit"]
317    #[inline(always)]
318    pub fn set_bit(self) -> &'a mut W {
319        self.bit(true)
320    }
321    #[doc = r"Clears the field bit"]
322    #[inline(always)]
323    pub fn clear_bit(self) -> &'a mut W {
324        self.bit(false)
325    }
326    #[doc = r"Writes raw bits to the field"]
327    #[inline(always)]
328    pub fn bit(self, value: bool) -> &'a mut W {
329        self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
330        self.w
331    }
332}
333#[doc = "Field `CAP2I` reader - Generate interrupt on channel 2 capture event: a CR2 load generates an interrupt."]
334pub struct CAP2I_R(crate::FieldReader<bool, bool>);
335impl CAP2I_R {
336    #[inline(always)]
337    pub(crate) fn new(bits: bool) -> Self {
338        CAP2I_R(crate::FieldReader::new(bits))
339    }
340}
341impl core::ops::Deref for CAP2I_R {
342    type Target = crate::FieldReader<bool, bool>;
343    #[inline(always)]
344    fn deref(&self) -> &Self::Target {
345        &self.0
346    }
347}
348#[doc = "Field `CAP2I` writer - Generate interrupt on channel 2 capture event: a CR2 load generates an interrupt."]
349pub struct CAP2I_W<'a> {
350    w: &'a mut W,
351}
352impl<'a> CAP2I_W<'a> {
353    #[doc = r"Sets the field bit"]
354    #[inline(always)]
355    pub fn set_bit(self) -> &'a mut W {
356        self.bit(true)
357    }
358    #[doc = r"Clears the field bit"]
359    #[inline(always)]
360    pub fn clear_bit(self) -> &'a mut W {
361        self.bit(false)
362    }
363    #[doc = r"Writes raw bits to the field"]
364    #[inline(always)]
365    pub fn bit(self, value: bool) -> &'a mut W {
366        self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
367        self.w
368    }
369}
370#[doc = "Field `CAP3RE` reader - Rising edge of capture channel 3: a sequence of 0 then 1 causes CR3 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
371pub struct CAP3RE_R(crate::FieldReader<bool, bool>);
372impl CAP3RE_R {
373    #[inline(always)]
374    pub(crate) fn new(bits: bool) -> Self {
375        CAP3RE_R(crate::FieldReader::new(bits))
376    }
377}
378impl core::ops::Deref for CAP3RE_R {
379    type Target = crate::FieldReader<bool, bool>;
380    #[inline(always)]
381    fn deref(&self) -> &Self::Target {
382        &self.0
383    }
384}
385#[doc = "Field `CAP3RE` writer - Rising edge of capture channel 3: a sequence of 0 then 1 causes CR3 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
386pub struct CAP3RE_W<'a> {
387    w: &'a mut W,
388}
389impl<'a> CAP3RE_W<'a> {
390    #[doc = r"Sets the field bit"]
391    #[inline(always)]
392    pub fn set_bit(self) -> &'a mut W {
393        self.bit(true)
394    }
395    #[doc = r"Clears the field bit"]
396    #[inline(always)]
397    pub fn clear_bit(self) -> &'a mut W {
398        self.bit(false)
399    }
400    #[doc = r"Writes raw bits to the field"]
401    #[inline(always)]
402    pub fn bit(self, value: bool) -> &'a mut W {
403        self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9);
404        self.w
405    }
406}
407#[doc = "Field `CAP3FE` reader - Falling edge of capture channel 3: a sequence of 1 then 0 causes CR3 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
408pub struct CAP3FE_R(crate::FieldReader<bool, bool>);
409impl CAP3FE_R {
410    #[inline(always)]
411    pub(crate) fn new(bits: bool) -> Self {
412        CAP3FE_R(crate::FieldReader::new(bits))
413    }
414}
415impl core::ops::Deref for CAP3FE_R {
416    type Target = crate::FieldReader<bool, bool>;
417    #[inline(always)]
418    fn deref(&self) -> &Self::Target {
419        &self.0
420    }
421}
422#[doc = "Field `CAP3FE` writer - Falling edge of capture channel 3: a sequence of 1 then 0 causes CR3 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
423pub struct CAP3FE_W<'a> {
424    w: &'a mut W,
425}
426impl<'a> CAP3FE_W<'a> {
427    #[doc = r"Sets the field bit"]
428    #[inline(always)]
429    pub fn set_bit(self) -> &'a mut W {
430        self.bit(true)
431    }
432    #[doc = r"Clears the field bit"]
433    #[inline(always)]
434    pub fn clear_bit(self) -> &'a mut W {
435        self.bit(false)
436    }
437    #[doc = r"Writes raw bits to the field"]
438    #[inline(always)]
439    pub fn bit(self, value: bool) -> &'a mut W {
440        self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10);
441        self.w
442    }
443}
444#[doc = "Field `CAP3I` reader - Generate interrupt on channel 3 capture event: a CR3 load generates an interrupt."]
445pub struct CAP3I_R(crate::FieldReader<bool, bool>);
446impl CAP3I_R {
447    #[inline(always)]
448    pub(crate) fn new(bits: bool) -> Self {
449        CAP3I_R(crate::FieldReader::new(bits))
450    }
451}
452impl core::ops::Deref for CAP3I_R {
453    type Target = crate::FieldReader<bool, bool>;
454    #[inline(always)]
455    fn deref(&self) -> &Self::Target {
456        &self.0
457    }
458}
459#[doc = "Field `CAP3I` writer - Generate interrupt on channel 3 capture event: a CR3 load generates an interrupt."]
460pub struct CAP3I_W<'a> {
461    w: &'a mut W,
462}
463impl<'a> CAP3I_W<'a> {
464    #[doc = r"Sets the field bit"]
465    #[inline(always)]
466    pub fn set_bit(self) -> &'a mut W {
467        self.bit(true)
468    }
469    #[doc = r"Clears the field bit"]
470    #[inline(always)]
471    pub fn clear_bit(self) -> &'a mut W {
472        self.bit(false)
473    }
474    #[doc = r"Writes raw bits to the field"]
475    #[inline(always)]
476    pub fn bit(self, value: bool) -> &'a mut W {
477        self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11);
478        self.w
479    }
480}
481impl R {
482    #[doc = "Bit 0 - Rising edge of capture channel 0: a sequence of 0 then 1 causes CR0 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
483    #[inline(always)]
484    pub fn cap0re(&self) -> CAP0RE_R {
485        CAP0RE_R::new((self.bits & 0x01) != 0)
486    }
487    #[doc = "Bit 1 - Falling edge of capture channel 0: a sequence of 1 then 0 causes CR0 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
488    #[inline(always)]
489    pub fn cap0fe(&self) -> CAP0FE_R {
490        CAP0FE_R::new(((self.bits >> 1) & 0x01) != 0)
491    }
492    #[doc = "Bit 2 - Generate interrupt on channel 0 capture event: a CR0 load generates an interrupt."]
493    #[inline(always)]
494    pub fn cap0i(&self) -> CAP0I_R {
495        CAP0I_R::new(((self.bits >> 2) & 0x01) != 0)
496    }
497    #[doc = "Bit 3 - Rising edge of capture channel 1: a sequence of 0 then 1 causes CR1 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
498    #[inline(always)]
499    pub fn cap1re(&self) -> CAP1RE_R {
500        CAP1RE_R::new(((self.bits >> 3) & 0x01) != 0)
501    }
502    #[doc = "Bit 4 - Falling edge of capture channel 1: a sequence of 1 then 0 causes CR1 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
503    #[inline(always)]
504    pub fn cap1fe(&self) -> CAP1FE_R {
505        CAP1FE_R::new(((self.bits >> 4) & 0x01) != 0)
506    }
507    #[doc = "Bit 5 - Generate interrupt on channel 1 capture event: a CR1 load generates an interrupt."]
508    #[inline(always)]
509    pub fn cap1i(&self) -> CAP1I_R {
510        CAP1I_R::new(((self.bits >> 5) & 0x01) != 0)
511    }
512    #[doc = "Bit 6 - Rising edge of capture channel 2: a sequence of 0 then 1 causes CR2 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
513    #[inline(always)]
514    pub fn cap2re(&self) -> CAP2RE_R {
515        CAP2RE_R::new(((self.bits >> 6) & 0x01) != 0)
516    }
517    #[doc = "Bit 7 - Falling edge of capture channel 2: a sequence of 1 then 0 causes CR2 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
518    #[inline(always)]
519    pub fn cap2fe(&self) -> CAP2FE_R {
520        CAP2FE_R::new(((self.bits >> 7) & 0x01) != 0)
521    }
522    #[doc = "Bit 8 - Generate interrupt on channel 2 capture event: a CR2 load generates an interrupt."]
523    #[inline(always)]
524    pub fn cap2i(&self) -> CAP2I_R {
525        CAP2I_R::new(((self.bits >> 8) & 0x01) != 0)
526    }
527    #[doc = "Bit 9 - Rising edge of capture channel 3: a sequence of 0 then 1 causes CR3 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
528    #[inline(always)]
529    pub fn cap3re(&self) -> CAP3RE_R {
530        CAP3RE_R::new(((self.bits >> 9) & 0x01) != 0)
531    }
532    #[doc = "Bit 10 - Falling edge of capture channel 3: a sequence of 1 then 0 causes CR3 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
533    #[inline(always)]
534    pub fn cap3fe(&self) -> CAP3FE_R {
535        CAP3FE_R::new(((self.bits >> 10) & 0x01) != 0)
536    }
537    #[doc = "Bit 11 - Generate interrupt on channel 3 capture event: a CR3 load generates an interrupt."]
538    #[inline(always)]
539    pub fn cap3i(&self) -> CAP3I_R {
540        CAP3I_R::new(((self.bits >> 11) & 0x01) != 0)
541    }
542}
543impl W {
544    #[doc = "Bit 0 - Rising edge of capture channel 0: a sequence of 0 then 1 causes CR0 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
545    #[inline(always)]
546    pub fn cap0re(&mut self) -> CAP0RE_W {
547        CAP0RE_W { w: self }
548    }
549    #[doc = "Bit 1 - Falling edge of capture channel 0: a sequence of 1 then 0 causes CR0 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
550    #[inline(always)]
551    pub fn cap0fe(&mut self) -> CAP0FE_W {
552        CAP0FE_W { w: self }
553    }
554    #[doc = "Bit 2 - Generate interrupt on channel 0 capture event: a CR0 load generates an interrupt."]
555    #[inline(always)]
556    pub fn cap0i(&mut self) -> CAP0I_W {
557        CAP0I_W { w: self }
558    }
559    #[doc = "Bit 3 - Rising edge of capture channel 1: a sequence of 0 then 1 causes CR1 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
560    #[inline(always)]
561    pub fn cap1re(&mut self) -> CAP1RE_W {
562        CAP1RE_W { w: self }
563    }
564    #[doc = "Bit 4 - Falling edge of capture channel 1: a sequence of 1 then 0 causes CR1 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
565    #[inline(always)]
566    pub fn cap1fe(&mut self) -> CAP1FE_W {
567        CAP1FE_W { w: self }
568    }
569    #[doc = "Bit 5 - Generate interrupt on channel 1 capture event: a CR1 load generates an interrupt."]
570    #[inline(always)]
571    pub fn cap1i(&mut self) -> CAP1I_W {
572        CAP1I_W { w: self }
573    }
574    #[doc = "Bit 6 - Rising edge of capture channel 2: a sequence of 0 then 1 causes CR2 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
575    #[inline(always)]
576    pub fn cap2re(&mut self) -> CAP2RE_W {
577        CAP2RE_W { w: self }
578    }
579    #[doc = "Bit 7 - Falling edge of capture channel 2: a sequence of 1 then 0 causes CR2 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
580    #[inline(always)]
581    pub fn cap2fe(&mut self) -> CAP2FE_W {
582        CAP2FE_W { w: self }
583    }
584    #[doc = "Bit 8 - Generate interrupt on channel 2 capture event: a CR2 load generates an interrupt."]
585    #[inline(always)]
586    pub fn cap2i(&mut self) -> CAP2I_W {
587        CAP2I_W { w: self }
588    }
589    #[doc = "Bit 9 - Rising edge of capture channel 3: a sequence of 0 then 1 causes CR3 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
590    #[inline(always)]
591    pub fn cap3re(&mut self) -> CAP3RE_W {
592        CAP3RE_W { w: self }
593    }
594    #[doc = "Bit 10 - Falling edge of capture channel 3: a sequence of 1 then 0 causes CR3 to be loaded with the contents of TC. 0 = disabled. 1 = enabled."]
595    #[inline(always)]
596    pub fn cap3fe(&mut self) -> CAP3FE_W {
597        CAP3FE_W { w: self }
598    }
599    #[doc = "Bit 11 - Generate interrupt on channel 3 capture event: a CR3 load generates an interrupt."]
600    #[inline(always)]
601    pub fn cap3i(&mut self) -> CAP3I_W {
602        CAP3I_W { w: self }
603    }
604    #[doc = "Writes raw bits to the register."]
605    #[inline(always)]
606    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
607        self.0.bits(bits);
608        self
609    }
610}
611#[doc = "Capture Control Register. The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ccr](index.html) module"]
612pub struct CCR_SPEC;
613impl crate::RegisterSpec for CCR_SPEC {
614    type Ux = u32;
615}
616#[doc = "`read()` method returns [ccr::R](R) reader structure"]
617impl crate::Readable for CCR_SPEC {
618    type Reader = R;
619}
620#[doc = "`write(|w| ..)` method takes [ccr::W](W) writer structure"]
621impl crate::Writable for CCR_SPEC {
622    type Writer = W;
623}
624#[doc = "`reset()` method sets CCR to value 0"]
625impl crate::Resettable for CCR_SPEC {
626    #[inline(always)]
627    fn reset_value() -> Self::Ux {
628        0
629    }
630}