xmc4700/ccu80_cc80/
ints.rs1#[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 = "Channel 1 Compare Match while Counting Up\n\nValue on reset: 0"]
76#[derive(Clone, Copy, Debug, PartialEq, Eq)]
77pub enum CMU1S_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<CMU1S_A> for bool {
84 #[inline(always)]
85 fn from(variant: CMU1S_A) -> Self {
86 variant as u8 != 0
87 }
88}
89#[doc = "Field `CMU1S` reader - Channel 1 Compare Match while Counting Up"]
90pub type CMU1S_R = crate::BitReader<CMU1S_A>;
91impl CMU1S_R {
92 #[doc = "Get enumerated values variant"]
93 #[inline(always)]
94 pub const fn variant(&self) -> CMU1S_A {
95 match self.bits {
96 false => CMU1S_A::VALUE1,
97 true => CMU1S_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 == CMU1S_A::VALUE1
104 }
105 #[doc = "Compare match while counting up detected"]
106 #[inline(always)]
107 pub fn is_value2(&self) -> bool {
108 *self == CMU1S_A::VALUE2
109 }
110}
111#[doc = "Channel 1 Compare Match while Counting Down\n\nValue on reset: 0"]
112#[derive(Clone, Copy, Debug, PartialEq, Eq)]
113pub enum CMD1S_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<CMD1S_A> for bool {
120 #[inline(always)]
121 fn from(variant: CMD1S_A) -> Self {
122 variant as u8 != 0
123 }
124}
125#[doc = "Field `CMD1S` reader - Channel 1 Compare Match while Counting Down"]
126pub type CMD1S_R = crate::BitReader<CMD1S_A>;
127impl CMD1S_R {
128 #[doc = "Get enumerated values variant"]
129 #[inline(always)]
130 pub const fn variant(&self) -> CMD1S_A {
131 match self.bits {
132 false => CMD1S_A::VALUE1,
133 true => CMD1S_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 == CMD1S_A::VALUE1
140 }
141 #[doc = "Compare match while counting down detected"]
142 #[inline(always)]
143 pub fn is_value2(&self) -> bool {
144 *self == CMD1S_A::VALUE2
145 }
146}
147#[doc = "Channel 2 Compare Match while Counting Up\n\nValue on reset: 0"]
148#[derive(Clone, Copy, Debug, PartialEq, Eq)]
149pub enum CMU2S_A {
150 #[doc = "0: Compare match while counting up not detected"]
151 VALUE1 = 0,
152 #[doc = "1: Compare match while counting up detected"]
153 VALUE2 = 1,
154}
155impl From<CMU2S_A> for bool {
156 #[inline(always)]
157 fn from(variant: CMU2S_A) -> Self {
158 variant as u8 != 0
159 }
160}
161#[doc = "Field `CMU2S` reader - Channel 2 Compare Match while Counting Up"]
162pub type CMU2S_R = crate::BitReader<CMU2S_A>;
163impl CMU2S_R {
164 #[doc = "Get enumerated values variant"]
165 #[inline(always)]
166 pub const fn variant(&self) -> CMU2S_A {
167 match self.bits {
168 false => CMU2S_A::VALUE1,
169 true => CMU2S_A::VALUE2,
170 }
171 }
172 #[doc = "Compare match while counting up not detected"]
173 #[inline(always)]
174 pub fn is_value1(&self) -> bool {
175 *self == CMU2S_A::VALUE1
176 }
177 #[doc = "Compare match while counting up detected"]
178 #[inline(always)]
179 pub fn is_value2(&self) -> bool {
180 *self == CMU2S_A::VALUE2
181 }
182}
183#[doc = "Channel 2 Compare Match while Counting Down\n\nValue on reset: 0"]
184#[derive(Clone, Copy, Debug, PartialEq, Eq)]
185pub enum CMD2S_A {
186 #[doc = "0: Compare match while counting down not detected"]
187 VALUE1 = 0,
188 #[doc = "1: Compare match while counting down detected"]
189 VALUE2 = 1,
190}
191impl From<CMD2S_A> for bool {
192 #[inline(always)]
193 fn from(variant: CMD2S_A) -> Self {
194 variant as u8 != 0
195 }
196}
197#[doc = "Field `CMD2S` reader - Channel 2 Compare Match while Counting Down"]
198pub type CMD2S_R = crate::BitReader<CMD2S_A>;
199impl CMD2S_R {
200 #[doc = "Get enumerated values variant"]
201 #[inline(always)]
202 pub const fn variant(&self) -> CMD2S_A {
203 match self.bits {
204 false => CMD2S_A::VALUE1,
205 true => CMD2S_A::VALUE2,
206 }
207 }
208 #[doc = "Compare match while counting down not detected"]
209 #[inline(always)]
210 pub fn is_value1(&self) -> bool {
211 *self == CMD2S_A::VALUE1
212 }
213 #[doc = "Compare match while counting down detected"]
214 #[inline(always)]
215 pub fn is_value2(&self) -> bool {
216 *self == CMD2S_A::VALUE2
217 }
218}
219#[doc = "Event 0 Detection Status\n\nValue on reset: 0"]
220#[derive(Clone, Copy, Debug, PartialEq, Eq)]
221pub enum E0AS_A {
222 #[doc = "0: Event 0 not detected"]
223 VALUE1 = 0,
224 #[doc = "1: Event 0 detected"]
225 VALUE2 = 1,
226}
227impl From<E0AS_A> for bool {
228 #[inline(always)]
229 fn from(variant: E0AS_A) -> Self {
230 variant as u8 != 0
231 }
232}
233#[doc = "Field `E0AS` reader - Event 0 Detection Status"]
234pub type E0AS_R = crate::BitReader<E0AS_A>;
235impl E0AS_R {
236 #[doc = "Get enumerated values variant"]
237 #[inline(always)]
238 pub const fn variant(&self) -> E0AS_A {
239 match self.bits {
240 false => E0AS_A::VALUE1,
241 true => E0AS_A::VALUE2,
242 }
243 }
244 #[doc = "Event 0 not detected"]
245 #[inline(always)]
246 pub fn is_value1(&self) -> bool {
247 *self == E0AS_A::VALUE1
248 }
249 #[doc = "Event 0 detected"]
250 #[inline(always)]
251 pub fn is_value2(&self) -> bool {
252 *self == E0AS_A::VALUE2
253 }
254}
255#[doc = "Event 1 Detection Status\n\nValue on reset: 0"]
256#[derive(Clone, Copy, Debug, PartialEq, Eq)]
257pub enum E1AS_A {
258 #[doc = "0: Event 1 not detected"]
259 VALUE1 = 0,
260 #[doc = "1: Event 1 detected"]
261 VALUE2 = 1,
262}
263impl From<E1AS_A> for bool {
264 #[inline(always)]
265 fn from(variant: E1AS_A) -> Self {
266 variant as u8 != 0
267 }
268}
269#[doc = "Field `E1AS` reader - Event 1 Detection Status"]
270pub type E1AS_R = crate::BitReader<E1AS_A>;
271impl E1AS_R {
272 #[doc = "Get enumerated values variant"]
273 #[inline(always)]
274 pub const fn variant(&self) -> E1AS_A {
275 match self.bits {
276 false => E1AS_A::VALUE1,
277 true => E1AS_A::VALUE2,
278 }
279 }
280 #[doc = "Event 1 not detected"]
281 #[inline(always)]
282 pub fn is_value1(&self) -> bool {
283 *self == E1AS_A::VALUE1
284 }
285 #[doc = "Event 1 detected"]
286 #[inline(always)]
287 pub fn is_value2(&self) -> bool {
288 *self == E1AS_A::VALUE2
289 }
290}
291#[doc = "Event 2 Detection Status\n\nValue on reset: 0"]
292#[derive(Clone, Copy, Debug, PartialEq, Eq)]
293pub enum E2AS_A {
294 #[doc = "0: Event 2 not detected"]
295 VALUE1 = 0,
296 #[doc = "1: Event 2 detected"]
297 VALUE2 = 1,
298}
299impl From<E2AS_A> for bool {
300 #[inline(always)]
301 fn from(variant: E2AS_A) -> Self {
302 variant as u8 != 0
303 }
304}
305#[doc = "Field `E2AS` reader - Event 2 Detection Status"]
306pub type E2AS_R = crate::BitReader<E2AS_A>;
307impl E2AS_R {
308 #[doc = "Get enumerated values variant"]
309 #[inline(always)]
310 pub const fn variant(&self) -> E2AS_A {
311 match self.bits {
312 false => E2AS_A::VALUE1,
313 true => E2AS_A::VALUE2,
314 }
315 }
316 #[doc = "Event 2 not detected"]
317 #[inline(always)]
318 pub fn is_value1(&self) -> bool {
319 *self == E2AS_A::VALUE1
320 }
321 #[doc = "Event 2 detected"]
322 #[inline(always)]
323 pub fn is_value2(&self) -> bool {
324 *self == E2AS_A::VALUE2
325 }
326}
327#[doc = "Field `TRPF` reader - Trap Flag Status"]
328pub type TRPF_R = crate::BitReader;
329impl R {
330 #[doc = "Bit 0 - Period Match while Counting Up"]
331 #[inline(always)]
332 pub fn pmus(&self) -> PMUS_R {
333 PMUS_R::new((self.bits & 1) != 0)
334 }
335 #[doc = "Bit 1 - One Match while Counting Down"]
336 #[inline(always)]
337 pub fn omds(&self) -> OMDS_R {
338 OMDS_R::new(((self.bits >> 1) & 1) != 0)
339 }
340 #[doc = "Bit 2 - Channel 1 Compare Match while Counting Up"]
341 #[inline(always)]
342 pub fn cmu1s(&self) -> CMU1S_R {
343 CMU1S_R::new(((self.bits >> 2) & 1) != 0)
344 }
345 #[doc = "Bit 3 - Channel 1 Compare Match while Counting Down"]
346 #[inline(always)]
347 pub fn cmd1s(&self) -> CMD1S_R {
348 CMD1S_R::new(((self.bits >> 3) & 1) != 0)
349 }
350 #[doc = "Bit 4 - Channel 2 Compare Match while Counting Up"]
351 #[inline(always)]
352 pub fn cmu2s(&self) -> CMU2S_R {
353 CMU2S_R::new(((self.bits >> 4) & 1) != 0)
354 }
355 #[doc = "Bit 5 - Channel 2 Compare Match while Counting Down"]
356 #[inline(always)]
357 pub fn cmd2s(&self) -> CMD2S_R {
358 CMD2S_R::new(((self.bits >> 5) & 1) != 0)
359 }
360 #[doc = "Bit 8 - Event 0 Detection Status"]
361 #[inline(always)]
362 pub fn e0as(&self) -> E0AS_R {
363 E0AS_R::new(((self.bits >> 8) & 1) != 0)
364 }
365 #[doc = "Bit 9 - Event 1 Detection Status"]
366 #[inline(always)]
367 pub fn e1as(&self) -> E1AS_R {
368 E1AS_R::new(((self.bits >> 9) & 1) != 0)
369 }
370 #[doc = "Bit 10 - Event 2 Detection Status"]
371 #[inline(always)]
372 pub fn e2as(&self) -> E2AS_R {
373 E2AS_R::new(((self.bits >> 10) & 1) != 0)
374 }
375 #[doc = "Bit 11 - Trap Flag Status"]
376 #[inline(always)]
377 pub fn trpf(&self) -> TRPF_R {
378 TRPF_R::new(((self.bits >> 11) & 1) != 0)
379 }
380}
381#[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)."]
382pub struct INTS_SPEC;
383impl crate::RegisterSpec for INTS_SPEC {
384 type Ux = u32;
385}
386#[doc = "`read()` method returns [`ints::R`](R) reader structure"]
387impl crate::Readable for INTS_SPEC {}
388#[doc = "`reset()` method sets INTS to value 0"]
389impl crate::Resettable for INTS_SPEC {
390 const RESET_VALUE: u32 = 0;
391}