esp32p4/lp_ana/
touch_work.rs

1#[doc = "Register `TOUCH_WORK` reader"]
2pub type R = crate::R<TOUCH_WORK_SPEC>;
3#[doc = "Register `TOUCH_WORK` writer"]
4pub type W = crate::W<TOUCH_WORK_SPEC>;
5#[doc = "Field `DIV_NUM2` reader - need_des"]
6pub type DIV_NUM2_R = crate::FieldReader;
7#[doc = "Field `DIV_NUM2` writer - need_des"]
8pub type DIV_NUM2_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
9#[doc = "Field `DIV_NUM1` reader - need_des"]
10pub type DIV_NUM1_R = crate::FieldReader;
11#[doc = "Field `DIV_NUM1` writer - need_des"]
12pub type DIV_NUM1_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
13#[doc = "Field `DIV_NUM0` reader - need_des"]
14pub type DIV_NUM0_R = crate::FieldReader;
15#[doc = "Field `DIV_NUM0` writer - need_des"]
16pub type DIV_NUM0_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
17#[doc = "Field `TOUCH_OUT_SEL` reader - need_des"]
18pub type TOUCH_OUT_SEL_R = crate::BitReader;
19#[doc = "Field `TOUCH_OUT_SEL` writer - need_des"]
20pub type TOUCH_OUT_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `TOUCH_OUT_RESET` writer - need_des"]
22pub type TOUCH_OUT_RESET_W<'a, REG> = crate::BitWriter<'a, REG>;
23#[doc = "Field `TOUCH_OUT_GATE` reader - need_des"]
24pub type TOUCH_OUT_GATE_R = crate::BitReader;
25#[doc = "Field `TOUCH_OUT_GATE` writer - need_des"]
26pub type TOUCH_OUT_GATE_W<'a, REG> = crate::BitWriter<'a, REG>;
27impl R {
28    #[doc = "Bits 16:18 - need_des"]
29    #[inline(always)]
30    pub fn div_num2(&self) -> DIV_NUM2_R {
31        DIV_NUM2_R::new(((self.bits >> 16) & 7) as u8)
32    }
33    #[doc = "Bits 19:21 - need_des"]
34    #[inline(always)]
35    pub fn div_num1(&self) -> DIV_NUM1_R {
36        DIV_NUM1_R::new(((self.bits >> 19) & 7) as u8)
37    }
38    #[doc = "Bits 22:24 - need_des"]
39    #[inline(always)]
40    pub fn div_num0(&self) -> DIV_NUM0_R {
41        DIV_NUM0_R::new(((self.bits >> 22) & 7) as u8)
42    }
43    #[doc = "Bit 25 - need_des"]
44    #[inline(always)]
45    pub fn touch_out_sel(&self) -> TOUCH_OUT_SEL_R {
46        TOUCH_OUT_SEL_R::new(((self.bits >> 25) & 1) != 0)
47    }
48    #[doc = "Bit 27 - need_des"]
49    #[inline(always)]
50    pub fn touch_out_gate(&self) -> TOUCH_OUT_GATE_R {
51        TOUCH_OUT_GATE_R::new(((self.bits >> 27) & 1) != 0)
52    }
53}
54#[cfg(feature = "impl-register-debug")]
55impl core::fmt::Debug for R {
56    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
57        f.debug_struct("TOUCH_WORK")
58            .field("div_num2", &format_args!("{}", self.div_num2().bits()))
59            .field("div_num1", &format_args!("{}", self.div_num1().bits()))
60            .field("div_num0", &format_args!("{}", self.div_num0().bits()))
61            .field(
62                "touch_out_sel",
63                &format_args!("{}", self.touch_out_sel().bit()),
64            )
65            .field(
66                "touch_out_gate",
67                &format_args!("{}", self.touch_out_gate().bit()),
68            )
69            .finish()
70    }
71}
72#[cfg(feature = "impl-register-debug")]
73impl core::fmt::Debug for crate::generic::Reg<TOUCH_WORK_SPEC> {
74    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
75        core::fmt::Debug::fmt(&self.read(), f)
76    }
77}
78impl W {
79    #[doc = "Bits 16:18 - need_des"]
80    #[inline(always)]
81    #[must_use]
82    pub fn div_num2(&mut self) -> DIV_NUM2_W<TOUCH_WORK_SPEC> {
83        DIV_NUM2_W::new(self, 16)
84    }
85    #[doc = "Bits 19:21 - need_des"]
86    #[inline(always)]
87    #[must_use]
88    pub fn div_num1(&mut self) -> DIV_NUM1_W<TOUCH_WORK_SPEC> {
89        DIV_NUM1_W::new(self, 19)
90    }
91    #[doc = "Bits 22:24 - need_des"]
92    #[inline(always)]
93    #[must_use]
94    pub fn div_num0(&mut self) -> DIV_NUM0_W<TOUCH_WORK_SPEC> {
95        DIV_NUM0_W::new(self, 22)
96    }
97    #[doc = "Bit 25 - need_des"]
98    #[inline(always)]
99    #[must_use]
100    pub fn touch_out_sel(&mut self) -> TOUCH_OUT_SEL_W<TOUCH_WORK_SPEC> {
101        TOUCH_OUT_SEL_W::new(self, 25)
102    }
103    #[doc = "Bit 26 - need_des"]
104    #[inline(always)]
105    #[must_use]
106    pub fn touch_out_reset(&mut self) -> TOUCH_OUT_RESET_W<TOUCH_WORK_SPEC> {
107        TOUCH_OUT_RESET_W::new(self, 26)
108    }
109    #[doc = "Bit 27 - need_des"]
110    #[inline(always)]
111    #[must_use]
112    pub fn touch_out_gate(&mut self) -> TOUCH_OUT_GATE_W<TOUCH_WORK_SPEC> {
113        TOUCH_OUT_GATE_W::new(self, 27)
114    }
115}
116#[doc = "need_des\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`touch_work::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_work::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
117pub struct TOUCH_WORK_SPEC;
118impl crate::RegisterSpec for TOUCH_WORK_SPEC {
119    type Ux = u32;
120}
121#[doc = "`read()` method returns [`touch_work::R`](R) reader structure"]
122impl crate::Readable for TOUCH_WORK_SPEC {}
123#[doc = "`write(|w| ..)` method takes [`touch_work::W`](W) writer structure"]
124impl crate::Writable for TOUCH_WORK_SPEC {
125    type Safety = crate::Unsafe;
126    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
127    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
128}
129#[doc = "`reset()` method sets TOUCH_WORK to value 0"]
130impl crate::Resettable for TOUCH_WORK_SPEC {
131    const RESET_VALUE: u32 = 0;
132}