1#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"High-Speed Analog Comparator 1"]
28unsafe impl ::core::marker::Send for super::Acmphs1 {}
29unsafe impl ::core::marker::Sync for super::Acmphs1 {}
30impl super::Acmphs1 {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36
37 #[doc = "Comparator Control Register"]
38 #[inline(always)]
39 pub const fn cmpctl(
40 &self,
41 ) -> &'static crate::common::Reg<self::Cmpctl_SPEC, crate::common::RW> {
42 unsafe {
43 crate::common::Reg::<self::Cmpctl_SPEC, crate::common::RW>::from_ptr(
44 self._svd2pac_as_ptr().add(0usize),
45 )
46 }
47 }
48
49 #[doc = "Comparator Input Select Register"]
50 #[inline(always)]
51 pub const fn cmpsel0(
52 &self,
53 ) -> &'static crate::common::Reg<self::Cmpsel0_SPEC, crate::common::RW> {
54 unsafe {
55 crate::common::Reg::<self::Cmpsel0_SPEC, crate::common::RW>::from_ptr(
56 self._svd2pac_as_ptr().add(4usize),
57 )
58 }
59 }
60
61 #[doc = "Comparator Reference Voltage Select Register"]
62 #[inline(always)]
63 pub const fn cmpsel1(
64 &self,
65 ) -> &'static crate::common::Reg<self::Cmpsel1_SPEC, crate::common::RW> {
66 unsafe {
67 crate::common::Reg::<self::Cmpsel1_SPEC, crate::common::RW>::from_ptr(
68 self._svd2pac_as_ptr().add(8usize),
69 )
70 }
71 }
72
73 #[doc = "Comparator Output Monitor Register"]
74 #[inline(always)]
75 pub const fn cmpmon(&self) -> &'static crate::common::Reg<self::Cmpmon_SPEC, crate::common::R> {
76 unsafe {
77 crate::common::Reg::<self::Cmpmon_SPEC, crate::common::R>::from_ptr(
78 self._svd2pac_as_ptr().add(12usize),
79 )
80 }
81 }
82
83 #[doc = "Comparator Output Control Register"]
84 #[inline(always)]
85 pub const fn cpioc(&self) -> &'static crate::common::Reg<self::Cpioc_SPEC, crate::common::RW> {
86 unsafe {
87 crate::common::Reg::<self::Cpioc_SPEC, crate::common::RW>::from_ptr(
88 self._svd2pac_as_ptr().add(16usize),
89 )
90 }
91 }
92}
93#[doc(hidden)]
94#[derive(Copy, Clone, Eq, PartialEq)]
95pub struct Cmpctl_SPEC;
96impl crate::sealed::RegSpec for Cmpctl_SPEC {
97 type DataType = u8;
98}
99
100#[doc = "Comparator Control Register"]
101pub type Cmpctl = crate::RegValueT<Cmpctl_SPEC>;
102
103impl Cmpctl {
104 #[doc = "Comparator operation control"]
105 #[inline(always)]
106 pub fn hcmpon(
107 self,
108 ) -> crate::common::RegisterField<
109 7,
110 0x1,
111 1,
112 0,
113 cmpctl::Hcmpon,
114 cmpctl::Hcmpon,
115 Cmpctl_SPEC,
116 crate::common::RW,
117 > {
118 crate::common::RegisterField::<
119 7,
120 0x1,
121 1,
122 0,
123 cmpctl::Hcmpon,
124 cmpctl::Hcmpon,
125 Cmpctl_SPEC,
126 crate::common::RW,
127 >::from_register(self, 0)
128 }
129
130 #[doc = "Noise filter selection"]
131 #[inline(always)]
132 pub fn cdfs(
133 self,
134 ) -> crate::common::RegisterField<
135 5,
136 0x3,
137 1,
138 0,
139 cmpctl::Cdfs,
140 cmpctl::Cdfs,
141 Cmpctl_SPEC,
142 crate::common::RW,
143 > {
144 crate::common::RegisterField::<
145 5,
146 0x3,
147 1,
148 0,
149 cmpctl::Cdfs,
150 cmpctl::Cdfs,
151 Cmpctl_SPEC,
152 crate::common::RW,
153 >::from_register(self, 0)
154 }
155
156 #[doc = "Selection of valid edge (Edge selector)"]
157 #[inline(always)]
158 pub fn ceg(
159 self,
160 ) -> crate::common::RegisterField<
161 3,
162 0x3,
163 1,
164 0,
165 cmpctl::Ceg,
166 cmpctl::Ceg,
167 Cmpctl_SPEC,
168 crate::common::RW,
169 > {
170 crate::common::RegisterField::<
171 3,
172 0x3,
173 1,
174 0,
175 cmpctl::Ceg,
176 cmpctl::Ceg,
177 Cmpctl_SPEC,
178 crate::common::RW,
179 >::from_register(self, 0)
180 }
181
182 #[doc = "Interrupt Select"]
183 #[inline(always)]
184 pub fn csten(
185 self,
186 ) -> crate::common::RegisterField<
187 2,
188 0x1,
189 1,
190 0,
191 cmpctl::Csten,
192 cmpctl::Csten,
193 Cmpctl_SPEC,
194 crate::common::RW,
195 > {
196 crate::common::RegisterField::<
197 2,
198 0x1,
199 1,
200 0,
201 cmpctl::Csten,
202 cmpctl::Csten,
203 Cmpctl_SPEC,
204 crate::common::RW,
205 >::from_register(self, 0)
206 }
207
208 #[doc = "Comparator output enable"]
209 #[inline(always)]
210 pub fn coe(
211 self,
212 ) -> crate::common::RegisterField<
213 1,
214 0x1,
215 1,
216 0,
217 cmpctl::Coe,
218 cmpctl::Coe,
219 Cmpctl_SPEC,
220 crate::common::RW,
221 > {
222 crate::common::RegisterField::<
223 1,
224 0x1,
225 1,
226 0,
227 cmpctl::Coe,
228 cmpctl::Coe,
229 Cmpctl_SPEC,
230 crate::common::RW,
231 >::from_register(self, 0)
232 }
233
234 #[doc = "Comparator output polarity selection"]
235 #[inline(always)]
236 pub fn cinv(
237 self,
238 ) -> crate::common::RegisterField<
239 0,
240 0x1,
241 1,
242 0,
243 cmpctl::Cinv,
244 cmpctl::Cinv,
245 Cmpctl_SPEC,
246 crate::common::RW,
247 > {
248 crate::common::RegisterField::<
249 0,
250 0x1,
251 1,
252 0,
253 cmpctl::Cinv,
254 cmpctl::Cinv,
255 Cmpctl_SPEC,
256 crate::common::RW,
257 >::from_register(self, 0)
258 }
259}
260impl ::core::default::Default for Cmpctl {
261 #[inline(always)]
262 fn default() -> Cmpctl {
263 <crate::RegValueT<Cmpctl_SPEC> as RegisterValue<_>>::new(0)
264 }
265}
266pub mod cmpctl {
267
268 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
269 pub struct Hcmpon_SPEC;
270 pub type Hcmpon = crate::EnumBitfieldStruct<u8, Hcmpon_SPEC>;
271 impl Hcmpon {
272 #[doc = "Operation stopped (the comparator outputs a low-level signal)"]
273 pub const _0: Self = Self::new(0);
274
275 #[doc = "Operation enabled (input to the comparator pins is enabled"]
276 pub const _1: Self = Self::new(1);
277 }
278 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
279 pub struct Cdfs_SPEC;
280 pub type Cdfs = crate::EnumBitfieldStruct<u8, Cdfs_SPEC>;
281 impl Cdfs {
282 #[doc = "Noise filter not used."]
283 pub const _00: Self = Self::new(0);
284
285 #[doc = "Noise filter sampling frequency is 2^3/PCLKB."]
286 pub const _01: Self = Self::new(1);
287
288 #[doc = "Noise filter sampling frequency is 2^4/PCLKB."]
289 pub const _10: Self = Self::new(2);
290
291 #[doc = "Noise filter sampling frequency is 2^5/PCLKB."]
292 pub const _11: Self = Self::new(3);
293 }
294 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
295 pub struct Ceg_SPEC;
296 pub type Ceg = crate::EnumBitfieldStruct<u8, Ceg_SPEC>;
297 impl Ceg {
298 #[doc = "No edge selection."]
299 pub const _00: Self = Self::new(0);
300
301 #[doc = "Rising edge selection."]
302 pub const _01: Self = Self::new(1);
303
304 #[doc = "Falling edge selection"]
305 pub const _10: Self = Self::new(2);
306
307 #[doc = "Both-edge selection"]
308 pub const _11: Self = Self::new(3);
309 }
310 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
311 pub struct Csten_SPEC;
312 pub type Csten = crate::EnumBitfieldStruct<u8, Csten_SPEC>;
313 impl Csten {
314 #[doc = "Output via the Edge selector"]
315 pub const _0: Self = Self::new(0);
316
317 #[doc = "Direct output"]
318 pub const _1: Self = Self::new(1);
319 }
320 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
321 pub struct Coe_SPEC;
322 pub type Coe = crate::EnumBitfieldStruct<u8, Coe_SPEC>;
323 impl Coe {
324 #[doc = "Comparator output disabled (the output signal is low level)."]
325 pub const _0: Self = Self::new(0);
326
327 #[doc = "Comparator output enabled"]
328 pub const _1: Self = Self::new(1);
329 }
330 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
331 pub struct Cinv_SPEC;
332 pub type Cinv = crate::EnumBitfieldStruct<u8, Cinv_SPEC>;
333 impl Cinv {
334 #[doc = "Comparator output not inverted"]
335 pub const _0: Self = Self::new(0);
336
337 #[doc = "Comparator output inverted"]
338 pub const _1: Self = Self::new(1);
339 }
340}
341#[doc(hidden)]
342#[derive(Copy, Clone, Eq, PartialEq)]
343pub struct Cmpsel0_SPEC;
344impl crate::sealed::RegSpec for Cmpsel0_SPEC {
345 type DataType = u8;
346}
347
348#[doc = "Comparator Input Select Register"]
349pub type Cmpsel0 = crate::RegValueT<Cmpsel0_SPEC>;
350
351impl Cmpsel0 {
352 #[doc = "Comparator input selection"]
353 #[inline(always)]
354 pub fn cmpsel(
355 self,
356 ) -> crate::common::RegisterField<
357 0,
358 0xf,
359 1,
360 0,
361 cmpsel0::Cmpsel,
362 cmpsel0::Cmpsel,
363 Cmpsel0_SPEC,
364 crate::common::RW,
365 > {
366 crate::common::RegisterField::<
367 0,
368 0xf,
369 1,
370 0,
371 cmpsel0::Cmpsel,
372 cmpsel0::Cmpsel,
373 Cmpsel0_SPEC,
374 crate::common::RW,
375 >::from_register(self, 0)
376 }
377}
378impl ::core::default::Default for Cmpsel0 {
379 #[inline(always)]
380 fn default() -> Cmpsel0 {
381 <crate::RegValueT<Cmpsel0_SPEC> as RegisterValue<_>>::new(0)
382 }
383}
384pub mod cmpsel0 {
385
386 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
387 pub struct Cmpsel_SPEC;
388 pub type Cmpsel = crate::EnumBitfieldStruct<u8, Cmpsel_SPEC>;
389 impl Cmpsel {
390 #[doc = "No input"]
391 pub const _0000: Self = Self::new(0);
392
393 #[doc = "IVCMP0 selected"]
394 pub const _0001: Self = Self::new(1);
395
396 #[doc = "IVCMP1 selected"]
397 pub const _0010: Self = Self::new(2);
398
399 #[doc = "IVCMP2 selected"]
400 pub const _0100: Self = Self::new(4);
401
402 #[doc = "IVCMP3 selected"]
403 pub const _1000: Self = Self::new(8);
404 }
405}
406#[doc(hidden)]
407#[derive(Copy, Clone, Eq, PartialEq)]
408pub struct Cmpsel1_SPEC;
409impl crate::sealed::RegSpec for Cmpsel1_SPEC {
410 type DataType = u8;
411}
412
413#[doc = "Comparator Reference Voltage Select Register"]
414pub type Cmpsel1 = crate::RegValueT<Cmpsel1_SPEC>;
415
416impl Cmpsel1 {
417 #[doc = "Reference voltage selection"]
418 #[inline(always)]
419 pub fn crvs(
420 self,
421 ) -> crate::common::RegisterField<
422 0,
423 0xf,
424 1,
425 0,
426 cmpsel1::Crvs,
427 cmpsel1::Crvs,
428 Cmpsel1_SPEC,
429 crate::common::RW,
430 > {
431 crate::common::RegisterField::<
432 0,
433 0xf,
434 1,
435 0,
436 cmpsel1::Crvs,
437 cmpsel1::Crvs,
438 Cmpsel1_SPEC,
439 crate::common::RW,
440 >::from_register(self, 0)
441 }
442}
443impl ::core::default::Default for Cmpsel1 {
444 #[inline(always)]
445 fn default() -> Cmpsel1 {
446 <crate::RegValueT<Cmpsel1_SPEC> as RegisterValue<_>>::new(0)
447 }
448}
449pub mod cmpsel1 {
450
451 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
452 pub struct Crvs_SPEC;
453 pub type Crvs = crate::EnumBitfieldStruct<u8, Crvs_SPEC>;
454 impl Crvs {
455 #[doc = "No reference voltage"]
456 pub const _0000: Self = Self::new(0);
457
458 #[doc = "IVREF0 selected"]
459 pub const _0001: Self = Self::new(1);
460
461 #[doc = "IVREF1 selected"]
462 pub const _0010: Self = Self::new(2);
463
464 #[doc = "IVREF2 selected"]
465 pub const _0100: Self = Self::new(4);
466
467 #[doc = "IVREF3 selected"]
468 pub const _1000: Self = Self::new(8);
469 }
470}
471#[doc(hidden)]
472#[derive(Copy, Clone, Eq, PartialEq)]
473pub struct Cmpmon_SPEC;
474impl crate::sealed::RegSpec for Cmpmon_SPEC {
475 type DataType = u8;
476}
477
478#[doc = "Comparator Output Monitor Register"]
479pub type Cmpmon = crate::RegValueT<Cmpmon_SPEC>;
480
481impl Cmpmon {
482 #[doc = "Comparator output monitor"]
483 #[inline(always)]
484 pub fn cmpmon(
485 self,
486 ) -> crate::common::RegisterField<
487 0,
488 0x1,
489 1,
490 0,
491 cmpmon::Cmpmon,
492 cmpmon::Cmpmon,
493 Cmpmon_SPEC,
494 crate::common::R,
495 > {
496 crate::common::RegisterField::<
497 0,
498 0x1,
499 1,
500 0,
501 cmpmon::Cmpmon,
502 cmpmon::Cmpmon,
503 Cmpmon_SPEC,
504 crate::common::R,
505 >::from_register(self, 0)
506 }
507}
508impl ::core::default::Default for Cmpmon {
509 #[inline(always)]
510 fn default() -> Cmpmon {
511 <crate::RegValueT<Cmpmon_SPEC> as RegisterValue<_>>::new(0)
512 }
513}
514pub mod cmpmon {
515
516 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
517 pub struct Cmpmon_SPEC;
518 pub type Cmpmon = crate::EnumBitfieldStruct<u8, Cmpmon_SPEC>;
519 impl Cmpmon {
520 #[doc = "Comparator output Low"]
521 pub const _0: Self = Self::new(0);
522
523 #[doc = "Comparator output High"]
524 pub const _1: Self = Self::new(1);
525 }
526}
527#[doc(hidden)]
528#[derive(Copy, Clone, Eq, PartialEq)]
529pub struct Cpioc_SPEC;
530impl crate::sealed::RegSpec for Cpioc_SPEC {
531 type DataType = u8;
532}
533
534#[doc = "Comparator Output Control Register"]
535pub type Cpioc = crate::RegValueT<Cpioc_SPEC>;
536
537impl Cpioc {
538 #[doc = "Internal Vref enable"]
539 #[inline(always)]
540 pub fn vrefen(
541 self,
542 ) -> crate::common::RegisterField<
543 7,
544 0x1,
545 1,
546 0,
547 cpioc::Vrefen,
548 cpioc::Vrefen,
549 Cpioc_SPEC,
550 crate::common::RW,
551 > {
552 crate::common::RegisterField::<
553 7,
554 0x1,
555 1,
556 0,
557 cpioc::Vrefen,
558 cpioc::Vrefen,
559 Cpioc_SPEC,
560 crate::common::RW,
561 >::from_register(self, 0)
562 }
563
564 #[doc = "Comparator output selection"]
565 #[inline(always)]
566 pub fn cpoe(
567 self,
568 ) -> crate::common::RegisterField<
569 0,
570 0x1,
571 1,
572 0,
573 cpioc::Cpoe,
574 cpioc::Cpoe,
575 Cpioc_SPEC,
576 crate::common::RW,
577 > {
578 crate::common::RegisterField::<
579 0,
580 0x1,
581 1,
582 0,
583 cpioc::Cpoe,
584 cpioc::Cpoe,
585 Cpioc_SPEC,
586 crate::common::RW,
587 >::from_register(self, 0)
588 }
589}
590impl ::core::default::Default for Cpioc {
591 #[inline(always)]
592 fn default() -> Cpioc {
593 <crate::RegValueT<Cpioc_SPEC> as RegisterValue<_>>::new(0)
594 }
595}
596pub mod cpioc {
597
598 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
599 pub struct Vrefen_SPEC;
600 pub type Vrefen = crate::EnumBitfieldStruct<u8, Vrefen_SPEC>;
601 impl Vrefen {
602 #[doc = "Internal Vref disable"]
603 pub const _0: Self = Self::new(0);
604
605 #[doc = "Internal Vref enable"]
606 pub const _1: Self = Self::new(1);
607 }
608 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
609 pub struct Cpoe_SPEC;
610 pub type Cpoe = crate::EnumBitfieldStruct<u8, Cpoe_SPEC>;
611 impl Cpoe {
612 #[doc = "VCOUT pin output of the comparator is disabled (the output signal is low level)."]
613 pub const _0: Self = Self::new(0);
614
615 #[doc = "VCOUT pin output of the comparator is enabled"]
616 pub const _1: Self = Self::new(1);
617 }
618}