esp32c6_lp/lp_peri/
mem_ctrl.rs

1#[doc = "Register `MEM_CTRL` reader"]
2pub type R = crate::R<MEM_CTRL_SPEC>;
3#[doc = "Register `MEM_CTRL` writer"]
4pub type W = crate::W<MEM_CTRL_SPEC>;
5#[doc = "Field `UART_WAKEUP_FLAG_CLR` writer - need_des"]
6pub type UART_WAKEUP_FLAG_CLR_W<'a, REG> = crate::BitWriter<'a, REG>;
7#[doc = "Field `UART_WAKEUP_FLAG` reader - need_des"]
8pub type UART_WAKEUP_FLAG_R = crate::BitReader;
9#[doc = "Field `UART_WAKEUP_FLAG` writer - need_des"]
10pub type UART_WAKEUP_FLAG_W<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `UART_WAKEUP_EN` reader - need_des"]
12pub type UART_WAKEUP_EN_R = crate::BitReader;
13#[doc = "Field `UART_WAKEUP_EN` writer - need_des"]
14pub type UART_WAKEUP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
15#[doc = "Field `UART_MEM_FORCE_PD` reader - need_des"]
16pub type UART_MEM_FORCE_PD_R = crate::BitReader;
17#[doc = "Field `UART_MEM_FORCE_PD` writer - need_des"]
18pub type UART_MEM_FORCE_PD_W<'a, REG> = crate::BitWriter<'a, REG>;
19#[doc = "Field `UART_MEM_FORCE_PU` reader - need_des"]
20pub type UART_MEM_FORCE_PU_R = crate::BitReader;
21#[doc = "Field `UART_MEM_FORCE_PU` writer - need_des"]
22pub type UART_MEM_FORCE_PU_W<'a, REG> = crate::BitWriter<'a, REG>;
23impl R {
24    #[doc = "Bit 1 - need_des"]
25    #[inline(always)]
26    pub fn uart_wakeup_flag(&self) -> UART_WAKEUP_FLAG_R {
27        UART_WAKEUP_FLAG_R::new(((self.bits >> 1) & 1) != 0)
28    }
29    #[doc = "Bit 29 - need_des"]
30    #[inline(always)]
31    pub fn uart_wakeup_en(&self) -> UART_WAKEUP_EN_R {
32        UART_WAKEUP_EN_R::new(((self.bits >> 29) & 1) != 0)
33    }
34    #[doc = "Bit 30 - need_des"]
35    #[inline(always)]
36    pub fn uart_mem_force_pd(&self) -> UART_MEM_FORCE_PD_R {
37        UART_MEM_FORCE_PD_R::new(((self.bits >> 30) & 1) != 0)
38    }
39    #[doc = "Bit 31 - need_des"]
40    #[inline(always)]
41    pub fn uart_mem_force_pu(&self) -> UART_MEM_FORCE_PU_R {
42        UART_MEM_FORCE_PU_R::new(((self.bits >> 31) & 1) != 0)
43    }
44}
45#[cfg(feature = "impl-register-debug")]
46impl core::fmt::Debug for R {
47    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
48        f.debug_struct("MEM_CTRL")
49            .field("uart_wakeup_flag", &self.uart_wakeup_flag())
50            .field("uart_wakeup_en", &self.uart_wakeup_en())
51            .field("uart_mem_force_pd", &self.uart_mem_force_pd())
52            .field("uart_mem_force_pu", &self.uart_mem_force_pu())
53            .finish()
54    }
55}
56impl W {
57    #[doc = "Bit 0 - need_des"]
58    #[inline(always)]
59    #[must_use]
60    pub fn uart_wakeup_flag_clr(&mut self) -> UART_WAKEUP_FLAG_CLR_W<MEM_CTRL_SPEC> {
61        UART_WAKEUP_FLAG_CLR_W::new(self, 0)
62    }
63    #[doc = "Bit 1 - need_des"]
64    #[inline(always)]
65    #[must_use]
66    pub fn uart_wakeup_flag(&mut self) -> UART_WAKEUP_FLAG_W<MEM_CTRL_SPEC> {
67        UART_WAKEUP_FLAG_W::new(self, 1)
68    }
69    #[doc = "Bit 29 - need_des"]
70    #[inline(always)]
71    #[must_use]
72    pub fn uart_wakeup_en(&mut self) -> UART_WAKEUP_EN_W<MEM_CTRL_SPEC> {
73        UART_WAKEUP_EN_W::new(self, 29)
74    }
75    #[doc = "Bit 30 - need_des"]
76    #[inline(always)]
77    #[must_use]
78    pub fn uart_mem_force_pd(&mut self) -> UART_MEM_FORCE_PD_W<MEM_CTRL_SPEC> {
79        UART_MEM_FORCE_PD_W::new(self, 30)
80    }
81    #[doc = "Bit 31 - need_des"]
82    #[inline(always)]
83    #[must_use]
84    pub fn uart_mem_force_pu(&mut self) -> UART_MEM_FORCE_PU_W<MEM_CTRL_SPEC> {
85        UART_MEM_FORCE_PU_W::new(self, 31)
86    }
87}
88#[doc = "need_des\n\nYou can [`read`](crate::Reg::read) this register and get [`mem_ctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mem_ctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
89pub struct MEM_CTRL_SPEC;
90impl crate::RegisterSpec for MEM_CTRL_SPEC {
91    type Ux = u32;
92}
93#[doc = "`read()` method returns [`mem_ctrl::R`](R) reader structure"]
94impl crate::Readable for MEM_CTRL_SPEC {}
95#[doc = "`write(|w| ..)` method takes [`mem_ctrl::W`](W) writer structure"]
96impl crate::Writable for MEM_CTRL_SPEC {
97    type Safety = crate::Unsafe;
98    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
99    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
100}
101#[doc = "`reset()` method sets MEM_CTRL to value 0x8000_0000"]
102impl crate::Resettable for MEM_CTRL_SPEC {
103    const RESET_VALUE: u32 = 0x8000_0000;
104}