xmc4800/ledts0/
evfr.rs

1#[doc = "Register `EVFR` reader"]
2pub type R = crate::R<EVFR_SPEC>;
3#[doc = "Register `EVFR` writer"]
4pub type W = crate::W<EVFR_SPEC>;
5#[doc = "Field `TSF` reader - Time Slice Interrupt Flag"]
6pub type TSF_R = crate::BitReader;
7#[doc = "Field `TFF` reader - (Extended) Time Frame Interrupt Flag"]
8pub type TFF_R = crate::BitReader;
9#[doc = "Field `TPF` reader - Autoscan Time Period Interrupt Flag"]
10pub type TPF_R = crate::BitReader;
11#[doc = "TS-Counter Overflow Indication\n\nValue on reset: 0"]
12#[derive(Clone, Copy, Debug, PartialEq, Eq)]
13pub enum TSCTROVF_A {
14    #[doc = "0: No overflow has occurred."]
15    VALUE1 = 0,
16    #[doc = "1: The TS-counter has overflowed at least once."]
17    VALUE2 = 1,
18}
19impl From<TSCTROVF_A> for bool {
20    #[inline(always)]
21    fn from(variant: TSCTROVF_A) -> Self {
22        variant as u8 != 0
23    }
24}
25#[doc = "Field `TSCTROVF` reader - TS-Counter Overflow Indication"]
26pub type TSCTROVF_R = crate::BitReader<TSCTROVF_A>;
27impl TSCTROVF_R {
28    #[doc = "Get enumerated values variant"]
29    #[inline(always)]
30    pub const fn variant(&self) -> TSCTROVF_A {
31        match self.bits {
32            false => TSCTROVF_A::VALUE1,
33            true => TSCTROVF_A::VALUE2,
34        }
35    }
36    #[doc = "No overflow has occurred."]
37    #[inline(always)]
38    pub fn is_value1(&self) -> bool {
39        *self == TSCTROVF_A::VALUE1
40    }
41    #[doc = "The TS-counter has overflowed at least once."]
42    #[inline(always)]
43    pub fn is_value2(&self) -> bool {
44        *self == TSCTROVF_A::VALUE2
45    }
46}
47#[doc = "Clear Time Slice Interrupt Flag\n\nValue on reset: 0"]
48#[derive(Clone, Copy, Debug, PartialEq, Eq)]
49pub enum CTSF_A {
50    #[doc = "0: No action."]
51    VALUE1 = 0,
52    #[doc = "1: Bit TSF is cleared."]
53    VALUE2 = 1,
54}
55impl From<CTSF_A> for bool {
56    #[inline(always)]
57    fn from(variant: CTSF_A) -> Self {
58        variant as u8 != 0
59    }
60}
61#[doc = "Field `CTSF` writer - Clear Time Slice Interrupt Flag"]
62pub type CTSF_W<'a, REG> = crate::BitWriter<'a, REG, CTSF_A>;
63impl<'a, REG> CTSF_W<'a, REG>
64where
65    REG: crate::Writable + crate::RegisterSpec,
66{
67    #[doc = "No action."]
68    #[inline(always)]
69    pub fn value1(self) -> &'a mut crate::W<REG> {
70        self.variant(CTSF_A::VALUE1)
71    }
72    #[doc = "Bit TSF is cleared."]
73    #[inline(always)]
74    pub fn value2(self) -> &'a mut crate::W<REG> {
75        self.variant(CTSF_A::VALUE2)
76    }
77}
78#[doc = "Clear (Extended) Time Frame Interrupt Flag\n\nValue on reset: 0"]
79#[derive(Clone, Copy, Debug, PartialEq, Eq)]
80pub enum CTFF_A {
81    #[doc = "0: No action."]
82    VALUE1 = 0,
83    #[doc = "1: Bit TFF is cleared."]
84    VALUE2 = 1,
85}
86impl From<CTFF_A> for bool {
87    #[inline(always)]
88    fn from(variant: CTFF_A) -> Self {
89        variant as u8 != 0
90    }
91}
92#[doc = "Field `CTFF` writer - Clear (Extended) Time Frame Interrupt Flag"]
93pub type CTFF_W<'a, REG> = crate::BitWriter<'a, REG, CTFF_A>;
94impl<'a, REG> CTFF_W<'a, REG>
95where
96    REG: crate::Writable + crate::RegisterSpec,
97{
98    #[doc = "No action."]
99    #[inline(always)]
100    pub fn value1(self) -> &'a mut crate::W<REG> {
101        self.variant(CTFF_A::VALUE1)
102    }
103    #[doc = "Bit TFF is cleared."]
104    #[inline(always)]
105    pub fn value2(self) -> &'a mut crate::W<REG> {
106        self.variant(CTFF_A::VALUE2)
107    }
108}
109#[doc = "Clear Autoscan Time Period Interrupt Flag\n\nValue on reset: 0"]
110#[derive(Clone, Copy, Debug, PartialEq, Eq)]
111pub enum CTPF_A {
112    #[doc = "0: No action."]
113    VALUE1 = 0,
114    #[doc = "1: Bit TPF is cleared."]
115    VALUE2 = 1,
116}
117impl From<CTPF_A> for bool {
118    #[inline(always)]
119    fn from(variant: CTPF_A) -> Self {
120        variant as u8 != 0
121    }
122}
123#[doc = "Field `CTPF` writer - Clear Autoscan Time Period Interrupt Flag"]
124pub type CTPF_W<'a, REG> = crate::BitWriter<'a, REG, CTPF_A>;
125impl<'a, REG> CTPF_W<'a, REG>
126where
127    REG: crate::Writable + crate::RegisterSpec,
128{
129    #[doc = "No action."]
130    #[inline(always)]
131    pub fn value1(self) -> &'a mut crate::W<REG> {
132        self.variant(CTPF_A::VALUE1)
133    }
134    #[doc = "Bit TPF is cleared."]
135    #[inline(always)]
136    pub fn value2(self) -> &'a mut crate::W<REG> {
137        self.variant(CTPF_A::VALUE2)
138    }
139}
140impl R {
141    #[doc = "Bit 0 - Time Slice Interrupt Flag"]
142    #[inline(always)]
143    pub fn tsf(&self) -> TSF_R {
144        TSF_R::new((self.bits & 1) != 0)
145    }
146    #[doc = "Bit 1 - (Extended) Time Frame Interrupt Flag"]
147    #[inline(always)]
148    pub fn tff(&self) -> TFF_R {
149        TFF_R::new(((self.bits >> 1) & 1) != 0)
150    }
151    #[doc = "Bit 2 - Autoscan Time Period Interrupt Flag"]
152    #[inline(always)]
153    pub fn tpf(&self) -> TPF_R {
154        TPF_R::new(((self.bits >> 2) & 1) != 0)
155    }
156    #[doc = "Bit 3 - TS-Counter Overflow Indication"]
157    #[inline(always)]
158    pub fn tsctrovf(&self) -> TSCTROVF_R {
159        TSCTROVF_R::new(((self.bits >> 3) & 1) != 0)
160    }
161}
162impl W {
163    #[doc = "Bit 16 - Clear Time Slice Interrupt Flag"]
164    #[inline(always)]
165    pub fn ctsf(&mut self) -> CTSF_W<EVFR_SPEC> {
166        CTSF_W::new(self, 16)
167    }
168    #[doc = "Bit 17 - Clear (Extended) Time Frame Interrupt Flag"]
169    #[inline(always)]
170    pub fn ctff(&mut self) -> CTFF_W<EVFR_SPEC> {
171        CTFF_W::new(self, 17)
172    }
173    #[doc = "Bit 18 - Clear Autoscan Time Period Interrupt Flag"]
174    #[inline(always)]
175    pub fn ctpf(&mut self) -> CTPF_W<EVFR_SPEC> {
176        CTPF_W::new(self, 18)
177    }
178}
179#[doc = "Event Flag Register\n\nYou can [`read`](crate::Reg::read) this register and get [`evfr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`evfr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
180pub struct EVFR_SPEC;
181impl crate::RegisterSpec for EVFR_SPEC {
182    type Ux = u32;
183}
184#[doc = "`read()` method returns [`evfr::R`](R) reader structure"]
185impl crate::Readable for EVFR_SPEC {}
186#[doc = "`write(|w| ..)` method takes [`evfr::W`](W) writer structure"]
187impl crate::Writable for EVFR_SPEC {
188    type Safety = crate::Unsafe;
189    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
190    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
191}
192#[doc = "`reset()` method sets EVFR to value 0"]
193impl crate::Resettable for EVFR_SPEC {
194    const RESET_VALUE: u32 = 0;
195}