mcxa-pac 0.2.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
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
#[doc = "Register `CONTROL` reader"]
pub type R = crate::R<ControlSpec>;
#[doc = "Register `CONTROL` writer"]
pub type W = crate::W<ControlSpec>;
#[doc = "Lock control\n\nValue on reset: 2"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LockCtrl {
    #[doc = "1: Locked"]
    Locked = 1,
    #[doc = "2: Unlocked"]
    Unlocked = 2,
}
impl From<LockCtrl> for u8 {
    #[inline(always)]
    fn from(variant: LockCtrl) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for LockCtrl {
    type Ux = u8;
}
impl crate::IsEnum for LockCtrl {}
#[doc = "Field `LOCK_CTRL` reader - Lock control"]
pub type LockCtrlR = crate::FieldReader<LockCtrl>;
impl LockCtrlR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<LockCtrl> {
        match self.bits {
            1 => Some(LockCtrl::Locked),
            2 => Some(LockCtrl::Unlocked),
            _ => None,
        }
    }
    #[doc = "Locked"]
    #[inline(always)]
    pub fn is_locked(&self) -> bool {
        *self == LockCtrl::Locked
    }
    #[doc = "Unlocked"]
    #[inline(always)]
    pub fn is_unlocked(&self) -> bool {
        *self == LockCtrl::Unlocked
    }
}
#[doc = "Field `LOCK_CTRL` writer - Lock control"]
pub type LockCtrlW<'a, REG> = crate::FieldWriter<'a, REG, 2, LockCtrl>;
impl<'a, REG> LockCtrlW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Locked"]
    #[inline(always)]
    pub fn locked(self) -> &'a mut crate::W<REG> {
        self.variant(LockCtrl::Locked)
    }
    #[doc = "Unlocked"]
    #[inline(always)]
    pub fn unlocked(self) -> &'a mut crate::W<REG> {
        self.variant(LockCtrl::Unlocked)
    }
}
#[doc = "TIMEOUT fault control\n\nValue on reset: 4"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TimeoutCtrl {
    #[doc = "1: Enable reset"]
    EnableReset = 1,
    #[doc = "2: Enable interrupt"]
    EnableInterrupt = 2,
    #[doc = "4: Disable both reset and interrupt"]
    DisableBoth = 4,
}
impl From<TimeoutCtrl> for u8 {
    #[inline(always)]
    fn from(variant: TimeoutCtrl) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for TimeoutCtrl {
    type Ux = u8;
}
impl crate::IsEnum for TimeoutCtrl {}
#[doc = "Field `TIMEOUT_CTRL` reader - TIMEOUT fault control"]
pub type TimeoutCtrlR = crate::FieldReader<TimeoutCtrl>;
impl TimeoutCtrlR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<TimeoutCtrl> {
        match self.bits {
            1 => Some(TimeoutCtrl::EnableReset),
            2 => Some(TimeoutCtrl::EnableInterrupt),
            4 => Some(TimeoutCtrl::DisableBoth),
            _ => None,
        }
    }
    #[doc = "Enable reset"]
    #[inline(always)]
    pub fn is_enable_reset(&self) -> bool {
        *self == TimeoutCtrl::EnableReset
    }
    #[doc = "Enable interrupt"]
    #[inline(always)]
    pub fn is_enable_interrupt(&self) -> bool {
        *self == TimeoutCtrl::EnableInterrupt
    }
    #[doc = "Disable both reset and interrupt"]
    #[inline(always)]
    pub fn is_disable_both(&self) -> bool {
        *self == TimeoutCtrl::DisableBoth
    }
}
#[doc = "Field `TIMEOUT_CTRL` writer - TIMEOUT fault control"]
pub type TimeoutCtrlW<'a, REG> = crate::FieldWriter<'a, REG, 3, TimeoutCtrl>;
impl<'a, REG> TimeoutCtrlW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Enable reset"]
    #[inline(always)]
    pub fn enable_reset(self) -> &'a mut crate::W<REG> {
        self.variant(TimeoutCtrl::EnableReset)
    }
    #[doc = "Enable interrupt"]
    #[inline(always)]
    pub fn enable_interrupt(self) -> &'a mut crate::W<REG> {
        self.variant(TimeoutCtrl::EnableInterrupt)
    }
    #[doc = "Disable both reset and interrupt"]
    #[inline(always)]
    pub fn disable_both(self) -> &'a mut crate::W<REG> {
        self.variant(TimeoutCtrl::DisableBoth)
    }
}
#[doc = "MISCOMPARE fault control\n\nValue on reset: 4"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum MiscompareCtrl {
    #[doc = "1: Enable reset"]
    EnableReset = 1,
    #[doc = "2: Enable interrupt"]
    EnableInterrupt = 2,
    #[doc = "4: Disable both reset and interrupt"]
    DisableBoth = 4,
}
impl From<MiscompareCtrl> for u8 {
    #[inline(always)]
    fn from(variant: MiscompareCtrl) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for MiscompareCtrl {
    type Ux = u8;
}
impl crate::IsEnum for MiscompareCtrl {}
#[doc = "Field `MISCOMPARE_CTRL` reader - MISCOMPARE fault control"]
pub type MiscompareCtrlR = crate::FieldReader<MiscompareCtrl>;
impl MiscompareCtrlR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<MiscompareCtrl> {
        match self.bits {
            1 => Some(MiscompareCtrl::EnableReset),
            2 => Some(MiscompareCtrl::EnableInterrupt),
            4 => Some(MiscompareCtrl::DisableBoth),
            _ => None,
        }
    }
    #[doc = "Enable reset"]
    #[inline(always)]
    pub fn is_enable_reset(&self) -> bool {
        *self == MiscompareCtrl::EnableReset
    }
    #[doc = "Enable interrupt"]
    #[inline(always)]
    pub fn is_enable_interrupt(&self) -> bool {
        *self == MiscompareCtrl::EnableInterrupt
    }
    #[doc = "Disable both reset and interrupt"]
    #[inline(always)]
    pub fn is_disable_both(&self) -> bool {
        *self == MiscompareCtrl::DisableBoth
    }
}
#[doc = "Field `MISCOMPARE_CTRL` writer - MISCOMPARE fault control"]
pub type MiscompareCtrlW<'a, REG> = crate::FieldWriter<'a, REG, 3, MiscompareCtrl>;
impl<'a, REG> MiscompareCtrlW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Enable reset"]
    #[inline(always)]
    pub fn enable_reset(self) -> &'a mut crate::W<REG> {
        self.variant(MiscompareCtrl::EnableReset)
    }
    #[doc = "Enable interrupt"]
    #[inline(always)]
    pub fn enable_interrupt(self) -> &'a mut crate::W<REG> {
        self.variant(MiscompareCtrl::EnableInterrupt)
    }
    #[doc = "Disable both reset and interrupt"]
    #[inline(always)]
    pub fn disable_both(self) -> &'a mut crate::W<REG> {
        self.variant(MiscompareCtrl::DisableBoth)
    }
}
#[doc = "SEQUENCE fault control\n\nValue on reset: 4"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SequenceCtrl {
    #[doc = "1: Enable reset"]
    EnableReset = 1,
    #[doc = "2: Enable interrupt"]
    EnableInterrupt = 2,
    #[doc = "4: Disable both reset and interrupt"]
    DisableBoth = 4,
}
impl From<SequenceCtrl> for u8 {
    #[inline(always)]
    fn from(variant: SequenceCtrl) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for SequenceCtrl {
    type Ux = u8;
}
impl crate::IsEnum for SequenceCtrl {}
#[doc = "Field `SEQUENCE_CTRL` reader - SEQUENCE fault control"]
pub type SequenceCtrlR = crate::FieldReader<SequenceCtrl>;
impl SequenceCtrlR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<SequenceCtrl> {
        match self.bits {
            1 => Some(SequenceCtrl::EnableReset),
            2 => Some(SequenceCtrl::EnableInterrupt),
            4 => Some(SequenceCtrl::DisableBoth),
            _ => None,
        }
    }
    #[doc = "Enable reset"]
    #[inline(always)]
    pub fn is_enable_reset(&self) -> bool {
        *self == SequenceCtrl::EnableReset
    }
    #[doc = "Enable interrupt"]
    #[inline(always)]
    pub fn is_enable_interrupt(&self) -> bool {
        *self == SequenceCtrl::EnableInterrupt
    }
    #[doc = "Disable both reset and interrupt"]
    #[inline(always)]
    pub fn is_disable_both(&self) -> bool {
        *self == SequenceCtrl::DisableBoth
    }
}
#[doc = "Field `SEQUENCE_CTRL` writer - SEQUENCE fault control"]
pub type SequenceCtrlW<'a, REG> = crate::FieldWriter<'a, REG, 3, SequenceCtrl>;
impl<'a, REG> SequenceCtrlW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Enable reset"]
    #[inline(always)]
    pub fn enable_reset(self) -> &'a mut crate::W<REG> {
        self.variant(SequenceCtrl::EnableReset)
    }
    #[doc = "Enable interrupt"]
    #[inline(always)]
    pub fn enable_interrupt(self) -> &'a mut crate::W<REG> {
        self.variant(SequenceCtrl::EnableInterrupt)
    }
    #[doc = "Disable both reset and interrupt"]
    #[inline(always)]
    pub fn disable_both(self) -> &'a mut crate::W<REG> {
        self.variant(SequenceCtrl::DisableBoth)
    }
}
#[doc = "STATE fault control\n\nValue on reset: 4"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum StateCtrl {
    #[doc = "1: Enable reset"]
    EnableReset = 1,
    #[doc = "2: Enable interrupt"]
    EnableInterrupt = 2,
    #[doc = "4: Disable both reset and interrupt"]
    DisableBoth = 4,
}
impl From<StateCtrl> for u8 {
    #[inline(always)]
    fn from(variant: StateCtrl) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for StateCtrl {
    type Ux = u8;
}
impl crate::IsEnum for StateCtrl {}
#[doc = "Field `STATE_CTRL` reader - STATE fault control"]
pub type StateCtrlR = crate::FieldReader<StateCtrl>;
impl StateCtrlR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<StateCtrl> {
        match self.bits {
            1 => Some(StateCtrl::EnableReset),
            2 => Some(StateCtrl::EnableInterrupt),
            4 => Some(StateCtrl::DisableBoth),
            _ => None,
        }
    }
    #[doc = "Enable reset"]
    #[inline(always)]
    pub fn is_enable_reset(&self) -> bool {
        *self == StateCtrl::EnableReset
    }
    #[doc = "Enable interrupt"]
    #[inline(always)]
    pub fn is_enable_interrupt(&self) -> bool {
        *self == StateCtrl::EnableInterrupt
    }
    #[doc = "Disable both reset and interrupt"]
    #[inline(always)]
    pub fn is_disable_both(&self) -> bool {
        *self == StateCtrl::DisableBoth
    }
}
#[doc = "Field `STATE_CTRL` writer - STATE fault control"]
pub type StateCtrlW<'a, REG> = crate::FieldWriter<'a, REG, 3, StateCtrl>;
impl<'a, REG> StateCtrlW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Enable reset"]
    #[inline(always)]
    pub fn enable_reset(self) -> &'a mut crate::W<REG> {
        self.variant(StateCtrl::EnableReset)
    }
    #[doc = "Enable interrupt"]
    #[inline(always)]
    pub fn enable_interrupt(self) -> &'a mut crate::W<REG> {
        self.variant(StateCtrl::EnableInterrupt)
    }
    #[doc = "Disable both reset and interrupt"]
    #[inline(always)]
    pub fn disable_both(self) -> &'a mut crate::W<REG> {
        self.variant(StateCtrl::DisableBoth)
    }
}
#[doc = "ADDRESS fault control\n\nValue on reset: 4"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum AddressCtrl {
    #[doc = "1: Enable reset"]
    EnableReset = 1,
    #[doc = "2: Enable interrupt"]
    EnableInterrupt = 2,
    #[doc = "4: Disable both reset and interrupt"]
    DisableBoth = 4,
}
impl From<AddressCtrl> for u8 {
    #[inline(always)]
    fn from(variant: AddressCtrl) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for AddressCtrl {
    type Ux = u8;
}
impl crate::IsEnum for AddressCtrl {}
#[doc = "Field `ADDRESS_CTRL` reader - ADDRESS fault control"]
pub type AddressCtrlR = crate::FieldReader<AddressCtrl>;
impl AddressCtrlR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<AddressCtrl> {
        match self.bits {
            1 => Some(AddressCtrl::EnableReset),
            2 => Some(AddressCtrl::EnableInterrupt),
            4 => Some(AddressCtrl::DisableBoth),
            _ => None,
        }
    }
    #[doc = "Enable reset"]
    #[inline(always)]
    pub fn is_enable_reset(&self) -> bool {
        *self == AddressCtrl::EnableReset
    }
    #[doc = "Enable interrupt"]
    #[inline(always)]
    pub fn is_enable_interrupt(&self) -> bool {
        *self == AddressCtrl::EnableInterrupt
    }
    #[doc = "Disable both reset and interrupt"]
    #[inline(always)]
    pub fn is_disable_both(&self) -> bool {
        *self == AddressCtrl::DisableBoth
    }
}
#[doc = "Field `ADDRESS_CTRL` writer - ADDRESS fault control"]
pub type AddressCtrlW<'a, REG> = crate::FieldWriter<'a, REG, 3, AddressCtrl>;
impl<'a, REG> AddressCtrlW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Enable reset"]
    #[inline(always)]
    pub fn enable_reset(self) -> &'a mut crate::W<REG> {
        self.variant(AddressCtrl::EnableReset)
    }
    #[doc = "Enable interrupt"]
    #[inline(always)]
    pub fn enable_interrupt(self) -> &'a mut crate::W<REG> {
        self.variant(AddressCtrl::EnableInterrupt)
    }
    #[doc = "Disable both reset and interrupt"]
    #[inline(always)]
    pub fn disable_both(self) -> &'a mut crate::W<REG> {
        self.variant(AddressCtrl::DisableBoth)
    }
}
#[doc = "IRQ pause control\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum IrqPause {
    #[doc = "1: Keep the timer running"]
    RunTimer = 1,
    #[doc = "2: Stop the timer"]
    PauseTimer = 2,
}
impl From<IrqPause> for u8 {
    #[inline(always)]
    fn from(variant: IrqPause) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for IrqPause {
    type Ux = u8;
}
impl crate::IsEnum for IrqPause {}
#[doc = "Field `IRQ_PAUSE` reader - IRQ pause control"]
pub type IrqPauseR = crate::FieldReader<IrqPause>;
impl IrqPauseR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<IrqPause> {
        match self.bits {
            1 => Some(IrqPause::RunTimer),
            2 => Some(IrqPause::PauseTimer),
            _ => None,
        }
    }
    #[doc = "Keep the timer running"]
    #[inline(always)]
    pub fn is_run_timer(&self) -> bool {
        *self == IrqPause::RunTimer
    }
    #[doc = "Stop the timer"]
    #[inline(always)]
    pub fn is_pause_timer(&self) -> bool {
        *self == IrqPause::PauseTimer
    }
}
#[doc = "Field `IRQ_PAUSE` writer - IRQ pause control"]
pub type IrqPauseW<'a, REG> = crate::FieldWriter<'a, REG, 2, IrqPause>;
impl<'a, REG> IrqPauseW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Keep the timer running"]
    #[inline(always)]
    pub fn run_timer(self) -> &'a mut crate::W<REG> {
        self.variant(IrqPause::RunTimer)
    }
    #[doc = "Stop the timer"]
    #[inline(always)]
    pub fn pause_timer(self) -> &'a mut crate::W<REG> {
        self.variant(IrqPause::PauseTimer)
    }
}
#[doc = "DEBUG_HALT control\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DebugHaltCtrl {
    #[doc = "1: Keep the timer running"]
    RunTimer = 1,
    #[doc = "2: Stop the timer"]
    PauseTimer = 2,
}
impl From<DebugHaltCtrl> for u8 {
    #[inline(always)]
    fn from(variant: DebugHaltCtrl) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for DebugHaltCtrl {
    type Ux = u8;
}
impl crate::IsEnum for DebugHaltCtrl {}
#[doc = "Field `DEBUG_HALT_CTRL` reader - DEBUG_HALT control"]
pub type DebugHaltCtrlR = crate::FieldReader<DebugHaltCtrl>;
impl DebugHaltCtrlR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<DebugHaltCtrl> {
        match self.bits {
            1 => Some(DebugHaltCtrl::RunTimer),
            2 => Some(DebugHaltCtrl::PauseTimer),
            _ => None,
        }
    }
    #[doc = "Keep the timer running"]
    #[inline(always)]
    pub fn is_run_timer(&self) -> bool {
        *self == DebugHaltCtrl::RunTimer
    }
    #[doc = "Stop the timer"]
    #[inline(always)]
    pub fn is_pause_timer(&self) -> bool {
        *self == DebugHaltCtrl::PauseTimer
    }
}
#[doc = "Field `DEBUG_HALT_CTRL` writer - DEBUG_HALT control"]
pub type DebugHaltCtrlW<'a, REG> = crate::FieldWriter<'a, REG, 2, DebugHaltCtrl>;
impl<'a, REG> DebugHaltCtrlW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Keep the timer running"]
    #[inline(always)]
    pub fn run_timer(self) -> &'a mut crate::W<REG> {
        self.variant(DebugHaltCtrl::RunTimer)
    }
    #[doc = "Stop the timer"]
    #[inline(always)]
    pub fn pause_timer(self) -> &'a mut crate::W<REG> {
        self.variant(DebugHaltCtrl::PauseTimer)
    }
}
impl R {
    #[doc = "Bits 0:1 - Lock control"]
    #[inline(always)]
    pub fn lock_ctrl(&self) -> LockCtrlR {
        LockCtrlR::new((self.bits & 3) as u8)
    }
    #[doc = "Bits 2:4 - TIMEOUT fault control"]
    #[inline(always)]
    pub fn timeout_ctrl(&self) -> TimeoutCtrlR {
        TimeoutCtrlR::new(((self.bits >> 2) & 7) as u8)
    }
    #[doc = "Bits 5:7 - MISCOMPARE fault control"]
    #[inline(always)]
    pub fn miscompare_ctrl(&self) -> MiscompareCtrlR {
        MiscompareCtrlR::new(((self.bits >> 5) & 7) as u8)
    }
    #[doc = "Bits 8:10 - SEQUENCE fault control"]
    #[inline(always)]
    pub fn sequence_ctrl(&self) -> SequenceCtrlR {
        SequenceCtrlR::new(((self.bits >> 8) & 7) as u8)
    }
    #[doc = "Bits 14:16 - STATE fault control"]
    #[inline(always)]
    pub fn state_ctrl(&self) -> StateCtrlR {
        StateCtrlR::new(((self.bits >> 14) & 7) as u8)
    }
    #[doc = "Bits 17:19 - ADDRESS fault control"]
    #[inline(always)]
    pub fn address_ctrl(&self) -> AddressCtrlR {
        AddressCtrlR::new(((self.bits >> 17) & 7) as u8)
    }
    #[doc = "Bits 28:29 - IRQ pause control"]
    #[inline(always)]
    pub fn irq_pause(&self) -> IrqPauseR {
        IrqPauseR::new(((self.bits >> 28) & 3) as u8)
    }
    #[doc = "Bits 30:31 - DEBUG_HALT control"]
    #[inline(always)]
    pub fn debug_halt_ctrl(&self) -> DebugHaltCtrlR {
        DebugHaltCtrlR::new(((self.bits >> 30) & 3) as u8)
    }
}
#[cfg(feature = "debug")]
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("CONTROL")
            .field("lock_ctrl", &self.lock_ctrl())
            .field("timeout_ctrl", &self.timeout_ctrl())
            .field("miscompare_ctrl", &self.miscompare_ctrl())
            .field("sequence_ctrl", &self.sequence_ctrl())
            .field("state_ctrl", &self.state_ctrl())
            .field("address_ctrl", &self.address_ctrl())
            .field("irq_pause", &self.irq_pause())
            .field("debug_halt_ctrl", &self.debug_halt_ctrl())
            .finish()
    }
}
impl W {
    #[doc = "Bits 0:1 - Lock control"]
    #[inline(always)]
    pub fn lock_ctrl(&mut self) -> LockCtrlW<'_, ControlSpec> {
        LockCtrlW::new(self, 0)
    }
    #[doc = "Bits 2:4 - TIMEOUT fault control"]
    #[inline(always)]
    pub fn timeout_ctrl(&mut self) -> TimeoutCtrlW<'_, ControlSpec> {
        TimeoutCtrlW::new(self, 2)
    }
    #[doc = "Bits 5:7 - MISCOMPARE fault control"]
    #[inline(always)]
    pub fn miscompare_ctrl(&mut self) -> MiscompareCtrlW<'_, ControlSpec> {
        MiscompareCtrlW::new(self, 5)
    }
    #[doc = "Bits 8:10 - SEQUENCE fault control"]
    #[inline(always)]
    pub fn sequence_ctrl(&mut self) -> SequenceCtrlW<'_, ControlSpec> {
        SequenceCtrlW::new(self, 8)
    }
    #[doc = "Bits 14:16 - STATE fault control"]
    #[inline(always)]
    pub fn state_ctrl(&mut self) -> StateCtrlW<'_, ControlSpec> {
        StateCtrlW::new(self, 14)
    }
    #[doc = "Bits 17:19 - ADDRESS fault control"]
    #[inline(always)]
    pub fn address_ctrl(&mut self) -> AddressCtrlW<'_, ControlSpec> {
        AddressCtrlW::new(self, 17)
    }
    #[doc = "Bits 28:29 - IRQ pause control"]
    #[inline(always)]
    pub fn irq_pause(&mut self) -> IrqPauseW<'_, ControlSpec> {
        IrqPauseW::new(self, 28)
    }
    #[doc = "Bits 30:31 - DEBUG_HALT control"]
    #[inline(always)]
    pub fn debug_halt_ctrl(&mut self) -> DebugHaltCtrlW<'_, ControlSpec> {
        DebugHaltCtrlW::new(self, 30)
    }
}
#[doc = "Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`control::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`control::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct ControlSpec;
impl crate::RegisterSpec for ControlSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`control::R`](R) reader structure"]
impl crate::Readable for ControlSpec {}
#[doc = "`write(|w| ..)` method takes [`control::W`](W) writer structure"]
impl crate::Writable for ControlSpec {
    type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets CONTROL to value 0x5009_2492"]
impl crate::Resettable for ControlSpec {
    const RESET_VALUE: u32 = 0x5009_2492;
}