esp32p4/lp_touch/
status_15.rs

1#[doc = "Register `STATUS_15` reader"]
2pub type R = crate::R<STATUS_15_SPEC>;
3#[doc = "Field `SLP_DATA` reader - need_des"]
4pub type SLP_DATA_R = crate::FieldReader<u16>;
5#[doc = "Field `SLP_DEBOUNCE_CNT` reader - need_des"]
6pub type SLP_DEBOUNCE_CNT_R = crate::FieldReader;
7#[doc = "Field `SLP_NEG_NOISE_CNT` reader - need_des"]
8pub type SLP_NEG_NOISE_CNT_R = crate::FieldReader;
9impl R {
10    #[doc = "Bits 0:15 - need_des"]
11    #[inline(always)]
12    pub fn slp_data(&self) -> SLP_DATA_R {
13        SLP_DATA_R::new((self.bits & 0xffff) as u16)
14    }
15    #[doc = "Bits 16:18 - need_des"]
16    #[inline(always)]
17    pub fn slp_debounce_cnt(&self) -> SLP_DEBOUNCE_CNT_R {
18        SLP_DEBOUNCE_CNT_R::new(((self.bits >> 16) & 7) as u8)
19    }
20    #[doc = "Bits 19:22 - need_des"]
21    #[inline(always)]
22    pub fn slp_neg_noise_cnt(&self) -> SLP_NEG_NOISE_CNT_R {
23        SLP_NEG_NOISE_CNT_R::new(((self.bits >> 19) & 0x0f) as u8)
24    }
25}
26#[cfg(feature = "impl-register-debug")]
27impl core::fmt::Debug for R {
28    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
29        f.debug_struct("STATUS_15")
30            .field("slp_data", &format_args!("{}", self.slp_data().bits()))
31            .field(
32                "slp_debounce_cnt",
33                &format_args!("{}", self.slp_debounce_cnt().bits()),
34            )
35            .field(
36                "slp_neg_noise_cnt",
37                &format_args!("{}", self.slp_neg_noise_cnt().bits()),
38            )
39            .finish()
40    }
41}
42#[cfg(feature = "impl-register-debug")]
43impl core::fmt::Debug for crate::generic::Reg<STATUS_15_SPEC> {
44    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
45        core::fmt::Debug::fmt(&self.read(), f)
46    }
47}
48#[doc = "need_des\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`status_15::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
49pub struct STATUS_15_SPEC;
50impl crate::RegisterSpec for STATUS_15_SPEC {
51    type Ux = u32;
52}
53#[doc = "`read()` method returns [`status_15::R`](R) reader structure"]
54impl crate::Readable for STATUS_15_SPEC {}
55#[doc = "`reset()` method sets STATUS_15 to value 0"]
56impl crate::Resettable for STATUS_15_SPEC {
57    const RESET_VALUE: u32 = 0;
58}