mcxa_pac/ctimer0/
ir.rs

1#[doc = "Register `IR` reader"]
2pub type R = crate::R<IrSpec>;
3#[doc = "Register `IR` writer"]
4pub type W = crate::W<IrSpec>;
5#[doc = "Field `MR0INT` reader - Interrupt Flag for Match Channel 0 Event"]
6pub type Mr0intR = crate::BitReader;
7#[doc = "Field `MR0INT` writer - Interrupt Flag for Match Channel 0 Event"]
8pub type Mr0intW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `MR1INT` reader - Interrupt Flag for Match Channel 1 Event"]
10pub type Mr1intR = crate::BitReader;
11#[doc = "Field `MR1INT` writer - Interrupt Flag for Match Channel 1 Event"]
12pub type Mr1intW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `MR2INT` reader - Interrupt Flag for Match Channel 2 Event"]
14pub type Mr2intR = crate::BitReader;
15#[doc = "Field `MR2INT` writer - Interrupt Flag for Match Channel 2 Event"]
16pub type Mr2intW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `MR3INT` reader - Interrupt Flag for Match Channel 3 Event"]
18pub type Mr3intR = crate::BitReader;
19#[doc = "Field `MR3INT` writer - Interrupt Flag for Match Channel 3 Event"]
20pub type Mr3intW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `CR0INT` reader - Interrupt Flag for Capture Channel 0 Event"]
22pub type Cr0intR = crate::BitReader;
23#[doc = "Field `CR0INT` writer - Interrupt Flag for Capture Channel 0 Event"]
24pub type Cr0intW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `CR1INT` reader - Interrupt Flag for Capture Channel 1 Event"]
26pub type Cr1intR = crate::BitReader;
27#[doc = "Field `CR1INT` writer - Interrupt Flag for Capture Channel 1 Event"]
28pub type Cr1intW<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `CR2INT` reader - Interrupt Flag for Capture Channel 2 Event"]
30pub type Cr2intR = crate::BitReader;
31#[doc = "Field `CR2INT` writer - Interrupt Flag for Capture Channel 2 Event"]
32pub type Cr2intW<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `CR3INT` reader - Interrupt Flag for Capture Channel 3 Event"]
34pub type Cr3intR = crate::BitReader;
35#[doc = "Field `CR3INT` writer - Interrupt Flag for Capture Channel 3 Event"]
36pub type Cr3intW<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38    #[doc = "Bit 0 - Interrupt Flag for Match Channel 0 Event"]
39    #[inline(always)]
40    pub fn mr0int(&self) -> Mr0intR {
41        Mr0intR::new((self.bits & 1) != 0)
42    }
43    #[doc = "Bit 1 - Interrupt Flag for Match Channel 1 Event"]
44    #[inline(always)]
45    pub fn mr1int(&self) -> Mr1intR {
46        Mr1intR::new(((self.bits >> 1) & 1) != 0)
47    }
48    #[doc = "Bit 2 - Interrupt Flag for Match Channel 2 Event"]
49    #[inline(always)]
50    pub fn mr2int(&self) -> Mr2intR {
51        Mr2intR::new(((self.bits >> 2) & 1) != 0)
52    }
53    #[doc = "Bit 3 - Interrupt Flag for Match Channel 3 Event"]
54    #[inline(always)]
55    pub fn mr3int(&self) -> Mr3intR {
56        Mr3intR::new(((self.bits >> 3) & 1) != 0)
57    }
58    #[doc = "Bit 4 - Interrupt Flag for Capture Channel 0 Event"]
59    #[inline(always)]
60    pub fn cr0int(&self) -> Cr0intR {
61        Cr0intR::new(((self.bits >> 4) & 1) != 0)
62    }
63    #[doc = "Bit 5 - Interrupt Flag for Capture Channel 1 Event"]
64    #[inline(always)]
65    pub fn cr1int(&self) -> Cr1intR {
66        Cr1intR::new(((self.bits >> 5) & 1) != 0)
67    }
68    #[doc = "Bit 6 - Interrupt Flag for Capture Channel 2 Event"]
69    #[inline(always)]
70    pub fn cr2int(&self) -> Cr2intR {
71        Cr2intR::new(((self.bits >> 6) & 1) != 0)
72    }
73    #[doc = "Bit 7 - Interrupt Flag for Capture Channel 3 Event"]
74    #[inline(always)]
75    pub fn cr3int(&self) -> Cr3intR {
76        Cr3intR::new(((self.bits >> 7) & 1) != 0)
77    }
78}
79#[cfg(feature = "debug")]
80impl core::fmt::Debug for R {
81    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
82        f.debug_struct("IR")
83            .field("mr0int", &self.mr0int())
84            .field("mr1int", &self.mr1int())
85            .field("mr2int", &self.mr2int())
86            .field("mr3int", &self.mr3int())
87            .field("cr0int", &self.cr0int())
88            .field("cr1int", &self.cr1int())
89            .field("cr2int", &self.cr2int())
90            .field("cr3int", &self.cr3int())
91            .finish()
92    }
93}
94impl W {
95    #[doc = "Bit 0 - Interrupt Flag for Match Channel 0 Event"]
96    #[inline(always)]
97    pub fn mr0int(&mut self) -> Mr0intW<'_, IrSpec> {
98        Mr0intW::new(self, 0)
99    }
100    #[doc = "Bit 1 - Interrupt Flag for Match Channel 1 Event"]
101    #[inline(always)]
102    pub fn mr1int(&mut self) -> Mr1intW<'_, IrSpec> {
103        Mr1intW::new(self, 1)
104    }
105    #[doc = "Bit 2 - Interrupt Flag for Match Channel 2 Event"]
106    #[inline(always)]
107    pub fn mr2int(&mut self) -> Mr2intW<'_, IrSpec> {
108        Mr2intW::new(self, 2)
109    }
110    #[doc = "Bit 3 - Interrupt Flag for Match Channel 3 Event"]
111    #[inline(always)]
112    pub fn mr3int(&mut self) -> Mr3intW<'_, IrSpec> {
113        Mr3intW::new(self, 3)
114    }
115    #[doc = "Bit 4 - Interrupt Flag for Capture Channel 0 Event"]
116    #[inline(always)]
117    pub fn cr0int(&mut self) -> Cr0intW<'_, IrSpec> {
118        Cr0intW::new(self, 4)
119    }
120    #[doc = "Bit 5 - Interrupt Flag for Capture Channel 1 Event"]
121    #[inline(always)]
122    pub fn cr1int(&mut self) -> Cr1intW<'_, IrSpec> {
123        Cr1intW::new(self, 5)
124    }
125    #[doc = "Bit 6 - Interrupt Flag for Capture Channel 2 Event"]
126    #[inline(always)]
127    pub fn cr2int(&mut self) -> Cr2intW<'_, IrSpec> {
128        Cr2intW::new(self, 6)
129    }
130    #[doc = "Bit 7 - Interrupt Flag for Capture Channel 3 Event"]
131    #[inline(always)]
132    pub fn cr3int(&mut self) -> Cr3intW<'_, IrSpec> {
133        Cr3intW::new(self, 7)
134    }
135}
136#[doc = "Interrupt\n\nYou can [`read`](crate::Reg::read) this register and get [`ir::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ir::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
137pub struct IrSpec;
138impl crate::RegisterSpec for IrSpec {
139    type Ux = u32;
140}
141#[doc = "`read()` method returns [`ir::R`](R) reader structure"]
142impl crate::Readable for IrSpec {}
143#[doc = "`write(|w| ..)` method takes [`ir::W`](W) writer structure"]
144impl crate::Writable for IrSpec {
145    type Safety = crate::Unsafe;
146}
147#[doc = "`reset()` method sets IR to value 0"]
148impl crate::Resettable for IrSpec {}