mcxa-pac 0.3.0

Peripheral Access Crate for MCXA256 devices
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
#[doc = "Register `SFSR` reader"]
pub type R = crate::R<SfsrSpec>;
#[doc = "Register `SFSR` writer"]
pub type W = crate::W<SfsrSpec>;
#[doc = "Invalid entry point.\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Invep {
    #[doc = "0: Error has not occurred."]
    NoError = 0,
    #[doc = "1: Error has occurred."]
    Error = 1,
}
impl From<Invep> for bool {
    #[inline(always)]
    fn from(variant: Invep) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `INVEP` reader - Invalid entry point."]
pub type InvepR = crate::BitReader<Invep>;
impl InvepR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Invep {
        match self.bits {
            false => Invep::NoError,
            true => Invep::Error,
        }
    }
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Invep::NoError
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn is_error(&self) -> bool {
        *self == Invep::Error
    }
}
#[doc = "Field `INVEP` writer - Invalid entry point."]
pub type InvepW<'a, REG> = crate::BitWriter<'a, REG, Invep>;
impl<'a, REG> InvepW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn no_error(self) -> &'a mut crate::W<REG> {
        self.variant(Invep::NoError)
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn error(self) -> &'a mut crate::W<REG> {
        self.variant(Invep::Error)
    }
}
#[doc = "Invalid integrity signature flag.\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Invis {
    #[doc = "0: Error has not occurred."]
    NoError = 0,
    #[doc = "1: Error has occurred."]
    Error = 1,
}
impl From<Invis> for bool {
    #[inline(always)]
    fn from(variant: Invis) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `INVIS` reader - Invalid integrity signature flag."]
pub type InvisR = crate::BitReader<Invis>;
impl InvisR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Invis {
        match self.bits {
            false => Invis::NoError,
            true => Invis::Error,
        }
    }
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Invis::NoError
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn is_error(&self) -> bool {
        *self == Invis::Error
    }
}
#[doc = "Field `INVIS` writer - Invalid integrity signature flag."]
pub type InvisW<'a, REG> = crate::BitWriter<'a, REG, Invis>;
impl<'a, REG> InvisW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn no_error(self) -> &'a mut crate::W<REG> {
        self.variant(Invis::NoError)
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn error(self) -> &'a mut crate::W<REG> {
        self.variant(Invis::Error)
    }
}
#[doc = "Invalid exception return flag.\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Inver {
    #[doc = "0: Error has not occurred."]
    NoError = 0,
    #[doc = "1: Error has occurred."]
    Error = 1,
}
impl From<Inver> for bool {
    #[inline(always)]
    fn from(variant: Inver) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `INVER` reader - Invalid exception return flag."]
pub type InverR = crate::BitReader<Inver>;
impl InverR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Inver {
        match self.bits {
            false => Inver::NoError,
            true => Inver::Error,
        }
    }
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Inver::NoError
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn is_error(&self) -> bool {
        *self == Inver::Error
    }
}
#[doc = "Field `INVER` writer - Invalid exception return flag."]
pub type InverW<'a, REG> = crate::BitWriter<'a, REG, Inver>;
impl<'a, REG> InverW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn no_error(self) -> &'a mut crate::W<REG> {
        self.variant(Inver::NoError)
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn error(self) -> &'a mut crate::W<REG> {
        self.variant(Inver::Error)
    }
}
#[doc = "Attribution unit violation flag.\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Auviol {
    #[doc = "0: Error has not occurred."]
    NoError = 0,
    #[doc = "1: Error has occurred."]
    Error = 1,
}
impl From<Auviol> for bool {
    #[inline(always)]
    fn from(variant: Auviol) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `AUVIOL` reader - Attribution unit violation flag."]
pub type AuviolR = crate::BitReader<Auviol>;
impl AuviolR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Auviol {
        match self.bits {
            false => Auviol::NoError,
            true => Auviol::Error,
        }
    }
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Auviol::NoError
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn is_error(&self) -> bool {
        *self == Auviol::Error
    }
}
#[doc = "Field `AUVIOL` writer - Attribution unit violation flag."]
pub type AuviolW<'a, REG> = crate::BitWriter<'a, REG, Auviol>;
impl<'a, REG> AuviolW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn no_error(self) -> &'a mut crate::W<REG> {
        self.variant(Auviol::NoError)
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn error(self) -> &'a mut crate::W<REG> {
        self.variant(Auviol::Error)
    }
}
#[doc = "Invalid transition flag.\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Invtran {
    #[doc = "0: Error has not occurred."]
    NoError = 0,
    #[doc = "1: Error has occurred."]
    Error = 1,
}
impl From<Invtran> for bool {
    #[inline(always)]
    fn from(variant: Invtran) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `INVTRAN` reader - Invalid transition flag."]
pub type InvtranR = crate::BitReader<Invtran>;
impl InvtranR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Invtran {
        match self.bits {
            false => Invtran::NoError,
            true => Invtran::Error,
        }
    }
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Invtran::NoError
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn is_error(&self) -> bool {
        *self == Invtran::Error
    }
}
#[doc = "Field `INVTRAN` writer - Invalid transition flag."]
pub type InvtranW<'a, REG> = crate::BitWriter<'a, REG, Invtran>;
impl<'a, REG> InvtranW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn no_error(self) -> &'a mut crate::W<REG> {
        self.variant(Invtran::NoError)
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn error(self) -> &'a mut crate::W<REG> {
        self.variant(Invtran::Error)
    }
}
#[doc = "Lazy state preservation error flag.\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lsperr {
    #[doc = "0: Error has not occurred."]
    NoError = 0,
    #[doc = "1: Error has occurred."]
    Error = 1,
}
impl From<Lsperr> for bool {
    #[inline(always)]
    fn from(variant: Lsperr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LSPERR` reader - Lazy state preservation error flag."]
pub type LsperrR = crate::BitReader<Lsperr>;
impl LsperrR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lsperr {
        match self.bits {
            false => Lsperr::NoError,
            true => Lsperr::Error,
        }
    }
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Lsperr::NoError
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn is_error(&self) -> bool {
        *self == Lsperr::Error
    }
}
#[doc = "Field `LSPERR` writer - Lazy state preservation error flag."]
pub type LsperrW<'a, REG> = crate::BitWriter<'a, REG, Lsperr>;
impl<'a, REG> LsperrW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Error has not occurred."]
    #[inline(always)]
    pub fn no_error(self) -> &'a mut crate::W<REG> {
        self.variant(Lsperr::NoError)
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn error(self) -> &'a mut crate::W<REG> {
        self.variant(Lsperr::Error)
    }
}
#[doc = "Secure fault address valid.\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sfarvalid {
    #[doc = "0: SFAR content not valid."]
    NotValid = 0,
    #[doc = "1: SFAR content valid."]
    Valid = 1,
}
impl From<Sfarvalid> for bool {
    #[inline(always)]
    fn from(variant: Sfarvalid) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SFARVALID` reader - Secure fault address valid."]
pub type SfarvalidR = crate::BitReader<Sfarvalid>;
impl SfarvalidR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sfarvalid {
        match self.bits {
            false => Sfarvalid::NotValid,
            true => Sfarvalid::Valid,
        }
    }
    #[doc = "SFAR content not valid."]
    #[inline(always)]
    pub fn is_not_valid(&self) -> bool {
        *self == Sfarvalid::NotValid
    }
    #[doc = "SFAR content valid."]
    #[inline(always)]
    pub fn is_valid(&self) -> bool {
        *self == Sfarvalid::Valid
    }
}
#[doc = "Field `SFARVALID` writer - Secure fault address valid."]
pub type SfarvalidW<'a, REG> = crate::BitWriter<'a, REG, Sfarvalid>;
impl<'a, REG> SfarvalidW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "SFAR content not valid."]
    #[inline(always)]
    pub fn not_valid(self) -> &'a mut crate::W<REG> {
        self.variant(Sfarvalid::NotValid)
    }
    #[doc = "SFAR content valid."]
    #[inline(always)]
    pub fn valid(self) -> &'a mut crate::W<REG> {
        self.variant(Sfarvalid::Valid)
    }
}
#[doc = "Lazy state error flag.\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lserr {
    #[doc = "0: Error has not occurred"]
    NoError = 0,
    #[doc = "1: Error has occurred."]
    Error = 1,
}
impl From<Lserr> for bool {
    #[inline(always)]
    fn from(variant: Lserr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LSERR` reader - Lazy state error flag."]
pub type LserrR = crate::BitReader<Lserr>;
impl LserrR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lserr {
        match self.bits {
            false => Lserr::NoError,
            true => Lserr::Error,
        }
    }
    #[doc = "Error has not occurred"]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Lserr::NoError
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn is_error(&self) -> bool {
        *self == Lserr::Error
    }
}
#[doc = "Field `LSERR` writer - Lazy state error flag."]
pub type LserrW<'a, REG> = crate::BitWriter<'a, REG, Lserr>;
impl<'a, REG> LserrW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Error has not occurred"]
    #[inline(always)]
    pub fn no_error(self) -> &'a mut crate::W<REG> {
        self.variant(Lserr::NoError)
    }
    #[doc = "Error has occurred."]
    #[inline(always)]
    pub fn error(self) -> &'a mut crate::W<REG> {
        self.variant(Lserr::Error)
    }
}
impl R {
    #[doc = "Bit 0 - Invalid entry point."]
    #[inline(always)]
    pub fn invep(&self) -> InvepR {
        InvepR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Invalid integrity signature flag."]
    #[inline(always)]
    pub fn invis(&self) -> InvisR {
        InvisR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Invalid exception return flag."]
    #[inline(always)]
    pub fn inver(&self) -> InverR {
        InverR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Attribution unit violation flag."]
    #[inline(always)]
    pub fn auviol(&self) -> AuviolR {
        AuviolR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Invalid transition flag."]
    #[inline(always)]
    pub fn invtran(&self) -> InvtranR {
        InvtranR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Lazy state preservation error flag."]
    #[inline(always)]
    pub fn lsperr(&self) -> LsperrR {
        LsperrR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - Secure fault address valid."]
    #[inline(always)]
    pub fn sfarvalid(&self) -> SfarvalidR {
        SfarvalidR::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Lazy state error flag."]
    #[inline(always)]
    pub fn lserr(&self) -> LserrR {
        LserrR::new(((self.bits >> 7) & 1) != 0)
    }
}
#[cfg(feature = "debug")]
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("SFSR")
            .field("invep", &self.invep())
            .field("invis", &self.invis())
            .field("inver", &self.inver())
            .field("auviol", &self.auviol())
            .field("invtran", &self.invtran())
            .field("lsperr", &self.lsperr())
            .field("sfarvalid", &self.sfarvalid())
            .field("lserr", &self.lserr())
            .finish()
    }
}
impl W {
    #[doc = "Bit 0 - Invalid entry point."]
    #[inline(always)]
    pub fn invep(&mut self) -> InvepW<'_, SfsrSpec> {
        InvepW::new(self, 0)
    }
    #[doc = "Bit 1 - Invalid integrity signature flag."]
    #[inline(always)]
    pub fn invis(&mut self) -> InvisW<'_, SfsrSpec> {
        InvisW::new(self, 1)
    }
    #[doc = "Bit 2 - Invalid exception return flag."]
    #[inline(always)]
    pub fn inver(&mut self) -> InverW<'_, SfsrSpec> {
        InverW::new(self, 2)
    }
    #[doc = "Bit 3 - Attribution unit violation flag."]
    #[inline(always)]
    pub fn auviol(&mut self) -> AuviolW<'_, SfsrSpec> {
        AuviolW::new(self, 3)
    }
    #[doc = "Bit 4 - Invalid transition flag."]
    #[inline(always)]
    pub fn invtran(&mut self) -> InvtranW<'_, SfsrSpec> {
        InvtranW::new(self, 4)
    }
    #[doc = "Bit 5 - Lazy state preservation error flag."]
    #[inline(always)]
    pub fn lsperr(&mut self) -> LsperrW<'_, SfsrSpec> {
        LsperrW::new(self, 5)
    }
    #[doc = "Bit 6 - Secure fault address valid."]
    #[inline(always)]
    pub fn sfarvalid(&mut self) -> SfarvalidW<'_, SfsrSpec> {
        SfarvalidW::new(self, 6)
    }
    #[doc = "Bit 7 - Lazy state error flag."]
    #[inline(always)]
    pub fn lserr(&mut self) -> LserrW<'_, SfsrSpec> {
        LserrW::new(self, 7)
    }
}
#[doc = "Secure Fault Status Register\n\nYou can [`read`](crate::Reg::read) this register and get [`sfsr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sfsr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct SfsrSpec;
impl crate::RegisterSpec for SfsrSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`sfsr::R`](R) reader structure"]
impl crate::Readable for SfsrSpec {}
#[doc = "`write(|w| ..)` method takes [`sfsr::W`](W) writer structure"]
impl crate::Writable for SfsrSpec {
    type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets SFSR to value 0"]
impl crate::Resettable for SfsrSpec {}