esp32c2/rtc_cntl/
ext_xtl_conf.rs

1#[doc = "Register `EXT_XTL_CONF` reader"]
2pub type R = crate::R<EXT_XTL_CONF_SPEC>;
3#[doc = "Register `EXT_XTL_CONF` writer"]
4pub type W = crate::W<EXT_XTL_CONF_SPEC>;
5#[doc = "Field `XTL_EXT_CTR_LV` reader - 0: power down XTAL at high level"]
6pub type XTL_EXT_CTR_LV_R = crate::BitReader;
7#[doc = "Field `XTL_EXT_CTR_LV` writer - 0: power down XTAL at high level"]
8pub type XTL_EXT_CTR_LV_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `XTL_EXT_CTR_EN` reader - Need add desc"]
10pub type XTL_EXT_CTR_EN_R = crate::BitReader;
11#[doc = "Field `XTL_EXT_CTR_EN` writer - Need add desc"]
12pub type XTL_EXT_CTR_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    #[doc = "Bit 30 - 0: power down XTAL at high level"]
15    #[inline(always)]
16    pub fn xtl_ext_ctr_lv(&self) -> XTL_EXT_CTR_LV_R {
17        XTL_EXT_CTR_LV_R::new(((self.bits >> 30) & 1) != 0)
18    }
19    #[doc = "Bit 31 - Need add desc"]
20    #[inline(always)]
21    pub fn xtl_ext_ctr_en(&self) -> XTL_EXT_CTR_EN_R {
22        XTL_EXT_CTR_EN_R::new(((self.bits >> 31) & 1) != 0)
23    }
24}
25#[cfg(feature = "impl-register-debug")]
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("EXT_XTL_CONF")
29            .field("xtl_ext_ctr_lv", &self.xtl_ext_ctr_lv())
30            .field("xtl_ext_ctr_en", &self.xtl_ext_ctr_en())
31            .finish()
32    }
33}
34impl W {
35    #[doc = "Bit 30 - 0: power down XTAL at high level"]
36    #[inline(always)]
37    pub fn xtl_ext_ctr_lv(&mut self) -> XTL_EXT_CTR_LV_W<EXT_XTL_CONF_SPEC> {
38        XTL_EXT_CTR_LV_W::new(self, 30)
39    }
40    #[doc = "Bit 31 - Need add desc"]
41    #[inline(always)]
42    pub fn xtl_ext_ctr_en(&mut self) -> XTL_EXT_CTR_EN_W<EXT_XTL_CONF_SPEC> {
43        XTL_EXT_CTR_EN_W::new(self, 31)
44    }
45}
46#[doc = "register description\n\nYou can [`read`](crate::Reg::read) this register and get [`ext_xtl_conf::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ext_xtl_conf::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct EXT_XTL_CONF_SPEC;
48impl crate::RegisterSpec for EXT_XTL_CONF_SPEC {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`ext_xtl_conf::R`](R) reader structure"]
52impl crate::Readable for EXT_XTL_CONF_SPEC {}
53#[doc = "`write(|w| ..)` method takes [`ext_xtl_conf::W`](W) writer structure"]
54impl crate::Writable for EXT_XTL_CONF_SPEC {
55    type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets EXT_XTL_CONF to value 0"]
58impl crate::Resettable for EXT_XTL_CONF_SPEC {}