esp32p4/lp_ana/
touch_scan_ctrl1.rs1#[doc = "Register `TOUCH_SCAN_CTRL1` reader"]
2pub type R = crate::R<TOUCH_SCAN_CTRL1_SPEC>;
3#[doc = "Register `TOUCH_SCAN_CTRL1` writer"]
4pub type W = crate::W<TOUCH_SCAN_CTRL1_SPEC>;
5#[doc = "Field `TOUCH_SHIELD_PAD_EN` reader - need_des"]
6pub type TOUCH_SHIELD_PAD_EN_R = crate::BitReader;
7#[doc = "Field `TOUCH_SHIELD_PAD_EN` writer - need_des"]
8pub type TOUCH_SHIELD_PAD_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `TOUCH_INACTIVE_CONNECTION` reader - need_des"]
10pub type TOUCH_INACTIVE_CONNECTION_R = crate::BitReader;
11#[doc = "Field `TOUCH_INACTIVE_CONNECTION` writer - need_des"]
12pub type TOUCH_INACTIVE_CONNECTION_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `TOUCH_SCAN_PAD_MAP` reader - need_des"]
14pub type TOUCH_SCAN_PAD_MAP_R = crate::FieldReader<u16>;
15#[doc = "Field `TOUCH_SCAN_PAD_MAP` writer - need_des"]
16pub type TOUCH_SCAN_PAD_MAP_W<'a, REG> = crate::FieldWriter<'a, REG, 15, u16>;
17#[doc = "Field `TOUCH_XPD_WAIT` reader - need_des"]
18pub type TOUCH_XPD_WAIT_R = crate::FieldReader<u16>;
19#[doc = "Field `TOUCH_XPD_WAIT` writer - need_des"]
20pub type TOUCH_XPD_WAIT_W<'a, REG> = crate::FieldWriter<'a, REG, 15, u16>;
21impl R {
22 #[doc = "Bit 0 - need_des"]
23 #[inline(always)]
24 pub fn touch_shield_pad_en(&self) -> TOUCH_SHIELD_PAD_EN_R {
25 TOUCH_SHIELD_PAD_EN_R::new((self.bits & 1) != 0)
26 }
27 #[doc = "Bit 1 - need_des"]
28 #[inline(always)]
29 pub fn touch_inactive_connection(&self) -> TOUCH_INACTIVE_CONNECTION_R {
30 TOUCH_INACTIVE_CONNECTION_R::new(((self.bits >> 1) & 1) != 0)
31 }
32 #[doc = "Bits 2:16 - need_des"]
33 #[inline(always)]
34 pub fn touch_scan_pad_map(&self) -> TOUCH_SCAN_PAD_MAP_R {
35 TOUCH_SCAN_PAD_MAP_R::new(((self.bits >> 2) & 0x7fff) as u16)
36 }
37 #[doc = "Bits 17:31 - need_des"]
38 #[inline(always)]
39 pub fn touch_xpd_wait(&self) -> TOUCH_XPD_WAIT_R {
40 TOUCH_XPD_WAIT_R::new(((self.bits >> 17) & 0x7fff) as u16)
41 }
42}
43#[cfg(feature = "impl-register-debug")]
44impl core::fmt::Debug for R {
45 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46 f.debug_struct("TOUCH_SCAN_CTRL1")
47 .field(
48 "touch_shield_pad_en",
49 &format_args!("{}", self.touch_shield_pad_en().bit()),
50 )
51 .field(
52 "touch_inactive_connection",
53 &format_args!("{}", self.touch_inactive_connection().bit()),
54 )
55 .field(
56 "touch_scan_pad_map",
57 &format_args!("{}", self.touch_scan_pad_map().bits()),
58 )
59 .field(
60 "touch_xpd_wait",
61 &format_args!("{}", self.touch_xpd_wait().bits()),
62 )
63 .finish()
64 }
65}
66#[cfg(feature = "impl-register-debug")]
67impl core::fmt::Debug for crate::generic::Reg<TOUCH_SCAN_CTRL1_SPEC> {
68 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
69 core::fmt::Debug::fmt(&self.read(), f)
70 }
71}
72impl W {
73 #[doc = "Bit 0 - need_des"]
74 #[inline(always)]
75 #[must_use]
76 pub fn touch_shield_pad_en(&mut self) -> TOUCH_SHIELD_PAD_EN_W<TOUCH_SCAN_CTRL1_SPEC> {
77 TOUCH_SHIELD_PAD_EN_W::new(self, 0)
78 }
79 #[doc = "Bit 1 - need_des"]
80 #[inline(always)]
81 #[must_use]
82 pub fn touch_inactive_connection(
83 &mut self,
84 ) -> TOUCH_INACTIVE_CONNECTION_W<TOUCH_SCAN_CTRL1_SPEC> {
85 TOUCH_INACTIVE_CONNECTION_W::new(self, 1)
86 }
87 #[doc = "Bits 2:16 - need_des"]
88 #[inline(always)]
89 #[must_use]
90 pub fn touch_scan_pad_map(&mut self) -> TOUCH_SCAN_PAD_MAP_W<TOUCH_SCAN_CTRL1_SPEC> {
91 TOUCH_SCAN_PAD_MAP_W::new(self, 2)
92 }
93 #[doc = "Bits 17:31 - need_des"]
94 #[inline(always)]
95 #[must_use]
96 pub fn touch_xpd_wait(&mut self) -> TOUCH_XPD_WAIT_W<TOUCH_SCAN_CTRL1_SPEC> {
97 TOUCH_XPD_WAIT_W::new(self, 17)
98 }
99}
100#[doc = "need_des\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`touch_scan_ctrl1::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_scan_ctrl1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
101pub struct TOUCH_SCAN_CTRL1_SPEC;
102impl crate::RegisterSpec for TOUCH_SCAN_CTRL1_SPEC {
103 type Ux = u32;
104}
105#[doc = "`read()` method returns [`touch_scan_ctrl1::R`](R) reader structure"]
106impl crate::Readable for TOUCH_SCAN_CTRL1_SPEC {}
107#[doc = "`write(|w| ..)` method takes [`touch_scan_ctrl1::W`](W) writer structure"]
108impl crate::Writable for TOUCH_SCAN_CTRL1_SPEC {
109 type Safety = crate::Unsafe;
110 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
111 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
112}
113#[doc = "`reset()` method sets TOUCH_SCAN_CTRL1 to value 0x0008_0000"]
114impl crate::Resettable for TOUCH_SCAN_CTRL1_SPEC {
115 const RESET_VALUE: u32 = 0x0008_0000;
116}