esp32h2/pmu/
lp_sleep_bias.rs

1#[doc = "Register `LP_SLEEP_BIAS` reader"]
2pub type R = crate::R<LP_SLEEP_BIAS_SPEC>;
3#[doc = "Register `LP_SLEEP_BIAS` writer"]
4pub type W = crate::W<LP_SLEEP_BIAS_SPEC>;
5#[doc = "Field `LP_SLEEP_XPD_BIAS` reader - need_des"]
6pub type LP_SLEEP_XPD_BIAS_R = crate::BitReader;
7#[doc = "Field `LP_SLEEP_XPD_BIAS` writer - need_des"]
8pub type LP_SLEEP_XPD_BIAS_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `LP_SLEEP_PD_CUR` reader - need_des"]
10pub type LP_SLEEP_PD_CUR_R = crate::BitReader;
11#[doc = "Field `LP_SLEEP_PD_CUR` writer - need_des"]
12pub type LP_SLEEP_PD_CUR_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SLEEP` reader - need_des"]
14pub type SLEEP_R = crate::BitReader;
15#[doc = "Field `SLEEP` writer - need_des"]
16pub type SLEEP_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bit 25 - need_des"]
19    #[inline(always)]
20    pub fn lp_sleep_xpd_bias(&self) -> LP_SLEEP_XPD_BIAS_R {
21        LP_SLEEP_XPD_BIAS_R::new(((self.bits >> 25) & 1) != 0)
22    }
23    #[doc = "Bit 30 - need_des"]
24    #[inline(always)]
25    pub fn lp_sleep_pd_cur(&self) -> LP_SLEEP_PD_CUR_R {
26        LP_SLEEP_PD_CUR_R::new(((self.bits >> 30) & 1) != 0)
27    }
28    #[doc = "Bit 31 - need_des"]
29    #[inline(always)]
30    pub fn sleep(&self) -> SLEEP_R {
31        SLEEP_R::new(((self.bits >> 31) & 1) != 0)
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("LP_SLEEP_BIAS")
38            .field("lp_sleep_xpd_bias", &self.lp_sleep_xpd_bias())
39            .field("lp_sleep_pd_cur", &self.lp_sleep_pd_cur())
40            .field("sleep", &self.sleep())
41            .finish()
42    }
43}
44impl W {
45    #[doc = "Bit 25 - need_des"]
46    #[inline(always)]
47    pub fn lp_sleep_xpd_bias(&mut self) -> LP_SLEEP_XPD_BIAS_W<LP_SLEEP_BIAS_SPEC> {
48        LP_SLEEP_XPD_BIAS_W::new(self, 25)
49    }
50    #[doc = "Bit 30 - need_des"]
51    #[inline(always)]
52    pub fn lp_sleep_pd_cur(&mut self) -> LP_SLEEP_PD_CUR_W<LP_SLEEP_BIAS_SPEC> {
53        LP_SLEEP_PD_CUR_W::new(self, 30)
54    }
55    #[doc = "Bit 31 - need_des"]
56    #[inline(always)]
57    pub fn sleep(&mut self) -> SLEEP_W<LP_SLEEP_BIAS_SPEC> {
58        SLEEP_W::new(self, 31)
59    }
60}
61#[doc = "need_des\n\nYou can [`read`](crate::Reg::read) this register and get [`lp_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 [`lp_sleep_bias::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct LP_SLEEP_BIAS_SPEC;
63impl crate::RegisterSpec for LP_SLEEP_BIAS_SPEC {
64    type Ux = u32;
65}
66#[doc = "`read()` method returns [`lp_sleep_bias::R`](R) reader structure"]
67impl crate::Readable for LP_SLEEP_BIAS_SPEC {}
68#[doc = "`write(|w| ..)` method takes [`lp_sleep_bias::W`](W) writer structure"]
69impl crate::Writable for LP_SLEEP_BIAS_SPEC {
70    type Safety = crate::Unsafe;
71    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
72    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
73}
74#[doc = "`reset()` method sets LP_SLEEP_BIAS to value 0"]
75impl crate::Resettable for LP_SLEEP_BIAS_SPEC {
76    const RESET_VALUE: u32 = 0;
77}