xmc4800/ccu40_cc40/
inte.rs

1#[doc = "Register `INTE` reader"]
2pub type R = crate::R<INTE_SPEC>;
3#[doc = "Register `INTE` writer"]
4pub type W = crate::W<INTE_SPEC>;
5#[doc = "Period match while counting up enable\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum PME_A {
8    #[doc = "0: Period Match interrupt is disabled"]
9    VALUE1 = 0,
10    #[doc = "1: Period Match interrupt is enabled"]
11    VALUE2 = 1,
12}
13impl From<PME_A> for bool {
14    #[inline(always)]
15    fn from(variant: PME_A) -> Self {
16        variant as u8 != 0
17    }
18}
19#[doc = "Field `PME` reader - Period match while counting up enable"]
20pub type PME_R = crate::BitReader<PME_A>;
21impl PME_R {
22    #[doc = "Get enumerated values variant"]
23    #[inline(always)]
24    pub const fn variant(&self) -> PME_A {
25        match self.bits {
26            false => PME_A::VALUE1,
27            true => PME_A::VALUE2,
28        }
29    }
30    #[doc = "Period Match interrupt is disabled"]
31    #[inline(always)]
32    pub fn is_value1(&self) -> bool {
33        *self == PME_A::VALUE1
34    }
35    #[doc = "Period Match interrupt is enabled"]
36    #[inline(always)]
37    pub fn is_value2(&self) -> bool {
38        *self == PME_A::VALUE2
39    }
40}
41#[doc = "Field `PME` writer - Period match while counting up enable"]
42pub type PME_W<'a, REG> = crate::BitWriter<'a, REG, PME_A>;
43impl<'a, REG> PME_W<'a, REG>
44where
45    REG: crate::Writable + crate::RegisterSpec,
46{
47    #[doc = "Period Match interrupt is disabled"]
48    #[inline(always)]
49    pub fn value1(self) -> &'a mut crate::W<REG> {
50        self.variant(PME_A::VALUE1)
51    }
52    #[doc = "Period Match interrupt is enabled"]
53    #[inline(always)]
54    pub fn value2(self) -> &'a mut crate::W<REG> {
55        self.variant(PME_A::VALUE2)
56    }
57}
58#[doc = "One match while counting down enable\n\nValue on reset: 0"]
59#[derive(Clone, Copy, Debug, PartialEq, Eq)]
60pub enum OME_A {
61    #[doc = "0: One Match interrupt is disabled"]
62    VALUE1 = 0,
63    #[doc = "1: One Match interrupt is enabled"]
64    VALUE2 = 1,
65}
66impl From<OME_A> for bool {
67    #[inline(always)]
68    fn from(variant: OME_A) -> Self {
69        variant as u8 != 0
70    }
71}
72#[doc = "Field `OME` reader - One match while counting down enable"]
73pub type OME_R = crate::BitReader<OME_A>;
74impl OME_R {
75    #[doc = "Get enumerated values variant"]
76    #[inline(always)]
77    pub const fn variant(&self) -> OME_A {
78        match self.bits {
79            false => OME_A::VALUE1,
80            true => OME_A::VALUE2,
81        }
82    }
83    #[doc = "One Match interrupt is disabled"]
84    #[inline(always)]
85    pub fn is_value1(&self) -> bool {
86        *self == OME_A::VALUE1
87    }
88    #[doc = "One Match interrupt is enabled"]
89    #[inline(always)]
90    pub fn is_value2(&self) -> bool {
91        *self == OME_A::VALUE2
92    }
93}
94#[doc = "Field `OME` writer - One match while counting down enable"]
95pub type OME_W<'a, REG> = crate::BitWriter<'a, REG, OME_A>;
96impl<'a, REG> OME_W<'a, REG>
97where
98    REG: crate::Writable + crate::RegisterSpec,
99{
100    #[doc = "One Match interrupt is disabled"]
101    #[inline(always)]
102    pub fn value1(self) -> &'a mut crate::W<REG> {
103        self.variant(OME_A::VALUE1)
104    }
105    #[doc = "One Match interrupt is enabled"]
106    #[inline(always)]
107    pub fn value2(self) -> &'a mut crate::W<REG> {
108        self.variant(OME_A::VALUE2)
109    }
110}
111#[doc = "Compare match while counting up enable\n\nValue on reset: 0"]
112#[derive(Clone, Copy, Debug, PartialEq, Eq)]
113pub enum CMUE_A {
114    #[doc = "0: Compare Match while counting up interrupt is disabled"]
115    VALUE1 = 0,
116    #[doc = "1: Compare Match while counting up interrupt is enabled"]
117    VALUE2 = 1,
118}
119impl From<CMUE_A> for bool {
120    #[inline(always)]
121    fn from(variant: CMUE_A) -> Self {
122        variant as u8 != 0
123    }
124}
125#[doc = "Field `CMUE` reader - Compare match while counting up enable"]
126pub type CMUE_R = crate::BitReader<CMUE_A>;
127impl CMUE_R {
128    #[doc = "Get enumerated values variant"]
129    #[inline(always)]
130    pub const fn variant(&self) -> CMUE_A {
131        match self.bits {
132            false => CMUE_A::VALUE1,
133            true => CMUE_A::VALUE2,
134        }
135    }
136    #[doc = "Compare Match while counting up interrupt is disabled"]
137    #[inline(always)]
138    pub fn is_value1(&self) -> bool {
139        *self == CMUE_A::VALUE1
140    }
141    #[doc = "Compare Match while counting up interrupt is enabled"]
142    #[inline(always)]
143    pub fn is_value2(&self) -> bool {
144        *self == CMUE_A::VALUE2
145    }
146}
147#[doc = "Field `CMUE` writer - Compare match while counting up enable"]
148pub type CMUE_W<'a, REG> = crate::BitWriter<'a, REG, CMUE_A>;
149impl<'a, REG> CMUE_W<'a, REG>
150where
151    REG: crate::Writable + crate::RegisterSpec,
152{
153    #[doc = "Compare Match while counting up interrupt is disabled"]
154    #[inline(always)]
155    pub fn value1(self) -> &'a mut crate::W<REG> {
156        self.variant(CMUE_A::VALUE1)
157    }
158    #[doc = "Compare Match while counting up interrupt is enabled"]
159    #[inline(always)]
160    pub fn value2(self) -> &'a mut crate::W<REG> {
161        self.variant(CMUE_A::VALUE2)
162    }
163}
164#[doc = "Compare match while counting down enable\n\nValue on reset: 0"]
165#[derive(Clone, Copy, Debug, PartialEq, Eq)]
166pub enum CMDE_A {
167    #[doc = "0: Compare Match while counting down interrupt is disabled"]
168    VALUE1 = 0,
169    #[doc = "1: Compare Match while counting down interrupt is enabled"]
170    VALUE2 = 1,
171}
172impl From<CMDE_A> for bool {
173    #[inline(always)]
174    fn from(variant: CMDE_A) -> Self {
175        variant as u8 != 0
176    }
177}
178#[doc = "Field `CMDE` reader - Compare match while counting down enable"]
179pub type CMDE_R = crate::BitReader<CMDE_A>;
180impl CMDE_R {
181    #[doc = "Get enumerated values variant"]
182    #[inline(always)]
183    pub const fn variant(&self) -> CMDE_A {
184        match self.bits {
185            false => CMDE_A::VALUE1,
186            true => CMDE_A::VALUE2,
187        }
188    }
189    #[doc = "Compare Match while counting down interrupt is disabled"]
190    #[inline(always)]
191    pub fn is_value1(&self) -> bool {
192        *self == CMDE_A::VALUE1
193    }
194    #[doc = "Compare Match while counting down interrupt is enabled"]
195    #[inline(always)]
196    pub fn is_value2(&self) -> bool {
197        *self == CMDE_A::VALUE2
198    }
199}
200#[doc = "Field `CMDE` writer - Compare match while counting down enable"]
201pub type CMDE_W<'a, REG> = crate::BitWriter<'a, REG, CMDE_A>;
202impl<'a, REG> CMDE_W<'a, REG>
203where
204    REG: crate::Writable + crate::RegisterSpec,
205{
206    #[doc = "Compare Match while counting down interrupt is disabled"]
207    #[inline(always)]
208    pub fn value1(self) -> &'a mut crate::W<REG> {
209        self.variant(CMDE_A::VALUE1)
210    }
211    #[doc = "Compare Match while counting down interrupt is enabled"]
212    #[inline(always)]
213    pub fn value2(self) -> &'a mut crate::W<REG> {
214        self.variant(CMDE_A::VALUE2)
215    }
216}
217#[doc = "Event 0 interrupt enable\n\nValue on reset: 0"]
218#[derive(Clone, Copy, Debug, PartialEq, Eq)]
219pub enum E0AE_A {
220    #[doc = "0: Event 0 detection interrupt is disabled"]
221    VALUE1 = 0,
222    #[doc = "1: Event 0 detection interrupt is enabled"]
223    VALUE2 = 1,
224}
225impl From<E0AE_A> for bool {
226    #[inline(always)]
227    fn from(variant: E0AE_A) -> Self {
228        variant as u8 != 0
229    }
230}
231#[doc = "Field `E0AE` reader - Event 0 interrupt enable"]
232pub type E0AE_R = crate::BitReader<E0AE_A>;
233impl E0AE_R {
234    #[doc = "Get enumerated values variant"]
235    #[inline(always)]
236    pub const fn variant(&self) -> E0AE_A {
237        match self.bits {
238            false => E0AE_A::VALUE1,
239            true => E0AE_A::VALUE2,
240        }
241    }
242    #[doc = "Event 0 detection interrupt is disabled"]
243    #[inline(always)]
244    pub fn is_value1(&self) -> bool {
245        *self == E0AE_A::VALUE1
246    }
247    #[doc = "Event 0 detection interrupt is enabled"]
248    #[inline(always)]
249    pub fn is_value2(&self) -> bool {
250        *self == E0AE_A::VALUE2
251    }
252}
253#[doc = "Field `E0AE` writer - Event 0 interrupt enable"]
254pub type E0AE_W<'a, REG> = crate::BitWriter<'a, REG, E0AE_A>;
255impl<'a, REG> E0AE_W<'a, REG>
256where
257    REG: crate::Writable + crate::RegisterSpec,
258{
259    #[doc = "Event 0 detection interrupt is disabled"]
260    #[inline(always)]
261    pub fn value1(self) -> &'a mut crate::W<REG> {
262        self.variant(E0AE_A::VALUE1)
263    }
264    #[doc = "Event 0 detection interrupt is enabled"]
265    #[inline(always)]
266    pub fn value2(self) -> &'a mut crate::W<REG> {
267        self.variant(E0AE_A::VALUE2)
268    }
269}
270#[doc = "Event 1 interrupt enable\n\nValue on reset: 0"]
271#[derive(Clone, Copy, Debug, PartialEq, Eq)]
272pub enum E1AE_A {
273    #[doc = "0: Event 1 detection interrupt is disabled"]
274    VALUE1 = 0,
275    #[doc = "1: Event 1 detection interrupt is enabled"]
276    VALUE2 = 1,
277}
278impl From<E1AE_A> for bool {
279    #[inline(always)]
280    fn from(variant: E1AE_A) -> Self {
281        variant as u8 != 0
282    }
283}
284#[doc = "Field `E1AE` reader - Event 1 interrupt enable"]
285pub type E1AE_R = crate::BitReader<E1AE_A>;
286impl E1AE_R {
287    #[doc = "Get enumerated values variant"]
288    #[inline(always)]
289    pub const fn variant(&self) -> E1AE_A {
290        match self.bits {
291            false => E1AE_A::VALUE1,
292            true => E1AE_A::VALUE2,
293        }
294    }
295    #[doc = "Event 1 detection interrupt is disabled"]
296    #[inline(always)]
297    pub fn is_value1(&self) -> bool {
298        *self == E1AE_A::VALUE1
299    }
300    #[doc = "Event 1 detection interrupt is enabled"]
301    #[inline(always)]
302    pub fn is_value2(&self) -> bool {
303        *self == E1AE_A::VALUE2
304    }
305}
306#[doc = "Field `E1AE` writer - Event 1 interrupt enable"]
307pub type E1AE_W<'a, REG> = crate::BitWriter<'a, REG, E1AE_A>;
308impl<'a, REG> E1AE_W<'a, REG>
309where
310    REG: crate::Writable + crate::RegisterSpec,
311{
312    #[doc = "Event 1 detection interrupt is disabled"]
313    #[inline(always)]
314    pub fn value1(self) -> &'a mut crate::W<REG> {
315        self.variant(E1AE_A::VALUE1)
316    }
317    #[doc = "Event 1 detection interrupt is enabled"]
318    #[inline(always)]
319    pub fn value2(self) -> &'a mut crate::W<REG> {
320        self.variant(E1AE_A::VALUE2)
321    }
322}
323#[doc = "Event 2 interrupt enable\n\nValue on reset: 0"]
324#[derive(Clone, Copy, Debug, PartialEq, Eq)]
325pub enum E2AE_A {
326    #[doc = "0: Event 2 detection interrupt is disabled"]
327    VALUE1 = 0,
328    #[doc = "1: Event 2 detection interrupt is enabled"]
329    VALUE2 = 1,
330}
331impl From<E2AE_A> for bool {
332    #[inline(always)]
333    fn from(variant: E2AE_A) -> Self {
334        variant as u8 != 0
335    }
336}
337#[doc = "Field `E2AE` reader - Event 2 interrupt enable"]
338pub type E2AE_R = crate::BitReader<E2AE_A>;
339impl E2AE_R {
340    #[doc = "Get enumerated values variant"]
341    #[inline(always)]
342    pub const fn variant(&self) -> E2AE_A {
343        match self.bits {
344            false => E2AE_A::VALUE1,
345            true => E2AE_A::VALUE2,
346        }
347    }
348    #[doc = "Event 2 detection interrupt is disabled"]
349    #[inline(always)]
350    pub fn is_value1(&self) -> bool {
351        *self == E2AE_A::VALUE1
352    }
353    #[doc = "Event 2 detection interrupt is enabled"]
354    #[inline(always)]
355    pub fn is_value2(&self) -> bool {
356        *self == E2AE_A::VALUE2
357    }
358}
359#[doc = "Field `E2AE` writer - Event 2 interrupt enable"]
360pub type E2AE_W<'a, REG> = crate::BitWriter<'a, REG, E2AE_A>;
361impl<'a, REG> E2AE_W<'a, REG>
362where
363    REG: crate::Writable + crate::RegisterSpec,
364{
365    #[doc = "Event 2 detection interrupt is disabled"]
366    #[inline(always)]
367    pub fn value1(self) -> &'a mut crate::W<REG> {
368        self.variant(E2AE_A::VALUE1)
369    }
370    #[doc = "Event 2 detection interrupt is enabled"]
371    #[inline(always)]
372    pub fn value2(self) -> &'a mut crate::W<REG> {
373        self.variant(E2AE_A::VALUE2)
374    }
375}
376impl R {
377    #[doc = "Bit 0 - Period match while counting up enable"]
378    #[inline(always)]
379    pub fn pme(&self) -> PME_R {
380        PME_R::new((self.bits & 1) != 0)
381    }
382    #[doc = "Bit 1 - One match while counting down enable"]
383    #[inline(always)]
384    pub fn ome(&self) -> OME_R {
385        OME_R::new(((self.bits >> 1) & 1) != 0)
386    }
387    #[doc = "Bit 2 - Compare match while counting up enable"]
388    #[inline(always)]
389    pub fn cmue(&self) -> CMUE_R {
390        CMUE_R::new(((self.bits >> 2) & 1) != 0)
391    }
392    #[doc = "Bit 3 - Compare match while counting down enable"]
393    #[inline(always)]
394    pub fn cmde(&self) -> CMDE_R {
395        CMDE_R::new(((self.bits >> 3) & 1) != 0)
396    }
397    #[doc = "Bit 8 - Event 0 interrupt enable"]
398    #[inline(always)]
399    pub fn e0ae(&self) -> E0AE_R {
400        E0AE_R::new(((self.bits >> 8) & 1) != 0)
401    }
402    #[doc = "Bit 9 - Event 1 interrupt enable"]
403    #[inline(always)]
404    pub fn e1ae(&self) -> E1AE_R {
405        E1AE_R::new(((self.bits >> 9) & 1) != 0)
406    }
407    #[doc = "Bit 10 - Event 2 interrupt enable"]
408    #[inline(always)]
409    pub fn e2ae(&self) -> E2AE_R {
410        E2AE_R::new(((self.bits >> 10) & 1) != 0)
411    }
412}
413impl W {
414    #[doc = "Bit 0 - Period match while counting up enable"]
415    #[inline(always)]
416    pub fn pme(&mut self) -> PME_W<INTE_SPEC> {
417        PME_W::new(self, 0)
418    }
419    #[doc = "Bit 1 - One match while counting down enable"]
420    #[inline(always)]
421    pub fn ome(&mut self) -> OME_W<INTE_SPEC> {
422        OME_W::new(self, 1)
423    }
424    #[doc = "Bit 2 - Compare match while counting up enable"]
425    #[inline(always)]
426    pub fn cmue(&mut self) -> CMUE_W<INTE_SPEC> {
427        CMUE_W::new(self, 2)
428    }
429    #[doc = "Bit 3 - Compare match while counting down enable"]
430    #[inline(always)]
431    pub fn cmde(&mut self) -> CMDE_W<INTE_SPEC> {
432        CMDE_W::new(self, 3)
433    }
434    #[doc = "Bit 8 - Event 0 interrupt enable"]
435    #[inline(always)]
436    pub fn e0ae(&mut self) -> E0AE_W<INTE_SPEC> {
437        E0AE_W::new(self, 8)
438    }
439    #[doc = "Bit 9 - Event 1 interrupt enable"]
440    #[inline(always)]
441    pub fn e1ae(&mut self) -> E1AE_W<INTE_SPEC> {
442        E1AE_W::new(self, 9)
443    }
444    #[doc = "Bit 10 - Event 2 interrupt enable"]
445    #[inline(always)]
446    pub fn e2ae(&mut self) -> E2AE_W<INTE_SPEC> {
447        E2AE_W::new(self, 10)
448    }
449}
450#[doc = "Interrupt Enable Control\n\nYou can [`read`](crate::Reg::read) this register and get [`inte::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`inte::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
451pub struct INTE_SPEC;
452impl crate::RegisterSpec for INTE_SPEC {
453    type Ux = u32;
454}
455#[doc = "`read()` method returns [`inte::R`](R) reader structure"]
456impl crate::Readable for INTE_SPEC {}
457#[doc = "`write(|w| ..)` method takes [`inte::W`](W) writer structure"]
458impl crate::Writable for INTE_SPEC {
459    type Safety = crate::Unsafe;
460    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
461    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
462}
463#[doc = "`reset()` method sets INTE to value 0"]
464impl crate::Resettable for INTE_SPEC {
465    const RESET_VALUE: u32 = 0;
466}