esp32/efuse/
blk0_wdata4.rs

1#[doc = "Register `BLK0_WDATA4` reader"]
2pub type R = crate::R<BLK0_WDATA4_SPEC>;
3#[doc = "Register `BLK0_WDATA4` writer"]
4pub type W = crate::W<BLK0_WDATA4_SPEC>;
5#[doc = "Field `CLK8M_FREQ` reader - "]
6pub type CLK8M_FREQ_R = crate::FieldReader;
7#[doc = "Field `ADC_VREF` reader - "]
8pub type ADC_VREF_R = crate::FieldReader;
9#[doc = "Field `ADC_VREF` writer - "]
10pub type ADC_VREF_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
11#[doc = "Field `RESERVE_0_141` reader - "]
12pub type RESERVE_0_141_R = crate::BitReader;
13#[doc = "Field `RESERVE_0_141` writer - "]
14pub type RESERVE_0_141_W<'a, REG> = crate::BitWriter<'a, REG>;
15#[doc = "Field `XPD_SDIO` reader - "]
16pub type XPD_SDIO_R = crate::BitReader;
17#[doc = "Field `XPD_SDIO_TIEH` reader - "]
18pub type XPD_SDIO_TIEH_R = crate::BitReader;
19#[doc = "Field `XPD_SDIO_FORCE` reader - "]
20pub type XPD_SDIO_FORCE_R = crate::BitReader;
21#[doc = "Field `RESERVE_0_145` reader - "]
22pub type RESERVE_0_145_R = crate::FieldReader<u16>;
23#[doc = "Field `RESERVE_0_145` writer - "]
24pub type RESERVE_0_145_W<'a, REG> = crate::FieldWriter<'a, REG, 15, u16>;
25impl R {
26    #[doc = "Bits 0:7"]
27    #[inline(always)]
28    pub fn clk8m_freq(&self) -> CLK8M_FREQ_R {
29        CLK8M_FREQ_R::new((self.bits & 0xff) as u8)
30    }
31    #[doc = "Bits 8:12"]
32    #[inline(always)]
33    pub fn adc_vref(&self) -> ADC_VREF_R {
34        ADC_VREF_R::new(((self.bits >> 8) & 0x1f) as u8)
35    }
36    #[doc = "Bit 13"]
37    #[inline(always)]
38    pub fn reserve_0_141(&self) -> RESERVE_0_141_R {
39        RESERVE_0_141_R::new(((self.bits >> 13) & 1) != 0)
40    }
41    #[doc = "Bit 14"]
42    #[inline(always)]
43    pub fn xpd_sdio(&self) -> XPD_SDIO_R {
44        XPD_SDIO_R::new(((self.bits >> 14) & 1) != 0)
45    }
46    #[doc = "Bit 15"]
47    #[inline(always)]
48    pub fn xpd_sdio_tieh(&self) -> XPD_SDIO_TIEH_R {
49        XPD_SDIO_TIEH_R::new(((self.bits >> 15) & 1) != 0)
50    }
51    #[doc = "Bit 16"]
52    #[inline(always)]
53    pub fn xpd_sdio_force(&self) -> XPD_SDIO_FORCE_R {
54        XPD_SDIO_FORCE_R::new(((self.bits >> 16) & 1) != 0)
55    }
56    #[doc = "Bits 17:31"]
57    #[inline(always)]
58    pub fn reserve_0_145(&self) -> RESERVE_0_145_R {
59        RESERVE_0_145_R::new(((self.bits >> 17) & 0x7fff) as u16)
60    }
61}
62#[cfg(feature = "impl-register-debug")]
63impl core::fmt::Debug for R {
64    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
65        f.debug_struct("BLK0_WDATA4")
66            .field("clk8m_freq", &self.clk8m_freq())
67            .field("adc_vref", &self.adc_vref())
68            .field("reserve_0_141", &self.reserve_0_141())
69            .field("xpd_sdio", &self.xpd_sdio())
70            .field("xpd_sdio_tieh", &self.xpd_sdio_tieh())
71            .field("xpd_sdio_force", &self.xpd_sdio_force())
72            .field("reserve_0_145", &self.reserve_0_145())
73            .finish()
74    }
75}
76impl W {
77    #[doc = "Bits 8:12"]
78    #[inline(always)]
79    pub fn adc_vref(&mut self) -> ADC_VREF_W<BLK0_WDATA4_SPEC> {
80        ADC_VREF_W::new(self, 8)
81    }
82    #[doc = "Bit 13"]
83    #[inline(always)]
84    pub fn reserve_0_141(&mut self) -> RESERVE_0_141_W<BLK0_WDATA4_SPEC> {
85        RESERVE_0_141_W::new(self, 13)
86    }
87    #[doc = "Bits 17:31"]
88    #[inline(always)]
89    pub fn reserve_0_145(&mut self) -> RESERVE_0_145_W<BLK0_WDATA4_SPEC> {
90        RESERVE_0_145_W::new(self, 17)
91    }
92}
93#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`blk0_wdata4::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`blk0_wdata4::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
94pub struct BLK0_WDATA4_SPEC;
95impl crate::RegisterSpec for BLK0_WDATA4_SPEC {
96    type Ux = u32;
97}
98#[doc = "`read()` method returns [`blk0_wdata4::R`](R) reader structure"]
99impl crate::Readable for BLK0_WDATA4_SPEC {}
100#[doc = "`write(|w| ..)` method takes [`blk0_wdata4::W`](W) writer structure"]
101impl crate::Writable for BLK0_WDATA4_SPEC {
102    type Safety = crate::Unsafe;
103}
104#[doc = "`reset()` method sets BLK0_WDATA4 to value 0"]
105impl crate::Resettable for BLK0_WDATA4_SPEC {}