Skip to main content

ra6m2_pac/
ctsu.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.2, with svd2pac 0.6.1 on Sun, 15 Mar 2026 07:11:44 +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"Capacitive Touch Sensing Unit"]
28unsafe impl ::core::marker::Send for super::Ctsu {}
29unsafe impl ::core::marker::Sync for super::Ctsu {}
30impl super::Ctsu {
31    #[allow(unused)]
32    #[inline(always)]
33    pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34        self.ptr
35    }
36
37    #[doc = "CTSU Control Register 0"]
38    #[inline(always)]
39    pub const fn ctsucr0(
40        &self,
41    ) -> &'static crate::common::Reg<self::Ctsucr0_SPEC, crate::common::RW> {
42        unsafe {
43            crate::common::Reg::<self::Ctsucr0_SPEC, crate::common::RW>::from_ptr(
44                self._svd2pac_as_ptr().add(0usize),
45            )
46        }
47    }
48
49    #[doc = "CTSU Control Register 1"]
50    #[inline(always)]
51    pub const fn ctsucr1(
52        &self,
53    ) -> &'static crate::common::Reg<self::Ctsucr1_SPEC, crate::common::RW> {
54        unsafe {
55            crate::common::Reg::<self::Ctsucr1_SPEC, crate::common::RW>::from_ptr(
56                self._svd2pac_as_ptr().add(1usize),
57            )
58        }
59    }
60
61    #[doc = "CTSU Synchronous Noise Reduction Setting Register"]
62    #[inline(always)]
63    pub const fn ctsusdprs(
64        &self,
65    ) -> &'static crate::common::Reg<self::Ctsusdprs_SPEC, crate::common::RW> {
66        unsafe {
67            crate::common::Reg::<self::Ctsusdprs_SPEC, crate::common::RW>::from_ptr(
68                self._svd2pac_as_ptr().add(2usize),
69            )
70        }
71    }
72
73    #[doc = "CTSU Sensor Stabilization Wait Control Register"]
74    #[inline(always)]
75    pub const fn ctsusst(
76        &self,
77    ) -> &'static crate::common::Reg<self::Ctsusst_SPEC, crate::common::RW> {
78        unsafe {
79            crate::common::Reg::<self::Ctsusst_SPEC, crate::common::RW>::from_ptr(
80                self._svd2pac_as_ptr().add(3usize),
81            )
82        }
83    }
84
85    #[doc = "CTSU Measurement Channel Register 0"]
86    #[inline(always)]
87    pub const fn ctsumch0(
88        &self,
89    ) -> &'static crate::common::Reg<self::Ctsumch0_SPEC, crate::common::RW> {
90        unsafe {
91            crate::common::Reg::<self::Ctsumch0_SPEC, crate::common::RW>::from_ptr(
92                self._svd2pac_as_ptr().add(4usize),
93            )
94        }
95    }
96
97    #[doc = "CTSU Measurement Channel Register 1"]
98    #[inline(always)]
99    pub const fn ctsumch1(
100        &self,
101    ) -> &'static crate::common::Reg<self::Ctsumch1_SPEC, crate::common::R> {
102        unsafe {
103            crate::common::Reg::<self::Ctsumch1_SPEC, crate::common::R>::from_ptr(
104                self._svd2pac_as_ptr().add(5usize),
105            )
106        }
107    }
108
109    #[doc = "CTSU Channel Enable Control Register 0"]
110    #[inline(always)]
111    pub const fn ctsuchac0(
112        &self,
113    ) -> &'static crate::common::Reg<self::Ctsuchac0_SPEC, crate::common::RW> {
114        unsafe {
115            crate::common::Reg::<self::Ctsuchac0_SPEC, crate::common::RW>::from_ptr(
116                self._svd2pac_as_ptr().add(6usize),
117            )
118        }
119    }
120
121    #[doc = "CTSU Channel Enable Control Register 1"]
122    #[inline(always)]
123    pub const fn ctsuchac1(
124        &self,
125    ) -> &'static crate::common::Reg<self::Ctsuchac1_SPEC, crate::common::RW> {
126        unsafe {
127            crate::common::Reg::<self::Ctsuchac1_SPEC, crate::common::RW>::from_ptr(
128                self._svd2pac_as_ptr().add(7usize),
129            )
130        }
131    }
132
133    #[doc = "CTSU Channel Enable Control Register 2"]
134    #[inline(always)]
135    pub const fn ctsuchac2(
136        &self,
137    ) -> &'static crate::common::Reg<self::Ctsuchac2_SPEC, crate::common::RW> {
138        unsafe {
139            crate::common::Reg::<self::Ctsuchac2_SPEC, crate::common::RW>::from_ptr(
140                self._svd2pac_as_ptr().add(8usize),
141            )
142        }
143    }
144
145    #[doc = "CTSU Channel Transmit/Receive Control Register 0"]
146    #[inline(always)]
147    pub const fn ctsuchtrc0(
148        &self,
149    ) -> &'static crate::common::Reg<self::Ctsuchtrc0_SPEC, crate::common::RW> {
150        unsafe {
151            crate::common::Reg::<self::Ctsuchtrc0_SPEC, crate::common::RW>::from_ptr(
152                self._svd2pac_as_ptr().add(11usize),
153            )
154        }
155    }
156
157    #[doc = "CTSU Channel Transmit/Receive Control Register 1"]
158    #[inline(always)]
159    pub const fn ctsuchtrc1(
160        &self,
161    ) -> &'static crate::common::Reg<self::Ctsuchtrc1_SPEC, crate::common::RW> {
162        unsafe {
163            crate::common::Reg::<self::Ctsuchtrc1_SPEC, crate::common::RW>::from_ptr(
164                self._svd2pac_as_ptr().add(12usize),
165            )
166        }
167    }
168
169    #[doc = "CTSU Channel Transmit/Receive Control Register 2"]
170    #[inline(always)]
171    pub const fn ctsuchtrc2(
172        &self,
173    ) -> &'static crate::common::Reg<self::Ctsuchtrc2_SPEC, crate::common::RW> {
174        unsafe {
175            crate::common::Reg::<self::Ctsuchtrc2_SPEC, crate::common::RW>::from_ptr(
176                self._svd2pac_as_ptr().add(13usize),
177            )
178        }
179    }
180
181    #[doc = "CTSU High-Pass Noise Reduction Control Register"]
182    #[inline(always)]
183    pub const fn ctsudclkc(
184        &self,
185    ) -> &'static crate::common::Reg<self::Ctsudclkc_SPEC, crate::common::RW> {
186        unsafe {
187            crate::common::Reg::<self::Ctsudclkc_SPEC, crate::common::RW>::from_ptr(
188                self._svd2pac_as_ptr().add(16usize),
189            )
190        }
191    }
192
193    #[doc = "CTSU Status Register"]
194    #[inline(always)]
195    pub const fn ctsust(
196        &self,
197    ) -> &'static crate::common::Reg<self::Ctsust_SPEC, crate::common::RW> {
198        unsafe {
199            crate::common::Reg::<self::Ctsust_SPEC, crate::common::RW>::from_ptr(
200                self._svd2pac_as_ptr().add(17usize),
201            )
202        }
203    }
204
205    #[doc = "CTSU High-Pass Noise Reduction Spectrum Diffusion Control Register"]
206    #[inline(always)]
207    pub const fn ctsussc(
208        &self,
209    ) -> &'static crate::common::Reg<self::Ctsussc_SPEC, crate::common::RW> {
210        unsafe {
211            crate::common::Reg::<self::Ctsussc_SPEC, crate::common::RW>::from_ptr(
212                self._svd2pac_as_ptr().add(18usize),
213            )
214        }
215    }
216
217    #[doc = "CTSU Sensor Offset Register 0"]
218    #[inline(always)]
219    pub const fn ctsuso0(
220        &self,
221    ) -> &'static crate::common::Reg<self::Ctsuso0_SPEC, crate::common::RW> {
222        unsafe {
223            crate::common::Reg::<self::Ctsuso0_SPEC, crate::common::RW>::from_ptr(
224                self._svd2pac_as_ptr().add(20usize),
225            )
226        }
227    }
228
229    #[doc = "CTSU Sensor Offset Register 1"]
230    #[inline(always)]
231    pub const fn ctsuso1(
232        &self,
233    ) -> &'static crate::common::Reg<self::Ctsuso1_SPEC, crate::common::RW> {
234        unsafe {
235            crate::common::Reg::<self::Ctsuso1_SPEC, crate::common::RW>::from_ptr(
236                self._svd2pac_as_ptr().add(22usize),
237            )
238        }
239    }
240
241    #[doc = "CTSU Sensor Counter"]
242    #[inline(always)]
243    pub const fn ctsusc(&self) -> &'static crate::common::Reg<self::Ctsusc_SPEC, crate::common::R> {
244        unsafe {
245            crate::common::Reg::<self::Ctsusc_SPEC, crate::common::R>::from_ptr(
246                self._svd2pac_as_ptr().add(24usize),
247            )
248        }
249    }
250
251    #[doc = "CTSU Reference Counter"]
252    #[inline(always)]
253    pub const fn ctsurc(&self) -> &'static crate::common::Reg<self::Ctsurc_SPEC, crate::common::R> {
254        unsafe {
255            crate::common::Reg::<self::Ctsurc_SPEC, crate::common::R>::from_ptr(
256                self._svd2pac_as_ptr().add(26usize),
257            )
258        }
259    }
260
261    #[doc = "CTSU Error Status Register"]
262    #[inline(always)]
263    pub const fn ctsuerrs(
264        &self,
265    ) -> &'static crate::common::Reg<self::Ctsuerrs_SPEC, crate::common::R> {
266        unsafe {
267            crate::common::Reg::<self::Ctsuerrs_SPEC, crate::common::R>::from_ptr(
268                self._svd2pac_as_ptr().add(28usize),
269            )
270        }
271    }
272}
273#[doc(hidden)]
274#[derive(Copy, Clone, Eq, PartialEq)]
275pub struct Ctsucr0_SPEC;
276impl crate::sealed::RegSpec for Ctsucr0_SPEC {
277    type DataType = u8;
278}
279
280#[doc = "CTSU Control Register 0"]
281pub type Ctsucr0 = crate::RegValueT<Ctsucr0_SPEC>;
282
283impl Ctsucr0 {
284    #[doc = "CTSU Transmission power supply selection"]
285    #[inline(always)]
286    pub fn ctsutxvsel(
287        self,
288    ) -> crate::common::RegisterField<
289        7,
290        0x1,
291        1,
292        0,
293        ctsucr0::Ctsutxvsel,
294        ctsucr0::Ctsutxvsel,
295        Ctsucr0_SPEC,
296        crate::common::RW,
297    > {
298        crate::common::RegisterField::<
299            7,
300            0x1,
301            1,
302            0,
303            ctsucr0::Ctsutxvsel,
304            ctsucr0::Ctsutxvsel,
305            Ctsucr0_SPEC,
306            crate::common::RW,
307        >::from_register(self, 0)
308    }
309
310    #[doc = "CTSU Control Block Initialization"]
311    #[inline(always)]
312    pub fn ctsuinit(
313        self,
314    ) -> crate::common::RegisterField<
315        4,
316        0x1,
317        1,
318        0,
319        ctsucr0::Ctsuinit,
320        ctsucr0::Ctsuinit,
321        Ctsucr0_SPEC,
322        crate::common::RW,
323    > {
324        crate::common::RegisterField::<
325            4,
326            0x1,
327            1,
328            0,
329            ctsucr0::Ctsuinit,
330            ctsucr0::Ctsuinit,
331            Ctsucr0_SPEC,
332            crate::common::RW,
333        >::from_register(self, 0)
334    }
335
336    #[doc = "CTSU Wait State Power-Saving Enable"]
337    #[inline(always)]
338    pub fn ctsusnz(
339        self,
340    ) -> crate::common::RegisterField<
341        2,
342        0x1,
343        1,
344        0,
345        ctsucr0::Ctsusnz,
346        ctsucr0::Ctsusnz,
347        Ctsucr0_SPEC,
348        crate::common::RW,
349    > {
350        crate::common::RegisterField::<
351            2,
352            0x1,
353            1,
354            0,
355            ctsucr0::Ctsusnz,
356            ctsucr0::Ctsusnz,
357            Ctsucr0_SPEC,
358            crate::common::RW,
359        >::from_register(self, 0)
360    }
361
362    #[doc = "CTSU Measurement Operation Start Trigger Select"]
363    #[inline(always)]
364    pub fn ctsucap(
365        self,
366    ) -> crate::common::RegisterField<
367        1,
368        0x1,
369        1,
370        0,
371        ctsucr0::Ctsucap,
372        ctsucr0::Ctsucap,
373        Ctsucr0_SPEC,
374        crate::common::RW,
375    > {
376        crate::common::RegisterField::<
377            1,
378            0x1,
379            1,
380            0,
381            ctsucr0::Ctsucap,
382            ctsucr0::Ctsucap,
383            Ctsucr0_SPEC,
384            crate::common::RW,
385        >::from_register(self, 0)
386    }
387
388    #[doc = "CTSU Measurement Operation Start"]
389    #[inline(always)]
390    pub fn ctsustrt(
391        self,
392    ) -> crate::common::RegisterField<
393        0,
394        0x1,
395        1,
396        0,
397        ctsucr0::Ctsustrt,
398        ctsucr0::Ctsustrt,
399        Ctsucr0_SPEC,
400        crate::common::RW,
401    > {
402        crate::common::RegisterField::<
403            0,
404            0x1,
405            1,
406            0,
407            ctsucr0::Ctsustrt,
408            ctsucr0::Ctsustrt,
409            Ctsucr0_SPEC,
410            crate::common::RW,
411        >::from_register(self, 0)
412    }
413}
414impl ::core::default::Default for Ctsucr0 {
415    #[inline(always)]
416    fn default() -> Ctsucr0 {
417        <crate::RegValueT<Ctsucr0_SPEC> as RegisterValue<_>>::new(0)
418    }
419}
420pub mod ctsucr0 {
421
422    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
423    pub struct Ctsutxvsel_SPEC;
424    pub type Ctsutxvsel = crate::EnumBitfieldStruct<u8, Ctsutxvsel_SPEC>;
425    impl Ctsutxvsel {
426        #[doc = "Select Vcc"]
427        pub const _0: Self = Self::new(0);
428
429        #[doc = "Select internal logic power supply"]
430        pub const _1: Self = Self::new(1);
431    }
432    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
433    pub struct Ctsuinit_SPEC;
434    pub type Ctsuinit = crate::EnumBitfieldStruct<u8, Ctsuinit_SPEC>;
435    impl Ctsuinit {
436        #[doc = "Writing a 0 has no effect, this bit is read as 0."]
437        pub const _0: Self = Self::new(0);
438
439        #[doc = "initializes the CTSU control block and registers."]
440        pub const _1: Self = Self::new(1);
441    }
442    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
443    pub struct Ctsusnz_SPEC;
444    pub type Ctsusnz = crate::EnumBitfieldStruct<u8, Ctsusnz_SPEC>;
445    impl Ctsusnz {
446        #[doc = "Power-saving function during wait state is disabled."]
447        pub const _0: Self = Self::new(0);
448
449        #[doc = "Power-saving function during wait state is enabled."]
450        pub const _1: Self = Self::new(1);
451    }
452    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
453    pub struct Ctsucap_SPEC;
454    pub type Ctsucap = crate::EnumBitfieldStruct<u8, Ctsucap_SPEC>;
455    impl Ctsucap {
456        #[doc = "Software trigger."]
457        pub const _0: Self = Self::new(0);
458
459        #[doc = "External trigger."]
460        pub const _1: Self = Self::new(1);
461    }
462    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
463    pub struct Ctsustrt_SPEC;
464    pub type Ctsustrt = crate::EnumBitfieldStruct<u8, Ctsustrt_SPEC>;
465    impl Ctsustrt {
466        #[doc = "Measurement operation stops."]
467        pub const _0: Self = Self::new(0);
468
469        #[doc = "Measurement operation starts."]
470        pub const _1: Self = Self::new(1);
471    }
472}
473#[doc(hidden)]
474#[derive(Copy, Clone, Eq, PartialEq)]
475pub struct Ctsucr1_SPEC;
476impl crate::sealed::RegSpec for Ctsucr1_SPEC {
477    type DataType = u8;
478}
479
480#[doc = "CTSU Control Register 1"]
481pub type Ctsucr1 = crate::RegValueT<Ctsucr1_SPEC>;
482
483impl Ctsucr1 {
484    #[doc = "CTSU Measurement Mode Select"]
485    #[inline(always)]
486    pub fn ctsumd(
487        self,
488    ) -> crate::common::RegisterField<
489        6,
490        0x3,
491        1,
492        0,
493        ctsucr1::Ctsumd,
494        ctsucr1::Ctsumd,
495        Ctsucr1_SPEC,
496        crate::common::RW,
497    > {
498        crate::common::RegisterField::<
499            6,
500            0x3,
501            1,
502            0,
503            ctsucr1::Ctsumd,
504            ctsucr1::Ctsumd,
505            Ctsucr1_SPEC,
506            crate::common::RW,
507        >::from_register(self, 0)
508    }
509
510    #[doc = "CTSU Operating Clock Select"]
511    #[inline(always)]
512    pub fn ctsuclk(
513        self,
514    ) -> crate::common::RegisterField<
515        4,
516        0x3,
517        1,
518        0,
519        ctsucr1::Ctsuclk,
520        ctsucr1::Ctsuclk,
521        Ctsucr1_SPEC,
522        crate::common::RW,
523    > {
524        crate::common::RegisterField::<
525            4,
526            0x3,
527            1,
528            0,
529            ctsucr1::Ctsuclk,
530            ctsucr1::Ctsuclk,
531            Ctsucr1_SPEC,
532            crate::common::RW,
533        >::from_register(self, 0)
534    }
535
536    #[doc = "CTSU Power Supply Capacity Adjustment"]
537    #[inline(always)]
538    pub fn ctsuatune1(
539        self,
540    ) -> crate::common::RegisterField<
541        3,
542        0x1,
543        1,
544        0,
545        ctsucr1::Ctsuatune1,
546        ctsucr1::Ctsuatune1,
547        Ctsucr1_SPEC,
548        crate::common::RW,
549    > {
550        crate::common::RegisterField::<
551            3,
552            0x1,
553            1,
554            0,
555            ctsucr1::Ctsuatune1,
556            ctsucr1::Ctsuatune1,
557            Ctsucr1_SPEC,
558            crate::common::RW,
559        >::from_register(self, 0)
560    }
561
562    #[doc = "CTSU LPF Capacitance Charging Control"]
563    #[inline(always)]
564    pub fn ctsucsw(
565        self,
566    ) -> crate::common::RegisterField<
567        1,
568        0x1,
569        1,
570        0,
571        ctsucr1::Ctsucsw,
572        ctsucr1::Ctsucsw,
573        Ctsucr1_SPEC,
574        crate::common::RW,
575    > {
576        crate::common::RegisterField::<
577            1,
578            0x1,
579            1,
580            0,
581            ctsucr1::Ctsucsw,
582            ctsucr1::Ctsucsw,
583            Ctsucr1_SPEC,
584            crate::common::RW,
585        >::from_register(self, 0)
586    }
587
588    #[doc = "CTSU Power Supply Enable"]
589    #[inline(always)]
590    pub fn ctsupon(
591        self,
592    ) -> crate::common::RegisterField<
593        0,
594        0x1,
595        1,
596        0,
597        ctsucr1::Ctsupon,
598        ctsucr1::Ctsupon,
599        Ctsucr1_SPEC,
600        crate::common::RW,
601    > {
602        crate::common::RegisterField::<
603            0,
604            0x1,
605            1,
606            0,
607            ctsucr1::Ctsupon,
608            ctsucr1::Ctsupon,
609            Ctsucr1_SPEC,
610            crate::common::RW,
611        >::from_register(self, 0)
612    }
613}
614impl ::core::default::Default for Ctsucr1 {
615    #[inline(always)]
616    fn default() -> Ctsucr1 {
617        <crate::RegValueT<Ctsucr1_SPEC> as RegisterValue<_>>::new(0)
618    }
619}
620pub mod ctsucr1 {
621
622    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
623    pub struct Ctsumd_SPEC;
624    pub type Ctsumd = crate::EnumBitfieldStruct<u8, Ctsumd_SPEC>;
625    impl Ctsumd {
626        #[doc = "Self-capacitance single scan mode"]
627        pub const _00: Self = Self::new(0);
628
629        #[doc = "Self-capacitance multi-scan mode"]
630        pub const _01: Self = Self::new(1);
631
632        #[doc = "Mutual capacitance simple scan mode"]
633        pub const _10: Self = Self::new(2);
634
635        #[doc = "Mutual capacitance full scan mode"]
636        pub const _11: Self = Self::new(3);
637    }
638    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
639    pub struct Ctsuclk_SPEC;
640    pub type Ctsuclk = crate::EnumBitfieldStruct<u8, Ctsuclk_SPEC>;
641    impl Ctsuclk {
642        #[doc = "PCLK"]
643        pub const _00: Self = Self::new(0);
644
645        #[doc = "PCLK/2 (PCLK divided by 2)"]
646        pub const _01: Self = Self::new(1);
647
648        #[doc = "PCLK/2 (PCLK divided by 4)"]
649        pub const _10: Self = Self::new(2);
650
651        #[doc = "Setting prohibited"]
652        pub const _11: Self = Self::new(3);
653    }
654    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
655    pub struct Ctsuatune1_SPEC;
656    pub type Ctsuatune1 = crate::EnumBitfieldStruct<u8, Ctsuatune1_SPEC>;
657    impl Ctsuatune1 {
658        #[doc = "Normal output"]
659        pub const _0: Self = Self::new(0);
660
661        #[doc = "High-current output"]
662        pub const _1: Self = Self::new(1);
663    }
664    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
665    pub struct Ctsucsw_SPEC;
666    pub type Ctsucsw = crate::EnumBitfieldStruct<u8, Ctsucsw_SPEC>;
667    impl Ctsucsw {
668        #[doc = "Turned off capacitance switch"]
669        pub const _0: Self = Self::new(0);
670
671        #[doc = "Turned on capacitance switch"]
672        pub const _1: Self = Self::new(1);
673    }
674    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
675    pub struct Ctsupon_SPEC;
676    pub type Ctsupon = crate::EnumBitfieldStruct<u8, Ctsupon_SPEC>;
677    impl Ctsupon {
678        #[doc = "Powered off the CTSU"]
679        pub const _0: Self = Self::new(0);
680
681        #[doc = "Powered on the CTSU"]
682        pub const _1: Self = Self::new(1);
683    }
684}
685#[doc(hidden)]
686#[derive(Copy, Clone, Eq, PartialEq)]
687pub struct Ctsusdprs_SPEC;
688impl crate::sealed::RegSpec for Ctsusdprs_SPEC {
689    type DataType = u8;
690}
691
692#[doc = "CTSU Synchronous Noise Reduction Setting Register"]
693pub type Ctsusdprs = crate::RegValueT<Ctsusdprs_SPEC>;
694
695impl Ctsusdprs {
696    #[doc = "CTSU High-Pass Noise Reduction Function Off Setting"]
697    #[inline(always)]
698    pub fn ctsusoff(
699        self,
700    ) -> crate::common::RegisterField<
701        6,
702        0x1,
703        1,
704        0,
705        ctsusdprs::Ctsusoff,
706        ctsusdprs::Ctsusoff,
707        Ctsusdprs_SPEC,
708        crate::common::RW,
709    > {
710        crate::common::RegisterField::<
711            6,
712            0x1,
713            1,
714            0,
715            ctsusdprs::Ctsusoff,
716            ctsusdprs::Ctsusoff,
717            Ctsusdprs_SPEC,
718            crate::common::RW,
719        >::from_register(self, 0)
720    }
721
722    #[doc = "CTSU Base Period and Pulse Count Setting"]
723    #[inline(always)]
724    pub fn ctsuprmode(
725        self,
726    ) -> crate::common::RegisterField<
727        4,
728        0x3,
729        1,
730        0,
731        ctsusdprs::Ctsuprmode,
732        ctsusdprs::Ctsuprmode,
733        Ctsusdprs_SPEC,
734        crate::common::RW,
735    > {
736        crate::common::RegisterField::<
737            4,
738            0x3,
739            1,
740            0,
741            ctsusdprs::Ctsuprmode,
742            ctsusdprs::Ctsuprmode,
743            Ctsusdprs_SPEC,
744            crate::common::RW,
745        >::from_register(self, 0)
746    }
747
748    #[doc = "CTSU Measurement Time and Pulse Count AdjustmentRecommended setting: 3 (0011b)"]
749    #[inline(always)]
750    pub fn ctsuprratio(
751        self,
752    ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, Ctsusdprs_SPEC, crate::common::RW> {
753        crate::common::RegisterField::<0,0xf,1,0,u8,u8,Ctsusdprs_SPEC,crate::common::RW>::from_register(self,0)
754    }
755}
756impl ::core::default::Default for Ctsusdprs {
757    #[inline(always)]
758    fn default() -> Ctsusdprs {
759        <crate::RegValueT<Ctsusdprs_SPEC> as RegisterValue<_>>::new(0)
760    }
761}
762pub mod ctsusdprs {
763
764    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
765    pub struct Ctsusoff_SPEC;
766    pub type Ctsusoff = crate::EnumBitfieldStruct<u8, Ctsusoff_SPEC>;
767    impl Ctsusoff {
768        #[doc = "High-pass noise reduction function turned on"]
769        pub const _0: Self = Self::new(0);
770
771        #[doc = "High-pass noise reduction function turned off"]
772        pub const _1: Self = Self::new(1);
773    }
774    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
775    pub struct Ctsuprmode_SPEC;
776    pub type Ctsuprmode = crate::EnumBitfieldStruct<u8, Ctsuprmode_SPEC>;
777    impl Ctsuprmode {
778        #[doc = "510 pulses"]
779        pub const _00: Self = Self::new(0);
780
781        #[doc = "126 pulses"]
782        pub const _01: Self = Self::new(1);
783
784        #[doc = "62 pulses (recommended setting value)"]
785        pub const _10: Self = Self::new(2);
786
787        #[doc = "Setting prohibited"]
788        pub const _11: Self = Self::new(3);
789    }
790}
791#[doc(hidden)]
792#[derive(Copy, Clone, Eq, PartialEq)]
793pub struct Ctsusst_SPEC;
794impl crate::sealed::RegSpec for Ctsusst_SPEC {
795    type DataType = u8;
796}
797
798#[doc = "CTSU Sensor Stabilization Wait Control Register"]
799pub type Ctsusst = crate::RegValueT<Ctsusst_SPEC>;
800
801impl Ctsusst {
802    #[doc = "CTSU Sensor Stabilization Wait ControlNOTE: The value of these bits should be fixed to 00010000b."]
803    #[inline(always)]
804    pub fn ctsusst(
805        self,
806    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Ctsusst_SPEC, crate::common::RW> {
807        crate::common::RegisterField::<0,0xff,1,0,u8,u8,Ctsusst_SPEC,crate::common::RW>::from_register(self,0)
808    }
809}
810impl ::core::default::Default for Ctsusst {
811    #[inline(always)]
812    fn default() -> Ctsusst {
813        <crate::RegValueT<Ctsusst_SPEC> as RegisterValue<_>>::new(0)
814    }
815}
816
817#[doc(hidden)]
818#[derive(Copy, Clone, Eq, PartialEq)]
819pub struct Ctsumch0_SPEC;
820impl crate::sealed::RegSpec for Ctsumch0_SPEC {
821    type DataType = u8;
822}
823
824#[doc = "CTSU Measurement Channel Register 0"]
825pub type Ctsumch0 = crate::RegValueT<Ctsumch0_SPEC>;
826
827impl Ctsumch0 {
828    #[doc = "CTSU Measurement Channel 0.Note1: Writing to these bits is only enabled in self-capacitance single scan mode (CTSUCR1.CTSUMD\\[1:0\\] bits = 00b).Note2: If  the value of CTSUMCH0 was set to b\'11111 in  mode other than self-capacitor single scan mode, the measurement is stopped."]
829    #[inline(always)]
830    pub fn ctsumch0(
831        self,
832    ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, Ctsumch0_SPEC, crate::common::RW> {
833        crate::common::RegisterField::<0,0x1f,1,0,u8,u8,Ctsumch0_SPEC,crate::common::RW>::from_register(self,0)
834    }
835}
836impl ::core::default::Default for Ctsumch0 {
837    #[inline(always)]
838    fn default() -> Ctsumch0 {
839        <crate::RegValueT<Ctsumch0_SPEC> as RegisterValue<_>>::new(31)
840    }
841}
842
843#[doc(hidden)]
844#[derive(Copy, Clone, Eq, PartialEq)]
845pub struct Ctsumch1_SPEC;
846impl crate::sealed::RegSpec for Ctsumch1_SPEC {
847    type DataType = u8;
848}
849
850#[doc = "CTSU Measurement Channel Register 1"]
851pub type Ctsumch1 = crate::RegValueT<Ctsumch1_SPEC>;
852
853impl Ctsumch1 {
854    #[doc = "CTSU Measurement Channel 1 Note1: If  the value of CTSUMCH1 was set to b\'11111, the measurement is stopped."]
855    #[inline(always)]
856    pub fn ctsumch1(
857        self,
858    ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, Ctsumch1_SPEC, crate::common::R> {
859        crate::common::RegisterField::<0,0x1f,1,0,u8,u8,Ctsumch1_SPEC,crate::common::R>::from_register(self,0)
860    }
861}
862impl ::core::default::Default for Ctsumch1 {
863    #[inline(always)]
864    fn default() -> Ctsumch1 {
865        <crate::RegValueT<Ctsumch1_SPEC> as RegisterValue<_>>::new(31)
866    }
867}
868
869#[doc(hidden)]
870#[derive(Copy, Clone, Eq, PartialEq)]
871pub struct Ctsuchac0_SPEC;
872impl crate::sealed::RegSpec for Ctsuchac0_SPEC {
873    type DataType = u8;
874}
875
876#[doc = "CTSU Channel Enable Control Register 0"]
877pub type Ctsuchac0 = crate::RegValueT<Ctsuchac0_SPEC>;
878
879impl Ctsuchac0 {
880    #[doc = "CTSU Channel Enable Control 0.0: Not measurement target1: Measurement targetNote: CTSUCHAC0\\[0\\] corresponds to TS00 and CTSUCHAC0\\[7\\] corresponds to TS07."]
881    #[inline(always)]
882    pub fn ctsuchac0(
883        self,
884    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Ctsuchac0_SPEC, crate::common::RW>
885    {
886        crate::common::RegisterField::<0,0xff,1,0,u8,u8,Ctsuchac0_SPEC,crate::common::RW>::from_register(self,0)
887    }
888}
889impl ::core::default::Default for Ctsuchac0 {
890    #[inline(always)]
891    fn default() -> Ctsuchac0 {
892        <crate::RegValueT<Ctsuchac0_SPEC> as RegisterValue<_>>::new(0)
893    }
894}
895
896#[doc(hidden)]
897#[derive(Copy, Clone, Eq, PartialEq)]
898pub struct Ctsuchac1_SPEC;
899impl crate::sealed::RegSpec for Ctsuchac1_SPEC {
900    type DataType = u8;
901}
902
903#[doc = "CTSU Channel Enable Control Register 1"]
904pub type Ctsuchac1 = crate::RegValueT<Ctsuchac1_SPEC>;
905
906impl Ctsuchac1 {
907    #[doc = "CTSU Channel Enable Control 1.0: Not measurement target1: Measurement targetNote: CTSUCHAC1\\[0\\] corresponds to TS08 and CTSUCHAC1\\[7\\] corresponds to TS15."]
908    #[inline(always)]
909    pub fn ctsuchac1(
910        self,
911    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Ctsuchac1_SPEC, crate::common::RW>
912    {
913        crate::common::RegisterField::<0,0xff,1,0,u8,u8,Ctsuchac1_SPEC,crate::common::RW>::from_register(self,0)
914    }
915}
916impl ::core::default::Default for Ctsuchac1 {
917    #[inline(always)]
918    fn default() -> Ctsuchac1 {
919        <crate::RegValueT<Ctsuchac1_SPEC> as RegisterValue<_>>::new(0)
920    }
921}
922
923#[doc(hidden)]
924#[derive(Copy, Clone, Eq, PartialEq)]
925pub struct Ctsuchac2_SPEC;
926impl crate::sealed::RegSpec for Ctsuchac2_SPEC {
927    type DataType = u8;
928}
929
930#[doc = "CTSU Channel Enable Control Register 2"]
931pub type Ctsuchac2 = crate::RegValueT<Ctsuchac2_SPEC>;
932
933impl NoBitfieldReg<Ctsuchac2_SPEC> for Ctsuchac2 {}
934impl ::core::default::Default for Ctsuchac2 {
935    #[inline(always)]
936    fn default() -> Ctsuchac2 {
937        <crate::RegValueT<Ctsuchac2_SPEC> as RegisterValue<_>>::new(0)
938    }
939}
940
941#[doc(hidden)]
942#[derive(Copy, Clone, Eq, PartialEq)]
943pub struct Ctsuchtrc0_SPEC;
944impl crate::sealed::RegSpec for Ctsuchtrc0_SPEC {
945    type DataType = u8;
946}
947
948#[doc = "CTSU Channel Transmit/Receive Control Register 0"]
949pub type Ctsuchtrc0 = crate::RegValueT<Ctsuchtrc0_SPEC>;
950
951impl Ctsuchtrc0 {
952    #[doc = "CTSU Channel Transmit/Receive Control 0CTSUCHTRC0\\[0\\] corresponds to TS00 and CTSUCHTRC0\\[7\\] corresponds to TS07. ( 0: Reception / 1: Transmission )"]
953    #[inline(always)]
954    pub fn ctsuchtrc0(
955        self,
956    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Ctsuchtrc0_SPEC, crate::common::RW>
957    {
958        crate::common::RegisterField::<0,0xff,1,0,u8,u8,Ctsuchtrc0_SPEC,crate::common::RW>::from_register(self,0)
959    }
960}
961impl ::core::default::Default for Ctsuchtrc0 {
962    #[inline(always)]
963    fn default() -> Ctsuchtrc0 {
964        <crate::RegValueT<Ctsuchtrc0_SPEC> as RegisterValue<_>>::new(0)
965    }
966}
967
968#[doc(hidden)]
969#[derive(Copy, Clone, Eq, PartialEq)]
970pub struct Ctsuchtrc1_SPEC;
971impl crate::sealed::RegSpec for Ctsuchtrc1_SPEC {
972    type DataType = u8;
973}
974
975#[doc = "CTSU Channel Transmit/Receive Control Register 1"]
976pub type Ctsuchtrc1 = crate::RegValueT<Ctsuchtrc1_SPEC>;
977
978impl Ctsuchtrc1 {
979    #[doc = "CTSU Channel Transmit/Receive Control 1CTSUCHTRC1\\[0\\] corresponds to TS08 and CTSUCHTRC1\\[7\\] corresponds to TS15. ( 0: Reception / 1: Transmission )"]
980    #[inline(always)]
981    pub fn ctsuchtrc1(
982        self,
983    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Ctsuchtrc1_SPEC, crate::common::RW>
984    {
985        crate::common::RegisterField::<0,0xff,1,0,u8,u8,Ctsuchtrc1_SPEC,crate::common::RW>::from_register(self,0)
986    }
987}
988impl ::core::default::Default for Ctsuchtrc1 {
989    #[inline(always)]
990    fn default() -> Ctsuchtrc1 {
991        <crate::RegValueT<Ctsuchtrc1_SPEC> as RegisterValue<_>>::new(0)
992    }
993}
994
995#[doc(hidden)]
996#[derive(Copy, Clone, Eq, PartialEq)]
997pub struct Ctsuchtrc2_SPEC;
998impl crate::sealed::RegSpec for Ctsuchtrc2_SPEC {
999    type DataType = u8;
1000}
1001
1002#[doc = "CTSU Channel Transmit/Receive Control Register 2"]
1003pub type Ctsuchtrc2 = crate::RegValueT<Ctsuchtrc2_SPEC>;
1004
1005impl NoBitfieldReg<Ctsuchtrc2_SPEC> for Ctsuchtrc2 {}
1006impl ::core::default::Default for Ctsuchtrc2 {
1007    #[inline(always)]
1008    fn default() -> Ctsuchtrc2 {
1009        <crate::RegValueT<Ctsuchtrc2_SPEC> as RegisterValue<_>>::new(0)
1010    }
1011}
1012
1013#[doc(hidden)]
1014#[derive(Copy, Clone, Eq, PartialEq)]
1015pub struct Ctsudclkc_SPEC;
1016impl crate::sealed::RegSpec for Ctsudclkc_SPEC {
1017    type DataType = u8;
1018}
1019
1020#[doc = "CTSU High-Pass Noise Reduction Control Register"]
1021pub type Ctsudclkc = crate::RegValueT<Ctsudclkc_SPEC>;
1022
1023impl Ctsudclkc {
1024    #[doc = "CTSU Diffusion Clock Mode ControlNOTE: This bit  should be set to 11b."]
1025    #[inline(always)]
1026    pub fn ctsusscnt(
1027        self,
1028    ) -> crate::common::RegisterField<4, 0x3, 1, 0, u8, u8, Ctsudclkc_SPEC, crate::common::RW> {
1029        crate::common::RegisterField::<4,0x3,1,0,u8,u8,Ctsudclkc_SPEC,crate::common::RW>::from_register(self,0)
1030    }
1031
1032    #[doc = "CTSU Diffusion Clock Mode SelectNOTE: This bit  should be set to 00b."]
1033    #[inline(always)]
1034    pub fn ctsussmod(
1035        self,
1036    ) -> crate::common::RegisterField<0, 0x3, 1, 0, u8, u8, Ctsudclkc_SPEC, crate::common::RW> {
1037        crate::common::RegisterField::<0,0x3,1,0,u8,u8,Ctsudclkc_SPEC,crate::common::RW>::from_register(self,0)
1038    }
1039}
1040impl ::core::default::Default for Ctsudclkc {
1041    #[inline(always)]
1042    fn default() -> Ctsudclkc {
1043        <crate::RegValueT<Ctsudclkc_SPEC> as RegisterValue<_>>::new(0)
1044    }
1045}
1046
1047#[doc(hidden)]
1048#[derive(Copy, Clone, Eq, PartialEq)]
1049pub struct Ctsust_SPEC;
1050impl crate::sealed::RegSpec for Ctsust_SPEC {
1051    type DataType = u8;
1052}
1053
1054#[doc = "CTSU Status Register"]
1055pub type Ctsust = crate::RegValueT<Ctsust_SPEC>;
1056
1057impl Ctsust {
1058    #[doc = "CTSU Mutual Capacitance Status Flag"]
1059    #[inline(always)]
1060    pub fn ctsups(
1061        self,
1062    ) -> crate::common::RegisterField<
1063        7,
1064        0x1,
1065        1,
1066        0,
1067        ctsust::Ctsups,
1068        ctsust::Ctsups,
1069        Ctsust_SPEC,
1070        crate::common::R,
1071    > {
1072        crate::common::RegisterField::<
1073            7,
1074            0x1,
1075            1,
1076            0,
1077            ctsust::Ctsups,
1078            ctsust::Ctsups,
1079            Ctsust_SPEC,
1080            crate::common::R,
1081        >::from_register(self, 0)
1082    }
1083
1084    #[doc = "CTSU Reference Counter Overflow Flag"]
1085    #[inline(always)]
1086    pub fn ctsurovf(
1087        self,
1088    ) -> crate::common::RegisterField<
1089        6,
1090        0x1,
1091        1,
1092        0,
1093        ctsust::Ctsurovf,
1094        ctsust::Ctsurovf,
1095        Ctsust_SPEC,
1096        crate::common::RW,
1097    > {
1098        crate::common::RegisterField::<
1099            6,
1100            0x1,
1101            1,
1102            0,
1103            ctsust::Ctsurovf,
1104            ctsust::Ctsurovf,
1105            Ctsust_SPEC,
1106            crate::common::RW,
1107        >::from_register(self, 0)
1108    }
1109
1110    #[doc = "CTSU Sensor Counter Overflow Flag"]
1111    #[inline(always)]
1112    pub fn ctsusovf(
1113        self,
1114    ) -> crate::common::RegisterField<
1115        5,
1116        0x1,
1117        1,
1118        0,
1119        ctsust::Ctsusovf,
1120        ctsust::Ctsusovf,
1121        Ctsust_SPEC,
1122        crate::common::RW,
1123    > {
1124        crate::common::RegisterField::<
1125            5,
1126            0x1,
1127            1,
1128            0,
1129            ctsust::Ctsusovf,
1130            ctsust::Ctsusovf,
1131            Ctsust_SPEC,
1132            crate::common::RW,
1133        >::from_register(self, 0)
1134    }
1135
1136    #[doc = "CTSU Data Transfer Status Flag"]
1137    #[inline(always)]
1138    pub fn ctsudtsr(
1139        self,
1140    ) -> crate::common::RegisterField<
1141        4,
1142        0x1,
1143        1,
1144        0,
1145        ctsust::Ctsudtsr,
1146        ctsust::Ctsudtsr,
1147        Ctsust_SPEC,
1148        crate::common::R,
1149    > {
1150        crate::common::RegisterField::<
1151            4,
1152            0x1,
1153            1,
1154            0,
1155            ctsust::Ctsudtsr,
1156            ctsust::Ctsudtsr,
1157            Ctsust_SPEC,
1158            crate::common::R,
1159        >::from_register(self, 0)
1160    }
1161
1162    #[doc = "CTSU Measurement Status Counter"]
1163    #[inline(always)]
1164    pub fn ctsustc(
1165        self,
1166    ) -> crate::common::RegisterField<
1167        0,
1168        0x7,
1169        1,
1170        0,
1171        ctsust::Ctsustc,
1172        ctsust::Ctsustc,
1173        Ctsust_SPEC,
1174        crate::common::R,
1175    > {
1176        crate::common::RegisterField::<
1177            0,
1178            0x7,
1179            1,
1180            0,
1181            ctsust::Ctsustc,
1182            ctsust::Ctsustc,
1183            Ctsust_SPEC,
1184            crate::common::R,
1185        >::from_register(self, 0)
1186    }
1187}
1188impl ::core::default::Default for Ctsust {
1189    #[inline(always)]
1190    fn default() -> Ctsust {
1191        <crate::RegValueT<Ctsust_SPEC> as RegisterValue<_>>::new(0)
1192    }
1193}
1194pub mod ctsust {
1195
1196    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
1197    pub struct Ctsups_SPEC;
1198    pub type Ctsups = crate::EnumBitfieldStruct<u8, Ctsups_SPEC>;
1199    impl Ctsups {
1200        #[doc = "First measurement"]
1201        pub const _0: Self = Self::new(0);
1202
1203        #[doc = "Second measurement"]
1204        pub const _1: Self = Self::new(1);
1205    }
1206    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
1207    pub struct Ctsurovf_SPEC;
1208    pub type Ctsurovf = crate::EnumBitfieldStruct<u8, Ctsurovf_SPEC>;
1209    impl Ctsurovf {
1210        #[doc = "No overflow"]
1211        pub const _0: Self = Self::new(0);
1212
1213        #[doc = "An overflow"]
1214        pub const _1: Self = Self::new(1);
1215    }
1216    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
1217    pub struct Ctsusovf_SPEC;
1218    pub type Ctsusovf = crate::EnumBitfieldStruct<u8, Ctsusovf_SPEC>;
1219    impl Ctsusovf {
1220        #[doc = "No overflow"]
1221        pub const _0: Self = Self::new(0);
1222
1223        #[doc = "An overflow"]
1224        pub const _1: Self = Self::new(1);
1225    }
1226    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
1227    pub struct Ctsudtsr_SPEC;
1228    pub type Ctsudtsr = crate::EnumBitfieldStruct<u8, Ctsudtsr_SPEC>;
1229    impl Ctsudtsr {
1230        #[doc = "Measurement result has been read"]
1231        pub const _0: Self = Self::new(0);
1232
1233        #[doc = "Measurement result has not been read"]
1234        pub const _1: Self = Self::new(1);
1235    }
1236    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
1237    pub struct Ctsustc_SPEC;
1238    pub type Ctsustc = crate::EnumBitfieldStruct<u8, Ctsustc_SPEC>;
1239    impl Ctsustc {
1240        #[doc = "Status 0"]
1241        pub const _000: Self = Self::new(0);
1242
1243        #[doc = "Status 1"]
1244        pub const _001: Self = Self::new(1);
1245
1246        #[doc = "Status 2"]
1247        pub const _010: Self = Self::new(2);
1248
1249        #[doc = "Status 3"]
1250        pub const _011: Self = Self::new(3);
1251
1252        #[doc = "Status 4"]
1253        pub const _100: Self = Self::new(4);
1254
1255        #[doc = "Status 5"]
1256        pub const _101: Self = Self::new(5);
1257    }
1258}
1259#[doc(hidden)]
1260#[derive(Copy, Clone, Eq, PartialEq)]
1261pub struct Ctsussc_SPEC;
1262impl crate::sealed::RegSpec for Ctsussc_SPEC {
1263    type DataType = u16;
1264}
1265
1266#[doc = "CTSU High-Pass Noise Reduction Spectrum Diffusion Control Register"]
1267pub type Ctsussc = crate::RegValueT<Ctsussc_SPEC>;
1268
1269impl Ctsussc {
1270    #[doc = "CTSU Spectrum Diffusion Frequency Division Setting"]
1271    #[inline(always)]
1272    pub fn ctsussdiv(
1273        self,
1274    ) -> crate::common::RegisterField<
1275        8,
1276        0xf,
1277        1,
1278        0,
1279        ctsussc::Ctsussdiv,
1280        ctsussc::Ctsussdiv,
1281        Ctsussc_SPEC,
1282        crate::common::RW,
1283    > {
1284        crate::common::RegisterField::<
1285            8,
1286            0xf,
1287            1,
1288            0,
1289            ctsussc::Ctsussdiv,
1290            ctsussc::Ctsussdiv,
1291            Ctsussc_SPEC,
1292            crate::common::RW,
1293        >::from_register(self, 0)
1294    }
1295}
1296impl ::core::default::Default for Ctsussc {
1297    #[inline(always)]
1298    fn default() -> Ctsussc {
1299        <crate::RegValueT<Ctsussc_SPEC> as RegisterValue<_>>::new(0)
1300    }
1301}
1302pub mod ctsussc {
1303
1304    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
1305    pub struct Ctsussdiv_SPEC;
1306    pub type Ctsussdiv = crate::EnumBitfieldStruct<u8, Ctsussdiv_SPEC>;
1307    impl Ctsussdiv {
1308        #[doc = "4.00 <= fb"]
1309        pub const _0000: Self = Self::new(0);
1310
1311        #[doc = "2.00 <= fb < 4.00"]
1312        pub const _0001: Self = Self::new(1);
1313
1314        #[doc = "1.33 <= fb < 2.00"]
1315        pub const _0010: Self = Self::new(2);
1316
1317        #[doc = "1.00 <= fb < 1.33"]
1318        pub const _0011: Self = Self::new(3);
1319
1320        #[doc = "0.80 <= fb < 1.00"]
1321        pub const _0100: Self = Self::new(4);
1322
1323        #[doc = "0.67 <= fb < 0.80"]
1324        pub const _0101: Self = Self::new(5);
1325
1326        #[doc = "0.57 <= fb < 0.67"]
1327        pub const _0110: Self = Self::new(6);
1328
1329        #[doc = "0.50 <= fb < 0.57"]
1330        pub const _0111: Self = Self::new(7);
1331
1332        #[doc = "0.44 <= fb < 0.50"]
1333        pub const _1000: Self = Self::new(8);
1334
1335        #[doc = "0.40 <= fb < 0.44"]
1336        pub const _1001: Self = Self::new(9);
1337
1338        #[doc = "0.36 <= fb < 0.40"]
1339        pub const _1010: Self = Self::new(10);
1340
1341        #[doc = "0.33 <= fb < 0.36"]
1342        pub const _1011: Self = Self::new(11);
1343
1344        #[doc = "0.31 <= fb < 0.33"]
1345        pub const _1100: Self = Self::new(12);
1346
1347        #[doc = "0.29 <= fb < 0.31"]
1348        pub const _1101: Self = Self::new(13);
1349
1350        #[doc = "0.27 <= fb < 0.29"]
1351        pub const _1110: Self = Self::new(14);
1352
1353        #[doc = "fb < 0.27"]
1354        pub const _1111: Self = Self::new(15);
1355    }
1356}
1357#[doc(hidden)]
1358#[derive(Copy, Clone, Eq, PartialEq)]
1359pub struct Ctsuso0_SPEC;
1360impl crate::sealed::RegSpec for Ctsuso0_SPEC {
1361    type DataType = u16;
1362}
1363
1364#[doc = "CTSU Sensor Offset Register 0"]
1365pub type Ctsuso0 = crate::RegValueT<Ctsuso0_SPEC>;
1366
1367impl Ctsuso0 {
1368    #[doc = "CTSU Measurement Count Setting"]
1369    #[inline(always)]
1370    pub fn ctsusnum(
1371        self,
1372    ) -> crate::common::RegisterField<10, 0x3f, 1, 0, u8, u8, Ctsuso0_SPEC, crate::common::RW> {
1373        crate::common::RegisterField::<10,0x3f,1,0,u8,u8,Ctsuso0_SPEC,crate::common::RW>::from_register(self,0)
1374    }
1375
1376    #[doc = "CTSU Sensor Offset AdjustmentCurrent offset amount is CTSUSO ( 0 to 1023 )"]
1377    #[inline(always)]
1378    pub fn ctsuso(
1379        self,
1380    ) -> crate::common::RegisterField<0, 0x3ff, 1, 0, u16, u16, Ctsuso0_SPEC, crate::common::RW>
1381    {
1382        crate::common::RegisterField::<0,0x3ff,1,0,u16,u16,Ctsuso0_SPEC,crate::common::RW>::from_register(self,0)
1383    }
1384}
1385impl ::core::default::Default for Ctsuso0 {
1386    #[inline(always)]
1387    fn default() -> Ctsuso0 {
1388        <crate::RegValueT<Ctsuso0_SPEC> as RegisterValue<_>>::new(0)
1389    }
1390}
1391
1392#[doc(hidden)]
1393#[derive(Copy, Clone, Eq, PartialEq)]
1394pub struct Ctsuso1_SPEC;
1395impl crate::sealed::RegSpec for Ctsuso1_SPEC {
1396    type DataType = u16;
1397}
1398
1399#[doc = "CTSU Sensor Offset Register 1"]
1400pub type Ctsuso1 = crate::RegValueT<Ctsuso1_SPEC>;
1401
1402impl Ctsuso1 {
1403    #[doc = "CTSU ICO Gain Adjustment"]
1404    #[inline(always)]
1405    pub fn ctsuicog(
1406        self,
1407    ) -> crate::common::RegisterField<
1408        13,
1409        0x3,
1410        1,
1411        0,
1412        ctsuso1::Ctsuicog,
1413        ctsuso1::Ctsuicog,
1414        Ctsuso1_SPEC,
1415        crate::common::RW,
1416    > {
1417        crate::common::RegisterField::<
1418            13,
1419            0x3,
1420            1,
1421            0,
1422            ctsuso1::Ctsuicog,
1423            ctsuso1::Ctsuicog,
1424            Ctsuso1_SPEC,
1425            crate::common::RW,
1426        >::from_register(self, 0)
1427    }
1428
1429    #[doc = "CTSU Base Clock SettingOperating clock divided by ( CTSUSDPA + 1 ) x 2"]
1430    #[inline(always)]
1431    pub fn ctsusdpa(
1432        self,
1433    ) -> crate::common::RegisterField<8, 0x1f, 1, 0, u8, u8, Ctsuso1_SPEC, crate::common::RW> {
1434        crate::common::RegisterField::<8,0x1f,1,0,u8,u8,Ctsuso1_SPEC,crate::common::RW>::from_register(self,0)
1435    }
1436
1437    #[doc = "CTSU Reference ICO Current AdjustmentCurrent offset amount is CTSUSO ( 0 to 255 )"]
1438    #[inline(always)]
1439    pub fn ctsuricoa(
1440        self,
1441    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Ctsuso1_SPEC, crate::common::RW> {
1442        crate::common::RegisterField::<0,0xff,1,0,u8,u8,Ctsuso1_SPEC,crate::common::RW>::from_register(self,0)
1443    }
1444}
1445impl ::core::default::Default for Ctsuso1 {
1446    #[inline(always)]
1447    fn default() -> Ctsuso1 {
1448        <crate::RegValueT<Ctsuso1_SPEC> as RegisterValue<_>>::new(0)
1449    }
1450}
1451pub mod ctsuso1 {
1452
1453    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
1454    pub struct Ctsuicog_SPEC;
1455    pub type Ctsuicog = crate::EnumBitfieldStruct<u8, Ctsuicog_SPEC>;
1456    impl Ctsuicog {
1457        #[doc = "100% gain"]
1458        pub const _00: Self = Self::new(0);
1459
1460        #[doc = "66% gain"]
1461        pub const _01: Self = Self::new(1);
1462
1463        #[doc = "50% gain"]
1464        pub const _10: Self = Self::new(2);
1465
1466        #[doc = "40% gain"]
1467        pub const _11: Self = Self::new(3);
1468    }
1469}
1470#[doc(hidden)]
1471#[derive(Copy, Clone, Eq, PartialEq)]
1472pub struct Ctsusc_SPEC;
1473impl crate::sealed::RegSpec for Ctsusc_SPEC {
1474    type DataType = u16;
1475}
1476
1477#[doc = "CTSU Sensor Counter"]
1478pub type Ctsusc = crate::RegValueT<Ctsusc_SPEC>;
1479
1480impl Ctsusc {
1481    #[doc = "CTSU Sensor CounterThese bits indicate the measurement result of the CTSU. These bits indicate FFFFh when an overflow occurs."]
1482    #[inline(always)]
1483    pub fn ctsusc(
1484        self,
1485    ) -> crate::common::RegisterField<0, 0xffff, 1, 0, u16, u16, Ctsusc_SPEC, crate::common::R>
1486    {
1487        crate::common::RegisterField::<0,0xffff,1,0,u16,u16,Ctsusc_SPEC,crate::common::R>::from_register(self,0)
1488    }
1489}
1490impl ::core::default::Default for Ctsusc {
1491    #[inline(always)]
1492    fn default() -> Ctsusc {
1493        <crate::RegValueT<Ctsusc_SPEC> as RegisterValue<_>>::new(0)
1494    }
1495}
1496
1497#[doc(hidden)]
1498#[derive(Copy, Clone, Eq, PartialEq)]
1499pub struct Ctsurc_SPEC;
1500impl crate::sealed::RegSpec for Ctsurc_SPEC {
1501    type DataType = u16;
1502}
1503
1504#[doc = "CTSU Reference Counter"]
1505pub type Ctsurc = crate::RegValueT<Ctsurc_SPEC>;
1506
1507impl Ctsurc {
1508    #[doc = "CTSU Reference Counter"]
1509    #[inline(always)]
1510    pub fn ctsurc(
1511        self,
1512    ) -> crate::common::RegisterField<0, 0xffff, 1, 0, u16, u16, Ctsurc_SPEC, crate::common::R>
1513    {
1514        crate::common::RegisterField::<0,0xffff,1,0,u16,u16,Ctsurc_SPEC,crate::common::R>::from_register(self,0)
1515    }
1516}
1517impl ::core::default::Default for Ctsurc {
1518    #[inline(always)]
1519    fn default() -> Ctsurc {
1520        <crate::RegValueT<Ctsurc_SPEC> as RegisterValue<_>>::new(0)
1521    }
1522}
1523
1524#[doc(hidden)]
1525#[derive(Copy, Clone, Eq, PartialEq)]
1526pub struct Ctsuerrs_SPEC;
1527impl crate::sealed::RegSpec for Ctsuerrs_SPEC {
1528    type DataType = u16;
1529}
1530
1531#[doc = "CTSU Error Status Register"]
1532pub type Ctsuerrs = crate::RegValueT<Ctsuerrs_SPEC>;
1533
1534impl Ctsuerrs {
1535    #[doc = "TSCAP Voltage Error Monitor"]
1536    #[inline(always)]
1537    pub fn ctsuicomp(
1538        self,
1539    ) -> crate::common::RegisterField<
1540        15,
1541        0x1,
1542        1,
1543        0,
1544        ctsuerrs::Ctsuicomp,
1545        ctsuerrs::Ctsuicomp,
1546        Ctsuerrs_SPEC,
1547        crate::common::R,
1548    > {
1549        crate::common::RegisterField::<
1550            15,
1551            0x1,
1552            1,
1553            0,
1554            ctsuerrs::Ctsuicomp,
1555            ctsuerrs::Ctsuicomp,
1556            Ctsuerrs_SPEC,
1557            crate::common::R,
1558        >::from_register(self, 0)
1559    }
1560}
1561impl ::core::default::Default for Ctsuerrs {
1562    #[inline(always)]
1563    fn default() -> Ctsuerrs {
1564        <crate::RegValueT<Ctsuerrs_SPEC> as RegisterValue<_>>::new(0)
1565    }
1566}
1567pub mod ctsuerrs {
1568
1569    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
1570    pub struct Ctsuicomp_SPEC;
1571    pub type Ctsuicomp = crate::EnumBitfieldStruct<u8, Ctsuicomp_SPEC>;
1572    impl Ctsuicomp {
1573        #[doc = "Normal TSCAP voltage"]
1574        pub const _0: Self = Self::new(0);
1575
1576        #[doc = "Abnormal TSCAP voltage"]
1577        pub const _1: Self = Self::new(1);
1578    }
1579}