xmc4200/ccu40_cc40/
ints.rs

1#[doc = "Register `INTS` reader"]
2pub type R = crate::R<INTS_SPEC>;
3#[doc = "Period Match while Counting Up\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum PMUS_A {
6    #[doc = "0: Period match while counting up not detected"]
7    VALUE1 = 0,
8    #[doc = "1: Period match while counting up detected"]
9    VALUE2 = 1,
10}
11impl From<PMUS_A> for bool {
12    #[inline(always)]
13    fn from(variant: PMUS_A) -> Self {
14        variant as u8 != 0
15    }
16}
17#[doc = "Field `PMUS` reader - Period Match while Counting Up"]
18pub type PMUS_R = crate::BitReader<PMUS_A>;
19impl PMUS_R {
20    #[doc = "Get enumerated values variant"]
21    #[inline(always)]
22    pub const fn variant(&self) -> PMUS_A {
23        match self.bits {
24            false => PMUS_A::VALUE1,
25            true => PMUS_A::VALUE2,
26        }
27    }
28    #[doc = "Period match while counting up not detected"]
29    #[inline(always)]
30    pub fn is_value1(&self) -> bool {
31        *self == PMUS_A::VALUE1
32    }
33    #[doc = "Period match while counting up detected"]
34    #[inline(always)]
35    pub fn is_value2(&self) -> bool {
36        *self == PMUS_A::VALUE2
37    }
38}
39#[doc = "One Match while Counting Down\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum OMDS_A {
42    #[doc = "0: One match while counting down not detected"]
43    VALUE1 = 0,
44    #[doc = "1: One match while counting down detected"]
45    VALUE2 = 1,
46}
47impl From<OMDS_A> for bool {
48    #[inline(always)]
49    fn from(variant: OMDS_A) -> Self {
50        variant as u8 != 0
51    }
52}
53#[doc = "Field `OMDS` reader - One Match while Counting Down"]
54pub type OMDS_R = crate::BitReader<OMDS_A>;
55impl OMDS_R {
56    #[doc = "Get enumerated values variant"]
57    #[inline(always)]
58    pub const fn variant(&self) -> OMDS_A {
59        match self.bits {
60            false => OMDS_A::VALUE1,
61            true => OMDS_A::VALUE2,
62        }
63    }
64    #[doc = "One match while counting down not detected"]
65    #[inline(always)]
66    pub fn is_value1(&self) -> bool {
67        *self == OMDS_A::VALUE1
68    }
69    #[doc = "One match while counting down detected"]
70    #[inline(always)]
71    pub fn is_value2(&self) -> bool {
72        *self == OMDS_A::VALUE2
73    }
74}
75#[doc = "Compare Match while Counting Up\n\nValue on reset: 0"]
76#[derive(Clone, Copy, Debug, PartialEq, Eq)]
77pub enum CMUS_A {
78    #[doc = "0: Compare match while counting up not detected"]
79    VALUE1 = 0,
80    #[doc = "1: Compare match while counting up detected"]
81    VALUE2 = 1,
82}
83impl From<CMUS_A> for bool {
84    #[inline(always)]
85    fn from(variant: CMUS_A) -> Self {
86        variant as u8 != 0
87    }
88}
89#[doc = "Field `CMUS` reader - Compare Match while Counting Up"]
90pub type CMUS_R = crate::BitReader<CMUS_A>;
91impl CMUS_R {
92    #[doc = "Get enumerated values variant"]
93    #[inline(always)]
94    pub const fn variant(&self) -> CMUS_A {
95        match self.bits {
96            false => CMUS_A::VALUE1,
97            true => CMUS_A::VALUE2,
98        }
99    }
100    #[doc = "Compare match while counting up not detected"]
101    #[inline(always)]
102    pub fn is_value1(&self) -> bool {
103        *self == CMUS_A::VALUE1
104    }
105    #[doc = "Compare match while counting up detected"]
106    #[inline(always)]
107    pub fn is_value2(&self) -> bool {
108        *self == CMUS_A::VALUE2
109    }
110}
111#[doc = "Compare Match while Counting Down\n\nValue on reset: 0"]
112#[derive(Clone, Copy, Debug, PartialEq, Eq)]
113pub enum CMDS_A {
114    #[doc = "0: Compare match while counting down not detected"]
115    VALUE1 = 0,
116    #[doc = "1: Compare match while counting down detected"]
117    VALUE2 = 1,
118}
119impl From<CMDS_A> for bool {
120    #[inline(always)]
121    fn from(variant: CMDS_A) -> Self {
122        variant as u8 != 0
123    }
124}
125#[doc = "Field `CMDS` reader - Compare Match while Counting Down"]
126pub type CMDS_R = crate::BitReader<CMDS_A>;
127impl CMDS_R {
128    #[doc = "Get enumerated values variant"]
129    #[inline(always)]
130    pub const fn variant(&self) -> CMDS_A {
131        match self.bits {
132            false => CMDS_A::VALUE1,
133            true => CMDS_A::VALUE2,
134        }
135    }
136    #[doc = "Compare match while counting down not detected"]
137    #[inline(always)]
138    pub fn is_value1(&self) -> bool {
139        *self == CMDS_A::VALUE1
140    }
141    #[doc = "Compare match while counting down detected"]
142    #[inline(always)]
143    pub fn is_value2(&self) -> bool {
144        *self == CMDS_A::VALUE2
145    }
146}
147#[doc = "Event 0 Detection Status\n\nValue on reset: 0"]
148#[derive(Clone, Copy, Debug, PartialEq, Eq)]
149pub enum E0AS_A {
150    #[doc = "0: Event 0 not detected"]
151    VALUE1 = 0,
152    #[doc = "1: Event 0 detected"]
153    VALUE2 = 1,
154}
155impl From<E0AS_A> for bool {
156    #[inline(always)]
157    fn from(variant: E0AS_A) -> Self {
158        variant as u8 != 0
159    }
160}
161#[doc = "Field `E0AS` reader - Event 0 Detection Status"]
162pub type E0AS_R = crate::BitReader<E0AS_A>;
163impl E0AS_R {
164    #[doc = "Get enumerated values variant"]
165    #[inline(always)]
166    pub const fn variant(&self) -> E0AS_A {
167        match self.bits {
168            false => E0AS_A::VALUE1,
169            true => E0AS_A::VALUE2,
170        }
171    }
172    #[doc = "Event 0 not detected"]
173    #[inline(always)]
174    pub fn is_value1(&self) -> bool {
175        *self == E0AS_A::VALUE1
176    }
177    #[doc = "Event 0 detected"]
178    #[inline(always)]
179    pub fn is_value2(&self) -> bool {
180        *self == E0AS_A::VALUE2
181    }
182}
183#[doc = "Event 1 Detection Status\n\nValue on reset: 0"]
184#[derive(Clone, Copy, Debug, PartialEq, Eq)]
185pub enum E1AS_A {
186    #[doc = "0: Event 1 not detected"]
187    VALUE1 = 0,
188    #[doc = "1: Event 1 detected"]
189    VALUE2 = 1,
190}
191impl From<E1AS_A> for bool {
192    #[inline(always)]
193    fn from(variant: E1AS_A) -> Self {
194        variant as u8 != 0
195    }
196}
197#[doc = "Field `E1AS` reader - Event 1 Detection Status"]
198pub type E1AS_R = crate::BitReader<E1AS_A>;
199impl E1AS_R {
200    #[doc = "Get enumerated values variant"]
201    #[inline(always)]
202    pub const fn variant(&self) -> E1AS_A {
203        match self.bits {
204            false => E1AS_A::VALUE1,
205            true => E1AS_A::VALUE2,
206        }
207    }
208    #[doc = "Event 1 not detected"]
209    #[inline(always)]
210    pub fn is_value1(&self) -> bool {
211        *self == E1AS_A::VALUE1
212    }
213    #[doc = "Event 1 detected"]
214    #[inline(always)]
215    pub fn is_value2(&self) -> bool {
216        *self == E1AS_A::VALUE2
217    }
218}
219#[doc = "Event 2 Detection Status\n\nValue on reset: 0"]
220#[derive(Clone, Copy, Debug, PartialEq, Eq)]
221pub enum E2AS_A {
222    #[doc = "0: Event 2 not detected"]
223    VALUE1 = 0,
224    #[doc = "1: Event 2 detected"]
225    VALUE2 = 1,
226}
227impl From<E2AS_A> for bool {
228    #[inline(always)]
229    fn from(variant: E2AS_A) -> Self {
230        variant as u8 != 0
231    }
232}
233#[doc = "Field `E2AS` reader - Event 2 Detection Status"]
234pub type E2AS_R = crate::BitReader<E2AS_A>;
235impl E2AS_R {
236    #[doc = "Get enumerated values variant"]
237    #[inline(always)]
238    pub const fn variant(&self) -> E2AS_A {
239        match self.bits {
240            false => E2AS_A::VALUE1,
241            true => E2AS_A::VALUE2,
242        }
243    }
244    #[doc = "Event 2 not detected"]
245    #[inline(always)]
246    pub fn is_value1(&self) -> bool {
247        *self == E2AS_A::VALUE1
248    }
249    #[doc = "Event 2 detected"]
250    #[inline(always)]
251    pub fn is_value2(&self) -> bool {
252        *self == E2AS_A::VALUE2
253    }
254}
255#[doc = "Field `TRPF` reader - Trap Flag Status"]
256pub type TRPF_R = crate::BitReader;
257impl R {
258    #[doc = "Bit 0 - Period Match while Counting Up"]
259    #[inline(always)]
260    pub fn pmus(&self) -> PMUS_R {
261        PMUS_R::new((self.bits & 1) != 0)
262    }
263    #[doc = "Bit 1 - One Match while Counting Down"]
264    #[inline(always)]
265    pub fn omds(&self) -> OMDS_R {
266        OMDS_R::new(((self.bits >> 1) & 1) != 0)
267    }
268    #[doc = "Bit 2 - Compare Match while Counting Up"]
269    #[inline(always)]
270    pub fn cmus(&self) -> CMUS_R {
271        CMUS_R::new(((self.bits >> 2) & 1) != 0)
272    }
273    #[doc = "Bit 3 - Compare Match while Counting Down"]
274    #[inline(always)]
275    pub fn cmds(&self) -> CMDS_R {
276        CMDS_R::new(((self.bits >> 3) & 1) != 0)
277    }
278    #[doc = "Bit 8 - Event 0 Detection Status"]
279    #[inline(always)]
280    pub fn e0as(&self) -> E0AS_R {
281        E0AS_R::new(((self.bits >> 8) & 1) != 0)
282    }
283    #[doc = "Bit 9 - Event 1 Detection Status"]
284    #[inline(always)]
285    pub fn e1as(&self) -> E1AS_R {
286        E1AS_R::new(((self.bits >> 9) & 1) != 0)
287    }
288    #[doc = "Bit 10 - Event 2 Detection Status"]
289    #[inline(always)]
290    pub fn e2as(&self) -> E2AS_R {
291        E2AS_R::new(((self.bits >> 10) & 1) != 0)
292    }
293    #[doc = "Bit 11 - Trap Flag Status"]
294    #[inline(always)]
295    pub fn trpf(&self) -> TRPF_R {
296        TRPF_R::new(((self.bits >> 11) & 1) != 0)
297    }
298}
299#[doc = "Interrupt Status\n\nYou can [`read`](crate::Reg::read) this register and get [`ints::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
300pub struct INTS_SPEC;
301impl crate::RegisterSpec for INTS_SPEC {
302    type Ux = u32;
303}
304#[doc = "`read()` method returns [`ints::R`](R) reader structure"]
305impl crate::Readable for INTS_SPEC {}
306#[doc = "`reset()` method sets INTS to value 0"]
307impl crate::Resettable for INTS_SPEC {
308    const RESET_VALUE: u32 = 0;
309}