rp2040_pac/syscfg/
mempowerdown.rs

1#[doc = "Register `MEMPOWERDOWN` reader"]
2pub type R = crate::R<MEMPOWERDOWN_SPEC>;
3#[doc = "Register `MEMPOWERDOWN` writer"]
4pub type W = crate::W<MEMPOWERDOWN_SPEC>;
5#[doc = "Field `SRAM0` reader - "]
6pub type SRAM0_R = crate::BitReader;
7#[doc = "Field `SRAM0` writer - "]
8pub type SRAM0_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `SRAM1` reader - "]
10pub type SRAM1_R = crate::BitReader;
11#[doc = "Field `SRAM1` writer - "]
12pub type SRAM1_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SRAM2` reader - "]
14pub type SRAM2_R = crate::BitReader;
15#[doc = "Field `SRAM2` writer - "]
16pub type SRAM2_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `SRAM3` reader - "]
18pub type SRAM3_R = crate::BitReader;
19#[doc = "Field `SRAM3` writer - "]
20pub type SRAM3_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `SRAM4` reader - "]
22pub type SRAM4_R = crate::BitReader;
23#[doc = "Field `SRAM4` writer - "]
24pub type SRAM4_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `SRAM5` reader - "]
26pub type SRAM5_R = crate::BitReader;
27#[doc = "Field `SRAM5` writer - "]
28pub type SRAM5_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `USB` reader - "]
30pub type USB_R = crate::BitReader;
31#[doc = "Field `USB` writer - "]
32pub type USB_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `ROM` reader - "]
34pub type ROM_R = crate::BitReader;
35#[doc = "Field `ROM` writer - "]
36pub type ROM_W<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38    #[doc = "Bit 0"]
39    #[inline(always)]
40    pub fn sram0(&self) -> SRAM0_R {
41        SRAM0_R::new((self.bits & 1) != 0)
42    }
43    #[doc = "Bit 1"]
44    #[inline(always)]
45    pub fn sram1(&self) -> SRAM1_R {
46        SRAM1_R::new(((self.bits >> 1) & 1) != 0)
47    }
48    #[doc = "Bit 2"]
49    #[inline(always)]
50    pub fn sram2(&self) -> SRAM2_R {
51        SRAM2_R::new(((self.bits >> 2) & 1) != 0)
52    }
53    #[doc = "Bit 3"]
54    #[inline(always)]
55    pub fn sram3(&self) -> SRAM3_R {
56        SRAM3_R::new(((self.bits >> 3) & 1) != 0)
57    }
58    #[doc = "Bit 4"]
59    #[inline(always)]
60    pub fn sram4(&self) -> SRAM4_R {
61        SRAM4_R::new(((self.bits >> 4) & 1) != 0)
62    }
63    #[doc = "Bit 5"]
64    #[inline(always)]
65    pub fn sram5(&self) -> SRAM5_R {
66        SRAM5_R::new(((self.bits >> 5) & 1) != 0)
67    }
68    #[doc = "Bit 6"]
69    #[inline(always)]
70    pub fn usb(&self) -> USB_R {
71        USB_R::new(((self.bits >> 6) & 1) != 0)
72    }
73    #[doc = "Bit 7"]
74    #[inline(always)]
75    pub fn rom(&self) -> ROM_R {
76        ROM_R::new(((self.bits >> 7) & 1) != 0)
77    }
78}
79impl W {
80    #[doc = "Bit 0"]
81    #[inline(always)]
82    #[must_use]
83    pub fn sram0(&mut self) -> SRAM0_W<MEMPOWERDOWN_SPEC> {
84        SRAM0_W::new(self, 0)
85    }
86    #[doc = "Bit 1"]
87    #[inline(always)]
88    #[must_use]
89    pub fn sram1(&mut self) -> SRAM1_W<MEMPOWERDOWN_SPEC> {
90        SRAM1_W::new(self, 1)
91    }
92    #[doc = "Bit 2"]
93    #[inline(always)]
94    #[must_use]
95    pub fn sram2(&mut self) -> SRAM2_W<MEMPOWERDOWN_SPEC> {
96        SRAM2_W::new(self, 2)
97    }
98    #[doc = "Bit 3"]
99    #[inline(always)]
100    #[must_use]
101    pub fn sram3(&mut self) -> SRAM3_W<MEMPOWERDOWN_SPEC> {
102        SRAM3_W::new(self, 3)
103    }
104    #[doc = "Bit 4"]
105    #[inline(always)]
106    #[must_use]
107    pub fn sram4(&mut self) -> SRAM4_W<MEMPOWERDOWN_SPEC> {
108        SRAM4_W::new(self, 4)
109    }
110    #[doc = "Bit 5"]
111    #[inline(always)]
112    #[must_use]
113    pub fn sram5(&mut self) -> SRAM5_W<MEMPOWERDOWN_SPEC> {
114        SRAM5_W::new(self, 5)
115    }
116    #[doc = "Bit 6"]
117    #[inline(always)]
118    #[must_use]
119    pub fn usb(&mut self) -> USB_W<MEMPOWERDOWN_SPEC> {
120        USB_W::new(self, 6)
121    }
122    #[doc = "Bit 7"]
123    #[inline(always)]
124    #[must_use]
125    pub fn rom(&mut self) -> ROM_W<MEMPOWERDOWN_SPEC> {
126        ROM_W::new(self, 7)
127    }
128    #[doc = r" Writes raw bits to the register."]
129    #[doc = r""]
130    #[doc = r" # Safety"]
131    #[doc = r""]
132    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
133    #[inline(always)]
134    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
135        self.bits = bits;
136        self
137    }
138}
139#[doc = "Control power downs to memories. Set high to power down memories.  
140 Use with extreme caution  
141
142You can [`read`](crate::generic::Reg::read) this register and get [`mempowerdown::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mempowerdown::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
143pub struct MEMPOWERDOWN_SPEC;
144impl crate::RegisterSpec for MEMPOWERDOWN_SPEC {
145    type Ux = u32;
146}
147#[doc = "`read()` method returns [`mempowerdown::R`](R) reader structure"]
148impl crate::Readable for MEMPOWERDOWN_SPEC {}
149#[doc = "`write(|w| ..)` method takes [`mempowerdown::W`](W) writer structure"]
150impl crate::Writable for MEMPOWERDOWN_SPEC {
151    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
152    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
153}
154#[doc = "`reset()` method sets MEMPOWERDOWN to value 0"]
155impl crate::Resettable for MEMPOWERDOWN_SPEC {
156    const RESET_VALUE: u32 = 0;
157}