esp32/rtc_io/
touch_cfg.rs

1#[doc = "Register `TOUCH_CFG` reader"]
2pub type R = crate::R<TOUCH_CFG_SPEC>;
3#[doc = "Register `TOUCH_CFG` writer"]
4pub type W = crate::W<TOUCH_CFG_SPEC>;
5#[doc = "Field `TOUCH_DCUR` reader - touch sensor bias current. Should have option to tie with BIAS_SLEEP(When BIAS_SLEEP this setting is available"]
6pub type TOUCH_DCUR_R = crate::FieldReader;
7#[doc = "Field `TOUCH_DCUR` writer - touch sensor bias current. Should have option to tie with BIAS_SLEEP(When BIAS_SLEEP this setting is available"]
8pub type TOUCH_DCUR_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `TOUCH_DRANGE` reader - touch sensor saw wave voltage range."]
10pub type TOUCH_DRANGE_R = crate::FieldReader;
11#[doc = "Field `TOUCH_DRANGE` writer - touch sensor saw wave voltage range."]
12pub type TOUCH_DRANGE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13#[doc = "Field `TOUCH_DREFL` reader - touch sensor saw wave bottom voltage."]
14pub type TOUCH_DREFL_R = crate::FieldReader;
15#[doc = "Field `TOUCH_DREFL` writer - touch sensor saw wave bottom voltage."]
16pub type TOUCH_DREFL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
17#[doc = "Field `TOUCH_DREFH` reader - touch sensor saw wave top voltage."]
18pub type TOUCH_DREFH_R = crate::FieldReader;
19#[doc = "Field `TOUCH_DREFH` writer - touch sensor saw wave top voltage."]
20pub type TOUCH_DREFH_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
21#[doc = "Field `TOUCH_XPD_BIAS` reader - touch sensor bias power on."]
22pub type TOUCH_XPD_BIAS_R = crate::BitReader;
23#[doc = "Field `TOUCH_XPD_BIAS` writer - touch sensor bias power on."]
24pub type TOUCH_XPD_BIAS_W<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26    #[doc = "Bits 23:24 - touch sensor bias current. Should have option to tie with BIAS_SLEEP(When BIAS_SLEEP this setting is available"]
27    #[inline(always)]
28    pub fn touch_dcur(&self) -> TOUCH_DCUR_R {
29        TOUCH_DCUR_R::new(((self.bits >> 23) & 3) as u8)
30    }
31    #[doc = "Bits 25:26 - touch sensor saw wave voltage range."]
32    #[inline(always)]
33    pub fn touch_drange(&self) -> TOUCH_DRANGE_R {
34        TOUCH_DRANGE_R::new(((self.bits >> 25) & 3) as u8)
35    }
36    #[doc = "Bits 27:28 - touch sensor saw wave bottom voltage."]
37    #[inline(always)]
38    pub fn touch_drefl(&self) -> TOUCH_DREFL_R {
39        TOUCH_DREFL_R::new(((self.bits >> 27) & 3) as u8)
40    }
41    #[doc = "Bits 29:30 - touch sensor saw wave top voltage."]
42    #[inline(always)]
43    pub fn touch_drefh(&self) -> TOUCH_DREFH_R {
44        TOUCH_DREFH_R::new(((self.bits >> 29) & 3) as u8)
45    }
46    #[doc = "Bit 31 - touch sensor bias power on."]
47    #[inline(always)]
48    pub fn touch_xpd_bias(&self) -> TOUCH_XPD_BIAS_R {
49        TOUCH_XPD_BIAS_R::new(((self.bits >> 31) & 1) != 0)
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_CFG")
56            .field("touch_dcur", &self.touch_dcur())
57            .field("touch_drange", &self.touch_drange())
58            .field("touch_drefl", &self.touch_drefl())
59            .field("touch_drefh", &self.touch_drefh())
60            .field("touch_xpd_bias", &self.touch_xpd_bias())
61            .finish()
62    }
63}
64impl W {
65    #[doc = "Bits 23:24 - touch sensor bias current. Should have option to tie with BIAS_SLEEP(When BIAS_SLEEP this setting is available"]
66    #[inline(always)]
67    pub fn touch_dcur(&mut self) -> TOUCH_DCUR_W<TOUCH_CFG_SPEC> {
68        TOUCH_DCUR_W::new(self, 23)
69    }
70    #[doc = "Bits 25:26 - touch sensor saw wave voltage range."]
71    #[inline(always)]
72    pub fn touch_drange(&mut self) -> TOUCH_DRANGE_W<TOUCH_CFG_SPEC> {
73        TOUCH_DRANGE_W::new(self, 25)
74    }
75    #[doc = "Bits 27:28 - touch sensor saw wave bottom voltage."]
76    #[inline(always)]
77    pub fn touch_drefl(&mut self) -> TOUCH_DREFL_W<TOUCH_CFG_SPEC> {
78        TOUCH_DREFL_W::new(self, 27)
79    }
80    #[doc = "Bits 29:30 - touch sensor saw wave top voltage."]
81    #[inline(always)]
82    pub fn touch_drefh(&mut self) -> TOUCH_DREFH_W<TOUCH_CFG_SPEC> {
83        TOUCH_DREFH_W::new(self, 29)
84    }
85    #[doc = "Bit 31 - touch sensor bias power on."]
86    #[inline(always)]
87    pub fn touch_xpd_bias(&mut self) -> TOUCH_XPD_BIAS_W<TOUCH_CFG_SPEC> {
88        TOUCH_XPD_BIAS_W::new(self, 31)
89    }
90}
91#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`touch_cfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`touch_cfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
92pub struct TOUCH_CFG_SPEC;
93impl crate::RegisterSpec for TOUCH_CFG_SPEC {
94    type Ux = u32;
95}
96#[doc = "`read()` method returns [`touch_cfg::R`](R) reader structure"]
97impl crate::Readable for TOUCH_CFG_SPEC {}
98#[doc = "`write(|w| ..)` method takes [`touch_cfg::W`](W) writer structure"]
99impl crate::Writable for TOUCH_CFG_SPEC {
100    type Safety = crate::Unsafe;
101    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
102    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
103}
104#[doc = "`reset()` method sets TOUCH_CFG to value 0x6600_0000"]
105impl crate::Resettable for TOUCH_CFG_SPEC {
106    const RESET_VALUE: u32 = 0x6600_0000;
107}