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 `INTEN` reader"]
pub type R = crate::R<IntenSpec>;
#[doc = "Register `INTEN` writer"]
pub type W = crate::W<IntenSpec>;
#[doc = "USBRST Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Usbrsten {
    #[doc = "0: Disable"]
    DisUsbrstInt = 0,
    #[doc = "1: Enable"]
    EnUsbrstInt = 1,
}
impl From<Usbrsten> for bool {
    #[inline(always)]
    fn from(variant: Usbrsten) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `USBRSTEN` reader - USBRST Interrupt Enable"]
pub type UsbrstenR = crate::BitReader<Usbrsten>;
impl UsbrstenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Usbrsten {
        match self.bits {
            false => Usbrsten::DisUsbrstInt,
            true => Usbrsten::EnUsbrstInt,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_dis_usbrst_int(&self) -> bool {
        *self == Usbrsten::DisUsbrstInt
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_en_usbrst_int(&self) -> bool {
        *self == Usbrsten::EnUsbrstInt
    }
}
#[doc = "Field `USBRSTEN` writer - USBRST Interrupt Enable"]
pub type UsbrstenW<'a, REG> = crate::BitWriter<'a, REG, Usbrsten>;
impl<'a, REG> UsbrstenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn dis_usbrst_int(self) -> &'a mut crate::W<REG> {
        self.variant(Usbrsten::DisUsbrstInt)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn en_usbrst_int(self) -> &'a mut crate::W<REG> {
        self.variant(Usbrsten::EnUsbrstInt)
    }
}
#[doc = "ERROR Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Erroren {
    #[doc = "0: Disable"]
    DisErrorInt = 0,
    #[doc = "1: Enable"]
    EnErrorInt = 1,
}
impl From<Erroren> for bool {
    #[inline(always)]
    fn from(variant: Erroren) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ERROREN` reader - ERROR Interrupt Enable"]
pub type ErrorenR = crate::BitReader<Erroren>;
impl ErrorenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Erroren {
        match self.bits {
            false => Erroren::DisErrorInt,
            true => Erroren::EnErrorInt,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_dis_error_int(&self) -> bool {
        *self == Erroren::DisErrorInt
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_en_error_int(&self) -> bool {
        *self == Erroren::EnErrorInt
    }
}
#[doc = "Field `ERROREN` writer - ERROR Interrupt Enable"]
pub type ErrorenW<'a, REG> = crate::BitWriter<'a, REG, Erroren>;
impl<'a, REG> ErrorenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn dis_error_int(self) -> &'a mut crate::W<REG> {
        self.variant(Erroren::DisErrorInt)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn en_error_int(self) -> &'a mut crate::W<REG> {
        self.variant(Erroren::EnErrorInt)
    }
}
#[doc = "SOFTOK Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Softoken {
    #[doc = "0: Disable"]
    DisSoftokInt = 0,
    #[doc = "1: Enable"]
    EnSoftokInt = 1,
}
impl From<Softoken> for bool {
    #[inline(always)]
    fn from(variant: Softoken) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SOFTOKEN` reader - SOFTOK Interrupt Enable"]
pub type SoftokenR = crate::BitReader<Softoken>;
impl SoftokenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Softoken {
        match self.bits {
            false => Softoken::DisSoftokInt,
            true => Softoken::EnSoftokInt,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_dis_softok_int(&self) -> bool {
        *self == Softoken::DisSoftokInt
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_en_softok_int(&self) -> bool {
        *self == Softoken::EnSoftokInt
    }
}
#[doc = "Field `SOFTOKEN` writer - SOFTOK Interrupt Enable"]
pub type SoftokenW<'a, REG> = crate::BitWriter<'a, REG, Softoken>;
impl<'a, REG> SoftokenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn dis_softok_int(self) -> &'a mut crate::W<REG> {
        self.variant(Softoken::DisSoftokInt)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn en_softok_int(self) -> &'a mut crate::W<REG> {
        self.variant(Softoken::EnSoftokInt)
    }
}
#[doc = "TOKDNE Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Tokdneen {
    #[doc = "0: Disable"]
    DisTokdneInt = 0,
    #[doc = "1: Enable"]
    EnTokdneInt = 1,
}
impl From<Tokdneen> for bool {
    #[inline(always)]
    fn from(variant: Tokdneen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `TOKDNEEN` reader - TOKDNE Interrupt Enable"]
pub type TokdneenR = crate::BitReader<Tokdneen>;
impl TokdneenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Tokdneen {
        match self.bits {
            false => Tokdneen::DisTokdneInt,
            true => Tokdneen::EnTokdneInt,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_dis_tokdne_int(&self) -> bool {
        *self == Tokdneen::DisTokdneInt
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_en_tokdne_int(&self) -> bool {
        *self == Tokdneen::EnTokdneInt
    }
}
#[doc = "Field `TOKDNEEN` writer - TOKDNE Interrupt Enable"]
pub type TokdneenW<'a, REG> = crate::BitWriter<'a, REG, Tokdneen>;
impl<'a, REG> TokdneenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn dis_tokdne_int(self) -> &'a mut crate::W<REG> {
        self.variant(Tokdneen::DisTokdneInt)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn en_tokdne_int(self) -> &'a mut crate::W<REG> {
        self.variant(Tokdneen::EnTokdneInt)
    }
}
#[doc = "SLEEP Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sleepen {
    #[doc = "0: Disable"]
    DisSleepInt = 0,
    #[doc = "1: Enable"]
    EnSleepInt = 1,
}
impl From<Sleepen> for bool {
    #[inline(always)]
    fn from(variant: Sleepen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SLEEPEN` reader - SLEEP Interrupt Enable"]
pub type SleepenR = crate::BitReader<Sleepen>;
impl SleepenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sleepen {
        match self.bits {
            false => Sleepen::DisSleepInt,
            true => Sleepen::EnSleepInt,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_dis_sleep_int(&self) -> bool {
        *self == Sleepen::DisSleepInt
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_en_sleep_int(&self) -> bool {
        *self == Sleepen::EnSleepInt
    }
}
#[doc = "Field `SLEEPEN` writer - SLEEP Interrupt Enable"]
pub type SleepenW<'a, REG> = crate::BitWriter<'a, REG, Sleepen>;
impl<'a, REG> SleepenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn dis_sleep_int(self) -> &'a mut crate::W<REG> {
        self.variant(Sleepen::DisSleepInt)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn en_sleep_int(self) -> &'a mut crate::W<REG> {
        self.variant(Sleepen::EnSleepInt)
    }
}
#[doc = "RESUME Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Resumeen {
    #[doc = "0: Disable"]
    DisResumeInt = 0,
    #[doc = "1: Enable"]
    EnResumeInt = 1,
}
impl From<Resumeen> for bool {
    #[inline(always)]
    fn from(variant: Resumeen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RESUMEEN` reader - RESUME Interrupt Enable"]
pub type ResumeenR = crate::BitReader<Resumeen>;
impl ResumeenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Resumeen {
        match self.bits {
            false => Resumeen::DisResumeInt,
            true => Resumeen::EnResumeInt,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_dis_resume_int(&self) -> bool {
        *self == Resumeen::DisResumeInt
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_en_resume_int(&self) -> bool {
        *self == Resumeen::EnResumeInt
    }
}
#[doc = "Field `RESUMEEN` writer - RESUME Interrupt Enable"]
pub type ResumeenW<'a, REG> = crate::BitWriter<'a, REG, Resumeen>;
impl<'a, REG> ResumeenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn dis_resume_int(self) -> &'a mut crate::W<REG> {
        self.variant(Resumeen::DisResumeInt)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn en_resume_int(self) -> &'a mut crate::W<REG> {
        self.variant(Resumeen::EnResumeInt)
    }
}
#[doc = "ATTACH Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Attachen {
    #[doc = "0: Disable"]
    DisAttachInt = 0,
    #[doc = "1: Enable"]
    EnAttachInt = 1,
}
impl From<Attachen> for bool {
    #[inline(always)]
    fn from(variant: Attachen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ATTACHEN` reader - ATTACH Interrupt Enable"]
pub type AttachenR = crate::BitReader<Attachen>;
impl AttachenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Attachen {
        match self.bits {
            false => Attachen::DisAttachInt,
            true => Attachen::EnAttachInt,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_dis_attach_int(&self) -> bool {
        *self == Attachen::DisAttachInt
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_en_attach_int(&self) -> bool {
        *self == Attachen::EnAttachInt
    }
}
#[doc = "Field `ATTACHEN` writer - ATTACH Interrupt Enable"]
pub type AttachenW<'a, REG> = crate::BitWriter<'a, REG, Attachen>;
impl<'a, REG> AttachenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn dis_attach_int(self) -> &'a mut crate::W<REG> {
        self.variant(Attachen::DisAttachInt)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn en_attach_int(self) -> &'a mut crate::W<REG> {
        self.variant(Attachen::EnAttachInt)
    }
}
#[doc = "STALL Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Stallen {
    #[doc = "0: Disable"]
    DisStallInt = 0,
    #[doc = "1: Enable"]
    EnStallInt = 1,
}
impl From<Stallen> for bool {
    #[inline(always)]
    fn from(variant: Stallen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `STALLEN` reader - STALL Interrupt Enable"]
pub type StallenR = crate::BitReader<Stallen>;
impl StallenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Stallen {
        match self.bits {
            false => Stallen::DisStallInt,
            true => Stallen::EnStallInt,
        }
    }
    #[doc = "Disable"]
    #[inline(always)]
    pub fn is_dis_stall_int(&self) -> bool {
        *self == Stallen::DisStallInt
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn is_en_stall_int(&self) -> bool {
        *self == Stallen::EnStallInt
    }
}
#[doc = "Field `STALLEN` writer - STALL Interrupt Enable"]
pub type StallenW<'a, REG> = crate::BitWriter<'a, REG, Stallen>;
impl<'a, REG> StallenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disable"]
    #[inline(always)]
    pub fn dis_stall_int(self) -> &'a mut crate::W<REG> {
        self.variant(Stallen::DisStallInt)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn en_stall_int(self) -> &'a mut crate::W<REG> {
        self.variant(Stallen::EnStallInt)
    }
}
impl R {
    #[doc = "Bit 0 - USBRST Interrupt Enable"]
    #[inline(always)]
    pub fn usbrsten(&self) -> UsbrstenR {
        UsbrstenR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - ERROR Interrupt Enable"]
    #[inline(always)]
    pub fn erroren(&self) -> ErrorenR {
        ErrorenR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - SOFTOK Interrupt Enable"]
    #[inline(always)]
    pub fn softoken(&self) -> SoftokenR {
        SoftokenR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - TOKDNE Interrupt Enable"]
    #[inline(always)]
    pub fn tokdneen(&self) -> TokdneenR {
        TokdneenR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - SLEEP Interrupt Enable"]
    #[inline(always)]
    pub fn sleepen(&self) -> SleepenR {
        SleepenR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - RESUME Interrupt Enable"]
    #[inline(always)]
    pub fn resumeen(&self) -> ResumeenR {
        ResumeenR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - ATTACH Interrupt Enable"]
    #[inline(always)]
    pub fn attachen(&self) -> AttachenR {
        AttachenR::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - STALL Interrupt Enable"]
    #[inline(always)]
    pub fn stallen(&self) -> StallenR {
        StallenR::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("INTEN")
            .field("usbrsten", &self.usbrsten())
            .field("erroren", &self.erroren())
            .field("softoken", &self.softoken())
            .field("tokdneen", &self.tokdneen())
            .field("sleepen", &self.sleepen())
            .field("resumeen", &self.resumeen())
            .field("attachen", &self.attachen())
            .field("stallen", &self.stallen())
            .finish()
    }
}
impl W {
    #[doc = "Bit 0 - USBRST Interrupt Enable"]
    #[inline(always)]
    pub fn usbrsten(&mut self) -> UsbrstenW<'_, IntenSpec> {
        UsbrstenW::new(self, 0)
    }
    #[doc = "Bit 1 - ERROR Interrupt Enable"]
    #[inline(always)]
    pub fn erroren(&mut self) -> ErrorenW<'_, IntenSpec> {
        ErrorenW::new(self, 1)
    }
    #[doc = "Bit 2 - SOFTOK Interrupt Enable"]
    #[inline(always)]
    pub fn softoken(&mut self) -> SoftokenW<'_, IntenSpec> {
        SoftokenW::new(self, 2)
    }
    #[doc = "Bit 3 - TOKDNE Interrupt Enable"]
    #[inline(always)]
    pub fn tokdneen(&mut self) -> TokdneenW<'_, IntenSpec> {
        TokdneenW::new(self, 3)
    }
    #[doc = "Bit 4 - SLEEP Interrupt Enable"]
    #[inline(always)]
    pub fn sleepen(&mut self) -> SleepenW<'_, IntenSpec> {
        SleepenW::new(self, 4)
    }
    #[doc = "Bit 5 - RESUME Interrupt Enable"]
    #[inline(always)]
    pub fn resumeen(&mut self) -> ResumeenW<'_, IntenSpec> {
        ResumeenW::new(self, 5)
    }
    #[doc = "Bit 6 - ATTACH Interrupt Enable"]
    #[inline(always)]
    pub fn attachen(&mut self) -> AttachenW<'_, IntenSpec> {
        AttachenW::new(self, 6)
    }
    #[doc = "Bit 7 - STALL Interrupt Enable"]
    #[inline(always)]
    pub fn stallen(&mut self) -> StallenW<'_, IntenSpec> {
        StallenW::new(self, 7)
    }
}
#[doc = "Interrupt Enable\n\nYou can [`read`](crate::Reg::read) this register and get [`inten::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`inten::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct IntenSpec;
impl crate::RegisterSpec for IntenSpec {
    type Ux = u8;
}
#[doc = "`read()` method returns [`inten::R`](R) reader structure"]
impl crate::Readable for IntenSpec {}
#[doc = "`write(|w| ..)` method takes [`inten::W`](W) writer structure"]
impl crate::Writable for IntenSpec {
    type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets INTEN to value 0"]
impl crate::Resettable for IntenSpec {}