esp32p4/lp_touch/
int_raw.rs

1#[doc = "Register `INT_RAW` reader"]
2pub type R = crate::R<INT_RAW_SPEC>;
3#[doc = "Register `INT_RAW` writer"]
4pub type W = crate::W<INT_RAW_SPEC>;
5#[doc = "Field `SCAN_DONE` reader - need_des"]
6pub type SCAN_DONE_R = crate::BitReader;
7#[doc = "Field `SCAN_DONE` writer - need_des"]
8pub type SCAN_DONE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `DONE` reader - need_des"]
10pub type DONE_R = crate::BitReader;
11#[doc = "Field `DONE` writer - need_des"]
12pub type DONE_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `ACTIVE` reader - need_des"]
14pub type ACTIVE_R = crate::BitReader;
15#[doc = "Field `ACTIVE` writer - need_des"]
16pub type ACTIVE_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `INACTIVE` reader - need_des"]
18pub type INACTIVE_R = crate::BitReader;
19#[doc = "Field `INACTIVE` writer - need_des"]
20pub type INACTIVE_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `TIMEOUT` reader - need_des"]
22pub type TIMEOUT_R = crate::BitReader;
23#[doc = "Field `TIMEOUT` writer - need_des"]
24pub type TIMEOUT_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `APPROACH_LOOP_DONE` reader - need_des"]
26pub type APPROACH_LOOP_DONE_R = crate::BitReader;
27#[doc = "Field `APPROACH_LOOP_DONE` writer - need_des"]
28pub type APPROACH_LOOP_DONE_W<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30    #[doc = "Bit 0 - need_des"]
31    #[inline(always)]
32    pub fn scan_done(&self) -> SCAN_DONE_R {
33        SCAN_DONE_R::new((self.bits & 1) != 0)
34    }
35    #[doc = "Bit 1 - need_des"]
36    #[inline(always)]
37    pub fn done(&self) -> DONE_R {
38        DONE_R::new(((self.bits >> 1) & 1) != 0)
39    }
40    #[doc = "Bit 2 - need_des"]
41    #[inline(always)]
42    pub fn active(&self) -> ACTIVE_R {
43        ACTIVE_R::new(((self.bits >> 2) & 1) != 0)
44    }
45    #[doc = "Bit 3 - need_des"]
46    #[inline(always)]
47    pub fn inactive(&self) -> INACTIVE_R {
48        INACTIVE_R::new(((self.bits >> 3) & 1) != 0)
49    }
50    #[doc = "Bit 4 - need_des"]
51    #[inline(always)]
52    pub fn timeout(&self) -> TIMEOUT_R {
53        TIMEOUT_R::new(((self.bits >> 4) & 1) != 0)
54    }
55    #[doc = "Bit 5 - need_des"]
56    #[inline(always)]
57    pub fn approach_loop_done(&self) -> APPROACH_LOOP_DONE_R {
58        APPROACH_LOOP_DONE_R::new(((self.bits >> 5) & 1) != 0)
59    }
60}
61#[cfg(feature = "impl-register-debug")]
62impl core::fmt::Debug for R {
63    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64        f.debug_struct("INT_RAW")
65            .field("scan_done", &format_args!("{}", self.scan_done().bit()))
66            .field("done", &format_args!("{}", self.done().bit()))
67            .field("active", &format_args!("{}", self.active().bit()))
68            .field("inactive", &format_args!("{}", self.inactive().bit()))
69            .field("timeout", &format_args!("{}", self.timeout().bit()))
70            .field(
71                "approach_loop_done",
72                &format_args!("{}", self.approach_loop_done().bit()),
73            )
74            .finish()
75    }
76}
77#[cfg(feature = "impl-register-debug")]
78impl core::fmt::Debug for crate::generic::Reg<INT_RAW_SPEC> {
79    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
80        core::fmt::Debug::fmt(&self.read(), f)
81    }
82}
83impl W {
84    #[doc = "Bit 0 - need_des"]
85    #[inline(always)]
86    #[must_use]
87    pub fn scan_done(&mut self) -> SCAN_DONE_W<INT_RAW_SPEC> {
88        SCAN_DONE_W::new(self, 0)
89    }
90    #[doc = "Bit 1 - need_des"]
91    #[inline(always)]
92    #[must_use]
93    pub fn done(&mut self) -> DONE_W<INT_RAW_SPEC> {
94        DONE_W::new(self, 1)
95    }
96    #[doc = "Bit 2 - need_des"]
97    #[inline(always)]
98    #[must_use]
99    pub fn active(&mut self) -> ACTIVE_W<INT_RAW_SPEC> {
100        ACTIVE_W::new(self, 2)
101    }
102    #[doc = "Bit 3 - need_des"]
103    #[inline(always)]
104    #[must_use]
105    pub fn inactive(&mut self) -> INACTIVE_W<INT_RAW_SPEC> {
106        INACTIVE_W::new(self, 3)
107    }
108    #[doc = "Bit 4 - need_des"]
109    #[inline(always)]
110    #[must_use]
111    pub fn timeout(&mut self) -> TIMEOUT_W<INT_RAW_SPEC> {
112        TIMEOUT_W::new(self, 4)
113    }
114    #[doc = "Bit 5 - need_des"]
115    #[inline(always)]
116    #[must_use]
117    pub fn approach_loop_done(&mut self) -> APPROACH_LOOP_DONE_W<INT_RAW_SPEC> {
118        APPROACH_LOOP_DONE_W::new(self, 5)
119    }
120}
121#[doc = "need_des\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`int_raw::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 [`int_raw::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
122pub struct INT_RAW_SPEC;
123impl crate::RegisterSpec for INT_RAW_SPEC {
124    type Ux = u32;
125}
126#[doc = "`read()` method returns [`int_raw::R`](R) reader structure"]
127impl crate::Readable for INT_RAW_SPEC {}
128#[doc = "`write(|w| ..)` method takes [`int_raw::W`](W) writer structure"]
129impl crate::Writable for INT_RAW_SPEC {
130    type Safety = crate::Unsafe;
131    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
132    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
133}
134#[doc = "`reset()` method sets INT_RAW to value 0"]
135impl crate::Resettable for INT_RAW_SPEC {
136    const RESET_VALUE: u32 = 0;
137}