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
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
#[doc = "Register `MSTATUS` reader"]
pub type R = crate::R<MstatusSpec>;
#[doc = "Register `MSTATUS` writer"]
pub type W = crate::W<MstatusSpec>;
#[doc = "State of the Controller\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum State {
    #[doc = "0: IDLE (bus has stopped)"]
    Idle = 0,
    #[doc = "1: SLVREQ (target request)"]
    Slvreq = 1,
    #[doc = "2: MSGSDR"]
    Msgsdr = 2,
    #[doc = "3: NORMACT"]
    Normact = 3,
    #[doc = "4: MSGDDR"]
    Ddr = 4,
    #[doc = "5: DAA"]
    Daa = 5,
    #[doc = "6: IBIACK"]
    Ibiack = 6,
    #[doc = "7: IBIRCV"]
    Ibircv = 7,
}
impl From<State> for u8 {
    #[inline(always)]
    fn from(variant: State) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for State {
    type Ux = u8;
}
impl crate::IsEnum for State {}
#[doc = "Field `STATE` reader - State of the Controller"]
pub type StateR = crate::FieldReader<State>;
impl StateR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> State {
        match self.bits {
            0 => State::Idle,
            1 => State::Slvreq,
            2 => State::Msgsdr,
            3 => State::Normact,
            4 => State::Ddr,
            5 => State::Daa,
            6 => State::Ibiack,
            7 => State::Ibircv,
            _ => unreachable!(),
        }
    }
    #[doc = "IDLE (bus has stopped)"]
    #[inline(always)]
    pub fn is_idle(&self) -> bool {
        *self == State::Idle
    }
    #[doc = "SLVREQ (target request)"]
    #[inline(always)]
    pub fn is_slvreq(&self) -> bool {
        *self == State::Slvreq
    }
    #[doc = "MSGSDR"]
    #[inline(always)]
    pub fn is_msgsdr(&self) -> bool {
        *self == State::Msgsdr
    }
    #[doc = "NORMACT"]
    #[inline(always)]
    pub fn is_normact(&self) -> bool {
        *self == State::Normact
    }
    #[doc = "MSGDDR"]
    #[inline(always)]
    pub fn is_ddr(&self) -> bool {
        *self == State::Ddr
    }
    #[doc = "DAA"]
    #[inline(always)]
    pub fn is_daa(&self) -> bool {
        *self == State::Daa
    }
    #[doc = "IBIACK"]
    #[inline(always)]
    pub fn is_ibiack(&self) -> bool {
        *self == State::Ibiack
    }
    #[doc = "IBIRCV"]
    #[inline(always)]
    pub fn is_ibircv(&self) -> bool {
        *self == State::Ibircv
    }
}
#[doc = "Between\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Between {
    #[doc = "0: Inactive (for other cases)"]
    Inactive = 0,
    #[doc = "1: Active"]
    Active = 1,
}
impl From<Between> for bool {
    #[inline(always)]
    fn from(variant: Between) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `BETWEEN` reader - Between"]
pub type BetweenR = crate::BitReader<Between>;
impl BetweenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Between {
        match self.bits {
            false => Between::Inactive,
            true => Between::Active,
        }
    }
    #[doc = "Inactive (for other cases)"]
    #[inline(always)]
    pub fn is_inactive(&self) -> bool {
        *self == Between::Inactive
    }
    #[doc = "Active"]
    #[inline(always)]
    pub fn is_active(&self) -> bool {
        *self == Between::Active
    }
}
#[doc = "Not Acknowledged\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Nacked {
    #[doc = "0: Not NACKed"]
    NotNacked = 0,
    #[doc = "1: NACKed (not acknowledged)"]
    Nacked = 1,
}
impl From<Nacked> for bool {
    #[inline(always)]
    fn from(variant: Nacked) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `NACKED` reader - Not Acknowledged"]
pub type NackedR = crate::BitReader<Nacked>;
impl NackedR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Nacked {
        match self.bits {
            false => Nacked::NotNacked,
            true => Nacked::Nacked,
        }
    }
    #[doc = "Not NACKed"]
    #[inline(always)]
    pub fn is_not_nacked(&self) -> bool {
        *self == Nacked::NotNacked
    }
    #[doc = "NACKed (not acknowledged)"]
    #[inline(always)]
    pub fn is_nacked(&self) -> bool {
        *self == Nacked::Nacked
    }
}
#[doc = "In-Band Interrupt (IBI) Type\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Ibitype {
    #[doc = "0: NONE (no IBI: this status occurs when MSTATUS\\[IBIWON\\] becomes 0)"]
    None = 0,
    #[doc = "1: IBI"]
    Ibi = 1,
    #[doc = "2: CR"]
    Mr = 2,
    #[doc = "3: HJ"]
    Hj = 3,
}
impl From<Ibitype> for u8 {
    #[inline(always)]
    fn from(variant: Ibitype) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Ibitype {
    type Ux = u8;
}
impl crate::IsEnum for Ibitype {}
#[doc = "Field `IBITYPE` reader - In-Band Interrupt (IBI) Type"]
pub type IbitypeR = crate::FieldReader<Ibitype>;
impl IbitypeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ibitype {
        match self.bits {
            0 => Ibitype::None,
            1 => Ibitype::Ibi,
            2 => Ibitype::Mr,
            3 => Ibitype::Hj,
            _ => unreachable!(),
        }
    }
    #[doc = "NONE (no IBI: this status occurs when MSTATUS\\[IBIWON\\] becomes 0)"]
    #[inline(always)]
    pub fn is_none(&self) -> bool {
        *self == Ibitype::None
    }
    #[doc = "IBI"]
    #[inline(always)]
    pub fn is_ibi(&self) -> bool {
        *self == Ibitype::Ibi
    }
    #[doc = "CR"]
    #[inline(always)]
    pub fn is_mr(&self) -> bool {
        *self == Ibitype::Mr
    }
    #[doc = "HJ"]
    #[inline(always)]
    pub fn is_hj(&self) -> bool {
        *self == Ibitype::Hj
    }
}
#[doc = "Target Start Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Slvstart {
    #[doc = "0: Target not requesting START"]
    NotStart = 0,
    #[doc = "1: Target requesting START"]
    Start = 1,
}
impl From<Slvstart> for bool {
    #[inline(always)]
    fn from(variant: Slvstart) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SLVSTART` reader - Target Start Flag"]
pub type SlvstartR = crate::BitReader<Slvstart>;
impl SlvstartR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Slvstart {
        match self.bits {
            false => Slvstart::NotStart,
            true => Slvstart::Start,
        }
    }
    #[doc = "Target not requesting START"]
    #[inline(always)]
    pub fn is_not_start(&self) -> bool {
        *self == Slvstart::NotStart
    }
    #[doc = "Target requesting START"]
    #[inline(always)]
    pub fn is_start(&self) -> bool {
        *self == Slvstart::Start
    }
}
#[doc = "Field `SLVSTART` writer - Target Start Flag"]
pub type SlvstartW<'a, REG> = crate::BitWriter1C<'a, REG, Slvstart>;
impl<'a, REG> SlvstartW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Target not requesting START"]
    #[inline(always)]
    pub fn not_start(self) -> &'a mut crate::W<REG> {
        self.variant(Slvstart::NotStart)
    }
    #[doc = "Target requesting START"]
    #[inline(always)]
    pub fn start(self) -> &'a mut crate::W<REG> {
        self.variant(Slvstart::Start)
    }
}
#[doc = "Controller Control Done Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Mctrldone {
    #[doc = "0: Not done"]
    NotDone = 0,
    #[doc = "1: Done"]
    Done = 1,
}
impl From<Mctrldone> for bool {
    #[inline(always)]
    fn from(variant: Mctrldone) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `MCTRLDONE` reader - Controller Control Done Flag"]
pub type MctrldoneR = crate::BitReader<Mctrldone>;
impl MctrldoneR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Mctrldone {
        match self.bits {
            false => Mctrldone::NotDone,
            true => Mctrldone::Done,
        }
    }
    #[doc = "Not done"]
    #[inline(always)]
    pub fn is_not_done(&self) -> bool {
        *self == Mctrldone::NotDone
    }
    #[doc = "Done"]
    #[inline(always)]
    pub fn is_done(&self) -> bool {
        *self == Mctrldone::Done
    }
}
#[doc = "Field `MCTRLDONE` writer - Controller Control Done Flag"]
pub type MctrldoneW<'a, REG> = crate::BitWriter1C<'a, REG, Mctrldone>;
impl<'a, REG> MctrldoneW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Not done"]
    #[inline(always)]
    pub fn not_done(self) -> &'a mut crate::W<REG> {
        self.variant(Mctrldone::NotDone)
    }
    #[doc = "Done"]
    #[inline(always)]
    pub fn done(self) -> &'a mut crate::W<REG> {
        self.variant(Mctrldone::Done)
    }
}
#[doc = "Complete Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Complete {
    #[doc = "0: Not complete"]
    NotComplete = 0,
    #[doc = "1: Complete"]
    Complete = 1,
}
impl From<Complete> for bool {
    #[inline(always)]
    fn from(variant: Complete) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `COMPLETE` reader - Complete Flag"]
pub type CompleteR = crate::BitReader<Complete>;
impl CompleteR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Complete {
        match self.bits {
            false => Complete::NotComplete,
            true => Complete::Complete,
        }
    }
    #[doc = "Not complete"]
    #[inline(always)]
    pub fn is_not_complete(&self) -> bool {
        *self == Complete::NotComplete
    }
    #[doc = "Complete"]
    #[inline(always)]
    pub fn is_complete(&self) -> bool {
        *self == Complete::Complete
    }
}
#[doc = "Field `COMPLETE` writer - Complete Flag"]
pub type CompleteW<'a, REG> = crate::BitWriter1C<'a, REG, Complete>;
impl<'a, REG> CompleteW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Not complete"]
    #[inline(always)]
    pub fn not_complete(self) -> &'a mut crate::W<REG> {
        self.variant(Complete::NotComplete)
    }
    #[doc = "Complete"]
    #[inline(always)]
    pub fn complete(self) -> &'a mut crate::W<REG> {
        self.variant(Complete::Complete)
    }
}
#[doc = "RXPEND\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Rxpend {
    #[doc = "0: No receive message pending"]
    Idle = 0,
    #[doc = "1: Receive message pending"]
    Pending = 1,
}
impl From<Rxpend> for bool {
    #[inline(always)]
    fn from(variant: Rxpend) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RXPEND` reader - RXPEND"]
pub type RxpendR = crate::BitReader<Rxpend>;
impl RxpendR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rxpend {
        match self.bits {
            false => Rxpend::Idle,
            true => Rxpend::Pending,
        }
    }
    #[doc = "No receive message pending"]
    #[inline(always)]
    pub fn is_idle(&self) -> bool {
        *self == Rxpend::Idle
    }
    #[doc = "Receive message pending"]
    #[inline(always)]
    pub fn is_pending(&self) -> bool {
        *self == Rxpend::Pending
    }
}
#[doc = "TX Buffer or FIFO Not Full\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Txnotfull {
    #[doc = "0: Receive buffer or FIFO full"]
    Full = 0,
    #[doc = "1: Receive buffer or FIFO not full"]
    Notfull = 1,
}
impl From<Txnotfull> for bool {
    #[inline(always)]
    fn from(variant: Txnotfull) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `TXNOTFULL` reader - TX Buffer or FIFO Not Full"]
pub type TxnotfullR = crate::BitReader<Txnotfull>;
impl TxnotfullR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Txnotfull {
        match self.bits {
            false => Txnotfull::Full,
            true => Txnotfull::Notfull,
        }
    }
    #[doc = "Receive buffer or FIFO full"]
    #[inline(always)]
    pub fn is_full(&self) -> bool {
        *self == Txnotfull::Full
    }
    #[doc = "Receive buffer or FIFO not full"]
    #[inline(always)]
    pub fn is_notfull(&self) -> bool {
        *self == Txnotfull::Notfull
    }
}
#[doc = "In-Band Interrupt (IBI) Won Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ibiwon {
    #[doc = "0: No IBI arbitration won"]
    NotWon = 0,
    #[doc = "1: IBI arbitration won"]
    Won = 1,
}
impl From<Ibiwon> for bool {
    #[inline(always)]
    fn from(variant: Ibiwon) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IBIWON` reader - In-Band Interrupt (IBI) Won Flag"]
pub type IbiwonR = crate::BitReader<Ibiwon>;
impl IbiwonR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ibiwon {
        match self.bits {
            false => Ibiwon::NotWon,
            true => Ibiwon::Won,
        }
    }
    #[doc = "No IBI arbitration won"]
    #[inline(always)]
    pub fn is_not_won(&self) -> bool {
        *self == Ibiwon::NotWon
    }
    #[doc = "IBI arbitration won"]
    #[inline(always)]
    pub fn is_won(&self) -> bool {
        *self == Ibiwon::Won
    }
}
#[doc = "Field `IBIWON` writer - In-Band Interrupt (IBI) Won Flag"]
pub type IbiwonW<'a, REG> = crate::BitWriter1C<'a, REG, Ibiwon>;
impl<'a, REG> IbiwonW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No IBI arbitration won"]
    #[inline(always)]
    pub fn not_won(self) -> &'a mut crate::W<REG> {
        self.variant(Ibiwon::NotWon)
    }
    #[doc = "IBI arbitration won"]
    #[inline(always)]
    pub fn won(self) -> &'a mut crate::W<REG> {
        self.variant(Ibiwon::Won)
    }
}
#[doc = "Error or Warning\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Errwarn {
    #[doc = "0: No error or warning"]
    NoError = 0,
    #[doc = "1: Error or warning"]
    Error = 1,
}
impl From<Errwarn> for bool {
    #[inline(always)]
    fn from(variant: Errwarn) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ERRWARN` reader - Error or Warning"]
pub type ErrwarnR = crate::BitReader<Errwarn>;
impl ErrwarnR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Errwarn {
        match self.bits {
            false => Errwarn::NoError,
            true => Errwarn::Error,
        }
    }
    #[doc = "No error or warning"]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Errwarn::NoError
    }
    #[doc = "Error or warning"]
    #[inline(always)]
    pub fn is_error(&self) -> bool {
        *self == Errwarn::Error
    }
}
#[doc = "Module is now Controller Flag\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Nowmaster {
    #[doc = "0: Not a controller"]
    NotMaster = 0,
    #[doc = "1: Controller"]
    Master = 1,
}
impl From<Nowmaster> for bool {
    #[inline(always)]
    fn from(variant: Nowmaster) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `NOWMASTER` reader - Module is now Controller Flag"]
pub type NowmasterR = crate::BitReader<Nowmaster>;
impl NowmasterR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Nowmaster {
        match self.bits {
            false => Nowmaster::NotMaster,
            true => Nowmaster::Master,
        }
    }
    #[doc = "Not a controller"]
    #[inline(always)]
    pub fn is_not_master(&self) -> bool {
        *self == Nowmaster::NotMaster
    }
    #[doc = "Controller"]
    #[inline(always)]
    pub fn is_master(&self) -> bool {
        *self == Nowmaster::Master
    }
}
#[doc = "Field `NOWMASTER` writer - Module is now Controller Flag"]
pub type NowmasterW<'a, REG> = crate::BitWriter1C<'a, REG, Nowmaster>;
impl<'a, REG> NowmasterW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Not a controller"]
    #[inline(always)]
    pub fn not_master(self) -> &'a mut crate::W<REG> {
        self.variant(Nowmaster::NotMaster)
    }
    #[doc = "Controller"]
    #[inline(always)]
    pub fn master(self) -> &'a mut crate::W<REG> {
        self.variant(Nowmaster::Master)
    }
}
#[doc = "Field `IBIADDR` reader - IBI Address"]
pub type IbiaddrR = crate::FieldReader;
impl R {
    #[doc = "Bits 0:2 - State of the Controller"]
    #[inline(always)]
    pub fn state(&self) -> StateR {
        StateR::new((self.bits & 7) as u8)
    }
    #[doc = "Bit 4 - Between"]
    #[inline(always)]
    pub fn between(&self) -> BetweenR {
        BetweenR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Not Acknowledged"]
    #[inline(always)]
    pub fn nacked(&self) -> NackedR {
        NackedR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bits 6:7 - In-Band Interrupt (IBI) Type"]
    #[inline(always)]
    pub fn ibitype(&self) -> IbitypeR {
        IbitypeR::new(((self.bits >> 6) & 3) as u8)
    }
    #[doc = "Bit 8 - Target Start Flag"]
    #[inline(always)]
    pub fn slvstart(&self) -> SlvstartR {
        SlvstartR::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Controller Control Done Flag"]
    #[inline(always)]
    pub fn mctrldone(&self) -> MctrldoneR {
        MctrldoneR::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Complete Flag"]
    #[inline(always)]
    pub fn complete(&self) -> CompleteR {
        CompleteR::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - RXPEND"]
    #[inline(always)]
    pub fn rxpend(&self) -> RxpendR {
        RxpendR::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 12 - TX Buffer or FIFO Not Full"]
    #[inline(always)]
    pub fn txnotfull(&self) -> TxnotfullR {
        TxnotfullR::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - In-Band Interrupt (IBI) Won Flag"]
    #[inline(always)]
    pub fn ibiwon(&self) -> IbiwonR {
        IbiwonR::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 15 - Error or Warning"]
    #[inline(always)]
    pub fn errwarn(&self) -> ErrwarnR {
        ErrwarnR::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bit 19 - Module is now Controller Flag"]
    #[inline(always)]
    pub fn nowmaster(&self) -> NowmasterR {
        NowmasterR::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bits 24:30 - IBI Address"]
    #[inline(always)]
    pub fn ibiaddr(&self) -> IbiaddrR {
        IbiaddrR::new(((self.bits >> 24) & 0x7f) 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("MSTATUS")
            .field("state", &self.state())
            .field("between", &self.between())
            .field("nacked", &self.nacked())
            .field("ibitype", &self.ibitype())
            .field("slvstart", &self.slvstart())
            .field("mctrldone", &self.mctrldone())
            .field("complete", &self.complete())
            .field("rxpend", &self.rxpend())
            .field("txnotfull", &self.txnotfull())
            .field("ibiwon", &self.ibiwon())
            .field("errwarn", &self.errwarn())
            .field("nowmaster", &self.nowmaster())
            .field("ibiaddr", &self.ibiaddr())
            .finish()
    }
}
impl W {
    #[doc = "Bit 8 - Target Start Flag"]
    #[inline(always)]
    pub fn slvstart(&mut self) -> SlvstartW<'_, MstatusSpec> {
        SlvstartW::new(self, 8)
    }
    #[doc = "Bit 9 - Controller Control Done Flag"]
    #[inline(always)]
    pub fn mctrldone(&mut self) -> MctrldoneW<'_, MstatusSpec> {
        MctrldoneW::new(self, 9)
    }
    #[doc = "Bit 10 - Complete Flag"]
    #[inline(always)]
    pub fn complete(&mut self) -> CompleteW<'_, MstatusSpec> {
        CompleteW::new(self, 10)
    }
    #[doc = "Bit 13 - In-Band Interrupt (IBI) Won Flag"]
    #[inline(always)]
    pub fn ibiwon(&mut self) -> IbiwonW<'_, MstatusSpec> {
        IbiwonW::new(self, 13)
    }
    #[doc = "Bit 19 - Module is now Controller Flag"]
    #[inline(always)]
    pub fn nowmaster(&mut self) -> NowmasterW<'_, MstatusSpec> {
        NowmasterW::new(self, 19)
    }
}
#[doc = "Controller Status\n\nYou can [`read`](crate::Reg::read) this register and get [`mstatus::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mstatus::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct MstatusSpec;
impl crate::RegisterSpec for MstatusSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`mstatus::R`](R) reader structure"]
impl crate::Readable for MstatusSpec {}
#[doc = "`write(|w| ..)` method takes [`mstatus::W`](W) writer structure"]
impl crate::Writable for MstatusSpec {
    type Safety = crate::Unsafe;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x0008_2700;
}
#[doc = "`reset()` method sets MSTATUS to value 0x1000"]
impl crate::Resettable for MstatusSpec {
    const RESET_VALUE: u32 = 0x1000;
}