esp32s2/sens/
sar_touch_status2.rs

1#[doc = "Register `SAR_TOUCH_STATUS2` reader"]
2pub type R = crate::R<SAR_TOUCH_STATUS2_SPEC>;
3#[doc = "Field `TOUCH_PAD2_DATA` reader - The data of touch pad 2, depending on the setting of SENS_TOUCH_DATA_SEL."]
4pub type TOUCH_PAD2_DATA_R = crate::FieldReader<u32>;
5#[doc = "Field `TOUCH_PAD2_DEBOUNCE` reader - Touch pad 2 debounce value."]
6pub type TOUCH_PAD2_DEBOUNCE_R = crate::FieldReader;
7impl R {
8    #[doc = "Bits 0:21 - The data of touch pad 2, depending on the setting of SENS_TOUCH_DATA_SEL."]
9    #[inline(always)]
10    pub fn touch_pad2_data(&self) -> TOUCH_PAD2_DATA_R {
11        TOUCH_PAD2_DATA_R::new(self.bits & 0x003f_ffff)
12    }
13    #[doc = "Bits 29:31 - Touch pad 2 debounce value."]
14    #[inline(always)]
15    pub fn touch_pad2_debounce(&self) -> TOUCH_PAD2_DEBOUNCE_R {
16        TOUCH_PAD2_DEBOUNCE_R::new(((self.bits >> 29) & 7) as u8)
17    }
18}
19#[cfg(feature = "impl-register-debug")]
20impl core::fmt::Debug for R {
21    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
22        f.debug_struct("SAR_TOUCH_STATUS2")
23            .field("touch_pad2_data", &self.touch_pad2_data())
24            .field("touch_pad2_debounce", &self.touch_pad2_debounce())
25            .finish()
26    }
27}
28#[doc = "Touch pad 2 status\n\nYou can [`read`](crate::Reg::read) this register and get [`sar_touch_status2::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
29pub struct SAR_TOUCH_STATUS2_SPEC;
30impl crate::RegisterSpec for SAR_TOUCH_STATUS2_SPEC {
31    type Ux = u32;
32}
33#[doc = "`read()` method returns [`sar_touch_status2::R`](R) reader structure"]
34impl crate::Readable for SAR_TOUCH_STATUS2_SPEC {}
35#[doc = "`reset()` method sets SAR_TOUCH_STATUS2 to value 0"]
36impl crate::Resettable for SAR_TOUCH_STATUS2_SPEC {
37    const RESET_VALUE: u32 = 0;
38}