Skip to main content

mcxa_pac/i3c0/
mstatus.rs

1#[doc = "Register `MSTATUS` reader"]
2pub type R = crate::R<MstatusSpec>;
3#[doc = "Register `MSTATUS` writer"]
4pub type W = crate::W<MstatusSpec>;
5#[doc = "State of the Controller\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8#[repr(u8)]
9pub enum State {
10    #[doc = "0: IDLE (bus has stopped)"]
11    Idle = 0,
12    #[doc = "1: SLVREQ (target request)"]
13    Slvreq = 1,
14    #[doc = "2: MSGSDR"]
15    Msgsdr = 2,
16    #[doc = "3: NORMACT"]
17    Normact = 3,
18    #[doc = "4: MSGDDR"]
19    Ddr = 4,
20    #[doc = "5: DAA"]
21    Daa = 5,
22    #[doc = "6: IBIACK"]
23    Ibiack = 6,
24    #[doc = "7: IBIRCV"]
25    Ibircv = 7,
26}
27impl From<State> for u8 {
28    #[inline(always)]
29    fn from(variant: State) -> Self {
30        variant as _
31    }
32}
33impl crate::FieldSpec for State {
34    type Ux = u8;
35}
36impl crate::IsEnum for State {}
37#[doc = "Field `STATE` reader - State of the Controller"]
38pub type StateR = crate::FieldReader<State>;
39impl StateR {
40    #[doc = "Get enumerated values variant"]
41    #[inline(always)]
42    pub const fn variant(&self) -> State {
43        match self.bits {
44            0 => State::Idle,
45            1 => State::Slvreq,
46            2 => State::Msgsdr,
47            3 => State::Normact,
48            4 => State::Ddr,
49            5 => State::Daa,
50            6 => State::Ibiack,
51            7 => State::Ibircv,
52            _ => unreachable!(),
53        }
54    }
55    #[doc = "IDLE (bus has stopped)"]
56    #[inline(always)]
57    pub fn is_idle(&self) -> bool {
58        *self == State::Idle
59    }
60    #[doc = "SLVREQ (target request)"]
61    #[inline(always)]
62    pub fn is_slvreq(&self) -> bool {
63        *self == State::Slvreq
64    }
65    #[doc = "MSGSDR"]
66    #[inline(always)]
67    pub fn is_msgsdr(&self) -> bool {
68        *self == State::Msgsdr
69    }
70    #[doc = "NORMACT"]
71    #[inline(always)]
72    pub fn is_normact(&self) -> bool {
73        *self == State::Normact
74    }
75    #[doc = "MSGDDR"]
76    #[inline(always)]
77    pub fn is_ddr(&self) -> bool {
78        *self == State::Ddr
79    }
80    #[doc = "DAA"]
81    #[inline(always)]
82    pub fn is_daa(&self) -> bool {
83        *self == State::Daa
84    }
85    #[doc = "IBIACK"]
86    #[inline(always)]
87    pub fn is_ibiack(&self) -> bool {
88        *self == State::Ibiack
89    }
90    #[doc = "IBIRCV"]
91    #[inline(always)]
92    pub fn is_ibircv(&self) -> bool {
93        *self == State::Ibircv
94    }
95}
96#[doc = "Between\n\nValue on reset: 0"]
97#[cfg_attr(feature = "defmt", derive(defmt::Format))]
98#[derive(Clone, Copy, Debug, PartialEq, Eq)]
99pub enum Between {
100    #[doc = "0: Inactive (for other cases)"]
101    Inactive = 0,
102    #[doc = "1: Active"]
103    Active = 1,
104}
105impl From<Between> for bool {
106    #[inline(always)]
107    fn from(variant: Between) -> Self {
108        variant as u8 != 0
109    }
110}
111#[doc = "Field `BETWEEN` reader - Between"]
112pub type BetweenR = crate::BitReader<Between>;
113impl BetweenR {
114    #[doc = "Get enumerated values variant"]
115    #[inline(always)]
116    pub const fn variant(&self) -> Between {
117        match self.bits {
118            false => Between::Inactive,
119            true => Between::Active,
120        }
121    }
122    #[doc = "Inactive (for other cases)"]
123    #[inline(always)]
124    pub fn is_inactive(&self) -> bool {
125        *self == Between::Inactive
126    }
127    #[doc = "Active"]
128    #[inline(always)]
129    pub fn is_active(&self) -> bool {
130        *self == Between::Active
131    }
132}
133#[doc = "Not Acknowledged\n\nValue on reset: 0"]
134#[cfg_attr(feature = "defmt", derive(defmt::Format))]
135#[derive(Clone, Copy, Debug, PartialEq, Eq)]
136pub enum Nacked {
137    #[doc = "0: Not NACKed"]
138    NotNacked = 0,
139    #[doc = "1: NACKed (not acknowledged)"]
140    Nacked = 1,
141}
142impl From<Nacked> for bool {
143    #[inline(always)]
144    fn from(variant: Nacked) -> Self {
145        variant as u8 != 0
146    }
147}
148#[doc = "Field `NACKED` reader - Not Acknowledged"]
149pub type NackedR = crate::BitReader<Nacked>;
150impl NackedR {
151    #[doc = "Get enumerated values variant"]
152    #[inline(always)]
153    pub const fn variant(&self) -> Nacked {
154        match self.bits {
155            false => Nacked::NotNacked,
156            true => Nacked::Nacked,
157        }
158    }
159    #[doc = "Not NACKed"]
160    #[inline(always)]
161    pub fn is_not_nacked(&self) -> bool {
162        *self == Nacked::NotNacked
163    }
164    #[doc = "NACKed (not acknowledged)"]
165    #[inline(always)]
166    pub fn is_nacked(&self) -> bool {
167        *self == Nacked::Nacked
168    }
169}
170#[doc = "In-Band Interrupt (IBI) Type\n\nValue on reset: 0"]
171#[cfg_attr(feature = "defmt", derive(defmt::Format))]
172#[derive(Clone, Copy, Debug, PartialEq, Eq)]
173#[repr(u8)]
174pub enum Ibitype {
175    #[doc = "0: NONE (no IBI: this status occurs when MSTATUS\\[IBIWON\\] becomes 0)"]
176    None = 0,
177    #[doc = "1: IBI"]
178    Ibi = 1,
179    #[doc = "2: CR"]
180    Mr = 2,
181    #[doc = "3: HJ"]
182    Hj = 3,
183}
184impl From<Ibitype> for u8 {
185    #[inline(always)]
186    fn from(variant: Ibitype) -> Self {
187        variant as _
188    }
189}
190impl crate::FieldSpec for Ibitype {
191    type Ux = u8;
192}
193impl crate::IsEnum for Ibitype {}
194#[doc = "Field `IBITYPE` reader - In-Band Interrupt (IBI) Type"]
195pub type IbitypeR = crate::FieldReader<Ibitype>;
196impl IbitypeR {
197    #[doc = "Get enumerated values variant"]
198    #[inline(always)]
199    pub const fn variant(&self) -> Ibitype {
200        match self.bits {
201            0 => Ibitype::None,
202            1 => Ibitype::Ibi,
203            2 => Ibitype::Mr,
204            3 => Ibitype::Hj,
205            _ => unreachable!(),
206        }
207    }
208    #[doc = "NONE (no IBI: this status occurs when MSTATUS\\[IBIWON\\] becomes 0)"]
209    #[inline(always)]
210    pub fn is_none(&self) -> bool {
211        *self == Ibitype::None
212    }
213    #[doc = "IBI"]
214    #[inline(always)]
215    pub fn is_ibi(&self) -> bool {
216        *self == Ibitype::Ibi
217    }
218    #[doc = "CR"]
219    #[inline(always)]
220    pub fn is_mr(&self) -> bool {
221        *self == Ibitype::Mr
222    }
223    #[doc = "HJ"]
224    #[inline(always)]
225    pub fn is_hj(&self) -> bool {
226        *self == Ibitype::Hj
227    }
228}
229#[doc = "Target Start Flag\n\nValue on reset: 0"]
230#[cfg_attr(feature = "defmt", derive(defmt::Format))]
231#[derive(Clone, Copy, Debug, PartialEq, Eq)]
232pub enum Slvstart {
233    #[doc = "0: Target not requesting START"]
234    NotStart = 0,
235    #[doc = "1: Target requesting START"]
236    Start = 1,
237}
238impl From<Slvstart> for bool {
239    #[inline(always)]
240    fn from(variant: Slvstart) -> Self {
241        variant as u8 != 0
242    }
243}
244#[doc = "Field `SLVSTART` reader - Target Start Flag"]
245pub type SlvstartR = crate::BitReader<Slvstart>;
246impl SlvstartR {
247    #[doc = "Get enumerated values variant"]
248    #[inline(always)]
249    pub const fn variant(&self) -> Slvstart {
250        match self.bits {
251            false => Slvstart::NotStart,
252            true => Slvstart::Start,
253        }
254    }
255    #[doc = "Target not requesting START"]
256    #[inline(always)]
257    pub fn is_not_start(&self) -> bool {
258        *self == Slvstart::NotStart
259    }
260    #[doc = "Target requesting START"]
261    #[inline(always)]
262    pub fn is_start(&self) -> bool {
263        *self == Slvstart::Start
264    }
265}
266#[doc = "Field `SLVSTART` writer - Target Start Flag"]
267pub type SlvstartW<'a, REG> = crate::BitWriter1C<'a, REG, Slvstart>;
268impl<'a, REG> SlvstartW<'a, REG>
269where
270    REG: crate::Writable + crate::RegisterSpec,
271{
272    #[doc = "Target not requesting START"]
273    #[inline(always)]
274    pub fn not_start(self) -> &'a mut crate::W<REG> {
275        self.variant(Slvstart::NotStart)
276    }
277    #[doc = "Target requesting START"]
278    #[inline(always)]
279    pub fn start(self) -> &'a mut crate::W<REG> {
280        self.variant(Slvstart::Start)
281    }
282}
283#[doc = "Controller Control Done Flag\n\nValue on reset: 0"]
284#[cfg_attr(feature = "defmt", derive(defmt::Format))]
285#[derive(Clone, Copy, Debug, PartialEq, Eq)]
286pub enum Mctrldone {
287    #[doc = "0: Not done"]
288    NotDone = 0,
289    #[doc = "1: Done"]
290    Done = 1,
291}
292impl From<Mctrldone> for bool {
293    #[inline(always)]
294    fn from(variant: Mctrldone) -> Self {
295        variant as u8 != 0
296    }
297}
298#[doc = "Field `MCTRLDONE` reader - Controller Control Done Flag"]
299pub type MctrldoneR = crate::BitReader<Mctrldone>;
300impl MctrldoneR {
301    #[doc = "Get enumerated values variant"]
302    #[inline(always)]
303    pub const fn variant(&self) -> Mctrldone {
304        match self.bits {
305            false => Mctrldone::NotDone,
306            true => Mctrldone::Done,
307        }
308    }
309    #[doc = "Not done"]
310    #[inline(always)]
311    pub fn is_not_done(&self) -> bool {
312        *self == Mctrldone::NotDone
313    }
314    #[doc = "Done"]
315    #[inline(always)]
316    pub fn is_done(&self) -> bool {
317        *self == Mctrldone::Done
318    }
319}
320#[doc = "Field `MCTRLDONE` writer - Controller Control Done Flag"]
321pub type MctrldoneW<'a, REG> = crate::BitWriter1C<'a, REG, Mctrldone>;
322impl<'a, REG> MctrldoneW<'a, REG>
323where
324    REG: crate::Writable + crate::RegisterSpec,
325{
326    #[doc = "Not done"]
327    #[inline(always)]
328    pub fn not_done(self) -> &'a mut crate::W<REG> {
329        self.variant(Mctrldone::NotDone)
330    }
331    #[doc = "Done"]
332    #[inline(always)]
333    pub fn done(self) -> &'a mut crate::W<REG> {
334        self.variant(Mctrldone::Done)
335    }
336}
337#[doc = "Complete Flag\n\nValue on reset: 0"]
338#[cfg_attr(feature = "defmt", derive(defmt::Format))]
339#[derive(Clone, Copy, Debug, PartialEq, Eq)]
340pub enum Complete {
341    #[doc = "0: Not complete"]
342    NotComplete = 0,
343    #[doc = "1: Complete"]
344    Complete = 1,
345}
346impl From<Complete> for bool {
347    #[inline(always)]
348    fn from(variant: Complete) -> Self {
349        variant as u8 != 0
350    }
351}
352#[doc = "Field `COMPLETE` reader - Complete Flag"]
353pub type CompleteR = crate::BitReader<Complete>;
354impl CompleteR {
355    #[doc = "Get enumerated values variant"]
356    #[inline(always)]
357    pub const fn variant(&self) -> Complete {
358        match self.bits {
359            false => Complete::NotComplete,
360            true => Complete::Complete,
361        }
362    }
363    #[doc = "Not complete"]
364    #[inline(always)]
365    pub fn is_not_complete(&self) -> bool {
366        *self == Complete::NotComplete
367    }
368    #[doc = "Complete"]
369    #[inline(always)]
370    pub fn is_complete(&self) -> bool {
371        *self == Complete::Complete
372    }
373}
374#[doc = "Field `COMPLETE` writer - Complete Flag"]
375pub type CompleteW<'a, REG> = crate::BitWriter1C<'a, REG, Complete>;
376impl<'a, REG> CompleteW<'a, REG>
377where
378    REG: crate::Writable + crate::RegisterSpec,
379{
380    #[doc = "Not complete"]
381    #[inline(always)]
382    pub fn not_complete(self) -> &'a mut crate::W<REG> {
383        self.variant(Complete::NotComplete)
384    }
385    #[doc = "Complete"]
386    #[inline(always)]
387    pub fn complete(self) -> &'a mut crate::W<REG> {
388        self.variant(Complete::Complete)
389    }
390}
391#[doc = "RXPEND\n\nValue on reset: 0"]
392#[cfg_attr(feature = "defmt", derive(defmt::Format))]
393#[derive(Clone, Copy, Debug, PartialEq, Eq)]
394pub enum Rxpend {
395    #[doc = "0: No receive message pending"]
396    Idle = 0,
397    #[doc = "1: Receive message pending"]
398    Pending = 1,
399}
400impl From<Rxpend> for bool {
401    #[inline(always)]
402    fn from(variant: Rxpend) -> Self {
403        variant as u8 != 0
404    }
405}
406#[doc = "Field `RXPEND` reader - RXPEND"]
407pub type RxpendR = crate::BitReader<Rxpend>;
408impl RxpendR {
409    #[doc = "Get enumerated values variant"]
410    #[inline(always)]
411    pub const fn variant(&self) -> Rxpend {
412        match self.bits {
413            false => Rxpend::Idle,
414            true => Rxpend::Pending,
415        }
416    }
417    #[doc = "No receive message pending"]
418    #[inline(always)]
419    pub fn is_idle(&self) -> bool {
420        *self == Rxpend::Idle
421    }
422    #[doc = "Receive message pending"]
423    #[inline(always)]
424    pub fn is_pending(&self) -> bool {
425        *self == Rxpend::Pending
426    }
427}
428#[doc = "TX Buffer or FIFO Not Full\n\nValue on reset: 1"]
429#[cfg_attr(feature = "defmt", derive(defmt::Format))]
430#[derive(Clone, Copy, Debug, PartialEq, Eq)]
431pub enum Txnotfull {
432    #[doc = "0: Receive buffer or FIFO full"]
433    Full = 0,
434    #[doc = "1: Receive buffer or FIFO not full"]
435    Notfull = 1,
436}
437impl From<Txnotfull> for bool {
438    #[inline(always)]
439    fn from(variant: Txnotfull) -> Self {
440        variant as u8 != 0
441    }
442}
443#[doc = "Field `TXNOTFULL` reader - TX Buffer or FIFO Not Full"]
444pub type TxnotfullR = crate::BitReader<Txnotfull>;
445impl TxnotfullR {
446    #[doc = "Get enumerated values variant"]
447    #[inline(always)]
448    pub const fn variant(&self) -> Txnotfull {
449        match self.bits {
450            false => Txnotfull::Full,
451            true => Txnotfull::Notfull,
452        }
453    }
454    #[doc = "Receive buffer or FIFO full"]
455    #[inline(always)]
456    pub fn is_full(&self) -> bool {
457        *self == Txnotfull::Full
458    }
459    #[doc = "Receive buffer or FIFO not full"]
460    #[inline(always)]
461    pub fn is_notfull(&self) -> bool {
462        *self == Txnotfull::Notfull
463    }
464}
465#[doc = "In-Band Interrupt (IBI) Won Flag\n\nValue on reset: 0"]
466#[cfg_attr(feature = "defmt", derive(defmt::Format))]
467#[derive(Clone, Copy, Debug, PartialEq, Eq)]
468pub enum Ibiwon {
469    #[doc = "0: No IBI arbitration won"]
470    NotWon = 0,
471    #[doc = "1: IBI arbitration won"]
472    Won = 1,
473}
474impl From<Ibiwon> for bool {
475    #[inline(always)]
476    fn from(variant: Ibiwon) -> Self {
477        variant as u8 != 0
478    }
479}
480#[doc = "Field `IBIWON` reader - In-Band Interrupt (IBI) Won Flag"]
481pub type IbiwonR = crate::BitReader<Ibiwon>;
482impl IbiwonR {
483    #[doc = "Get enumerated values variant"]
484    #[inline(always)]
485    pub const fn variant(&self) -> Ibiwon {
486        match self.bits {
487            false => Ibiwon::NotWon,
488            true => Ibiwon::Won,
489        }
490    }
491    #[doc = "No IBI arbitration won"]
492    #[inline(always)]
493    pub fn is_not_won(&self) -> bool {
494        *self == Ibiwon::NotWon
495    }
496    #[doc = "IBI arbitration won"]
497    #[inline(always)]
498    pub fn is_won(&self) -> bool {
499        *self == Ibiwon::Won
500    }
501}
502#[doc = "Field `IBIWON` writer - In-Band Interrupt (IBI) Won Flag"]
503pub type IbiwonW<'a, REG> = crate::BitWriter1C<'a, REG, Ibiwon>;
504impl<'a, REG> IbiwonW<'a, REG>
505where
506    REG: crate::Writable + crate::RegisterSpec,
507{
508    #[doc = "No IBI arbitration won"]
509    #[inline(always)]
510    pub fn not_won(self) -> &'a mut crate::W<REG> {
511        self.variant(Ibiwon::NotWon)
512    }
513    #[doc = "IBI arbitration won"]
514    #[inline(always)]
515    pub fn won(self) -> &'a mut crate::W<REG> {
516        self.variant(Ibiwon::Won)
517    }
518}
519#[doc = "Error or Warning\n\nValue on reset: 0"]
520#[cfg_attr(feature = "defmt", derive(defmt::Format))]
521#[derive(Clone, Copy, Debug, PartialEq, Eq)]
522pub enum Errwarn {
523    #[doc = "0: No error or warning"]
524    NoError = 0,
525    #[doc = "1: Error or warning"]
526    Error = 1,
527}
528impl From<Errwarn> for bool {
529    #[inline(always)]
530    fn from(variant: Errwarn) -> Self {
531        variant as u8 != 0
532    }
533}
534#[doc = "Field `ERRWARN` reader - Error or Warning"]
535pub type ErrwarnR = crate::BitReader<Errwarn>;
536impl ErrwarnR {
537    #[doc = "Get enumerated values variant"]
538    #[inline(always)]
539    pub const fn variant(&self) -> Errwarn {
540        match self.bits {
541            false => Errwarn::NoError,
542            true => Errwarn::Error,
543        }
544    }
545    #[doc = "No error or warning"]
546    #[inline(always)]
547    pub fn is_no_error(&self) -> bool {
548        *self == Errwarn::NoError
549    }
550    #[doc = "Error or warning"]
551    #[inline(always)]
552    pub fn is_error(&self) -> bool {
553        *self == Errwarn::Error
554    }
555}
556#[doc = "Module is now Controller Flag\n\nValue on reset: 0"]
557#[cfg_attr(feature = "defmt", derive(defmt::Format))]
558#[derive(Clone, Copy, Debug, PartialEq, Eq)]
559pub enum Nowmaster {
560    #[doc = "0: Not a controller"]
561    NotMaster = 0,
562    #[doc = "1: Controller"]
563    Master = 1,
564}
565impl From<Nowmaster> for bool {
566    #[inline(always)]
567    fn from(variant: Nowmaster) -> Self {
568        variant as u8 != 0
569    }
570}
571#[doc = "Field `NOWMASTER` reader - Module is now Controller Flag"]
572pub type NowmasterR = crate::BitReader<Nowmaster>;
573impl NowmasterR {
574    #[doc = "Get enumerated values variant"]
575    #[inline(always)]
576    pub const fn variant(&self) -> Nowmaster {
577        match self.bits {
578            false => Nowmaster::NotMaster,
579            true => Nowmaster::Master,
580        }
581    }
582    #[doc = "Not a controller"]
583    #[inline(always)]
584    pub fn is_not_master(&self) -> bool {
585        *self == Nowmaster::NotMaster
586    }
587    #[doc = "Controller"]
588    #[inline(always)]
589    pub fn is_master(&self) -> bool {
590        *self == Nowmaster::Master
591    }
592}
593#[doc = "Field `NOWMASTER` writer - Module is now Controller Flag"]
594pub type NowmasterW<'a, REG> = crate::BitWriter1C<'a, REG, Nowmaster>;
595impl<'a, REG> NowmasterW<'a, REG>
596where
597    REG: crate::Writable + crate::RegisterSpec,
598{
599    #[doc = "Not a controller"]
600    #[inline(always)]
601    pub fn not_master(self) -> &'a mut crate::W<REG> {
602        self.variant(Nowmaster::NotMaster)
603    }
604    #[doc = "Controller"]
605    #[inline(always)]
606    pub fn master(self) -> &'a mut crate::W<REG> {
607        self.variant(Nowmaster::Master)
608    }
609}
610#[doc = "Field `IBIADDR` reader - IBI Address"]
611pub type IbiaddrR = crate::FieldReader;
612impl R {
613    #[doc = "Bits 0:2 - State of the Controller"]
614    #[inline(always)]
615    pub fn state(&self) -> StateR {
616        StateR::new((self.bits & 7) as u8)
617    }
618    #[doc = "Bit 4 - Between"]
619    #[inline(always)]
620    pub fn between(&self) -> BetweenR {
621        BetweenR::new(((self.bits >> 4) & 1) != 0)
622    }
623    #[doc = "Bit 5 - Not Acknowledged"]
624    #[inline(always)]
625    pub fn nacked(&self) -> NackedR {
626        NackedR::new(((self.bits >> 5) & 1) != 0)
627    }
628    #[doc = "Bits 6:7 - In-Band Interrupt (IBI) Type"]
629    #[inline(always)]
630    pub fn ibitype(&self) -> IbitypeR {
631        IbitypeR::new(((self.bits >> 6) & 3) as u8)
632    }
633    #[doc = "Bit 8 - Target Start Flag"]
634    #[inline(always)]
635    pub fn slvstart(&self) -> SlvstartR {
636        SlvstartR::new(((self.bits >> 8) & 1) != 0)
637    }
638    #[doc = "Bit 9 - Controller Control Done Flag"]
639    #[inline(always)]
640    pub fn mctrldone(&self) -> MctrldoneR {
641        MctrldoneR::new(((self.bits >> 9) & 1) != 0)
642    }
643    #[doc = "Bit 10 - Complete Flag"]
644    #[inline(always)]
645    pub fn complete(&self) -> CompleteR {
646        CompleteR::new(((self.bits >> 10) & 1) != 0)
647    }
648    #[doc = "Bit 11 - RXPEND"]
649    #[inline(always)]
650    pub fn rxpend(&self) -> RxpendR {
651        RxpendR::new(((self.bits >> 11) & 1) != 0)
652    }
653    #[doc = "Bit 12 - TX Buffer or FIFO Not Full"]
654    #[inline(always)]
655    pub fn txnotfull(&self) -> TxnotfullR {
656        TxnotfullR::new(((self.bits >> 12) & 1) != 0)
657    }
658    #[doc = "Bit 13 - In-Band Interrupt (IBI) Won Flag"]
659    #[inline(always)]
660    pub fn ibiwon(&self) -> IbiwonR {
661        IbiwonR::new(((self.bits >> 13) & 1) != 0)
662    }
663    #[doc = "Bit 15 - Error or Warning"]
664    #[inline(always)]
665    pub fn errwarn(&self) -> ErrwarnR {
666        ErrwarnR::new(((self.bits >> 15) & 1) != 0)
667    }
668    #[doc = "Bit 19 - Module is now Controller Flag"]
669    #[inline(always)]
670    pub fn nowmaster(&self) -> NowmasterR {
671        NowmasterR::new(((self.bits >> 19) & 1) != 0)
672    }
673    #[doc = "Bits 24:30 - IBI Address"]
674    #[inline(always)]
675    pub fn ibiaddr(&self) -> IbiaddrR {
676        IbiaddrR::new(((self.bits >> 24) & 0x7f) as u8)
677    }
678}
679#[cfg(feature = "debug")]
680impl core::fmt::Debug for R {
681    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
682        f.debug_struct("MSTATUS")
683            .field("state", &self.state())
684            .field("between", &self.between())
685            .field("nacked", &self.nacked())
686            .field("ibitype", &self.ibitype())
687            .field("slvstart", &self.slvstart())
688            .field("mctrldone", &self.mctrldone())
689            .field("complete", &self.complete())
690            .field("rxpend", &self.rxpend())
691            .field("txnotfull", &self.txnotfull())
692            .field("ibiwon", &self.ibiwon())
693            .field("errwarn", &self.errwarn())
694            .field("nowmaster", &self.nowmaster())
695            .field("ibiaddr", &self.ibiaddr())
696            .finish()
697    }
698}
699impl W {
700    #[doc = "Bit 8 - Target Start Flag"]
701    #[inline(always)]
702    pub fn slvstart(&mut self) -> SlvstartW<'_, MstatusSpec> {
703        SlvstartW::new(self, 8)
704    }
705    #[doc = "Bit 9 - Controller Control Done Flag"]
706    #[inline(always)]
707    pub fn mctrldone(&mut self) -> MctrldoneW<'_, MstatusSpec> {
708        MctrldoneW::new(self, 9)
709    }
710    #[doc = "Bit 10 - Complete Flag"]
711    #[inline(always)]
712    pub fn complete(&mut self) -> CompleteW<'_, MstatusSpec> {
713        CompleteW::new(self, 10)
714    }
715    #[doc = "Bit 13 - In-Band Interrupt (IBI) Won Flag"]
716    #[inline(always)]
717    pub fn ibiwon(&mut self) -> IbiwonW<'_, MstatusSpec> {
718        IbiwonW::new(self, 13)
719    }
720    #[doc = "Bit 19 - Module is now Controller Flag"]
721    #[inline(always)]
722    pub fn nowmaster(&mut self) -> NowmasterW<'_, MstatusSpec> {
723        NowmasterW::new(self, 19)
724    }
725}
726#[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)."]
727pub struct MstatusSpec;
728impl crate::RegisterSpec for MstatusSpec {
729    type Ux = u32;
730}
731#[doc = "`read()` method returns [`mstatus::R`](R) reader structure"]
732impl crate::Readable for MstatusSpec {}
733#[doc = "`write(|w| ..)` method takes [`mstatus::W`](W) writer structure"]
734impl crate::Writable for MstatusSpec {
735    type Safety = crate::Unsafe;
736    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x0008_2700;
737}
738#[doc = "`reset()` method sets MSTATUS to value 0x1000"]
739impl crate::Resettable for MstatusSpec {
740    const RESET_VALUE: u32 = 0x1000;
741}