esp32c6_lp/pmu/
slp_wakeup_cntl3.rs

1#[doc = "Register `SLP_WAKEUP_CNTL3` reader"]
2pub type R = crate::R<SLP_WAKEUP_CNTL3_SPEC>;
3#[doc = "Register `SLP_WAKEUP_CNTL3` writer"]
4pub type W = crate::W<SLP_WAKEUP_CNTL3_SPEC>;
5#[doc = "Field `LP_MIN_SLP_VAL` reader - need_des"]
6pub type LP_MIN_SLP_VAL_R = crate::FieldReader;
7#[doc = "Field `LP_MIN_SLP_VAL` writer - need_des"]
8pub type LP_MIN_SLP_VAL_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `HP_MIN_SLP_VAL` reader - need_des"]
10pub type HP_MIN_SLP_VAL_R = crate::FieldReader;
11#[doc = "Field `HP_MIN_SLP_VAL` writer - need_des"]
12pub type HP_MIN_SLP_VAL_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `SLEEP_PRT_SEL` reader - need_des"]
14pub type SLEEP_PRT_SEL_R = crate::FieldReader;
15#[doc = "Field `SLEEP_PRT_SEL` writer - need_des"]
16pub type SLEEP_PRT_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
17impl R {
18    #[doc = "Bits 0:7 - need_des"]
19    #[inline(always)]
20    pub fn lp_min_slp_val(&self) -> LP_MIN_SLP_VAL_R {
21        LP_MIN_SLP_VAL_R::new((self.bits & 0xff) as u8)
22    }
23    #[doc = "Bits 8:15 - need_des"]
24    #[inline(always)]
25    pub fn hp_min_slp_val(&self) -> HP_MIN_SLP_VAL_R {
26        HP_MIN_SLP_VAL_R::new(((self.bits >> 8) & 0xff) as u8)
27    }
28    #[doc = "Bits 16:17 - need_des"]
29    #[inline(always)]
30    pub fn sleep_prt_sel(&self) -> SLEEP_PRT_SEL_R {
31        SLEEP_PRT_SEL_R::new(((self.bits >> 16) & 3) as u8)
32    }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37        f.debug_struct("SLP_WAKEUP_CNTL3")
38            .field("lp_min_slp_val", &self.lp_min_slp_val())
39            .field("hp_min_slp_val", &self.hp_min_slp_val())
40            .field("sleep_prt_sel", &self.sleep_prt_sel())
41            .finish()
42    }
43}
44impl W {
45    #[doc = "Bits 0:7 - need_des"]
46    #[inline(always)]
47    #[must_use]
48    pub fn lp_min_slp_val(&mut self) -> LP_MIN_SLP_VAL_W<SLP_WAKEUP_CNTL3_SPEC> {
49        LP_MIN_SLP_VAL_W::new(self, 0)
50    }
51    #[doc = "Bits 8:15 - need_des"]
52    #[inline(always)]
53    #[must_use]
54    pub fn hp_min_slp_val(&mut self) -> HP_MIN_SLP_VAL_W<SLP_WAKEUP_CNTL3_SPEC> {
55        HP_MIN_SLP_VAL_W::new(self, 8)
56    }
57    #[doc = "Bits 16:17 - need_des"]
58    #[inline(always)]
59    #[must_use]
60    pub fn sleep_prt_sel(&mut self) -> SLEEP_PRT_SEL_W<SLP_WAKEUP_CNTL3_SPEC> {
61        SLEEP_PRT_SEL_W::new(self, 16)
62    }
63}
64#[doc = "need_des\n\nYou can [`read`](crate::Reg::read) this register and get [`slp_wakeup_cntl3::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`slp_wakeup_cntl3::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
65pub struct SLP_WAKEUP_CNTL3_SPEC;
66impl crate::RegisterSpec for SLP_WAKEUP_CNTL3_SPEC {
67    type Ux = u32;
68}
69#[doc = "`read()` method returns [`slp_wakeup_cntl3::R`](R) reader structure"]
70impl crate::Readable for SLP_WAKEUP_CNTL3_SPEC {}
71#[doc = "`write(|w| ..)` method takes [`slp_wakeup_cntl3::W`](W) writer structure"]
72impl crate::Writable for SLP_WAKEUP_CNTL3_SPEC {
73    type Safety = crate::Unsafe;
74    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
75    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
76}
77#[doc = "`reset()` method sets SLP_WAKEUP_CNTL3 to value 0"]
78impl crate::Resettable for SLP_WAKEUP_CNTL3_SPEC {
79    const RESET_VALUE: u32 = 0;
80}