esp32s3/rtc_cntl/
rtc.rs

1#[doc = "Register `RTC` reader"]
2pub type R = crate::R<RTC_SPEC>;
3#[doc = "Register `RTC` writer"]
4pub type W = crate::W<RTC_SPEC>;
5#[doc = "Field `DIG_REG_CAL_EN` reader - enable dig regulator cali"]
6pub type DIG_REG_CAL_EN_R = crate::BitReader;
7#[doc = "Field `DIG_REG_CAL_EN` writer - enable dig regulator cali"]
8pub type DIG_REG_CAL_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `SCK_DCAP` reader - SCK_DCAP"]
10pub type SCK_DCAP_R = crate::FieldReader;
11#[doc = "Field `SCK_DCAP` writer - SCK_DCAP"]
12pub type SCK_DCAP_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `DBOOST_FORCE_PD` reader - RTC_DBOOST force power down"]
14pub type DBOOST_FORCE_PD_R = crate::BitReader;
15#[doc = "Field `DBOOST_FORCE_PD` writer - RTC_DBOOST force power down"]
16pub type DBOOST_FORCE_PD_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `DBOOST_FORCE_PU` reader - RTC_DBOOST force power up"]
18pub type DBOOST_FORCE_PU_R = crate::BitReader;
19#[doc = "Field `DBOOST_FORCE_PU` writer - RTC_DBOOST force power up"]
20pub type DBOOST_FORCE_PU_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `REGULATOR_FORCE_PD` reader - RTC_REG force power down (for RTC_REG power down means decrease the voltage to 0.8v or lower )"]
22pub type REGULATOR_FORCE_PD_R = crate::BitReader;
23#[doc = "Field `REGULATOR_FORCE_PD` writer - RTC_REG force power down (for RTC_REG power down means decrease the voltage to 0.8v or lower )"]
24pub type REGULATOR_FORCE_PD_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `REGULATOR_FORCE_PU` reader - RTC_REG force power on (for RTC_REG power down means decrease the voltage to 0.8v or lower )"]
26pub type REGULATOR_FORCE_PU_R = crate::BitReader;
27#[doc = "Field `REGULATOR_FORCE_PU` writer - RTC_REG force power on (for RTC_REG power down means decrease the voltage to 0.8v or lower )"]
28pub type REGULATOR_FORCE_PU_W<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30    #[doc = "Bit 7 - enable dig regulator cali"]
31    #[inline(always)]
32    pub fn dig_reg_cal_en(&self) -> DIG_REG_CAL_EN_R {
33        DIG_REG_CAL_EN_R::new(((self.bits >> 7) & 1) != 0)
34    }
35    #[doc = "Bits 14:21 - SCK_DCAP"]
36    #[inline(always)]
37    pub fn sck_dcap(&self) -> SCK_DCAP_R {
38        SCK_DCAP_R::new(((self.bits >> 14) & 0xff) as u8)
39    }
40    #[doc = "Bit 28 - RTC_DBOOST force power down"]
41    #[inline(always)]
42    pub fn dboost_force_pd(&self) -> DBOOST_FORCE_PD_R {
43        DBOOST_FORCE_PD_R::new(((self.bits >> 28) & 1) != 0)
44    }
45    #[doc = "Bit 29 - RTC_DBOOST force power up"]
46    #[inline(always)]
47    pub fn dboost_force_pu(&self) -> DBOOST_FORCE_PU_R {
48        DBOOST_FORCE_PU_R::new(((self.bits >> 29) & 1) != 0)
49    }
50    #[doc = "Bit 30 - RTC_REG force power down (for RTC_REG power down means decrease the voltage to 0.8v or lower )"]
51    #[inline(always)]
52    pub fn regulator_force_pd(&self) -> REGULATOR_FORCE_PD_R {
53        REGULATOR_FORCE_PD_R::new(((self.bits >> 30) & 1) != 0)
54    }
55    #[doc = "Bit 31 - RTC_REG force power on (for RTC_REG power down means decrease the voltage to 0.8v or lower )"]
56    #[inline(always)]
57    pub fn regulator_force_pu(&self) -> REGULATOR_FORCE_PU_R {
58        REGULATOR_FORCE_PU_R::new(((self.bits >> 31) & 1) != 0)
59    }
60}
61#[cfg(feature = "impl-register-debug")]
62impl core::fmt::Debug for R {
63    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64        f.debug_struct("RTC")
65            .field("dig_reg_cal_en", &self.dig_reg_cal_en())
66            .field("sck_dcap", &self.sck_dcap())
67            .field("dboost_force_pd", &self.dboost_force_pd())
68            .field("dboost_force_pu", &self.dboost_force_pu())
69            .field("regulator_force_pd", &self.regulator_force_pd())
70            .field("regulator_force_pu", &self.regulator_force_pu())
71            .finish()
72    }
73}
74impl W {
75    #[doc = "Bit 7 - enable dig regulator cali"]
76    #[inline(always)]
77    pub fn dig_reg_cal_en(&mut self) -> DIG_REG_CAL_EN_W<RTC_SPEC> {
78        DIG_REG_CAL_EN_W::new(self, 7)
79    }
80    #[doc = "Bits 14:21 - SCK_DCAP"]
81    #[inline(always)]
82    pub fn sck_dcap(&mut self) -> SCK_DCAP_W<RTC_SPEC> {
83        SCK_DCAP_W::new(self, 14)
84    }
85    #[doc = "Bit 28 - RTC_DBOOST force power down"]
86    #[inline(always)]
87    pub fn dboost_force_pd(&mut self) -> DBOOST_FORCE_PD_W<RTC_SPEC> {
88        DBOOST_FORCE_PD_W::new(self, 28)
89    }
90    #[doc = "Bit 29 - RTC_DBOOST force power up"]
91    #[inline(always)]
92    pub fn dboost_force_pu(&mut self) -> DBOOST_FORCE_PU_W<RTC_SPEC> {
93        DBOOST_FORCE_PU_W::new(self, 29)
94    }
95    #[doc = "Bit 30 - RTC_REG force power down (for RTC_REG power down means decrease the voltage to 0.8v or lower )"]
96    #[inline(always)]
97    pub fn regulator_force_pd(&mut self) -> REGULATOR_FORCE_PD_W<RTC_SPEC> {
98        REGULATOR_FORCE_PD_W::new(self, 30)
99    }
100    #[doc = "Bit 31 - RTC_REG force power on (for RTC_REG power down means decrease the voltage to 0.8v or lower )"]
101    #[inline(always)]
102    pub fn regulator_force_pu(&mut self) -> REGULATOR_FORCE_PU_W<RTC_SPEC> {
103        REGULATOR_FORCE_PU_W::new(self, 31)
104    }
105}
106#[doc = "configure rtc regulator\n\nYou can [`read`](crate::Reg::read) this register and get [`rtc::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtc::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
107pub struct RTC_SPEC;
108impl crate::RegisterSpec for RTC_SPEC {
109    type Ux = u32;
110}
111#[doc = "`read()` method returns [`rtc::R`](R) reader structure"]
112impl crate::Readable for RTC_SPEC {}
113#[doc = "`write(|w| ..)` method takes [`rtc::W`](W) writer structure"]
114impl crate::Writable for RTC_SPEC {
115    type Safety = crate::Unsafe;
116    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
117    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
118}
119#[doc = "`reset()` method sets RTC to value 0xa000_0000"]
120impl crate::Resettable for RTC_SPEC {
121    const RESET_VALUE: u32 = 0xa000_0000;
122}