esp32p4/lp_ana/
touch_slp0.rs

1#[doc = "Register `TOUCH_SLP0` reader"]
2pub type R = crate::R<TOUCH_SLP0_SPEC>;
3#[doc = "Register `TOUCH_SLP0` writer"]
4pub type W = crate::W<TOUCH_SLP0_SPEC>;
5#[doc = "Field `TOUCH_SLP_TH0` reader - need_des"]
6pub type TOUCH_SLP_TH0_R = crate::FieldReader<u16>;
7#[doc = "Field `TOUCH_SLP_TH0` writer - need_des"]
8pub type TOUCH_SLP_TH0_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `TOUCH_SLP_CHANNEL_CLR` writer - need_des"]
10pub type TOUCH_SLP_CHANNEL_CLR_W<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `TOUCH_SLP_PAD` reader - need_des"]
12pub type TOUCH_SLP_PAD_R = crate::FieldReader;
13#[doc = "Field `TOUCH_SLP_PAD` writer - need_des"]
14pub type TOUCH_SLP_PAD_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
15impl R {
16    #[doc = "Bits 0:15 - need_des"]
17    #[inline(always)]
18    pub fn touch_slp_th0(&self) -> TOUCH_SLP_TH0_R {
19        TOUCH_SLP_TH0_R::new((self.bits & 0xffff) as u16)
20    }
21    #[doc = "Bits 17:20 - need_des"]
22    #[inline(always)]
23    pub fn touch_slp_pad(&self) -> TOUCH_SLP_PAD_R {
24        TOUCH_SLP_PAD_R::new(((self.bits >> 17) & 0x0f) as u8)
25    }
26}
27#[cfg(feature = "impl-register-debug")]
28impl core::fmt::Debug for R {
29    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
30        f.debug_struct("TOUCH_SLP0")
31            .field(
32                "touch_slp_th0",
33                &format_args!("{}", self.touch_slp_th0().bits()),
34            )
35            .field(
36                "touch_slp_pad",
37                &format_args!("{}", self.touch_slp_pad().bits()),
38            )
39            .finish()
40    }
41}
42#[cfg(feature = "impl-register-debug")]
43impl core::fmt::Debug for crate::generic::Reg<TOUCH_SLP0_SPEC> {
44    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
45        core::fmt::Debug::fmt(&self.read(), f)
46    }
47}
48impl W {
49    #[doc = "Bits 0:15 - need_des"]
50    #[inline(always)]
51    #[must_use]
52    pub fn touch_slp_th0(&mut self) -> TOUCH_SLP_TH0_W<TOUCH_SLP0_SPEC> {
53        TOUCH_SLP_TH0_W::new(self, 0)
54    }
55    #[doc = "Bit 16 - need_des"]
56    #[inline(always)]
57    #[must_use]
58    pub fn touch_slp_channel_clr(&mut self) -> TOUCH_SLP_CHANNEL_CLR_W<TOUCH_SLP0_SPEC> {
59        TOUCH_SLP_CHANNEL_CLR_W::new(self, 16)
60    }
61    #[doc = "Bits 17:20 - need_des"]
62    #[inline(always)]
63    #[must_use]
64    pub fn touch_slp_pad(&mut self) -> TOUCH_SLP_PAD_W<TOUCH_SLP0_SPEC> {
65        TOUCH_SLP_PAD_W::new(self, 17)
66    }
67}
68#[doc = "need_des\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`touch_slp0::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_slp0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
69pub struct TOUCH_SLP0_SPEC;
70impl crate::RegisterSpec for TOUCH_SLP0_SPEC {
71    type Ux = u32;
72}
73#[doc = "`read()` method returns [`touch_slp0::R`](R) reader structure"]
74impl crate::Readable for TOUCH_SLP0_SPEC {}
75#[doc = "`write(|w| ..)` method takes [`touch_slp0::W`](W) writer structure"]
76impl crate::Writable for TOUCH_SLP0_SPEC {
77    type Safety = crate::Unsafe;
78    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
79    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
80}
81#[doc = "`reset()` method sets TOUCH_SLP0 to value 0x001e_0000"]
82impl crate::Resettable for TOUCH_SLP0_SPEC {
83    const RESET_VALUE: u32 = 0x001e_0000;
84}