esp32p4/lp_ana/
touch_freq0_scan_para.rs

1#[doc = "Register `TOUCH_FREQ0_SCAN_PARA` reader"]
2pub type R = crate::R<TOUCH_FREQ0_SCAN_PARA_SPEC>;
3#[doc = "Register `TOUCH_FREQ0_SCAN_PARA` writer"]
4pub type W = crate::W<TOUCH_FREQ0_SCAN_PARA_SPEC>;
5#[doc = "Field `TOUCH_FREQ0_DCAP_LPF` reader - need_des"]
6pub type TOUCH_FREQ0_DCAP_LPF_R = crate::FieldReader;
7#[doc = "Field `TOUCH_FREQ0_DCAP_LPF` writer - need_des"]
8pub type TOUCH_FREQ0_DCAP_LPF_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
9#[doc = "Field `TOUCH_FREQ0_DRES_LPF` reader - need_des"]
10pub type TOUCH_FREQ0_DRES_LPF_R = crate::FieldReader;
11#[doc = "Field `TOUCH_FREQ0_DRES_LPF` writer - need_des"]
12pub type TOUCH_FREQ0_DRES_LPF_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13#[doc = "Field `TOUCH_FREQ0_DRV_LS` reader - need_des"]
14pub type TOUCH_FREQ0_DRV_LS_R = crate::FieldReader;
15#[doc = "Field `TOUCH_FREQ0_DRV_LS` writer - need_des"]
16pub type TOUCH_FREQ0_DRV_LS_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
17#[doc = "Field `TOUCH_FREQ0_DRV_HS` reader - need_des"]
18pub type TOUCH_FREQ0_DRV_HS_R = crate::FieldReader;
19#[doc = "Field `TOUCH_FREQ0_DRV_HS` writer - need_des"]
20pub type TOUCH_FREQ0_DRV_HS_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
21#[doc = "Field `TOUCH_FREQ0_DBIAS` reader - need_des"]
22pub type TOUCH_FREQ0_DBIAS_R = crate::FieldReader;
23#[doc = "Field `TOUCH_FREQ0_DBIAS` writer - need_des"]
24pub type TOUCH_FREQ0_DBIAS_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
25impl R {
26    #[doc = "Bits 0:6 - need_des"]
27    #[inline(always)]
28    pub fn touch_freq0_dcap_lpf(&self) -> TOUCH_FREQ0_DCAP_LPF_R {
29        TOUCH_FREQ0_DCAP_LPF_R::new((self.bits & 0x7f) as u8)
30    }
31    #[doc = "Bits 7:8 - need_des"]
32    #[inline(always)]
33    pub fn touch_freq0_dres_lpf(&self) -> TOUCH_FREQ0_DRES_LPF_R {
34        TOUCH_FREQ0_DRES_LPF_R::new(((self.bits >> 7) & 3) as u8)
35    }
36    #[doc = "Bits 9:12 - need_des"]
37    #[inline(always)]
38    pub fn touch_freq0_drv_ls(&self) -> TOUCH_FREQ0_DRV_LS_R {
39        TOUCH_FREQ0_DRV_LS_R::new(((self.bits >> 9) & 0x0f) as u8)
40    }
41    #[doc = "Bits 13:17 - need_des"]
42    #[inline(always)]
43    pub fn touch_freq0_drv_hs(&self) -> TOUCH_FREQ0_DRV_HS_R {
44        TOUCH_FREQ0_DRV_HS_R::new(((self.bits >> 13) & 0x1f) as u8)
45    }
46    #[doc = "Bits 18:22 - need_des"]
47    #[inline(always)]
48    pub fn touch_freq0_dbias(&self) -> TOUCH_FREQ0_DBIAS_R {
49        TOUCH_FREQ0_DBIAS_R::new(((self.bits >> 18) & 0x1f) as u8)
50    }
51}
52#[cfg(feature = "impl-register-debug")]
53impl core::fmt::Debug for R {
54    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
55        f.debug_struct("TOUCH_FREQ0_SCAN_PARA")
56            .field(
57                "touch_freq0_dcap_lpf",
58                &format_args!("{}", self.touch_freq0_dcap_lpf().bits()),
59            )
60            .field(
61                "touch_freq0_dres_lpf",
62                &format_args!("{}", self.touch_freq0_dres_lpf().bits()),
63            )
64            .field(
65                "touch_freq0_drv_ls",
66                &format_args!("{}", self.touch_freq0_drv_ls().bits()),
67            )
68            .field(
69                "touch_freq0_drv_hs",
70                &format_args!("{}", self.touch_freq0_drv_hs().bits()),
71            )
72            .field(
73                "touch_freq0_dbias",
74                &format_args!("{}", self.touch_freq0_dbias().bits()),
75            )
76            .finish()
77    }
78}
79#[cfg(feature = "impl-register-debug")]
80impl core::fmt::Debug for crate::generic::Reg<TOUCH_FREQ0_SCAN_PARA_SPEC> {
81    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
82        core::fmt::Debug::fmt(&self.read(), f)
83    }
84}
85impl W {
86    #[doc = "Bits 0:6 - need_des"]
87    #[inline(always)]
88    #[must_use]
89    pub fn touch_freq0_dcap_lpf(&mut self) -> TOUCH_FREQ0_DCAP_LPF_W<TOUCH_FREQ0_SCAN_PARA_SPEC> {
90        TOUCH_FREQ0_DCAP_LPF_W::new(self, 0)
91    }
92    #[doc = "Bits 7:8 - need_des"]
93    #[inline(always)]
94    #[must_use]
95    pub fn touch_freq0_dres_lpf(&mut self) -> TOUCH_FREQ0_DRES_LPF_W<TOUCH_FREQ0_SCAN_PARA_SPEC> {
96        TOUCH_FREQ0_DRES_LPF_W::new(self, 7)
97    }
98    #[doc = "Bits 9:12 - need_des"]
99    #[inline(always)]
100    #[must_use]
101    pub fn touch_freq0_drv_ls(&mut self) -> TOUCH_FREQ0_DRV_LS_W<TOUCH_FREQ0_SCAN_PARA_SPEC> {
102        TOUCH_FREQ0_DRV_LS_W::new(self, 9)
103    }
104    #[doc = "Bits 13:17 - need_des"]
105    #[inline(always)]
106    #[must_use]
107    pub fn touch_freq0_drv_hs(&mut self) -> TOUCH_FREQ0_DRV_HS_W<TOUCH_FREQ0_SCAN_PARA_SPEC> {
108        TOUCH_FREQ0_DRV_HS_W::new(self, 13)
109    }
110    #[doc = "Bits 18:22 - need_des"]
111    #[inline(always)]
112    #[must_use]
113    pub fn touch_freq0_dbias(&mut self) -> TOUCH_FREQ0_DBIAS_W<TOUCH_FREQ0_SCAN_PARA_SPEC> {
114        TOUCH_FREQ0_DBIAS_W::new(self, 18)
115    }
116}
117#[doc = "need_des\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`touch_freq0_scan_para::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`touch_freq0_scan_para::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
118pub struct TOUCH_FREQ0_SCAN_PARA_SPEC;
119impl crate::RegisterSpec for TOUCH_FREQ0_SCAN_PARA_SPEC {
120    type Ux = u32;
121}
122#[doc = "`read()` method returns [`touch_freq0_scan_para::R`](R) reader structure"]
123impl crate::Readable for TOUCH_FREQ0_SCAN_PARA_SPEC {}
124#[doc = "`write(|w| ..)` method takes [`touch_freq0_scan_para::W`](W) writer structure"]
125impl crate::Writable for TOUCH_FREQ0_SCAN_PARA_SPEC {
126    type Safety = crate::Unsafe;
127    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
128    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
129}
130#[doc = "`reset()` method sets TOUCH_FREQ0_SCAN_PARA to value 0"]
131impl crate::Resettable for TOUCH_FREQ0_SCAN_PARA_SPEC {
132    const RESET_VALUE: u32 = 0;
133}