esp32p4/cache/
l2_cache_cachesize_conf.rs1#[doc = "Register `L2_CACHE_CACHESIZE_CONF` reader"]
2pub type R = crate::R<L2_CACHE_CACHESIZE_CONF_SPEC>;
3#[doc = "Register `L2_CACHE_CACHESIZE_CONF` writer"]
4pub type W = crate::W<L2_CACHE_CACHESIZE_CONF_SPEC>;
5#[doc = "Field `L2_CACHE_CACHESIZE_256` reader - The field is used to configure cachesize of L2-Cache as 256 bytes. This field and all other fields within this register is onehot."]
6pub type L2_CACHE_CACHESIZE_256_R = crate::BitReader;
7#[doc = "Field `L2_CACHE_CACHESIZE_512` reader - The field is used to configure cachesize of L2-Cache as 512 bytes. This field and all other fields within this register is onehot."]
8pub type L2_CACHE_CACHESIZE_512_R = crate::BitReader;
9#[doc = "Field `L2_CACHE_CACHESIZE_1K` reader - The field is used to configure cachesize of L2-Cache as 1k bytes. This field and all other fields within this register is onehot."]
10pub type L2_CACHE_CACHESIZE_1K_R = crate::BitReader;
11#[doc = "Field `L2_CACHE_CACHESIZE_2K` reader - The field is used to configure cachesize of L2-Cache as 2k bytes. This field and all other fields within this register is onehot."]
12pub type L2_CACHE_CACHESIZE_2K_R = crate::BitReader;
13#[doc = "Field `L2_CACHE_CACHESIZE_4K` reader - The field is used to configure cachesize of L2-Cache as 4k bytes. This field and all other fields within this register is onehot."]
14pub type L2_CACHE_CACHESIZE_4K_R = crate::BitReader;
15#[doc = "Field `L2_CACHE_CACHESIZE_8K` reader - The field is used to configure cachesize of L2-Cache as 8k bytes. This field and all other fields within this register is onehot."]
16pub type L2_CACHE_CACHESIZE_8K_R = crate::BitReader;
17#[doc = "Field `L2_CACHE_CACHESIZE_16K` reader - The field is used to configure cachesize of L2-Cache as 16k bytes. This field and all other fields within this register is onehot."]
18pub type L2_CACHE_CACHESIZE_16K_R = crate::BitReader;
19#[doc = "Field `L2_CACHE_CACHESIZE_32K` reader - The field is used to configure cachesize of L2-Cache as 32k bytes. This field and all other fields within this register is onehot."]
20pub type L2_CACHE_CACHESIZE_32K_R = crate::BitReader;
21#[doc = "Field `L2_CACHE_CACHESIZE_64K` reader - The field is used to configure cachesize of L2-Cache as 64k bytes. This field and all other fields within this register is onehot."]
22pub type L2_CACHE_CACHESIZE_64K_R = crate::BitReader;
23#[doc = "Field `L2_CACHE_CACHESIZE_128K` reader - The field is used to configure cachesize of L2-Cache as 128k bytes. This field and all other fields within this register is onehot."]
24pub type L2_CACHE_CACHESIZE_128K_R = crate::BitReader;
25#[doc = "Field `L2_CACHE_CACHESIZE_128K` writer - The field is used to configure cachesize of L2-Cache as 128k bytes. This field and all other fields within this register is onehot."]
26pub type L2_CACHE_CACHESIZE_128K_W<'a, REG> = crate::BitWriter<'a, REG>;
27#[doc = "Field `L2_CACHE_CACHESIZE_256K` reader - The field is used to configure cachesize of L2-Cache as 256k bytes. This field and all other fields within this register is onehot."]
28pub type L2_CACHE_CACHESIZE_256K_R = crate::BitReader;
29#[doc = "Field `L2_CACHE_CACHESIZE_256K` writer - The field is used to configure cachesize of L2-Cache as 256k bytes. This field and all other fields within this register is onehot."]
30pub type L2_CACHE_CACHESIZE_256K_W<'a, REG> = crate::BitWriter<'a, REG>;
31#[doc = "Field `L2_CACHE_CACHESIZE_512K` reader - The field is used to configure cachesize of L2-Cache as 512k bytes. This field and all other fields within this register is onehot."]
32pub type L2_CACHE_CACHESIZE_512K_R = crate::BitReader;
33#[doc = "Field `L2_CACHE_CACHESIZE_512K` writer - The field is used to configure cachesize of L2-Cache as 512k bytes. This field and all other fields within this register is onehot."]
34pub type L2_CACHE_CACHESIZE_512K_W<'a, REG> = crate::BitWriter<'a, REG>;
35#[doc = "Field `L2_CACHE_CACHESIZE_1024K` reader - The field is used to configure cachesize of L2-Cache as 1024k bytes. This field and all other fields within this register is onehot."]
36pub type L2_CACHE_CACHESIZE_1024K_R = crate::BitReader;
37impl R {
38 #[doc = "Bit 0 - The field is used to configure cachesize of L2-Cache as 256 bytes. This field and all other fields within this register is onehot."]
39 #[inline(always)]
40 pub fn l2_cache_cachesize_256(&self) -> L2_CACHE_CACHESIZE_256_R {
41 L2_CACHE_CACHESIZE_256_R::new((self.bits & 1) != 0)
42 }
43 #[doc = "Bit 1 - The field is used to configure cachesize of L2-Cache as 512 bytes. This field and all other fields within this register is onehot."]
44 #[inline(always)]
45 pub fn l2_cache_cachesize_512(&self) -> L2_CACHE_CACHESIZE_512_R {
46 L2_CACHE_CACHESIZE_512_R::new(((self.bits >> 1) & 1) != 0)
47 }
48 #[doc = "Bit 2 - The field is used to configure cachesize of L2-Cache as 1k bytes. This field and all other fields within this register is onehot."]
49 #[inline(always)]
50 pub fn l2_cache_cachesize_1k(&self) -> L2_CACHE_CACHESIZE_1K_R {
51 L2_CACHE_CACHESIZE_1K_R::new(((self.bits >> 2) & 1) != 0)
52 }
53 #[doc = "Bit 3 - The field is used to configure cachesize of L2-Cache as 2k bytes. This field and all other fields within this register is onehot."]
54 #[inline(always)]
55 pub fn l2_cache_cachesize_2k(&self) -> L2_CACHE_CACHESIZE_2K_R {
56 L2_CACHE_CACHESIZE_2K_R::new(((self.bits >> 3) & 1) != 0)
57 }
58 #[doc = "Bit 4 - The field is used to configure cachesize of L2-Cache as 4k bytes. This field and all other fields within this register is onehot."]
59 #[inline(always)]
60 pub fn l2_cache_cachesize_4k(&self) -> L2_CACHE_CACHESIZE_4K_R {
61 L2_CACHE_CACHESIZE_4K_R::new(((self.bits >> 4) & 1) != 0)
62 }
63 #[doc = "Bit 5 - The field is used to configure cachesize of L2-Cache as 8k bytes. This field and all other fields within this register is onehot."]
64 #[inline(always)]
65 pub fn l2_cache_cachesize_8k(&self) -> L2_CACHE_CACHESIZE_8K_R {
66 L2_CACHE_CACHESIZE_8K_R::new(((self.bits >> 5) & 1) != 0)
67 }
68 #[doc = "Bit 6 - The field is used to configure cachesize of L2-Cache as 16k bytes. This field and all other fields within this register is onehot."]
69 #[inline(always)]
70 pub fn l2_cache_cachesize_16k(&self) -> L2_CACHE_CACHESIZE_16K_R {
71 L2_CACHE_CACHESIZE_16K_R::new(((self.bits >> 6) & 1) != 0)
72 }
73 #[doc = "Bit 7 - The field is used to configure cachesize of L2-Cache as 32k bytes. This field and all other fields within this register is onehot."]
74 #[inline(always)]
75 pub fn l2_cache_cachesize_32k(&self) -> L2_CACHE_CACHESIZE_32K_R {
76 L2_CACHE_CACHESIZE_32K_R::new(((self.bits >> 7) & 1) != 0)
77 }
78 #[doc = "Bit 8 - The field is used to configure cachesize of L2-Cache as 64k bytes. This field and all other fields within this register is onehot."]
79 #[inline(always)]
80 pub fn l2_cache_cachesize_64k(&self) -> L2_CACHE_CACHESIZE_64K_R {
81 L2_CACHE_CACHESIZE_64K_R::new(((self.bits >> 8) & 1) != 0)
82 }
83 #[doc = "Bit 9 - The field is used to configure cachesize of L2-Cache as 128k bytes. This field and all other fields within this register is onehot."]
84 #[inline(always)]
85 pub fn l2_cache_cachesize_128k(&self) -> L2_CACHE_CACHESIZE_128K_R {
86 L2_CACHE_CACHESIZE_128K_R::new(((self.bits >> 9) & 1) != 0)
87 }
88 #[doc = "Bit 10 - The field is used to configure cachesize of L2-Cache as 256k bytes. This field and all other fields within this register is onehot."]
89 #[inline(always)]
90 pub fn l2_cache_cachesize_256k(&self) -> L2_CACHE_CACHESIZE_256K_R {
91 L2_CACHE_CACHESIZE_256K_R::new(((self.bits >> 10) & 1) != 0)
92 }
93 #[doc = "Bit 11 - The field is used to configure cachesize of L2-Cache as 512k bytes. This field and all other fields within this register is onehot."]
94 #[inline(always)]
95 pub fn l2_cache_cachesize_512k(&self) -> L2_CACHE_CACHESIZE_512K_R {
96 L2_CACHE_CACHESIZE_512K_R::new(((self.bits >> 11) & 1) != 0)
97 }
98 #[doc = "Bit 12 - The field is used to configure cachesize of L2-Cache as 1024k bytes. This field and all other fields within this register is onehot."]
99 #[inline(always)]
100 pub fn l2_cache_cachesize_1024k(&self) -> L2_CACHE_CACHESIZE_1024K_R {
101 L2_CACHE_CACHESIZE_1024K_R::new(((self.bits >> 12) & 1) != 0)
102 }
103}
104#[cfg(feature = "impl-register-debug")]
105impl core::fmt::Debug for R {
106 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
107 f.debug_struct("L2_CACHE_CACHESIZE_CONF")
108 .field(
109 "l2_cache_cachesize_256",
110 &format_args!("{}", self.l2_cache_cachesize_256().bit()),
111 )
112 .field(
113 "l2_cache_cachesize_512",
114 &format_args!("{}", self.l2_cache_cachesize_512().bit()),
115 )
116 .field(
117 "l2_cache_cachesize_1k",
118 &format_args!("{}", self.l2_cache_cachesize_1k().bit()),
119 )
120 .field(
121 "l2_cache_cachesize_2k",
122 &format_args!("{}", self.l2_cache_cachesize_2k().bit()),
123 )
124 .field(
125 "l2_cache_cachesize_4k",
126 &format_args!("{}", self.l2_cache_cachesize_4k().bit()),
127 )
128 .field(
129 "l2_cache_cachesize_8k",
130 &format_args!("{}", self.l2_cache_cachesize_8k().bit()),
131 )
132 .field(
133 "l2_cache_cachesize_16k",
134 &format_args!("{}", self.l2_cache_cachesize_16k().bit()),
135 )
136 .field(
137 "l2_cache_cachesize_32k",
138 &format_args!("{}", self.l2_cache_cachesize_32k().bit()),
139 )
140 .field(
141 "l2_cache_cachesize_64k",
142 &format_args!("{}", self.l2_cache_cachesize_64k().bit()),
143 )
144 .field(
145 "l2_cache_cachesize_128k",
146 &format_args!("{}", self.l2_cache_cachesize_128k().bit()),
147 )
148 .field(
149 "l2_cache_cachesize_256k",
150 &format_args!("{}", self.l2_cache_cachesize_256k().bit()),
151 )
152 .field(
153 "l2_cache_cachesize_512k",
154 &format_args!("{}", self.l2_cache_cachesize_512k().bit()),
155 )
156 .field(
157 "l2_cache_cachesize_1024k",
158 &format_args!("{}", self.l2_cache_cachesize_1024k().bit()),
159 )
160 .finish()
161 }
162}
163#[cfg(feature = "impl-register-debug")]
164impl core::fmt::Debug for crate::generic::Reg<L2_CACHE_CACHESIZE_CONF_SPEC> {
165 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
166 core::fmt::Debug::fmt(&self.read(), f)
167 }
168}
169impl W {
170 #[doc = "Bit 9 - The field is used to configure cachesize of L2-Cache as 128k bytes. This field and all other fields within this register is onehot."]
171 #[inline(always)]
172 #[must_use]
173 pub fn l2_cache_cachesize_128k(
174 &mut self,
175 ) -> L2_CACHE_CACHESIZE_128K_W<L2_CACHE_CACHESIZE_CONF_SPEC> {
176 L2_CACHE_CACHESIZE_128K_W::new(self, 9)
177 }
178 #[doc = "Bit 10 - The field is used to configure cachesize of L2-Cache as 256k bytes. This field and all other fields within this register is onehot."]
179 #[inline(always)]
180 #[must_use]
181 pub fn l2_cache_cachesize_256k(
182 &mut self,
183 ) -> L2_CACHE_CACHESIZE_256K_W<L2_CACHE_CACHESIZE_CONF_SPEC> {
184 L2_CACHE_CACHESIZE_256K_W::new(self, 10)
185 }
186 #[doc = "Bit 11 - The field is used to configure cachesize of L2-Cache as 512k bytes. This field and all other fields within this register is onehot."]
187 #[inline(always)]
188 #[must_use]
189 pub fn l2_cache_cachesize_512k(
190 &mut self,
191 ) -> L2_CACHE_CACHESIZE_512K_W<L2_CACHE_CACHESIZE_CONF_SPEC> {
192 L2_CACHE_CACHESIZE_512K_W::new(self, 11)
193 }
194}
195#[doc = "L2 Cache CacheSize mode configure register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`l2_cache_cachesize_conf::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 [`l2_cache_cachesize_conf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
196pub struct L2_CACHE_CACHESIZE_CONF_SPEC;
197impl crate::RegisterSpec for L2_CACHE_CACHESIZE_CONF_SPEC {
198 type Ux = u32;
199}
200#[doc = "`read()` method returns [`l2_cache_cachesize_conf::R`](R) reader structure"]
201impl crate::Readable for L2_CACHE_CACHESIZE_CONF_SPEC {}
202#[doc = "`write(|w| ..)` method takes [`l2_cache_cachesize_conf::W`](W) writer structure"]
203impl crate::Writable for L2_CACHE_CACHESIZE_CONF_SPEC {
204 type Safety = crate::Unsafe;
205 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
206 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
207}
208#[doc = "`reset()` method sets L2_CACHE_CACHESIZE_CONF to value 0x0400"]
209impl crate::Resettable for L2_CACHE_CACHESIZE_CONF_SPEC {
210 const RESET_VALUE: u32 = 0x0400;
211}