esp32c6_lp/pmu/
hp_sleep_bias.rs

1#[doc = "Register `HP_SLEEP_BIAS` reader"]
2pub type R = crate::R<HP_SLEEP_BIAS_SPEC>;
3#[doc = "Register `HP_SLEEP_BIAS` writer"]
4pub type W = crate::W<HP_SLEEP_BIAS_SPEC>;
5#[doc = "Field `HP_SLEEP_XPD_BIAS` reader - need_des"]
6pub type HP_SLEEP_XPD_BIAS_R = crate::BitReader;
7#[doc = "Field `HP_SLEEP_XPD_BIAS` writer - need_des"]
8pub type HP_SLEEP_XPD_BIAS_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `HP_SLEEP_DBG_ATTEN` reader - need_des"]
10pub type HP_SLEEP_DBG_ATTEN_R = crate::FieldReader;
11#[doc = "Field `HP_SLEEP_DBG_ATTEN` writer - need_des"]
12pub type HP_SLEEP_DBG_ATTEN_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `HP_SLEEP_PD_CUR` reader - need_des"]
14pub type HP_SLEEP_PD_CUR_R = crate::BitReader;
15#[doc = "Field `HP_SLEEP_PD_CUR` writer - need_des"]
16pub type HP_SLEEP_PD_CUR_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `SLEEP` reader - need_des"]
18pub type SLEEP_R = crate::BitReader;
19#[doc = "Field `SLEEP` writer - need_des"]
20pub type SLEEP_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bit 25 - need_des"]
23    #[inline(always)]
24    pub fn hp_sleep_xpd_bias(&self) -> HP_SLEEP_XPD_BIAS_R {
25        HP_SLEEP_XPD_BIAS_R::new(((self.bits >> 25) & 1) != 0)
26    }
27    #[doc = "Bits 26:29 - need_des"]
28    #[inline(always)]
29    pub fn hp_sleep_dbg_atten(&self) -> HP_SLEEP_DBG_ATTEN_R {
30        HP_SLEEP_DBG_ATTEN_R::new(((self.bits >> 26) & 0x0f) as u8)
31    }
32    #[doc = "Bit 30 - need_des"]
33    #[inline(always)]
34    pub fn hp_sleep_pd_cur(&self) -> HP_SLEEP_PD_CUR_R {
35        HP_SLEEP_PD_CUR_R::new(((self.bits >> 30) & 1) != 0)
36    }
37    #[doc = "Bit 31 - need_des"]
38    #[inline(always)]
39    pub fn sleep(&self) -> SLEEP_R {
40        SLEEP_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("HP_SLEEP_BIAS")
47            .field("hp_sleep_xpd_bias", &self.hp_sleep_xpd_bias())
48            .field("hp_sleep_dbg_atten", &self.hp_sleep_dbg_atten())
49            .field("hp_sleep_pd_cur", &self.hp_sleep_pd_cur())
50            .field("sleep", &self.sleep())
51            .finish()
52    }
53}
54impl W {
55    #[doc = "Bit 25 - need_des"]
56    #[inline(always)]
57    #[must_use]
58    pub fn hp_sleep_xpd_bias(&mut self) -> HP_SLEEP_XPD_BIAS_W<HP_SLEEP_BIAS_SPEC> {
59        HP_SLEEP_XPD_BIAS_W::new(self, 25)
60    }
61    #[doc = "Bits 26:29 - need_des"]
62    #[inline(always)]
63    #[must_use]
64    pub fn hp_sleep_dbg_atten(&mut self) -> HP_SLEEP_DBG_ATTEN_W<HP_SLEEP_BIAS_SPEC> {
65        HP_SLEEP_DBG_ATTEN_W::new(self, 26)
66    }
67    #[doc = "Bit 30 - need_des"]
68    #[inline(always)]
69    #[must_use]
70    pub fn hp_sleep_pd_cur(&mut self) -> HP_SLEEP_PD_CUR_W<HP_SLEEP_BIAS_SPEC> {
71        HP_SLEEP_PD_CUR_W::new(self, 30)
72    }
73    #[doc = "Bit 31 - need_des"]
74    #[inline(always)]
75    #[must_use]
76    pub fn sleep(&mut self) -> SLEEP_W<HP_SLEEP_BIAS_SPEC> {
77        SLEEP_W::new(self, 31)
78    }
79}
80#[doc = "need_des\n\nYou can [`read`](crate::Reg::read) this register and get [`hp_sleep_bias::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`hp_sleep_bias::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
81pub struct HP_SLEEP_BIAS_SPEC;
82impl crate::RegisterSpec for HP_SLEEP_BIAS_SPEC {
83    type Ux = u32;
84}
85#[doc = "`read()` method returns [`hp_sleep_bias::R`](R) reader structure"]
86impl crate::Readable for HP_SLEEP_BIAS_SPEC {}
87#[doc = "`write(|w| ..)` method takes [`hp_sleep_bias::W`](W) writer structure"]
88impl crate::Writable for HP_SLEEP_BIAS_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 HP_SLEEP_BIAS to value 0"]
94impl crate::Resettable for HP_SLEEP_BIAS_SPEC {
95    const RESET_VALUE: u32 = 0;
96}