esp32c2/system/
mem_pvt.rs1#[doc = "Register `MEM_PVT` reader"]
2pub type R = crate::R<MEM_PVT_SPEC>;
3#[doc = "Register `MEM_PVT` writer"]
4pub type W = crate::W<MEM_PVT_SPEC>;
5#[doc = "Field `MEM_PATH_LEN` reader - reg_mem_path_len"]
6pub type MEM_PATH_LEN_R = crate::FieldReader;
7#[doc = "Field `MEM_PATH_LEN` writer - reg_mem_path_len"]
8pub type MEM_PATH_LEN_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
9#[doc = "Field `MEM_ERR_CNT_CLR` writer - reg_mem_err_cnt_clr"]
10pub type MEM_ERR_CNT_CLR_W<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `MONITOR_EN` reader - reg_mem_pvt_monitor_en"]
12pub type MONITOR_EN_R = crate::BitReader;
13#[doc = "Field `MONITOR_EN` writer - reg_mem_pvt_monitor_en"]
14pub type MONITOR_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
15#[doc = "Field `MEM_TIMING_ERR_CNT` reader - reg_mem_timing_err_cnt"]
16pub type MEM_TIMING_ERR_CNT_R = crate::FieldReader<u16>;
17#[doc = "Field `MEM_VT_SEL` reader - reg_mem_vt_sel"]
18pub type MEM_VT_SEL_R = crate::FieldReader;
19#[doc = "Field `MEM_VT_SEL` writer - reg_mem_vt_sel"]
20pub type MEM_VT_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
21impl R {
22 #[doc = "Bits 0:3 - reg_mem_path_len"]
23 #[inline(always)]
24 pub fn mem_path_len(&self) -> MEM_PATH_LEN_R {
25 MEM_PATH_LEN_R::new((self.bits & 0x0f) as u8)
26 }
27 #[doc = "Bit 5 - reg_mem_pvt_monitor_en"]
28 #[inline(always)]
29 pub fn monitor_en(&self) -> MONITOR_EN_R {
30 MONITOR_EN_R::new(((self.bits >> 5) & 1) != 0)
31 }
32 #[doc = "Bits 6:21 - reg_mem_timing_err_cnt"]
33 #[inline(always)]
34 pub fn mem_timing_err_cnt(&self) -> MEM_TIMING_ERR_CNT_R {
35 MEM_TIMING_ERR_CNT_R::new(((self.bits >> 6) & 0xffff) as u16)
36 }
37 #[doc = "Bits 22:23 - reg_mem_vt_sel"]
38 #[inline(always)]
39 pub fn mem_vt_sel(&self) -> MEM_VT_SEL_R {
40 MEM_VT_SEL_R::new(((self.bits >> 22) & 3) as u8)
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("MEM_PVT")
47 .field("mem_path_len", &self.mem_path_len())
48 .field("monitor_en", &self.monitor_en())
49 .field("mem_timing_err_cnt", &self.mem_timing_err_cnt())
50 .field("mem_vt_sel", &self.mem_vt_sel())
51 .finish()
52 }
53}
54impl W {
55 #[doc = "Bits 0:3 - reg_mem_path_len"]
56 #[inline(always)]
57 pub fn mem_path_len(&mut self) -> MEM_PATH_LEN_W<MEM_PVT_SPEC> {
58 MEM_PATH_LEN_W::new(self, 0)
59 }
60 #[doc = "Bit 4 - reg_mem_err_cnt_clr"]
61 #[inline(always)]
62 pub fn mem_err_cnt_clr(&mut self) -> MEM_ERR_CNT_CLR_W<MEM_PVT_SPEC> {
63 MEM_ERR_CNT_CLR_W::new(self, 4)
64 }
65 #[doc = "Bit 5 - reg_mem_pvt_monitor_en"]
66 #[inline(always)]
67 pub fn monitor_en(&mut self) -> MONITOR_EN_W<MEM_PVT_SPEC> {
68 MONITOR_EN_W::new(self, 5)
69 }
70 #[doc = "Bits 22:23 - reg_mem_vt_sel"]
71 #[inline(always)]
72 pub fn mem_vt_sel(&mut self) -> MEM_VT_SEL_W<MEM_PVT_SPEC> {
73 MEM_VT_SEL_W::new(self, 22)
74 }
75}
76#[doc = "mem pvt register\n\nYou can [`read`](crate::Reg::read) this register and get [`mem_pvt::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mem_pvt::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct MEM_PVT_SPEC;
78impl crate::RegisterSpec for MEM_PVT_SPEC {
79 type Ux = u32;
80}
81#[doc = "`read()` method returns [`mem_pvt::R`](R) reader structure"]
82impl crate::Readable for MEM_PVT_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`mem_pvt::W`](W) writer structure"]
84impl crate::Writable for MEM_PVT_SPEC {
85 type Safety = crate::Unsafe;
86}
87#[doc = "`reset()` method sets MEM_PVT to value 0x03"]
88impl crate::Resettable for MEM_PVT_SPEC {
89 const RESET_VALUE: u32 = 0x03;
90}