1#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"Key Interrupt Function"]
28unsafe impl ::core::marker::Send for super::Kint {}
29unsafe impl ::core::marker::Sync for super::Kint {}
30impl super::Kint {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36
37 #[doc = "Key Return Control Register"]
38 #[inline(always)]
39 pub const fn krctl(&self) -> &'static crate::common::Reg<self::Krctl_SPEC, crate::common::RW> {
40 unsafe {
41 crate::common::Reg::<self::Krctl_SPEC, crate::common::RW>::from_ptr(
42 self._svd2pac_as_ptr().add(0usize),
43 )
44 }
45 }
46
47 #[doc = "Key Return Flag Register"]
48 #[inline(always)]
49 pub const fn krf(&self) -> &'static crate::common::Reg<self::Krf_SPEC, crate::common::RW> {
50 unsafe {
51 crate::common::Reg::<self::Krf_SPEC, crate::common::RW>::from_ptr(
52 self._svd2pac_as_ptr().add(4usize),
53 )
54 }
55 }
56
57 #[doc = "Key Return Mode Register"]
58 #[inline(always)]
59 pub const fn krm(&self) -> &'static crate::common::Reg<self::Krm_SPEC, crate::common::RW> {
60 unsafe {
61 crate::common::Reg::<self::Krm_SPEC, crate::common::RW>::from_ptr(
62 self._svd2pac_as_ptr().add(8usize),
63 )
64 }
65 }
66}
67#[doc(hidden)]
68#[derive(Copy, Clone, Eq, PartialEq)]
69pub struct Krctl_SPEC;
70impl crate::sealed::RegSpec for Krctl_SPEC {
71 type DataType = u8;
72}
73
74#[doc = "Key Return Control Register"]
75pub type Krctl = crate::RegValueT<Krctl_SPEC>;
76
77impl Krctl {
78 #[doc = "Detection Edge Selection (KR00 to KR03 pins)"]
79 #[inline(always)]
80 pub fn kreg(
81 self,
82 ) -> crate::common::RegisterField<
83 0,
84 0x1,
85 1,
86 0,
87 krctl::Kreg,
88 krctl::Kreg,
89 Krctl_SPEC,
90 crate::common::RW,
91 > {
92 crate::common::RegisterField::<
93 0,
94 0x1,
95 1,
96 0,
97 krctl::Kreg,
98 krctl::Kreg,
99 Krctl_SPEC,
100 crate::common::RW,
101 >::from_register(self, 0)
102 }
103
104 #[doc = "Usage of Key Interrupt Flags (KRF.KIF0 to KRF.KIF3)"]
105 #[inline(always)]
106 pub fn krmd(
107 self,
108 ) -> crate::common::RegisterField<
109 7,
110 0x1,
111 1,
112 0,
113 krctl::Krmd,
114 krctl::Krmd,
115 Krctl_SPEC,
116 crate::common::RW,
117 > {
118 crate::common::RegisterField::<
119 7,
120 0x1,
121 1,
122 0,
123 krctl::Krmd,
124 krctl::Krmd,
125 Krctl_SPEC,
126 crate::common::RW,
127 >::from_register(self, 0)
128 }
129}
130impl ::core::default::Default for Krctl {
131 #[inline(always)]
132 fn default() -> Krctl {
133 <crate::RegValueT<Krctl_SPEC> as RegisterValue<_>>::new(0)
134 }
135}
136pub mod krctl {
137
138 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
139 pub struct Kreg_SPEC;
140 pub type Kreg = crate::EnumBitfieldStruct<u8, Kreg_SPEC>;
141 impl Kreg {
142 #[doc = "Falling edge"]
143 pub const _0: Self = Self::new(0);
144
145 #[doc = "Rising edge"]
146 pub const _1: Self = Self::new(1);
147 }
148 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
149 pub struct Krmd_SPEC;
150 pub type Krmd = crate::EnumBitfieldStruct<u8, Krmd_SPEC>;
151 impl Krmd {
152 #[doc = "Do not use key interrupt flags"]
153 pub const _0: Self = Self::new(0);
154
155 #[doc = "Use key interrupt flags"]
156 pub const _1: Self = Self::new(1);
157 }
158}
159#[doc(hidden)]
160#[derive(Copy, Clone, Eq, PartialEq)]
161pub struct Krf_SPEC;
162impl crate::sealed::RegSpec for Krf_SPEC {
163 type DataType = u8;
164}
165
166#[doc = "Key Return Flag Register"]
167pub type Krf = crate::RegValueT<Krf_SPEC>;
168
169impl Krf {
170 #[doc = "Key Interrupt Flag n"]
171 #[inline(always)]
172 pub fn kif0(
173 self,
174 ) -> crate::common::RegisterField<0, 0x1, 1, 0, krf::Kif0, krf::Kif0, Krf_SPEC, crate::common::RW>
175 {
176 crate::common::RegisterField::<
177 0,
178 0x1,
179 1,
180 0,
181 krf::Kif0,
182 krf::Kif0,
183 Krf_SPEC,
184 crate::common::RW,
185 >::from_register(self, 0)
186 }
187
188 #[doc = "Key Interrupt Flag n"]
189 #[inline(always)]
190 pub fn kif1(
191 self,
192 ) -> crate::common::RegisterField<1, 0x1, 1, 0, krf::Kif1, krf::Kif1, Krf_SPEC, crate::common::RW>
193 {
194 crate::common::RegisterField::<
195 1,
196 0x1,
197 1,
198 0,
199 krf::Kif1,
200 krf::Kif1,
201 Krf_SPEC,
202 crate::common::RW,
203 >::from_register(self, 0)
204 }
205
206 #[doc = "Key Interrupt Flag n"]
207 #[inline(always)]
208 pub fn kif2(
209 self,
210 ) -> crate::common::RegisterField<2, 0x1, 1, 0, krf::Kif2, krf::Kif2, Krf_SPEC, crate::common::RW>
211 {
212 crate::common::RegisterField::<
213 2,
214 0x1,
215 1,
216 0,
217 krf::Kif2,
218 krf::Kif2,
219 Krf_SPEC,
220 crate::common::RW,
221 >::from_register(self, 0)
222 }
223
224 #[doc = "Key Interrupt Flag n"]
225 #[inline(always)]
226 pub fn kif3(
227 self,
228 ) -> crate::common::RegisterField<3, 0x1, 1, 0, krf::Kif3, krf::Kif3, Krf_SPEC, crate::common::RW>
229 {
230 crate::common::RegisterField::<
231 3,
232 0x1,
233 1,
234 0,
235 krf::Kif3,
236 krf::Kif3,
237 Krf_SPEC,
238 crate::common::RW,
239 >::from_register(self, 0)
240 }
241}
242impl ::core::default::Default for Krf {
243 #[inline(always)]
244 fn default() -> Krf {
245 <crate::RegValueT<Krf_SPEC> as RegisterValue<_>>::new(0)
246 }
247}
248pub mod krf {
249
250 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
251 pub struct Kif0_SPEC;
252 pub type Kif0 = crate::EnumBitfieldStruct<u8, Kif0_SPEC>;
253 impl Kif0 {
254 #[doc = "No interrupt detected"]
255 pub const _0: Self = Self::new(0);
256
257 #[doc = "Interrupt detected"]
258 pub const _1: Self = Self::new(1);
259 }
260 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
261 pub struct Kif1_SPEC;
262 pub type Kif1 = crate::EnumBitfieldStruct<u8, Kif1_SPEC>;
263 impl Kif1 {
264 #[doc = "No interrupt detected"]
265 pub const _0: Self = Self::new(0);
266
267 #[doc = "Interrupt detected"]
268 pub const _1: Self = Self::new(1);
269 }
270 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
271 pub struct Kif2_SPEC;
272 pub type Kif2 = crate::EnumBitfieldStruct<u8, Kif2_SPEC>;
273 impl Kif2 {
274 #[doc = "No interrupt detected"]
275 pub const _0: Self = Self::new(0);
276
277 #[doc = "Interrupt detected"]
278 pub const _1: Self = Self::new(1);
279 }
280 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
281 pub struct Kif3_SPEC;
282 pub type Kif3 = crate::EnumBitfieldStruct<u8, Kif3_SPEC>;
283 impl Kif3 {
284 #[doc = "No interrupt detected"]
285 pub const _0: Self = Self::new(0);
286
287 #[doc = "Interrupt detected"]
288 pub const _1: Self = Self::new(1);
289 }
290}
291#[doc(hidden)]
292#[derive(Copy, Clone, Eq, PartialEq)]
293pub struct Krm_SPEC;
294impl crate::sealed::RegSpec for Krm_SPEC {
295 type DataType = u8;
296}
297
298#[doc = "Key Return Mode Register"]
299pub type Krm = crate::RegValueT<Krm_SPEC>;
300
301impl Krm {
302 #[doc = "Key Interrupt Mode Control n"]
303 #[inline(always)]
304 pub fn kimc0(
305 self,
306 ) -> crate::common::RegisterField<
307 0,
308 0x1,
309 1,
310 0,
311 krm::Kimc0,
312 krm::Kimc0,
313 Krm_SPEC,
314 crate::common::RW,
315 > {
316 crate::common::RegisterField::<
317 0,
318 0x1,
319 1,
320 0,
321 krm::Kimc0,
322 krm::Kimc0,
323 Krm_SPEC,
324 crate::common::RW,
325 >::from_register(self, 0)
326 }
327
328 #[doc = "Key Interrupt Mode Control n"]
329 #[inline(always)]
330 pub fn kimc1(
331 self,
332 ) -> crate::common::RegisterField<
333 1,
334 0x1,
335 1,
336 0,
337 krm::Kimc1,
338 krm::Kimc1,
339 Krm_SPEC,
340 crate::common::RW,
341 > {
342 crate::common::RegisterField::<
343 1,
344 0x1,
345 1,
346 0,
347 krm::Kimc1,
348 krm::Kimc1,
349 Krm_SPEC,
350 crate::common::RW,
351 >::from_register(self, 0)
352 }
353
354 #[doc = "Key Interrupt Mode Control n"]
355 #[inline(always)]
356 pub fn kimc2(
357 self,
358 ) -> crate::common::RegisterField<
359 2,
360 0x1,
361 1,
362 0,
363 krm::Kimc2,
364 krm::Kimc2,
365 Krm_SPEC,
366 crate::common::RW,
367 > {
368 crate::common::RegisterField::<
369 2,
370 0x1,
371 1,
372 0,
373 krm::Kimc2,
374 krm::Kimc2,
375 Krm_SPEC,
376 crate::common::RW,
377 >::from_register(self, 0)
378 }
379
380 #[doc = "Key Interrupt Mode Control n"]
381 #[inline(always)]
382 pub fn kimc3(
383 self,
384 ) -> crate::common::RegisterField<
385 3,
386 0x1,
387 1,
388 0,
389 krm::Kimc3,
390 krm::Kimc3,
391 Krm_SPEC,
392 crate::common::RW,
393 > {
394 crate::common::RegisterField::<
395 3,
396 0x1,
397 1,
398 0,
399 krm::Kimc3,
400 krm::Kimc3,
401 Krm_SPEC,
402 crate::common::RW,
403 >::from_register(self, 0)
404 }
405}
406impl ::core::default::Default for Krm {
407 #[inline(always)]
408 fn default() -> Krm {
409 <crate::RegValueT<Krm_SPEC> as RegisterValue<_>>::new(0)
410 }
411}
412pub mod krm {
413
414 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
415 pub struct Kimc0_SPEC;
416 pub type Kimc0 = crate::EnumBitfieldStruct<u8, Kimc0_SPEC>;
417 impl Kimc0 {
418 #[doc = "Do not detect key interrupt signals"]
419 pub const _0: Self = Self::new(0);
420
421 #[doc = "Detect key interrupt signals"]
422 pub const _1: Self = Self::new(1);
423 }
424 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
425 pub struct Kimc1_SPEC;
426 pub type Kimc1 = crate::EnumBitfieldStruct<u8, Kimc1_SPEC>;
427 impl Kimc1 {
428 #[doc = "Do not detect key interrupt signals"]
429 pub const _0: Self = Self::new(0);
430
431 #[doc = "Detect key interrupt signals"]
432 pub const _1: Self = Self::new(1);
433 }
434 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
435 pub struct Kimc2_SPEC;
436 pub type Kimc2 = crate::EnumBitfieldStruct<u8, Kimc2_SPEC>;
437 impl Kimc2 {
438 #[doc = "Do not detect key interrupt signals"]
439 pub const _0: Self = Self::new(0);
440
441 #[doc = "Detect key interrupt signals"]
442 pub const _1: Self = Self::new(1);
443 }
444 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
445 pub struct Kimc3_SPEC;
446 pub type Kimc3 = crate::EnumBitfieldStruct<u8, Kimc3_SPEC>;
447 impl Kimc3 {
448 #[doc = "Do not detect key interrupt signals"]
449 pub const _0: Self = Self::new(0);
450
451 #[doc = "Detect key interrupt signals"]
452 pub const _1: Self = Self::new(1);
453 }
454}