esp32p4/pmu/
hp_sleep_lp_dig_power.rs

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