esp32c6_lp/lp_aon/
ext_wakeup_cntl.rs

1#[doc = "Register `EXT_WAKEUP_CNTL` reader"]
2pub type R = crate::R<EXT_WAKEUP_CNTL_SPEC>;
3#[doc = "Register `EXT_WAKEUP_CNTL` writer"]
4pub type W = crate::W<EXT_WAKEUP_CNTL_SPEC>;
5#[doc = "Field `EXT_WAKEUP_STATUS` reader - need_des"]
6pub type EXT_WAKEUP_STATUS_R = crate::FieldReader;
7#[doc = "Field `EXT_WAKEUP_STATUS_CLR` writer - need_des"]
8pub type EXT_WAKEUP_STATUS_CLR_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `EXT_WAKEUP_SEL` reader - need_des"]
10pub type EXT_WAKEUP_SEL_R = crate::FieldReader;
11#[doc = "Field `EXT_WAKEUP_SEL` writer - need_des"]
12pub type EXT_WAKEUP_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `EXT_WAKEUP_LV` reader - need_des"]
14pub type EXT_WAKEUP_LV_R = crate::FieldReader;
15#[doc = "Field `EXT_WAKEUP_LV` writer - need_des"]
16pub type EXT_WAKEUP_LV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17#[doc = "Field `EXT_WAKEUP_FILTER` reader - need_des"]
18pub type EXT_WAKEUP_FILTER_R = crate::BitReader;
19#[doc = "Field `EXT_WAKEUP_FILTER` writer - need_des"]
20pub type EXT_WAKEUP_FILTER_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bits 0:7 - need_des"]
23    #[inline(always)]
24    pub fn ext_wakeup_status(&self) -> EXT_WAKEUP_STATUS_R {
25        EXT_WAKEUP_STATUS_R::new((self.bits & 0xff) as u8)
26    }
27    #[doc = "Bits 15:22 - need_des"]
28    #[inline(always)]
29    pub fn ext_wakeup_sel(&self) -> EXT_WAKEUP_SEL_R {
30        EXT_WAKEUP_SEL_R::new(((self.bits >> 15) & 0xff) as u8)
31    }
32    #[doc = "Bits 23:30 - need_des"]
33    #[inline(always)]
34    pub fn ext_wakeup_lv(&self) -> EXT_WAKEUP_LV_R {
35        EXT_WAKEUP_LV_R::new(((self.bits >> 23) & 0xff) as u8)
36    }
37    #[doc = "Bit 31 - need_des"]
38    #[inline(always)]
39    pub fn ext_wakeup_filter(&self) -> EXT_WAKEUP_FILTER_R {
40        EXT_WAKEUP_FILTER_R::new(((self.bits >> 31) & 1) != 0)
41    }
42}
43#[cfg(feature = "impl-register-debug")]
44impl core::fmt::Debug for R {
45    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46        f.debug_struct("EXT_WAKEUP_CNTL")
47            .field("ext_wakeup_status", &self.ext_wakeup_status())
48            .field("ext_wakeup_sel", &self.ext_wakeup_sel())
49            .field("ext_wakeup_lv", &self.ext_wakeup_lv())
50            .field("ext_wakeup_filter", &self.ext_wakeup_filter())
51            .finish()
52    }
53}
54impl W {
55    #[doc = "Bit 14 - need_des"]
56    #[inline(always)]
57    #[must_use]
58    pub fn ext_wakeup_status_clr(&mut self) -> EXT_WAKEUP_STATUS_CLR_W<EXT_WAKEUP_CNTL_SPEC> {
59        EXT_WAKEUP_STATUS_CLR_W::new(self, 14)
60    }
61    #[doc = "Bits 15:22 - need_des"]
62    #[inline(always)]
63    #[must_use]
64    pub fn ext_wakeup_sel(&mut self) -> EXT_WAKEUP_SEL_W<EXT_WAKEUP_CNTL_SPEC> {
65        EXT_WAKEUP_SEL_W::new(self, 15)
66    }
67    #[doc = "Bits 23:30 - need_des"]
68    #[inline(always)]
69    #[must_use]
70    pub fn ext_wakeup_lv(&mut self) -> EXT_WAKEUP_LV_W<EXT_WAKEUP_CNTL_SPEC> {
71        EXT_WAKEUP_LV_W::new(self, 23)
72    }
73    #[doc = "Bit 31 - need_des"]
74    #[inline(always)]
75    #[must_use]
76    pub fn ext_wakeup_filter(&mut self) -> EXT_WAKEUP_FILTER_W<EXT_WAKEUP_CNTL_SPEC> {
77        EXT_WAKEUP_FILTER_W::new(self, 31)
78    }
79}
80#[doc = "need_des\n\nYou can [`read`](crate::Reg::read) this register and get [`ext_wakeup_cntl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ext_wakeup_cntl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
81pub struct EXT_WAKEUP_CNTL_SPEC;
82impl crate::RegisterSpec for EXT_WAKEUP_CNTL_SPEC {
83    type Ux = u32;
84}
85#[doc = "`read()` method returns [`ext_wakeup_cntl::R`](R) reader structure"]
86impl crate::Readable for EXT_WAKEUP_CNTL_SPEC {}
87#[doc = "`write(|w| ..)` method takes [`ext_wakeup_cntl::W`](W) writer structure"]
88impl crate::Writable for EXT_WAKEUP_CNTL_SPEC {
89    type Safety = crate::Unsafe;
90    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
91    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
92}
93#[doc = "`reset()` method sets EXT_WAKEUP_CNTL to value 0"]
94impl crate::Resettable for EXT_WAKEUP_CNTL_SPEC {
95    const RESET_VALUE: u32 = 0;
96}