esp32s2/wifi/crypto_control/
crypto_key_slot_state.rs1#[doc = "Register `CRYPTO_KEY_SLOT_STATE` reader"]
2pub type R = crate::R<CRYPTO_KEY_SLOT_STATE_SPEC>;
3#[doc = "Register `CRYPTO_KEY_SLOT_STATE` writer"]
4pub type W = crate::W<CRYPTO_KEY_SLOT_STATE_SPEC>;
5#[doc = "Field `KEY_SLOT_ENABLE(0-24)` reader - Enable the key slot corresponding to this bit"]
6pub type KEY_SLOT_ENABLE_R = crate::BitReader;
7#[doc = "Field `KEY_SLOT_ENABLE(0-24)` writer - Enable the key slot corresponding to this bit"]
8pub type KEY_SLOT_ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
9impl R {
10 #[doc = "Enable the key slot corresponding to this bit"]
11 #[doc = ""]
12 #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `KEY_SLOT_ENABLE0` field.</div>"]
13 #[inline(always)]
14 pub fn key_slot_enable(&self, n: u8) -> KEY_SLOT_ENABLE_R {
15 #[allow(clippy::no_effect)]
16 [(); 25][n as usize];
17 KEY_SLOT_ENABLE_R::new(((self.bits >> n) & 1) != 0)
18 }
19 #[doc = "Iterator for array of:"]
20 #[doc = "Enable the key slot corresponding to this bit"]
21 #[inline(always)]
22 pub fn key_slot_enable_iter(&self) -> impl Iterator<Item = KEY_SLOT_ENABLE_R> + '_ {
23 (0..25).map(move |n| KEY_SLOT_ENABLE_R::new(((self.bits >> n) & 1) != 0))
24 }
25 #[doc = "Bit 0 - Enable the key slot corresponding to this bit"]
26 #[inline(always)]
27 pub fn key_slot_enable0(&self) -> KEY_SLOT_ENABLE_R {
28 KEY_SLOT_ENABLE_R::new((self.bits & 1) != 0)
29 }
30 #[doc = "Bit 1 - Enable the key slot corresponding to this bit"]
31 #[inline(always)]
32 pub fn key_slot_enable1(&self) -> KEY_SLOT_ENABLE_R {
33 KEY_SLOT_ENABLE_R::new(((self.bits >> 1) & 1) != 0)
34 }
35 #[doc = "Bit 2 - Enable the key slot corresponding to this bit"]
36 #[inline(always)]
37 pub fn key_slot_enable2(&self) -> KEY_SLOT_ENABLE_R {
38 KEY_SLOT_ENABLE_R::new(((self.bits >> 2) & 1) != 0)
39 }
40 #[doc = "Bit 3 - Enable the key slot corresponding to this bit"]
41 #[inline(always)]
42 pub fn key_slot_enable3(&self) -> KEY_SLOT_ENABLE_R {
43 KEY_SLOT_ENABLE_R::new(((self.bits >> 3) & 1) != 0)
44 }
45 #[doc = "Bit 4 - Enable the key slot corresponding to this bit"]
46 #[inline(always)]
47 pub fn key_slot_enable4(&self) -> KEY_SLOT_ENABLE_R {
48 KEY_SLOT_ENABLE_R::new(((self.bits >> 4) & 1) != 0)
49 }
50 #[doc = "Bit 5 - Enable the key slot corresponding to this bit"]
51 #[inline(always)]
52 pub fn key_slot_enable5(&self) -> KEY_SLOT_ENABLE_R {
53 KEY_SLOT_ENABLE_R::new(((self.bits >> 5) & 1) != 0)
54 }
55 #[doc = "Bit 6 - Enable the key slot corresponding to this bit"]
56 #[inline(always)]
57 pub fn key_slot_enable6(&self) -> KEY_SLOT_ENABLE_R {
58 KEY_SLOT_ENABLE_R::new(((self.bits >> 6) & 1) != 0)
59 }
60 #[doc = "Bit 7 - Enable the key slot corresponding to this bit"]
61 #[inline(always)]
62 pub fn key_slot_enable7(&self) -> KEY_SLOT_ENABLE_R {
63 KEY_SLOT_ENABLE_R::new(((self.bits >> 7) & 1) != 0)
64 }
65 #[doc = "Bit 8 - Enable the key slot corresponding to this bit"]
66 #[inline(always)]
67 pub fn key_slot_enable8(&self) -> KEY_SLOT_ENABLE_R {
68 KEY_SLOT_ENABLE_R::new(((self.bits >> 8) & 1) != 0)
69 }
70 #[doc = "Bit 9 - Enable the key slot corresponding to this bit"]
71 #[inline(always)]
72 pub fn key_slot_enable9(&self) -> KEY_SLOT_ENABLE_R {
73 KEY_SLOT_ENABLE_R::new(((self.bits >> 9) & 1) != 0)
74 }
75 #[doc = "Bit 10 - Enable the key slot corresponding to this bit"]
76 #[inline(always)]
77 pub fn key_slot_enable10(&self) -> KEY_SLOT_ENABLE_R {
78 KEY_SLOT_ENABLE_R::new(((self.bits >> 10) & 1) != 0)
79 }
80 #[doc = "Bit 11 - Enable the key slot corresponding to this bit"]
81 #[inline(always)]
82 pub fn key_slot_enable11(&self) -> KEY_SLOT_ENABLE_R {
83 KEY_SLOT_ENABLE_R::new(((self.bits >> 11) & 1) != 0)
84 }
85 #[doc = "Bit 12 - Enable the key slot corresponding to this bit"]
86 #[inline(always)]
87 pub fn key_slot_enable12(&self) -> KEY_SLOT_ENABLE_R {
88 KEY_SLOT_ENABLE_R::new(((self.bits >> 12) & 1) != 0)
89 }
90 #[doc = "Bit 13 - Enable the key slot corresponding to this bit"]
91 #[inline(always)]
92 pub fn key_slot_enable13(&self) -> KEY_SLOT_ENABLE_R {
93 KEY_SLOT_ENABLE_R::new(((self.bits >> 13) & 1) != 0)
94 }
95 #[doc = "Bit 14 - Enable the key slot corresponding to this bit"]
96 #[inline(always)]
97 pub fn key_slot_enable14(&self) -> KEY_SLOT_ENABLE_R {
98 KEY_SLOT_ENABLE_R::new(((self.bits >> 14) & 1) != 0)
99 }
100 #[doc = "Bit 15 - Enable the key slot corresponding to this bit"]
101 #[inline(always)]
102 pub fn key_slot_enable15(&self) -> KEY_SLOT_ENABLE_R {
103 KEY_SLOT_ENABLE_R::new(((self.bits >> 15) & 1) != 0)
104 }
105 #[doc = "Bit 16 - Enable the key slot corresponding to this bit"]
106 #[inline(always)]
107 pub fn key_slot_enable16(&self) -> KEY_SLOT_ENABLE_R {
108 KEY_SLOT_ENABLE_R::new(((self.bits >> 16) & 1) != 0)
109 }
110 #[doc = "Bit 17 - Enable the key slot corresponding to this bit"]
111 #[inline(always)]
112 pub fn key_slot_enable17(&self) -> KEY_SLOT_ENABLE_R {
113 KEY_SLOT_ENABLE_R::new(((self.bits >> 17) & 1) != 0)
114 }
115 #[doc = "Bit 18 - Enable the key slot corresponding to this bit"]
116 #[inline(always)]
117 pub fn key_slot_enable18(&self) -> KEY_SLOT_ENABLE_R {
118 KEY_SLOT_ENABLE_R::new(((self.bits >> 18) & 1) != 0)
119 }
120 #[doc = "Bit 19 - Enable the key slot corresponding to this bit"]
121 #[inline(always)]
122 pub fn key_slot_enable19(&self) -> KEY_SLOT_ENABLE_R {
123 KEY_SLOT_ENABLE_R::new(((self.bits >> 19) & 1) != 0)
124 }
125 #[doc = "Bit 20 - Enable the key slot corresponding to this bit"]
126 #[inline(always)]
127 pub fn key_slot_enable20(&self) -> KEY_SLOT_ENABLE_R {
128 KEY_SLOT_ENABLE_R::new(((self.bits >> 20) & 1) != 0)
129 }
130 #[doc = "Bit 21 - Enable the key slot corresponding to this bit"]
131 #[inline(always)]
132 pub fn key_slot_enable21(&self) -> KEY_SLOT_ENABLE_R {
133 KEY_SLOT_ENABLE_R::new(((self.bits >> 21) & 1) != 0)
134 }
135 #[doc = "Bit 22 - Enable the key slot corresponding to this bit"]
136 #[inline(always)]
137 pub fn key_slot_enable22(&self) -> KEY_SLOT_ENABLE_R {
138 KEY_SLOT_ENABLE_R::new(((self.bits >> 22) & 1) != 0)
139 }
140 #[doc = "Bit 23 - Enable the key slot corresponding to this bit"]
141 #[inline(always)]
142 pub fn key_slot_enable23(&self) -> KEY_SLOT_ENABLE_R {
143 KEY_SLOT_ENABLE_R::new(((self.bits >> 23) & 1) != 0)
144 }
145 #[doc = "Bit 24 - Enable the key slot corresponding to this bit"]
146 #[inline(always)]
147 pub fn key_slot_enable24(&self) -> KEY_SLOT_ENABLE_R {
148 KEY_SLOT_ENABLE_R::new(((self.bits >> 24) & 1) != 0)
149 }
150}
151#[cfg(feature = "impl-register-debug")]
152impl core::fmt::Debug for R {
153 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
154 f.debug_struct("CRYPTO_KEY_SLOT_STATE")
155 .field("key_slot_enable0", &self.key_slot_enable0())
156 .field("key_slot_enable1", &self.key_slot_enable1())
157 .field("key_slot_enable2", &self.key_slot_enable2())
158 .field("key_slot_enable3", &self.key_slot_enable3())
159 .field("key_slot_enable4", &self.key_slot_enable4())
160 .field("key_slot_enable5", &self.key_slot_enable5())
161 .field("key_slot_enable6", &self.key_slot_enable6())
162 .field("key_slot_enable7", &self.key_slot_enable7())
163 .field("key_slot_enable8", &self.key_slot_enable8())
164 .field("key_slot_enable9", &self.key_slot_enable9())
165 .field("key_slot_enable10", &self.key_slot_enable10())
166 .field("key_slot_enable11", &self.key_slot_enable11())
167 .field("key_slot_enable12", &self.key_slot_enable12())
168 .field("key_slot_enable13", &self.key_slot_enable13())
169 .field("key_slot_enable14", &self.key_slot_enable14())
170 .field("key_slot_enable15", &self.key_slot_enable15())
171 .field("key_slot_enable16", &self.key_slot_enable16())
172 .field("key_slot_enable17", &self.key_slot_enable17())
173 .field("key_slot_enable18", &self.key_slot_enable18())
174 .field("key_slot_enable19", &self.key_slot_enable19())
175 .field("key_slot_enable20", &self.key_slot_enable20())
176 .field("key_slot_enable21", &self.key_slot_enable21())
177 .field("key_slot_enable22", &self.key_slot_enable22())
178 .field("key_slot_enable23", &self.key_slot_enable23())
179 .field("key_slot_enable24", &self.key_slot_enable24())
180 .finish()
181 }
182}
183impl W {
184 #[doc = "Enable the key slot corresponding to this bit"]
185 #[doc = ""]
186 #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `KEY_SLOT_ENABLE0` field.</div>"]
187 #[inline(always)]
188 pub fn key_slot_enable(&mut self, n: u8) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
189 #[allow(clippy::no_effect)]
190 [(); 25][n as usize];
191 KEY_SLOT_ENABLE_W::new(self, n)
192 }
193 #[doc = "Bit 0 - Enable the key slot corresponding to this bit"]
194 #[inline(always)]
195 pub fn key_slot_enable0(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
196 KEY_SLOT_ENABLE_W::new(self, 0)
197 }
198 #[doc = "Bit 1 - Enable the key slot corresponding to this bit"]
199 #[inline(always)]
200 pub fn key_slot_enable1(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
201 KEY_SLOT_ENABLE_W::new(self, 1)
202 }
203 #[doc = "Bit 2 - Enable the key slot corresponding to this bit"]
204 #[inline(always)]
205 pub fn key_slot_enable2(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
206 KEY_SLOT_ENABLE_W::new(self, 2)
207 }
208 #[doc = "Bit 3 - Enable the key slot corresponding to this bit"]
209 #[inline(always)]
210 pub fn key_slot_enable3(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
211 KEY_SLOT_ENABLE_W::new(self, 3)
212 }
213 #[doc = "Bit 4 - Enable the key slot corresponding to this bit"]
214 #[inline(always)]
215 pub fn key_slot_enable4(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
216 KEY_SLOT_ENABLE_W::new(self, 4)
217 }
218 #[doc = "Bit 5 - Enable the key slot corresponding to this bit"]
219 #[inline(always)]
220 pub fn key_slot_enable5(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
221 KEY_SLOT_ENABLE_W::new(self, 5)
222 }
223 #[doc = "Bit 6 - Enable the key slot corresponding to this bit"]
224 #[inline(always)]
225 pub fn key_slot_enable6(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
226 KEY_SLOT_ENABLE_W::new(self, 6)
227 }
228 #[doc = "Bit 7 - Enable the key slot corresponding to this bit"]
229 #[inline(always)]
230 pub fn key_slot_enable7(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
231 KEY_SLOT_ENABLE_W::new(self, 7)
232 }
233 #[doc = "Bit 8 - Enable the key slot corresponding to this bit"]
234 #[inline(always)]
235 pub fn key_slot_enable8(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
236 KEY_SLOT_ENABLE_W::new(self, 8)
237 }
238 #[doc = "Bit 9 - Enable the key slot corresponding to this bit"]
239 #[inline(always)]
240 pub fn key_slot_enable9(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
241 KEY_SLOT_ENABLE_W::new(self, 9)
242 }
243 #[doc = "Bit 10 - Enable the key slot corresponding to this bit"]
244 #[inline(always)]
245 pub fn key_slot_enable10(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
246 KEY_SLOT_ENABLE_W::new(self, 10)
247 }
248 #[doc = "Bit 11 - Enable the key slot corresponding to this bit"]
249 #[inline(always)]
250 pub fn key_slot_enable11(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
251 KEY_SLOT_ENABLE_W::new(self, 11)
252 }
253 #[doc = "Bit 12 - Enable the key slot corresponding to this bit"]
254 #[inline(always)]
255 pub fn key_slot_enable12(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
256 KEY_SLOT_ENABLE_W::new(self, 12)
257 }
258 #[doc = "Bit 13 - Enable the key slot corresponding to this bit"]
259 #[inline(always)]
260 pub fn key_slot_enable13(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
261 KEY_SLOT_ENABLE_W::new(self, 13)
262 }
263 #[doc = "Bit 14 - Enable the key slot corresponding to this bit"]
264 #[inline(always)]
265 pub fn key_slot_enable14(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
266 KEY_SLOT_ENABLE_W::new(self, 14)
267 }
268 #[doc = "Bit 15 - Enable the key slot corresponding to this bit"]
269 #[inline(always)]
270 pub fn key_slot_enable15(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
271 KEY_SLOT_ENABLE_W::new(self, 15)
272 }
273 #[doc = "Bit 16 - Enable the key slot corresponding to this bit"]
274 #[inline(always)]
275 pub fn key_slot_enable16(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
276 KEY_SLOT_ENABLE_W::new(self, 16)
277 }
278 #[doc = "Bit 17 - Enable the key slot corresponding to this bit"]
279 #[inline(always)]
280 pub fn key_slot_enable17(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
281 KEY_SLOT_ENABLE_W::new(self, 17)
282 }
283 #[doc = "Bit 18 - Enable the key slot corresponding to this bit"]
284 #[inline(always)]
285 pub fn key_slot_enable18(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
286 KEY_SLOT_ENABLE_W::new(self, 18)
287 }
288 #[doc = "Bit 19 - Enable the key slot corresponding to this bit"]
289 #[inline(always)]
290 pub fn key_slot_enable19(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
291 KEY_SLOT_ENABLE_W::new(self, 19)
292 }
293 #[doc = "Bit 20 - Enable the key slot corresponding to this bit"]
294 #[inline(always)]
295 pub fn key_slot_enable20(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
296 KEY_SLOT_ENABLE_W::new(self, 20)
297 }
298 #[doc = "Bit 21 - Enable the key slot corresponding to this bit"]
299 #[inline(always)]
300 pub fn key_slot_enable21(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
301 KEY_SLOT_ENABLE_W::new(self, 21)
302 }
303 #[doc = "Bit 22 - Enable the key slot corresponding to this bit"]
304 #[inline(always)]
305 pub fn key_slot_enable22(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
306 KEY_SLOT_ENABLE_W::new(self, 22)
307 }
308 #[doc = "Bit 23 - Enable the key slot corresponding to this bit"]
309 #[inline(always)]
310 pub fn key_slot_enable23(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
311 KEY_SLOT_ENABLE_W::new(self, 23)
312 }
313 #[doc = "Bit 24 - Enable the key slot corresponding to this bit"]
314 #[inline(always)]
315 pub fn key_slot_enable24(&mut self) -> KEY_SLOT_ENABLE_W<CRYPTO_KEY_SLOT_STATE_SPEC> {
316 KEY_SLOT_ENABLE_W::new(self, 24)
317 }
318}
319#[doc = "State of cryptographic key slots\n\nYou can [`read`](crate::Reg::read) this register and get [`crypto_key_slot_state::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`crypto_key_slot_state::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
320pub struct CRYPTO_KEY_SLOT_STATE_SPEC;
321impl crate::RegisterSpec for CRYPTO_KEY_SLOT_STATE_SPEC {
322 type Ux = u32;
323}
324#[doc = "`read()` method returns [`crypto_key_slot_state::R`](R) reader structure"]
325impl crate::Readable for CRYPTO_KEY_SLOT_STATE_SPEC {}
326#[doc = "`write(|w| ..)` method takes [`crypto_key_slot_state::W`](W) writer structure"]
327impl crate::Writable for CRYPTO_KEY_SLOT_STATE_SPEC {
328 type Safety = crate::Unsafe;
329}
330#[doc = "`reset()` method sets CRYPTO_KEY_SLOT_STATE to value 0"]
331impl crate::Resettable for CRYPTO_KEY_SLOT_STATE_SPEC {}