lpc845_pac/ctimer0/
mcr.rs

1#[doc = "Register `MCR` reader"]
2pub struct R(crate::R<MCR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MCR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MCR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MCR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `MCR` writer"]
17pub struct W(crate::W<MCR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MCR_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<MCR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MCR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `MR0I` reader - Interrupt on MR0: an interrupt is generated when MR0 matches the value in the TC. 0 = disabled. 1 = enabled."]
38pub struct MR0I_R(crate::FieldReader<bool, bool>);
39impl MR0I_R {
40    pub(crate) fn new(bits: bool) -> Self {
41        MR0I_R(crate::FieldReader::new(bits))
42    }
43}
44impl core::ops::Deref for MR0I_R {
45    type Target = crate::FieldReader<bool, bool>;
46    #[inline(always)]
47    fn deref(&self) -> &Self::Target {
48        &self.0
49    }
50}
51#[doc = "Field `MR0I` writer - Interrupt on MR0: an interrupt is generated when MR0 matches the value in the TC. 0 = disabled. 1 = enabled."]
52pub struct MR0I_W<'a> {
53    w: &'a mut W,
54}
55impl<'a> MR0I_W<'a> {
56    #[doc = r"Sets the field bit"]
57    #[inline(always)]
58    pub fn set_bit(self) -> &'a mut W {
59        self.bit(true)
60    }
61    #[doc = r"Clears the field bit"]
62    #[inline(always)]
63    pub fn clear_bit(self) -> &'a mut W {
64        self.bit(false)
65    }
66    #[doc = r"Writes raw bits to the field"]
67    #[inline(always)]
68    pub fn bit(self, value: bool) -> &'a mut W {
69        self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
70        self.w
71    }
72}
73#[doc = "Field `MR0R` reader - Reset on MR0: the TC will be reset if MR0 matches it. 0 = disabled. 1 = enabled."]
74pub struct MR0R_R(crate::FieldReader<bool, bool>);
75impl MR0R_R {
76    pub(crate) fn new(bits: bool) -> Self {
77        MR0R_R(crate::FieldReader::new(bits))
78    }
79}
80impl core::ops::Deref for MR0R_R {
81    type Target = crate::FieldReader<bool, bool>;
82    #[inline(always)]
83    fn deref(&self) -> &Self::Target {
84        &self.0
85    }
86}
87#[doc = "Field `MR0R` writer - Reset on MR0: the TC will be reset if MR0 matches it. 0 = disabled. 1 = enabled."]
88pub struct MR0R_W<'a> {
89    w: &'a mut W,
90}
91impl<'a> MR0R_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 << 1)) | ((value as u32 & 0x01) << 1);
106        self.w
107    }
108}
109#[doc = "Field `MR0S` reader - Stop on MR0: the TC and PC will be stopped and TCR\\[0\\]
110will be set to 0 if MR0 matches the TC. 0 = disabled. 1 = enabled."]
111pub struct MR0S_R(crate::FieldReader<bool, bool>);
112impl MR0S_R {
113    pub(crate) fn new(bits: bool) -> Self {
114        MR0S_R(crate::FieldReader::new(bits))
115    }
116}
117impl core::ops::Deref for MR0S_R {
118    type Target = crate::FieldReader<bool, bool>;
119    #[inline(always)]
120    fn deref(&self) -> &Self::Target {
121        &self.0
122    }
123}
124#[doc = "Field `MR0S` writer - Stop on MR0: the TC and PC will be stopped and TCR\\[0\\]
125will be set to 0 if MR0 matches the TC. 0 = disabled. 1 = enabled."]
126pub struct MR0S_W<'a> {
127    w: &'a mut W,
128}
129impl<'a> MR0S_W<'a> {
130    #[doc = r"Sets the field bit"]
131    #[inline(always)]
132    pub fn set_bit(self) -> &'a mut W {
133        self.bit(true)
134    }
135    #[doc = r"Clears the field bit"]
136    #[inline(always)]
137    pub fn clear_bit(self) -> &'a mut W {
138        self.bit(false)
139    }
140    #[doc = r"Writes raw bits to the field"]
141    #[inline(always)]
142    pub fn bit(self, value: bool) -> &'a mut W {
143        self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
144        self.w
145    }
146}
147#[doc = "Field `MR1I` reader - Interrupt on MR1: an interrupt is generated when MR1 matches the value in the TC. 0 = disabled. 1 = enabled. 0 = disabled. 1 = enabled."]
148pub struct MR1I_R(crate::FieldReader<bool, bool>);
149impl MR1I_R {
150    pub(crate) fn new(bits: bool) -> Self {
151        MR1I_R(crate::FieldReader::new(bits))
152    }
153}
154impl core::ops::Deref for MR1I_R {
155    type Target = crate::FieldReader<bool, bool>;
156    #[inline(always)]
157    fn deref(&self) -> &Self::Target {
158        &self.0
159    }
160}
161#[doc = "Field `MR1I` writer - Interrupt on MR1: an interrupt is generated when MR1 matches the value in the TC. 0 = disabled. 1 = enabled. 0 = disabled. 1 = enabled."]
162pub struct MR1I_W<'a> {
163    w: &'a mut W,
164}
165impl<'a> MR1I_W<'a> {
166    #[doc = r"Sets the field bit"]
167    #[inline(always)]
168    pub fn set_bit(self) -> &'a mut W {
169        self.bit(true)
170    }
171    #[doc = r"Clears the field bit"]
172    #[inline(always)]
173    pub fn clear_bit(self) -> &'a mut W {
174        self.bit(false)
175    }
176    #[doc = r"Writes raw bits to the field"]
177    #[inline(always)]
178    pub fn bit(self, value: bool) -> &'a mut W {
179        self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
180        self.w
181    }
182}
183#[doc = "Field `MR1R` reader - Reset on MR1: the TC will be reset if MR1 matches it. 0 = disabled. 1 = enabled."]
184pub struct MR1R_R(crate::FieldReader<bool, bool>);
185impl MR1R_R {
186    pub(crate) fn new(bits: bool) -> Self {
187        MR1R_R(crate::FieldReader::new(bits))
188    }
189}
190impl core::ops::Deref for MR1R_R {
191    type Target = crate::FieldReader<bool, bool>;
192    #[inline(always)]
193    fn deref(&self) -> &Self::Target {
194        &self.0
195    }
196}
197#[doc = "Field `MR1R` writer - Reset on MR1: the TC will be reset if MR1 matches it. 0 = disabled. 1 = enabled."]
198pub struct MR1R_W<'a> {
199    w: &'a mut W,
200}
201impl<'a> MR1R_W<'a> {
202    #[doc = r"Sets the field bit"]
203    #[inline(always)]
204    pub fn set_bit(self) -> &'a mut W {
205        self.bit(true)
206    }
207    #[doc = r"Clears the field bit"]
208    #[inline(always)]
209    pub fn clear_bit(self) -> &'a mut W {
210        self.bit(false)
211    }
212    #[doc = r"Writes raw bits to the field"]
213    #[inline(always)]
214    pub fn bit(self, value: bool) -> &'a mut W {
215        self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
216        self.w
217    }
218}
219#[doc = "Field `MR1S` reader - Stop on MR1: the TC and PC will be stopped and TCR\\[0\\]
220will be set to 0 if MR1 matches the TC. 0 = disabled. 1 = enabled."]
221pub struct MR1S_R(crate::FieldReader<bool, bool>);
222impl MR1S_R {
223    pub(crate) fn new(bits: bool) -> Self {
224        MR1S_R(crate::FieldReader::new(bits))
225    }
226}
227impl core::ops::Deref for MR1S_R {
228    type Target = crate::FieldReader<bool, bool>;
229    #[inline(always)]
230    fn deref(&self) -> &Self::Target {
231        &self.0
232    }
233}
234#[doc = "Field `MR1S` writer - Stop on MR1: the TC and PC will be stopped and TCR\\[0\\]
235will be set to 0 if MR1 matches the TC. 0 = disabled. 1 = enabled."]
236pub struct MR1S_W<'a> {
237    w: &'a mut W,
238}
239impl<'a> MR1S_W<'a> {
240    #[doc = r"Sets the field bit"]
241    #[inline(always)]
242    pub fn set_bit(self) -> &'a mut W {
243        self.bit(true)
244    }
245    #[doc = r"Clears the field bit"]
246    #[inline(always)]
247    pub fn clear_bit(self) -> &'a mut W {
248        self.bit(false)
249    }
250    #[doc = r"Writes raw bits to the field"]
251    #[inline(always)]
252    pub fn bit(self, value: bool) -> &'a mut W {
253        self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
254        self.w
255    }
256}
257#[doc = "Field `MR2I` reader - Interrupt on MR2: an interrupt is generated when MR2 matches the value in the TC. 0 = disabled. 1 = enabled."]
258pub struct MR2I_R(crate::FieldReader<bool, bool>);
259impl MR2I_R {
260    pub(crate) fn new(bits: bool) -> Self {
261        MR2I_R(crate::FieldReader::new(bits))
262    }
263}
264impl core::ops::Deref for MR2I_R {
265    type Target = crate::FieldReader<bool, bool>;
266    #[inline(always)]
267    fn deref(&self) -> &Self::Target {
268        &self.0
269    }
270}
271#[doc = "Field `MR2I` writer - Interrupt on MR2: an interrupt is generated when MR2 matches the value in the TC. 0 = disabled. 1 = enabled."]
272pub struct MR2I_W<'a> {
273    w: &'a mut W,
274}
275impl<'a> MR2I_W<'a> {
276    #[doc = r"Sets the field bit"]
277    #[inline(always)]
278    pub fn set_bit(self) -> &'a mut W {
279        self.bit(true)
280    }
281    #[doc = r"Clears the field bit"]
282    #[inline(always)]
283    pub fn clear_bit(self) -> &'a mut W {
284        self.bit(false)
285    }
286    #[doc = r"Writes raw bits to the field"]
287    #[inline(always)]
288    pub fn bit(self, value: bool) -> &'a mut W {
289        self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
290        self.w
291    }
292}
293#[doc = "Field `MR2R` reader - Reset on MR2: the TC will be reset if MR2 matches it. 0 = disabled. 1 = enabled."]
294pub struct MR2R_R(crate::FieldReader<bool, bool>);
295impl MR2R_R {
296    pub(crate) fn new(bits: bool) -> Self {
297        MR2R_R(crate::FieldReader::new(bits))
298    }
299}
300impl core::ops::Deref for MR2R_R {
301    type Target = crate::FieldReader<bool, bool>;
302    #[inline(always)]
303    fn deref(&self) -> &Self::Target {
304        &self.0
305    }
306}
307#[doc = "Field `MR2R` writer - Reset on MR2: the TC will be reset if MR2 matches it. 0 = disabled. 1 = enabled."]
308pub struct MR2R_W<'a> {
309    w: &'a mut W,
310}
311impl<'a> MR2R_W<'a> {
312    #[doc = r"Sets the field bit"]
313    #[inline(always)]
314    pub fn set_bit(self) -> &'a mut W {
315        self.bit(true)
316    }
317    #[doc = r"Clears the field bit"]
318    #[inline(always)]
319    pub fn clear_bit(self) -> &'a mut W {
320        self.bit(false)
321    }
322    #[doc = r"Writes raw bits to the field"]
323    #[inline(always)]
324    pub fn bit(self, value: bool) -> &'a mut W {
325        self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
326        self.w
327    }
328}
329#[doc = "Field `MR2S` reader - Stop on MR2: the TC and PC will be stopped and TCR\\[0\\]
330will be set to 0 if MR2 matches the TC. 0 = disabled. 1 = enabled."]
331pub struct MR2S_R(crate::FieldReader<bool, bool>);
332impl MR2S_R {
333    pub(crate) fn new(bits: bool) -> Self {
334        MR2S_R(crate::FieldReader::new(bits))
335    }
336}
337impl core::ops::Deref for MR2S_R {
338    type Target = crate::FieldReader<bool, bool>;
339    #[inline(always)]
340    fn deref(&self) -> &Self::Target {
341        &self.0
342    }
343}
344#[doc = "Field `MR2S` writer - Stop on MR2: the TC and PC will be stopped and TCR\\[0\\]
345will be set to 0 if MR2 matches the TC. 0 = disabled. 1 = enabled."]
346pub struct MR2S_W<'a> {
347    w: &'a mut W,
348}
349impl<'a> MR2S_W<'a> {
350    #[doc = r"Sets the field bit"]
351    #[inline(always)]
352    pub fn set_bit(self) -> &'a mut W {
353        self.bit(true)
354    }
355    #[doc = r"Clears the field bit"]
356    #[inline(always)]
357    pub fn clear_bit(self) -> &'a mut W {
358        self.bit(false)
359    }
360    #[doc = r"Writes raw bits to the field"]
361    #[inline(always)]
362    pub fn bit(self, value: bool) -> &'a mut W {
363        self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
364        self.w
365    }
366}
367#[doc = "Field `MR3I` reader - Interrupt on MR3: an interrupt is generated when MR3 matches the value in the TC. 0 = disabled. 1 = enabled."]
368pub struct MR3I_R(crate::FieldReader<bool, bool>);
369impl MR3I_R {
370    pub(crate) fn new(bits: bool) -> Self {
371        MR3I_R(crate::FieldReader::new(bits))
372    }
373}
374impl core::ops::Deref for MR3I_R {
375    type Target = crate::FieldReader<bool, bool>;
376    #[inline(always)]
377    fn deref(&self) -> &Self::Target {
378        &self.0
379    }
380}
381#[doc = "Field `MR3I` writer - Interrupt on MR3: an interrupt is generated when MR3 matches the value in the TC. 0 = disabled. 1 = enabled."]
382pub struct MR3I_W<'a> {
383    w: &'a mut W,
384}
385impl<'a> MR3I_W<'a> {
386    #[doc = r"Sets the field bit"]
387    #[inline(always)]
388    pub fn set_bit(self) -> &'a mut W {
389        self.bit(true)
390    }
391    #[doc = r"Clears the field bit"]
392    #[inline(always)]
393    pub fn clear_bit(self) -> &'a mut W {
394        self.bit(false)
395    }
396    #[doc = r"Writes raw bits to the field"]
397    #[inline(always)]
398    pub fn bit(self, value: bool) -> &'a mut W {
399        self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9);
400        self.w
401    }
402}
403#[doc = "Field `MR3R` reader - Reset on MR3: the TC will be reset if MR3 matches it. 0 = disabled. 1 = enabled."]
404pub struct MR3R_R(crate::FieldReader<bool, bool>);
405impl MR3R_R {
406    pub(crate) fn new(bits: bool) -> Self {
407        MR3R_R(crate::FieldReader::new(bits))
408    }
409}
410impl core::ops::Deref for MR3R_R {
411    type Target = crate::FieldReader<bool, bool>;
412    #[inline(always)]
413    fn deref(&self) -> &Self::Target {
414        &self.0
415    }
416}
417#[doc = "Field `MR3R` writer - Reset on MR3: the TC will be reset if MR3 matches it. 0 = disabled. 1 = enabled."]
418pub struct MR3R_W<'a> {
419    w: &'a mut W,
420}
421impl<'a> MR3R_W<'a> {
422    #[doc = r"Sets the field bit"]
423    #[inline(always)]
424    pub fn set_bit(self) -> &'a mut W {
425        self.bit(true)
426    }
427    #[doc = r"Clears the field bit"]
428    #[inline(always)]
429    pub fn clear_bit(self) -> &'a mut W {
430        self.bit(false)
431    }
432    #[doc = r"Writes raw bits to the field"]
433    #[inline(always)]
434    pub fn bit(self, value: bool) -> &'a mut W {
435        self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10);
436        self.w
437    }
438}
439#[doc = "Field `MR3S` reader - Stop on MR3: the TC and PC will be stopped and TCR\\[0\\]
440will be set to 0 if MR3 matches the TC. 0 = disabled. 1 = enabled."]
441pub struct MR3S_R(crate::FieldReader<bool, bool>);
442impl MR3S_R {
443    pub(crate) fn new(bits: bool) -> Self {
444        MR3S_R(crate::FieldReader::new(bits))
445    }
446}
447impl core::ops::Deref for MR3S_R {
448    type Target = crate::FieldReader<bool, bool>;
449    #[inline(always)]
450    fn deref(&self) -> &Self::Target {
451        &self.0
452    }
453}
454#[doc = "Field `MR3S` writer - Stop on MR3: the TC and PC will be stopped and TCR\\[0\\]
455will be set to 0 if MR3 matches the TC. 0 = disabled. 1 = enabled."]
456pub struct MR3S_W<'a> {
457    w: &'a mut W,
458}
459impl<'a> MR3S_W<'a> {
460    #[doc = r"Sets the field bit"]
461    #[inline(always)]
462    pub fn set_bit(self) -> &'a mut W {
463        self.bit(true)
464    }
465    #[doc = r"Clears the field bit"]
466    #[inline(always)]
467    pub fn clear_bit(self) -> &'a mut W {
468        self.bit(false)
469    }
470    #[doc = r"Writes raw bits to the field"]
471    #[inline(always)]
472    pub fn bit(self, value: bool) -> &'a mut W {
473        self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11);
474        self.w
475    }
476}
477#[doc = "Field `MR0RL` reader - Reload MR0 with the contents of the Match 0 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
478pub struct MR0RL_R(crate::FieldReader<bool, bool>);
479impl MR0RL_R {
480    pub(crate) fn new(bits: bool) -> Self {
481        MR0RL_R(crate::FieldReader::new(bits))
482    }
483}
484impl core::ops::Deref for MR0RL_R {
485    type Target = crate::FieldReader<bool, bool>;
486    #[inline(always)]
487    fn deref(&self) -> &Self::Target {
488        &self.0
489    }
490}
491#[doc = "Field `MR0RL` writer - Reload MR0 with the contents of the Match 0 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
492pub struct MR0RL_W<'a> {
493    w: &'a mut W,
494}
495impl<'a> MR0RL_W<'a> {
496    #[doc = r"Sets the field bit"]
497    #[inline(always)]
498    pub fn set_bit(self) -> &'a mut W {
499        self.bit(true)
500    }
501    #[doc = r"Clears the field bit"]
502    #[inline(always)]
503    pub fn clear_bit(self) -> &'a mut W {
504        self.bit(false)
505    }
506    #[doc = r"Writes raw bits to the field"]
507    #[inline(always)]
508    pub fn bit(self, value: bool) -> &'a mut W {
509        self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24);
510        self.w
511    }
512}
513#[doc = "Field `MR1RL` reader - Reload MR1 with the contents of the Match 1 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
514pub struct MR1RL_R(crate::FieldReader<bool, bool>);
515impl MR1RL_R {
516    pub(crate) fn new(bits: bool) -> Self {
517        MR1RL_R(crate::FieldReader::new(bits))
518    }
519}
520impl core::ops::Deref for MR1RL_R {
521    type Target = crate::FieldReader<bool, bool>;
522    #[inline(always)]
523    fn deref(&self) -> &Self::Target {
524        &self.0
525    }
526}
527#[doc = "Field `MR1RL` writer - Reload MR1 with the contents of the Match 1 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
528pub struct MR1RL_W<'a> {
529    w: &'a mut W,
530}
531impl<'a> MR1RL_W<'a> {
532    #[doc = r"Sets the field bit"]
533    #[inline(always)]
534    pub fn set_bit(self) -> &'a mut W {
535        self.bit(true)
536    }
537    #[doc = r"Clears the field bit"]
538    #[inline(always)]
539    pub fn clear_bit(self) -> &'a mut W {
540        self.bit(false)
541    }
542    #[doc = r"Writes raw bits to the field"]
543    #[inline(always)]
544    pub fn bit(self, value: bool) -> &'a mut W {
545        self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25);
546        self.w
547    }
548}
549#[doc = "Field `MR2RL` reader - Reload MR2 with the contents of the Match 2 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
550pub struct MR2RL_R(crate::FieldReader<bool, bool>);
551impl MR2RL_R {
552    pub(crate) fn new(bits: bool) -> Self {
553        MR2RL_R(crate::FieldReader::new(bits))
554    }
555}
556impl core::ops::Deref for MR2RL_R {
557    type Target = crate::FieldReader<bool, bool>;
558    #[inline(always)]
559    fn deref(&self) -> &Self::Target {
560        &self.0
561    }
562}
563#[doc = "Field `MR2RL` writer - Reload MR2 with the contents of the Match 2 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
564pub struct MR2RL_W<'a> {
565    w: &'a mut W,
566}
567impl<'a> MR2RL_W<'a> {
568    #[doc = r"Sets the field bit"]
569    #[inline(always)]
570    pub fn set_bit(self) -> &'a mut W {
571        self.bit(true)
572    }
573    #[doc = r"Clears the field bit"]
574    #[inline(always)]
575    pub fn clear_bit(self) -> &'a mut W {
576        self.bit(false)
577    }
578    #[doc = r"Writes raw bits to the field"]
579    #[inline(always)]
580    pub fn bit(self, value: bool) -> &'a mut W {
581        self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26);
582        self.w
583    }
584}
585#[doc = "Field `MR3RL` reader - Reload MR3 with the contents of the Match 3 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
586pub struct MR3RL_R(crate::FieldReader<bool, bool>);
587impl MR3RL_R {
588    pub(crate) fn new(bits: bool) -> Self {
589        MR3RL_R(crate::FieldReader::new(bits))
590    }
591}
592impl core::ops::Deref for MR3RL_R {
593    type Target = crate::FieldReader<bool, bool>;
594    #[inline(always)]
595    fn deref(&self) -> &Self::Target {
596        &self.0
597    }
598}
599#[doc = "Field `MR3RL` writer - Reload MR3 with the contents of the Match 3 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
600pub struct MR3RL_W<'a> {
601    w: &'a mut W,
602}
603impl<'a> MR3RL_W<'a> {
604    #[doc = r"Sets the field bit"]
605    #[inline(always)]
606    pub fn set_bit(self) -> &'a mut W {
607        self.bit(true)
608    }
609    #[doc = r"Clears the field bit"]
610    #[inline(always)]
611    pub fn clear_bit(self) -> &'a mut W {
612        self.bit(false)
613    }
614    #[doc = r"Writes raw bits to the field"]
615    #[inline(always)]
616    pub fn bit(self, value: bool) -> &'a mut W {
617        self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27);
618        self.w
619    }
620}
621impl R {
622    #[doc = "Bit 0 - Interrupt on MR0: an interrupt is generated when MR0 matches the value in the TC. 0 = disabled. 1 = enabled."]
623    #[inline(always)]
624    pub fn mr0i(&self) -> MR0I_R {
625        MR0I_R::new((self.bits & 0x01) != 0)
626    }
627    #[doc = "Bit 1 - Reset on MR0: the TC will be reset if MR0 matches it. 0 = disabled. 1 = enabled."]
628    #[inline(always)]
629    pub fn mr0r(&self) -> MR0R_R {
630        MR0R_R::new(((self.bits >> 1) & 0x01) != 0)
631    }
632    #[doc = "Bit 2 - Stop on MR0: the TC and PC will be stopped and TCR\\[0\\]
633will be set to 0 if MR0 matches the TC. 0 = disabled. 1 = enabled."]
634    #[inline(always)]
635    pub fn mr0s(&self) -> MR0S_R {
636        MR0S_R::new(((self.bits >> 2) & 0x01) != 0)
637    }
638    #[doc = "Bit 3 - Interrupt on MR1: an interrupt is generated when MR1 matches the value in the TC. 0 = disabled. 1 = enabled. 0 = disabled. 1 = enabled."]
639    #[inline(always)]
640    pub fn mr1i(&self) -> MR1I_R {
641        MR1I_R::new(((self.bits >> 3) & 0x01) != 0)
642    }
643    #[doc = "Bit 4 - Reset on MR1: the TC will be reset if MR1 matches it. 0 = disabled. 1 = enabled."]
644    #[inline(always)]
645    pub fn mr1r(&self) -> MR1R_R {
646        MR1R_R::new(((self.bits >> 4) & 0x01) != 0)
647    }
648    #[doc = "Bit 5 - Stop on MR1: the TC and PC will be stopped and TCR\\[0\\]
649will be set to 0 if MR1 matches the TC. 0 = disabled. 1 = enabled."]
650    #[inline(always)]
651    pub fn mr1s(&self) -> MR1S_R {
652        MR1S_R::new(((self.bits >> 5) & 0x01) != 0)
653    }
654    #[doc = "Bit 6 - Interrupt on MR2: an interrupt is generated when MR2 matches the value in the TC. 0 = disabled. 1 = enabled."]
655    #[inline(always)]
656    pub fn mr2i(&self) -> MR2I_R {
657        MR2I_R::new(((self.bits >> 6) & 0x01) != 0)
658    }
659    #[doc = "Bit 7 - Reset on MR2: the TC will be reset if MR2 matches it. 0 = disabled. 1 = enabled."]
660    #[inline(always)]
661    pub fn mr2r(&self) -> MR2R_R {
662        MR2R_R::new(((self.bits >> 7) & 0x01) != 0)
663    }
664    #[doc = "Bit 8 - Stop on MR2: the TC and PC will be stopped and TCR\\[0\\]
665will be set to 0 if MR2 matches the TC. 0 = disabled. 1 = enabled."]
666    #[inline(always)]
667    pub fn mr2s(&self) -> MR2S_R {
668        MR2S_R::new(((self.bits >> 8) & 0x01) != 0)
669    }
670    #[doc = "Bit 9 - Interrupt on MR3: an interrupt is generated when MR3 matches the value in the TC. 0 = disabled. 1 = enabled."]
671    #[inline(always)]
672    pub fn mr3i(&self) -> MR3I_R {
673        MR3I_R::new(((self.bits >> 9) & 0x01) != 0)
674    }
675    #[doc = "Bit 10 - Reset on MR3: the TC will be reset if MR3 matches it. 0 = disabled. 1 = enabled."]
676    #[inline(always)]
677    pub fn mr3r(&self) -> MR3R_R {
678        MR3R_R::new(((self.bits >> 10) & 0x01) != 0)
679    }
680    #[doc = "Bit 11 - Stop on MR3: the TC and PC will be stopped and TCR\\[0\\]
681will be set to 0 if MR3 matches the TC. 0 = disabled. 1 = enabled."]
682    #[inline(always)]
683    pub fn mr3s(&self) -> MR3S_R {
684        MR3S_R::new(((self.bits >> 11) & 0x01) != 0)
685    }
686    #[doc = "Bit 24 - Reload MR0 with the contents of the Match 0 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
687    #[inline(always)]
688    pub fn mr0rl(&self) -> MR0RL_R {
689        MR0RL_R::new(((self.bits >> 24) & 0x01) != 0)
690    }
691    #[doc = "Bit 25 - Reload MR1 with the contents of the Match 1 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
692    #[inline(always)]
693    pub fn mr1rl(&self) -> MR1RL_R {
694        MR1RL_R::new(((self.bits >> 25) & 0x01) != 0)
695    }
696    #[doc = "Bit 26 - Reload MR2 with the contents of the Match 2 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
697    #[inline(always)]
698    pub fn mr2rl(&self) -> MR2RL_R {
699        MR2RL_R::new(((self.bits >> 26) & 0x01) != 0)
700    }
701    #[doc = "Bit 27 - Reload MR3 with the contents of the Match 3 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
702    #[inline(always)]
703    pub fn mr3rl(&self) -> MR3RL_R {
704        MR3RL_R::new(((self.bits >> 27) & 0x01) != 0)
705    }
706}
707impl W {
708    #[doc = "Bit 0 - Interrupt on MR0: an interrupt is generated when MR0 matches the value in the TC. 0 = disabled. 1 = enabled."]
709    #[inline(always)]
710    pub fn mr0i(&mut self) -> MR0I_W {
711        MR0I_W { w: self }
712    }
713    #[doc = "Bit 1 - Reset on MR0: the TC will be reset if MR0 matches it. 0 = disabled. 1 = enabled."]
714    #[inline(always)]
715    pub fn mr0r(&mut self) -> MR0R_W {
716        MR0R_W { w: self }
717    }
718    #[doc = "Bit 2 - Stop on MR0: the TC and PC will be stopped and TCR\\[0\\]
719will be set to 0 if MR0 matches the TC. 0 = disabled. 1 = enabled."]
720    #[inline(always)]
721    pub fn mr0s(&mut self) -> MR0S_W {
722        MR0S_W { w: self }
723    }
724    #[doc = "Bit 3 - Interrupt on MR1: an interrupt is generated when MR1 matches the value in the TC. 0 = disabled. 1 = enabled. 0 = disabled. 1 = enabled."]
725    #[inline(always)]
726    pub fn mr1i(&mut self) -> MR1I_W {
727        MR1I_W { w: self }
728    }
729    #[doc = "Bit 4 - Reset on MR1: the TC will be reset if MR1 matches it. 0 = disabled. 1 = enabled."]
730    #[inline(always)]
731    pub fn mr1r(&mut self) -> MR1R_W {
732        MR1R_W { w: self }
733    }
734    #[doc = "Bit 5 - Stop on MR1: the TC and PC will be stopped and TCR\\[0\\]
735will be set to 0 if MR1 matches the TC. 0 = disabled. 1 = enabled."]
736    #[inline(always)]
737    pub fn mr1s(&mut self) -> MR1S_W {
738        MR1S_W { w: self }
739    }
740    #[doc = "Bit 6 - Interrupt on MR2: an interrupt is generated when MR2 matches the value in the TC. 0 = disabled. 1 = enabled."]
741    #[inline(always)]
742    pub fn mr2i(&mut self) -> MR2I_W {
743        MR2I_W { w: self }
744    }
745    #[doc = "Bit 7 - Reset on MR2: the TC will be reset if MR2 matches it. 0 = disabled. 1 = enabled."]
746    #[inline(always)]
747    pub fn mr2r(&mut self) -> MR2R_W {
748        MR2R_W { w: self }
749    }
750    #[doc = "Bit 8 - Stop on MR2: the TC and PC will be stopped and TCR\\[0\\]
751will be set to 0 if MR2 matches the TC. 0 = disabled. 1 = enabled."]
752    #[inline(always)]
753    pub fn mr2s(&mut self) -> MR2S_W {
754        MR2S_W { w: self }
755    }
756    #[doc = "Bit 9 - Interrupt on MR3: an interrupt is generated when MR3 matches the value in the TC. 0 = disabled. 1 = enabled."]
757    #[inline(always)]
758    pub fn mr3i(&mut self) -> MR3I_W {
759        MR3I_W { w: self }
760    }
761    #[doc = "Bit 10 - Reset on MR3: the TC will be reset if MR3 matches it. 0 = disabled. 1 = enabled."]
762    #[inline(always)]
763    pub fn mr3r(&mut self) -> MR3R_W {
764        MR3R_W { w: self }
765    }
766    #[doc = "Bit 11 - Stop on MR3: the TC and PC will be stopped and TCR\\[0\\]
767will be set to 0 if MR3 matches the TC. 0 = disabled. 1 = enabled."]
768    #[inline(always)]
769    pub fn mr3s(&mut self) -> MR3S_W {
770        MR3S_W { w: self }
771    }
772    #[doc = "Bit 24 - Reload MR0 with the contents of the Match 0 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
773    #[inline(always)]
774    pub fn mr0rl(&mut self) -> MR0RL_W {
775        MR0RL_W { w: self }
776    }
777    #[doc = "Bit 25 - Reload MR1 with the contents of the Match 1 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
778    #[inline(always)]
779    pub fn mr1rl(&mut self) -> MR1RL_W {
780        MR1RL_W { w: self }
781    }
782    #[doc = "Bit 26 - Reload MR2 with the contents of the Match 2 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
783    #[inline(always)]
784    pub fn mr2rl(&mut self) -> MR2RL_W {
785        MR2RL_W { w: self }
786    }
787    #[doc = "Bit 27 - Reload MR3 with the contents of the Match 3 Shadow Register when the TC is reset to zero (either via a match event or a write to bit 1 of the TCR). 0 = disabled. 1 = enabled."]
788    #[inline(always)]
789    pub fn mr3rl(&mut self) -> MR3RL_W {
790        MR3RL_W { w: self }
791    }
792    #[doc = "Writes raw bits to the register."]
793    #[inline(always)]
794    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
795        self.0.bits(bits);
796        self
797    }
798}
799#[doc = "Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs.\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 [mcr](index.html) module"]
800pub struct MCR_SPEC;
801impl crate::RegisterSpec for MCR_SPEC {
802    type Ux = u32;
803}
804#[doc = "`read()` method returns [mcr::R](R) reader structure"]
805impl crate::Readable for MCR_SPEC {
806    type Reader = R;
807}
808#[doc = "`write(|w| ..)` method takes [mcr::W](W) writer structure"]
809impl crate::Writable for MCR_SPEC {
810    type Writer = W;
811}
812#[doc = "`reset()` method sets MCR to value 0"]
813impl crate::Resettable for MCR_SPEC {
814    #[inline(always)]
815    fn reset_value() -> Self::Ux {
816        0
817    }
818}