Skip to main content

ra2a1_pac/
acmphs0.rs

1/*
2DISCLAIMER
3This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
4No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
5applicable laws, including copyright laws.
6THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
7OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
8NON-INFRINGEMENT.  ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY
9LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT,
10INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR
11ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
12Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability
13of this software. By using this software, you agree to the additional terms and conditions found by accessing the
14following link:
15http://www.renesas.com/disclaimer
16
17*/
18// Generated from SVD 1.1, with svd2pac 0.6.1 on Sun, 15 Mar 2026 07:00:31 +0000
19
20#![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 0"]
28unsafe impl ::core::marker::Send for super::Acmphs0 {}
29unsafe impl ::core::marker::Sync for super::Acmphs0 {}
30impl super::Acmphs0 {
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 = "This bit is read as 0. The write value should be 0."]
183    #[inline(always)]
184    pub fn reserved(
185        self,
186    ) -> crate::common::RegisterFieldBool<2, 1, 0, Cmpctl_SPEC, crate::common::RW> {
187        crate::common::RegisterFieldBool::<2, 1, 0, Cmpctl_SPEC, crate::common::RW>::from_register(
188            self, 0,
189        )
190    }
191
192    #[doc = "Comparator output enable"]
193    #[inline(always)]
194    pub fn coe(
195        self,
196    ) -> crate::common::RegisterField<
197        1,
198        0x1,
199        1,
200        0,
201        cmpctl::Coe,
202        cmpctl::Coe,
203        Cmpctl_SPEC,
204        crate::common::RW,
205    > {
206        crate::common::RegisterField::<
207            1,
208            0x1,
209            1,
210            0,
211            cmpctl::Coe,
212            cmpctl::Coe,
213            Cmpctl_SPEC,
214            crate::common::RW,
215        >::from_register(self, 0)
216    }
217
218    #[doc = "Comparator output polarity selection"]
219    #[inline(always)]
220    pub fn cinv(
221        self,
222    ) -> crate::common::RegisterField<
223        0,
224        0x1,
225        1,
226        0,
227        cmpctl::Cinv,
228        cmpctl::Cinv,
229        Cmpctl_SPEC,
230        crate::common::RW,
231    > {
232        crate::common::RegisterField::<
233            0,
234            0x1,
235            1,
236            0,
237            cmpctl::Cinv,
238            cmpctl::Cinv,
239            Cmpctl_SPEC,
240            crate::common::RW,
241        >::from_register(self, 0)
242    }
243}
244impl ::core::default::Default for Cmpctl {
245    #[inline(always)]
246    fn default() -> Cmpctl {
247        <crate::RegValueT<Cmpctl_SPEC> as RegisterValue<_>>::new(0)
248    }
249}
250pub mod cmpctl {
251
252    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
253    pub struct Hcmpon_SPEC;
254    pub type Hcmpon = crate::EnumBitfieldStruct<u8, Hcmpon_SPEC>;
255    impl Hcmpon {
256        #[doc = "Operation stopped (the comparator outputs a low-level signal)"]
257        pub const _0: Self = Self::new(0);
258
259        #[doc = "Operation enabled (input to the comparator pins is enabled"]
260        pub const _1: Self = Self::new(1);
261    }
262    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
263    pub struct Cdfs_SPEC;
264    pub type Cdfs = crate::EnumBitfieldStruct<u8, Cdfs_SPEC>;
265    impl Cdfs {
266        #[doc = "Noise filter not used."]
267        pub const _00: Self = Self::new(0);
268
269        #[doc = "Noise filter sampling frequency is 2^3/PCLKB."]
270        pub const _01: Self = Self::new(1);
271
272        #[doc = "Noise filter sampling frequency is 2^4/PCLKB."]
273        pub const _10: Self = Self::new(2);
274
275        #[doc = "Noise filter sampling frequency is 2^5/PCLKB."]
276        pub const _11: Self = Self::new(3);
277    }
278    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
279    pub struct Ceg_SPEC;
280    pub type Ceg = crate::EnumBitfieldStruct<u8, Ceg_SPEC>;
281    impl Ceg {
282        #[doc = "No edge selection."]
283        pub const _00: Self = Self::new(0);
284
285        #[doc = "Rising edge selection."]
286        pub const _01: Self = Self::new(1);
287
288        #[doc = "Falling edge selection"]
289        pub const _10: Self = Self::new(2);
290
291        #[doc = "Both-edge selection"]
292        pub const _11: Self = Self::new(3);
293    }
294    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
295    pub struct Coe_SPEC;
296    pub type Coe = crate::EnumBitfieldStruct<u8, Coe_SPEC>;
297    impl Coe {
298        #[doc = "Comparator output disabled (the output signal is low level)."]
299        pub const _0: Self = Self::new(0);
300
301        #[doc = "Comparator output enabled"]
302        pub const _1: Self = Self::new(1);
303    }
304    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
305    pub struct Cinv_SPEC;
306    pub type Cinv = crate::EnumBitfieldStruct<u8, Cinv_SPEC>;
307    impl Cinv {
308        #[doc = "Comparator output not inverted"]
309        pub const _0: Self = Self::new(0);
310
311        #[doc = "Comparator output inverted"]
312        pub const _1: Self = Self::new(1);
313    }
314}
315#[doc(hidden)]
316#[derive(Copy, Clone, Eq, PartialEq)]
317pub struct Cmpsel0_SPEC;
318impl crate::sealed::RegSpec for Cmpsel0_SPEC {
319    type DataType = u8;
320}
321
322#[doc = "Comparator Input Select Register"]
323pub type Cmpsel0 = crate::RegValueT<Cmpsel0_SPEC>;
324
325impl Cmpsel0 {
326    #[doc = "Comparator input selection"]
327    #[inline(always)]
328    pub fn cmpsel(
329        self,
330    ) -> crate::common::RegisterField<
331        0,
332        0x7,
333        1,
334        0,
335        cmpsel0::Cmpsel,
336        cmpsel0::Cmpsel,
337        Cmpsel0_SPEC,
338        crate::common::RW,
339    > {
340        crate::common::RegisterField::<
341            0,
342            0x7,
343            1,
344            0,
345            cmpsel0::Cmpsel,
346            cmpsel0::Cmpsel,
347            Cmpsel0_SPEC,
348            crate::common::RW,
349        >::from_register(self, 0)
350    }
351}
352impl ::core::default::Default for Cmpsel0 {
353    #[inline(always)]
354    fn default() -> Cmpsel0 {
355        <crate::RegValueT<Cmpsel0_SPEC> as RegisterValue<_>>::new(0)
356    }
357}
358pub mod cmpsel0 {
359
360    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
361    pub struct Cmpsel_SPEC;
362    pub type Cmpsel = crate::EnumBitfieldStruct<u8, Cmpsel_SPEC>;
363    impl Cmpsel {
364        #[doc = "No input"]
365        pub const _000: Self = Self::new(0);
366
367        #[doc = "IVCMP0 selected"]
368        pub const _001: Self = Self::new(1);
369
370        #[doc = "IVCMP1 selected"]
371        pub const _010: Self = Self::new(2);
372
373        #[doc = "IVCMP2 selected"]
374        pub const _100: Self = Self::new(4);
375    }
376}
377#[doc(hidden)]
378#[derive(Copy, Clone, Eq, PartialEq)]
379pub struct Cmpsel1_SPEC;
380impl crate::sealed::RegSpec for Cmpsel1_SPEC {
381    type DataType = u8;
382}
383
384#[doc = "Comparator Reference Voltage Select Register"]
385pub type Cmpsel1 = crate::RegValueT<Cmpsel1_SPEC>;
386
387impl Cmpsel1 {
388    #[doc = "Reference voltage selection"]
389    #[inline(always)]
390    pub fn crvs(
391        self,
392    ) -> crate::common::RegisterField<
393        0,
394        0x3f,
395        1,
396        0,
397        cmpsel1::Crvs,
398        cmpsel1::Crvs,
399        Cmpsel1_SPEC,
400        crate::common::RW,
401    > {
402        crate::common::RegisterField::<
403            0,
404            0x3f,
405            1,
406            0,
407            cmpsel1::Crvs,
408            cmpsel1::Crvs,
409            Cmpsel1_SPEC,
410            crate::common::RW,
411        >::from_register(self, 0)
412    }
413}
414impl ::core::default::Default for Cmpsel1 {
415    #[inline(always)]
416    fn default() -> Cmpsel1 {
417        <crate::RegValueT<Cmpsel1_SPEC> as RegisterValue<_>>::new(0)
418    }
419}
420pub mod cmpsel1 {
421
422    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
423    pub struct Crvs_SPEC;
424    pub type Crvs = crate::EnumBitfieldStruct<u8, Crvs_SPEC>;
425    impl Crvs {
426        #[doc = "No reference voltage"]
427        pub const _000000: Self = Self::new(0);
428
429        #[doc = "IVREF0 selected"]
430        pub const _000001: Self = Self::new(1);
431
432        #[doc = "IVREF1 selected"]
433        pub const _000010: Self = Self::new(2);
434
435        #[doc = "IVREF2 selected"]
436        pub const _000100: Self = Self::new(4);
437
438        #[doc = "IVREF3 selected"]
439        pub const _001000: Self = Self::new(8);
440
441        #[doc = "IVREF4 selected"]
442        pub const _010000: Self = Self::new(16);
443
444        #[doc = "IVREF5 selected"]
445        pub const _100000: Self = Self::new(32);
446    }
447}
448#[doc(hidden)]
449#[derive(Copy, Clone, Eq, PartialEq)]
450pub struct Cmpmon_SPEC;
451impl crate::sealed::RegSpec for Cmpmon_SPEC {
452    type DataType = u8;
453}
454
455#[doc = "Comparator Output Monitor Register"]
456pub type Cmpmon = crate::RegValueT<Cmpmon_SPEC>;
457
458impl Cmpmon {
459    #[doc = "These bits are read as 0000000."]
460    #[inline(always)]
461    pub fn reserved(
462        self,
463    ) -> crate::common::RegisterField<1, 0x7f, 1, 0, u8, u8, Cmpmon_SPEC, crate::common::R> {
464        crate::common::RegisterField::<1,0x7f,1,0,u8,u8,Cmpmon_SPEC,crate::common::R>::from_register(self,0)
465    }
466
467    #[doc = "Comparator output monitor"]
468    #[inline(always)]
469    pub fn cmpmon(
470        self,
471    ) -> crate::common::RegisterField<
472        0,
473        0x1,
474        1,
475        0,
476        cmpmon::Cmpmon,
477        cmpmon::Cmpmon,
478        Cmpmon_SPEC,
479        crate::common::R,
480    > {
481        crate::common::RegisterField::<
482            0,
483            0x1,
484            1,
485            0,
486            cmpmon::Cmpmon,
487            cmpmon::Cmpmon,
488            Cmpmon_SPEC,
489            crate::common::R,
490        >::from_register(self, 0)
491    }
492}
493impl ::core::default::Default for Cmpmon {
494    #[inline(always)]
495    fn default() -> Cmpmon {
496        <crate::RegValueT<Cmpmon_SPEC> as RegisterValue<_>>::new(0)
497    }
498}
499pub mod cmpmon {
500
501    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
502    pub struct Cmpmon_SPEC;
503    pub type Cmpmon = crate::EnumBitfieldStruct<u8, Cmpmon_SPEC>;
504    impl Cmpmon {
505        #[doc = "Comparator output Low"]
506        pub const _0: Self = Self::new(0);
507
508        #[doc = "Comparator output High"]
509        pub const _1: Self = Self::new(1);
510    }
511}
512#[doc(hidden)]
513#[derive(Copy, Clone, Eq, PartialEq)]
514pub struct Cpioc_SPEC;
515impl crate::sealed::RegSpec for Cpioc_SPEC {
516    type DataType = u8;
517}
518
519#[doc = "Comparator Output Control Register"]
520pub type Cpioc = crate::RegValueT<Cpioc_SPEC>;
521
522impl Cpioc {
523    #[doc = "Internal Vref enable"]
524    #[inline(always)]
525    pub fn vrefen(
526        self,
527    ) -> crate::common::RegisterField<
528        7,
529        0x1,
530        1,
531        0,
532        cpioc::Vrefen,
533        cpioc::Vrefen,
534        Cpioc_SPEC,
535        crate::common::RW,
536    > {
537        crate::common::RegisterField::<
538            7,
539            0x1,
540            1,
541            0,
542            cpioc::Vrefen,
543            cpioc::Vrefen,
544            Cpioc_SPEC,
545            crate::common::RW,
546        >::from_register(self, 0)
547    }
548
549    #[doc = "These bits are read as 000000. The write value should be 000000."]
550    #[inline(always)]
551    pub fn reserved(
552        self,
553    ) -> crate::common::RegisterField<1, 0x3f, 1, 0, u8, u8, Cpioc_SPEC, crate::common::RW> {
554        crate::common::RegisterField::<1,0x3f,1,0,u8,u8,Cpioc_SPEC,crate::common::RW>::from_register(self,0)
555    }
556
557    #[doc = "Comparator output selection"]
558    #[inline(always)]
559    pub fn cpoe(
560        self,
561    ) -> crate::common::RegisterField<
562        0,
563        0x1,
564        1,
565        0,
566        cpioc::Cpoe,
567        cpioc::Cpoe,
568        Cpioc_SPEC,
569        crate::common::RW,
570    > {
571        crate::common::RegisterField::<
572            0,
573            0x1,
574            1,
575            0,
576            cpioc::Cpoe,
577            cpioc::Cpoe,
578            Cpioc_SPEC,
579            crate::common::RW,
580        >::from_register(self, 0)
581    }
582}
583impl ::core::default::Default for Cpioc {
584    #[inline(always)]
585    fn default() -> Cpioc {
586        <crate::RegValueT<Cpioc_SPEC> as RegisterValue<_>>::new(0)
587    }
588}
589pub mod cpioc {
590
591    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
592    pub struct Vrefen_SPEC;
593    pub type Vrefen = crate::EnumBitfieldStruct<u8, Vrefen_SPEC>;
594    impl Vrefen {
595        #[doc = "Internal Vref disable"]
596        pub const _0: Self = Self::new(0);
597
598        #[doc = "Internal Vref enable"]
599        pub const _1: Self = Self::new(1);
600    }
601    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
602    pub struct Cpoe_SPEC;
603    pub type Cpoe = crate::EnumBitfieldStruct<u8, Cpoe_SPEC>;
604    impl Cpoe {
605        #[doc = "VCOUT pin output of the comparator is disabled (the output signal is low level)."]
606        pub const _0: Self = Self::new(0);
607
608        #[doc = "VCOUT pin output of the comparator is enabled"]
609        pub const _1: Self = Self::new(1);
610    }
611}