s32k144/lpi2c0/
msr.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7    bits: u32,
8}
9impl super::MSR {
10    #[doc = r" Modifies the contents of the register"]
11    #[inline]
12    pub fn modify<F>(&self, f: F)
13    where
14        for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15    {
16        let bits = self.register.get();
17        let r = R { bits: bits };
18        let mut w = W { bits: bits };
19        f(&r, &mut w);
20        self.register.set(w.bits);
21    }
22    #[doc = r" Reads the contents of the register"]
23    #[inline]
24    pub fn read(&self) -> R {
25        R { bits: self.register.get() }
26    }
27    #[doc = r" Writes to the register"]
28    #[inline]
29    pub fn write<F>(&self, f: F)
30    where
31        F: FnOnce(&mut W) -> &mut W,
32    {
33        let mut w = W::reset_value();
34        f(&mut w);
35        self.register.set(w.bits);
36    }
37    #[doc = r" Writes the reset value to the register"]
38    #[inline]
39    pub fn reset(&self) {
40        self.write(|w| w)
41    }
42}
43#[doc = "Possible values of the field `TDF`"]
44#[derive(Clone, Copy, Debug, PartialEq)]
45pub enum TDFR {
46    #[doc = "Transmit data not requested."]
47    _0,
48    #[doc = "Transmit data is requested."]
49    _1,
50}
51impl TDFR {
52    #[doc = r" Returns `true` if the bit is clear (0)"]
53    #[inline]
54    pub fn bit_is_clear(&self) -> bool {
55        !self.bit()
56    }
57    #[doc = r" Returns `true` if the bit is set (1)"]
58    #[inline]
59    pub fn bit_is_set(&self) -> bool {
60        self.bit()
61    }
62    #[doc = r" Value of the field as raw bits"]
63    #[inline]
64    pub fn bit(&self) -> bool {
65        match *self {
66            TDFR::_0 => false,
67            TDFR::_1 => true,
68        }
69    }
70    #[allow(missing_docs)]
71    #[doc(hidden)]
72    #[inline]
73    pub fn _from(value: bool) -> TDFR {
74        match value {
75            false => TDFR::_0,
76            true => TDFR::_1,
77        }
78    }
79    #[doc = "Checks if the value of the field is `_0`"]
80    #[inline]
81    pub fn is_0(&self) -> bool {
82        *self == TDFR::_0
83    }
84    #[doc = "Checks if the value of the field is `_1`"]
85    #[inline]
86    pub fn is_1(&self) -> bool {
87        *self == TDFR::_1
88    }
89}
90#[doc = "Possible values of the field `RDF`"]
91#[derive(Clone, Copy, Debug, PartialEq)]
92pub enum RDFR {
93    #[doc = "Receive Data is not ready."]
94    _0,
95    #[doc = "Receive data is ready."]
96    _1,
97}
98impl RDFR {
99    #[doc = r" Returns `true` if the bit is clear (0)"]
100    #[inline]
101    pub fn bit_is_clear(&self) -> bool {
102        !self.bit()
103    }
104    #[doc = r" Returns `true` if the bit is set (1)"]
105    #[inline]
106    pub fn bit_is_set(&self) -> bool {
107        self.bit()
108    }
109    #[doc = r" Value of the field as raw bits"]
110    #[inline]
111    pub fn bit(&self) -> bool {
112        match *self {
113            RDFR::_0 => false,
114            RDFR::_1 => true,
115        }
116    }
117    #[allow(missing_docs)]
118    #[doc(hidden)]
119    #[inline]
120    pub fn _from(value: bool) -> RDFR {
121        match value {
122            false => RDFR::_0,
123            true => RDFR::_1,
124        }
125    }
126    #[doc = "Checks if the value of the field is `_0`"]
127    #[inline]
128    pub fn is_0(&self) -> bool {
129        *self == RDFR::_0
130    }
131    #[doc = "Checks if the value of the field is `_1`"]
132    #[inline]
133    pub fn is_1(&self) -> bool {
134        *self == RDFR::_1
135    }
136}
137#[doc = "Possible values of the field `EPF`"]
138#[derive(Clone, Copy, Debug, PartialEq)]
139pub enum EPFR {
140    #[doc = "Master has not generated a STOP or Repeated START condition."]
141    _0,
142    #[doc = "Master has generated a STOP or Repeated START condition."]
143    _1,
144}
145impl EPFR {
146    #[doc = r" Returns `true` if the bit is clear (0)"]
147    #[inline]
148    pub fn bit_is_clear(&self) -> bool {
149        !self.bit()
150    }
151    #[doc = r" Returns `true` if the bit is set (1)"]
152    #[inline]
153    pub fn bit_is_set(&self) -> bool {
154        self.bit()
155    }
156    #[doc = r" Value of the field as raw bits"]
157    #[inline]
158    pub fn bit(&self) -> bool {
159        match *self {
160            EPFR::_0 => false,
161            EPFR::_1 => true,
162        }
163    }
164    #[allow(missing_docs)]
165    #[doc(hidden)]
166    #[inline]
167    pub fn _from(value: bool) -> EPFR {
168        match value {
169            false => EPFR::_0,
170            true => EPFR::_1,
171        }
172    }
173    #[doc = "Checks if the value of the field is `_0`"]
174    #[inline]
175    pub fn is_0(&self) -> bool {
176        *self == EPFR::_0
177    }
178    #[doc = "Checks if the value of the field is `_1`"]
179    #[inline]
180    pub fn is_1(&self) -> bool {
181        *self == EPFR::_1
182    }
183}
184#[doc = "Possible values of the field `SDF`"]
185#[derive(Clone, Copy, Debug, PartialEq)]
186pub enum SDFR {
187    #[doc = "Master has not generated a STOP condition."]
188    _0,
189    #[doc = "Master has generated a STOP condition."]
190    _1,
191}
192impl SDFR {
193    #[doc = r" Returns `true` if the bit is clear (0)"]
194    #[inline]
195    pub fn bit_is_clear(&self) -> bool {
196        !self.bit()
197    }
198    #[doc = r" Returns `true` if the bit is set (1)"]
199    #[inline]
200    pub fn bit_is_set(&self) -> bool {
201        self.bit()
202    }
203    #[doc = r" Value of the field as raw bits"]
204    #[inline]
205    pub fn bit(&self) -> bool {
206        match *self {
207            SDFR::_0 => false,
208            SDFR::_1 => true,
209        }
210    }
211    #[allow(missing_docs)]
212    #[doc(hidden)]
213    #[inline]
214    pub fn _from(value: bool) -> SDFR {
215        match value {
216            false => SDFR::_0,
217            true => SDFR::_1,
218        }
219    }
220    #[doc = "Checks if the value of the field is `_0`"]
221    #[inline]
222    pub fn is_0(&self) -> bool {
223        *self == SDFR::_0
224    }
225    #[doc = "Checks if the value of the field is `_1`"]
226    #[inline]
227    pub fn is_1(&self) -> bool {
228        *self == SDFR::_1
229    }
230}
231#[doc = "Possible values of the field `NDF`"]
232#[derive(Clone, Copy, Debug, PartialEq)]
233pub enum NDFR {
234    #[doc = "Unexpected NACK not detected."]
235    _0,
236    #[doc = "Unexpected NACK was detected."]
237    _1,
238}
239impl NDFR {
240    #[doc = r" Returns `true` if the bit is clear (0)"]
241    #[inline]
242    pub fn bit_is_clear(&self) -> bool {
243        !self.bit()
244    }
245    #[doc = r" Returns `true` if the bit is set (1)"]
246    #[inline]
247    pub fn bit_is_set(&self) -> bool {
248        self.bit()
249    }
250    #[doc = r" Value of the field as raw bits"]
251    #[inline]
252    pub fn bit(&self) -> bool {
253        match *self {
254            NDFR::_0 => false,
255            NDFR::_1 => true,
256        }
257    }
258    #[allow(missing_docs)]
259    #[doc(hidden)]
260    #[inline]
261    pub fn _from(value: bool) -> NDFR {
262        match value {
263            false => NDFR::_0,
264            true => NDFR::_1,
265        }
266    }
267    #[doc = "Checks if the value of the field is `_0`"]
268    #[inline]
269    pub fn is_0(&self) -> bool {
270        *self == NDFR::_0
271    }
272    #[doc = "Checks if the value of the field is `_1`"]
273    #[inline]
274    pub fn is_1(&self) -> bool {
275        *self == NDFR::_1
276    }
277}
278#[doc = "Possible values of the field `ALF`"]
279#[derive(Clone, Copy, Debug, PartialEq)]
280pub enum ALFR {
281    #[doc = "Master has not lost arbitration."]
282    _0,
283    #[doc = "Master has lost arbitration."]
284    _1,
285}
286impl ALFR {
287    #[doc = r" Returns `true` if the bit is clear (0)"]
288    #[inline]
289    pub fn bit_is_clear(&self) -> bool {
290        !self.bit()
291    }
292    #[doc = r" Returns `true` if the bit is set (1)"]
293    #[inline]
294    pub fn bit_is_set(&self) -> bool {
295        self.bit()
296    }
297    #[doc = r" Value of the field as raw bits"]
298    #[inline]
299    pub fn bit(&self) -> bool {
300        match *self {
301            ALFR::_0 => false,
302            ALFR::_1 => true,
303        }
304    }
305    #[allow(missing_docs)]
306    #[doc(hidden)]
307    #[inline]
308    pub fn _from(value: bool) -> ALFR {
309        match value {
310            false => ALFR::_0,
311            true => ALFR::_1,
312        }
313    }
314    #[doc = "Checks if the value of the field is `_0`"]
315    #[inline]
316    pub fn is_0(&self) -> bool {
317        *self == ALFR::_0
318    }
319    #[doc = "Checks if the value of the field is `_1`"]
320    #[inline]
321    pub fn is_1(&self) -> bool {
322        *self == ALFR::_1
323    }
324}
325#[doc = "Possible values of the field `FEF`"]
326#[derive(Clone, Copy, Debug, PartialEq)]
327pub enum FEFR {
328    #[doc = "No error."]
329    _0,
330    #[doc = "Master sending or receiving data without START condition."]
331    _1,
332}
333impl FEFR {
334    #[doc = r" Returns `true` if the bit is clear (0)"]
335    #[inline]
336    pub fn bit_is_clear(&self) -> bool {
337        !self.bit()
338    }
339    #[doc = r" Returns `true` if the bit is set (1)"]
340    #[inline]
341    pub fn bit_is_set(&self) -> bool {
342        self.bit()
343    }
344    #[doc = r" Value of the field as raw bits"]
345    #[inline]
346    pub fn bit(&self) -> bool {
347        match *self {
348            FEFR::_0 => false,
349            FEFR::_1 => true,
350        }
351    }
352    #[allow(missing_docs)]
353    #[doc(hidden)]
354    #[inline]
355    pub fn _from(value: bool) -> FEFR {
356        match value {
357            false => FEFR::_0,
358            true => FEFR::_1,
359        }
360    }
361    #[doc = "Checks if the value of the field is `_0`"]
362    #[inline]
363    pub fn is_0(&self) -> bool {
364        *self == FEFR::_0
365    }
366    #[doc = "Checks if the value of the field is `_1`"]
367    #[inline]
368    pub fn is_1(&self) -> bool {
369        *self == FEFR::_1
370    }
371}
372#[doc = "Possible values of the field `PLTF`"]
373#[derive(Clone, Copy, Debug, PartialEq)]
374pub enum PLTFR {
375    #[doc = "Pin low timeout has not occurred or is disabled."]
376    _0,
377    #[doc = "Pin low timeout has occurred."]
378    _1,
379}
380impl PLTFR {
381    #[doc = r" Returns `true` if the bit is clear (0)"]
382    #[inline]
383    pub fn bit_is_clear(&self) -> bool {
384        !self.bit()
385    }
386    #[doc = r" Returns `true` if the bit is set (1)"]
387    #[inline]
388    pub fn bit_is_set(&self) -> bool {
389        self.bit()
390    }
391    #[doc = r" Value of the field as raw bits"]
392    #[inline]
393    pub fn bit(&self) -> bool {
394        match *self {
395            PLTFR::_0 => false,
396            PLTFR::_1 => true,
397        }
398    }
399    #[allow(missing_docs)]
400    #[doc(hidden)]
401    #[inline]
402    pub fn _from(value: bool) -> PLTFR {
403        match value {
404            false => PLTFR::_0,
405            true => PLTFR::_1,
406        }
407    }
408    #[doc = "Checks if the value of the field is `_0`"]
409    #[inline]
410    pub fn is_0(&self) -> bool {
411        *self == PLTFR::_0
412    }
413    #[doc = "Checks if the value of the field is `_1`"]
414    #[inline]
415    pub fn is_1(&self) -> bool {
416        *self == PLTFR::_1
417    }
418}
419#[doc = "Possible values of the field `DMF`"]
420#[derive(Clone, Copy, Debug, PartialEq)]
421pub enum DMFR {
422    #[doc = "Have not received matching data."]
423    _0,
424    #[doc = "Have received matching data."]
425    _1,
426}
427impl DMFR {
428    #[doc = r" Returns `true` if the bit is clear (0)"]
429    #[inline]
430    pub fn bit_is_clear(&self) -> bool {
431        !self.bit()
432    }
433    #[doc = r" Returns `true` if the bit is set (1)"]
434    #[inline]
435    pub fn bit_is_set(&self) -> bool {
436        self.bit()
437    }
438    #[doc = r" Value of the field as raw bits"]
439    #[inline]
440    pub fn bit(&self) -> bool {
441        match *self {
442            DMFR::_0 => false,
443            DMFR::_1 => true,
444        }
445    }
446    #[allow(missing_docs)]
447    #[doc(hidden)]
448    #[inline]
449    pub fn _from(value: bool) -> DMFR {
450        match value {
451            false => DMFR::_0,
452            true => DMFR::_1,
453        }
454    }
455    #[doc = "Checks if the value of the field is `_0`"]
456    #[inline]
457    pub fn is_0(&self) -> bool {
458        *self == DMFR::_0
459    }
460    #[doc = "Checks if the value of the field is `_1`"]
461    #[inline]
462    pub fn is_1(&self) -> bool {
463        *self == DMFR::_1
464    }
465}
466#[doc = "Possible values of the field `MBF`"]
467#[derive(Clone, Copy, Debug, PartialEq)]
468pub enum MBFR {
469    #[doc = "I2C Master is idle."]
470    _0,
471    #[doc = "I2C Master is busy."]
472    _1,
473}
474impl MBFR {
475    #[doc = r" Returns `true` if the bit is clear (0)"]
476    #[inline]
477    pub fn bit_is_clear(&self) -> bool {
478        !self.bit()
479    }
480    #[doc = r" Returns `true` if the bit is set (1)"]
481    #[inline]
482    pub fn bit_is_set(&self) -> bool {
483        self.bit()
484    }
485    #[doc = r" Value of the field as raw bits"]
486    #[inline]
487    pub fn bit(&self) -> bool {
488        match *self {
489            MBFR::_0 => false,
490            MBFR::_1 => true,
491        }
492    }
493    #[allow(missing_docs)]
494    #[doc(hidden)]
495    #[inline]
496    pub fn _from(value: bool) -> MBFR {
497        match value {
498            false => MBFR::_0,
499            true => MBFR::_1,
500        }
501    }
502    #[doc = "Checks if the value of the field is `_0`"]
503    #[inline]
504    pub fn is_0(&self) -> bool {
505        *self == MBFR::_0
506    }
507    #[doc = "Checks if the value of the field is `_1`"]
508    #[inline]
509    pub fn is_1(&self) -> bool {
510        *self == MBFR::_1
511    }
512}
513#[doc = "Possible values of the field `BBF`"]
514#[derive(Clone, Copy, Debug, PartialEq)]
515pub enum BBFR {
516    #[doc = "I2C Bus is idle."]
517    _0,
518    #[doc = "I2C Bus is busy."]
519    _1,
520}
521impl BBFR {
522    #[doc = r" Returns `true` if the bit is clear (0)"]
523    #[inline]
524    pub fn bit_is_clear(&self) -> bool {
525        !self.bit()
526    }
527    #[doc = r" Returns `true` if the bit is set (1)"]
528    #[inline]
529    pub fn bit_is_set(&self) -> bool {
530        self.bit()
531    }
532    #[doc = r" Value of the field as raw bits"]
533    #[inline]
534    pub fn bit(&self) -> bool {
535        match *self {
536            BBFR::_0 => false,
537            BBFR::_1 => true,
538        }
539    }
540    #[allow(missing_docs)]
541    #[doc(hidden)]
542    #[inline]
543    pub fn _from(value: bool) -> BBFR {
544        match value {
545            false => BBFR::_0,
546            true => BBFR::_1,
547        }
548    }
549    #[doc = "Checks if the value of the field is `_0`"]
550    #[inline]
551    pub fn is_0(&self) -> bool {
552        *self == BBFR::_0
553    }
554    #[doc = "Checks if the value of the field is `_1`"]
555    #[inline]
556    pub fn is_1(&self) -> bool {
557        *self == BBFR::_1
558    }
559}
560#[doc = "Values that can be written to the field `EPF`"]
561pub enum EPFW {
562    #[doc = "Master has not generated a STOP or Repeated START condition."]
563    _0,
564    #[doc = "Master has generated a STOP or Repeated START condition."]
565    _1,
566}
567impl EPFW {
568    #[allow(missing_docs)]
569    #[doc(hidden)]
570    #[inline]
571    pub fn _bits(&self) -> bool {
572        match *self {
573            EPFW::_0 => false,
574            EPFW::_1 => true,
575        }
576    }
577}
578#[doc = r" Proxy"]
579pub struct _EPFW<'a> {
580    w: &'a mut W,
581}
582impl<'a> _EPFW<'a> {
583    #[doc = r" Writes `variant` to the field"]
584    #[inline]
585    pub fn variant(self, variant: EPFW) -> &'a mut W {
586        {
587            self.bit(variant._bits())
588        }
589    }
590    #[doc = "Master has not generated a STOP or Repeated START condition."]
591    #[inline]
592    pub fn _0(self) -> &'a mut W {
593        self.variant(EPFW::_0)
594    }
595    #[doc = "Master has generated a STOP or Repeated START condition."]
596    #[inline]
597    pub fn _1(self) -> &'a mut W {
598        self.variant(EPFW::_1)
599    }
600    #[doc = r" Sets the field bit"]
601    pub fn set_bit(self) -> &'a mut W {
602        self.bit(true)
603    }
604    #[doc = r" Clears the field bit"]
605    pub fn clear_bit(self) -> &'a mut W {
606        self.bit(false)
607    }
608    #[doc = r" Writes raw bits to the field"]
609    #[inline]
610    pub fn bit(self, value: bool) -> &'a mut W {
611        const MASK: bool = true;
612        const OFFSET: u8 = 8;
613        self.w.bits &= !((MASK as u32) << OFFSET);
614        self.w.bits |= ((value & MASK) as u32) << OFFSET;
615        self.w
616    }
617}
618#[doc = "Values that can be written to the field `SDF`"]
619pub enum SDFW {
620    #[doc = "Master has not generated a STOP condition."]
621    _0,
622    #[doc = "Master has generated a STOP condition."]
623    _1,
624}
625impl SDFW {
626    #[allow(missing_docs)]
627    #[doc(hidden)]
628    #[inline]
629    pub fn _bits(&self) -> bool {
630        match *self {
631            SDFW::_0 => false,
632            SDFW::_1 => true,
633        }
634    }
635}
636#[doc = r" Proxy"]
637pub struct _SDFW<'a> {
638    w: &'a mut W,
639}
640impl<'a> _SDFW<'a> {
641    #[doc = r" Writes `variant` to the field"]
642    #[inline]
643    pub fn variant(self, variant: SDFW) -> &'a mut W {
644        {
645            self.bit(variant._bits())
646        }
647    }
648    #[doc = "Master has not generated a STOP condition."]
649    #[inline]
650    pub fn _0(self) -> &'a mut W {
651        self.variant(SDFW::_0)
652    }
653    #[doc = "Master has generated a STOP condition."]
654    #[inline]
655    pub fn _1(self) -> &'a mut W {
656        self.variant(SDFW::_1)
657    }
658    #[doc = r" Sets the field bit"]
659    pub fn set_bit(self) -> &'a mut W {
660        self.bit(true)
661    }
662    #[doc = r" Clears the field bit"]
663    pub fn clear_bit(self) -> &'a mut W {
664        self.bit(false)
665    }
666    #[doc = r" Writes raw bits to the field"]
667    #[inline]
668    pub fn bit(self, value: bool) -> &'a mut W {
669        const MASK: bool = true;
670        const OFFSET: u8 = 9;
671        self.w.bits &= !((MASK as u32) << OFFSET);
672        self.w.bits |= ((value & MASK) as u32) << OFFSET;
673        self.w
674    }
675}
676#[doc = "Values that can be written to the field `NDF`"]
677pub enum NDFW {
678    #[doc = "Unexpected NACK not detected."]
679    _0,
680    #[doc = "Unexpected NACK was detected."]
681    _1,
682}
683impl NDFW {
684    #[allow(missing_docs)]
685    #[doc(hidden)]
686    #[inline]
687    pub fn _bits(&self) -> bool {
688        match *self {
689            NDFW::_0 => false,
690            NDFW::_1 => true,
691        }
692    }
693}
694#[doc = r" Proxy"]
695pub struct _NDFW<'a> {
696    w: &'a mut W,
697}
698impl<'a> _NDFW<'a> {
699    #[doc = r" Writes `variant` to the field"]
700    #[inline]
701    pub fn variant(self, variant: NDFW) -> &'a mut W {
702        {
703            self.bit(variant._bits())
704        }
705    }
706    #[doc = "Unexpected NACK not detected."]
707    #[inline]
708    pub fn _0(self) -> &'a mut W {
709        self.variant(NDFW::_0)
710    }
711    #[doc = "Unexpected NACK was detected."]
712    #[inline]
713    pub fn _1(self) -> &'a mut W {
714        self.variant(NDFW::_1)
715    }
716    #[doc = r" Sets the field bit"]
717    pub fn set_bit(self) -> &'a mut W {
718        self.bit(true)
719    }
720    #[doc = r" Clears the field bit"]
721    pub fn clear_bit(self) -> &'a mut W {
722        self.bit(false)
723    }
724    #[doc = r" Writes raw bits to the field"]
725    #[inline]
726    pub fn bit(self, value: bool) -> &'a mut W {
727        const MASK: bool = true;
728        const OFFSET: u8 = 10;
729        self.w.bits &= !((MASK as u32) << OFFSET);
730        self.w.bits |= ((value & MASK) as u32) << OFFSET;
731        self.w
732    }
733}
734#[doc = "Values that can be written to the field `ALF`"]
735pub enum ALFW {
736    #[doc = "Master has not lost arbitration."]
737    _0,
738    #[doc = "Master has lost arbitration."]
739    _1,
740}
741impl ALFW {
742    #[allow(missing_docs)]
743    #[doc(hidden)]
744    #[inline]
745    pub fn _bits(&self) -> bool {
746        match *self {
747            ALFW::_0 => false,
748            ALFW::_1 => true,
749        }
750    }
751}
752#[doc = r" Proxy"]
753pub struct _ALFW<'a> {
754    w: &'a mut W,
755}
756impl<'a> _ALFW<'a> {
757    #[doc = r" Writes `variant` to the field"]
758    #[inline]
759    pub fn variant(self, variant: ALFW) -> &'a mut W {
760        {
761            self.bit(variant._bits())
762        }
763    }
764    #[doc = "Master has not lost arbitration."]
765    #[inline]
766    pub fn _0(self) -> &'a mut W {
767        self.variant(ALFW::_0)
768    }
769    #[doc = "Master has lost arbitration."]
770    #[inline]
771    pub fn _1(self) -> &'a mut W {
772        self.variant(ALFW::_1)
773    }
774    #[doc = r" Sets the field bit"]
775    pub fn set_bit(self) -> &'a mut W {
776        self.bit(true)
777    }
778    #[doc = r" Clears the field bit"]
779    pub fn clear_bit(self) -> &'a mut W {
780        self.bit(false)
781    }
782    #[doc = r" Writes raw bits to the field"]
783    #[inline]
784    pub fn bit(self, value: bool) -> &'a mut W {
785        const MASK: bool = true;
786        const OFFSET: u8 = 11;
787        self.w.bits &= !((MASK as u32) << OFFSET);
788        self.w.bits |= ((value & MASK) as u32) << OFFSET;
789        self.w
790    }
791}
792#[doc = "Values that can be written to the field `FEF`"]
793pub enum FEFW {
794    #[doc = "No error."]
795    _0,
796    #[doc = "Master sending or receiving data without START condition."]
797    _1,
798}
799impl FEFW {
800    #[allow(missing_docs)]
801    #[doc(hidden)]
802    #[inline]
803    pub fn _bits(&self) -> bool {
804        match *self {
805            FEFW::_0 => false,
806            FEFW::_1 => true,
807        }
808    }
809}
810#[doc = r" Proxy"]
811pub struct _FEFW<'a> {
812    w: &'a mut W,
813}
814impl<'a> _FEFW<'a> {
815    #[doc = r" Writes `variant` to the field"]
816    #[inline]
817    pub fn variant(self, variant: FEFW) -> &'a mut W {
818        {
819            self.bit(variant._bits())
820        }
821    }
822    #[doc = "No error."]
823    #[inline]
824    pub fn _0(self) -> &'a mut W {
825        self.variant(FEFW::_0)
826    }
827    #[doc = "Master sending or receiving data without START condition."]
828    #[inline]
829    pub fn _1(self) -> &'a mut W {
830        self.variant(FEFW::_1)
831    }
832    #[doc = r" Sets the field bit"]
833    pub fn set_bit(self) -> &'a mut W {
834        self.bit(true)
835    }
836    #[doc = r" Clears the field bit"]
837    pub fn clear_bit(self) -> &'a mut W {
838        self.bit(false)
839    }
840    #[doc = r" Writes raw bits to the field"]
841    #[inline]
842    pub fn bit(self, value: bool) -> &'a mut W {
843        const MASK: bool = true;
844        const OFFSET: u8 = 12;
845        self.w.bits &= !((MASK as u32) << OFFSET);
846        self.w.bits |= ((value & MASK) as u32) << OFFSET;
847        self.w
848    }
849}
850#[doc = "Values that can be written to the field `PLTF`"]
851pub enum PLTFW {
852    #[doc = "Pin low timeout has not occurred or is disabled."]
853    _0,
854    #[doc = "Pin low timeout has occurred."]
855    _1,
856}
857impl PLTFW {
858    #[allow(missing_docs)]
859    #[doc(hidden)]
860    #[inline]
861    pub fn _bits(&self) -> bool {
862        match *self {
863            PLTFW::_0 => false,
864            PLTFW::_1 => true,
865        }
866    }
867}
868#[doc = r" Proxy"]
869pub struct _PLTFW<'a> {
870    w: &'a mut W,
871}
872impl<'a> _PLTFW<'a> {
873    #[doc = r" Writes `variant` to the field"]
874    #[inline]
875    pub fn variant(self, variant: PLTFW) -> &'a mut W {
876        {
877            self.bit(variant._bits())
878        }
879    }
880    #[doc = "Pin low timeout has not occurred or is disabled."]
881    #[inline]
882    pub fn _0(self) -> &'a mut W {
883        self.variant(PLTFW::_0)
884    }
885    #[doc = "Pin low timeout has occurred."]
886    #[inline]
887    pub fn _1(self) -> &'a mut W {
888        self.variant(PLTFW::_1)
889    }
890    #[doc = r" Sets the field bit"]
891    pub fn set_bit(self) -> &'a mut W {
892        self.bit(true)
893    }
894    #[doc = r" Clears the field bit"]
895    pub fn clear_bit(self) -> &'a mut W {
896        self.bit(false)
897    }
898    #[doc = r" Writes raw bits to the field"]
899    #[inline]
900    pub fn bit(self, value: bool) -> &'a mut W {
901        const MASK: bool = true;
902        const OFFSET: u8 = 13;
903        self.w.bits &= !((MASK as u32) << OFFSET);
904        self.w.bits |= ((value & MASK) as u32) << OFFSET;
905        self.w
906    }
907}
908#[doc = "Values that can be written to the field `DMF`"]
909pub enum DMFW {
910    #[doc = "Have not received matching data."]
911    _0,
912    #[doc = "Have received matching data."]
913    _1,
914}
915impl DMFW {
916    #[allow(missing_docs)]
917    #[doc(hidden)]
918    #[inline]
919    pub fn _bits(&self) -> bool {
920        match *self {
921            DMFW::_0 => false,
922            DMFW::_1 => true,
923        }
924    }
925}
926#[doc = r" Proxy"]
927pub struct _DMFW<'a> {
928    w: &'a mut W,
929}
930impl<'a> _DMFW<'a> {
931    #[doc = r" Writes `variant` to the field"]
932    #[inline]
933    pub fn variant(self, variant: DMFW) -> &'a mut W {
934        {
935            self.bit(variant._bits())
936        }
937    }
938    #[doc = "Have not received matching data."]
939    #[inline]
940    pub fn _0(self) -> &'a mut W {
941        self.variant(DMFW::_0)
942    }
943    #[doc = "Have received matching data."]
944    #[inline]
945    pub fn _1(self) -> &'a mut W {
946        self.variant(DMFW::_1)
947    }
948    #[doc = r" Sets the field bit"]
949    pub fn set_bit(self) -> &'a mut W {
950        self.bit(true)
951    }
952    #[doc = r" Clears the field bit"]
953    pub fn clear_bit(self) -> &'a mut W {
954        self.bit(false)
955    }
956    #[doc = r" Writes raw bits to the field"]
957    #[inline]
958    pub fn bit(self, value: bool) -> &'a mut W {
959        const MASK: bool = true;
960        const OFFSET: u8 = 14;
961        self.w.bits &= !((MASK as u32) << OFFSET);
962        self.w.bits |= ((value & MASK) as u32) << OFFSET;
963        self.w
964    }
965}
966impl R {
967    #[doc = r" Value of the register as raw bits"]
968    #[inline]
969    pub fn bits(&self) -> u32 {
970        self.bits
971    }
972    #[doc = "Bit 0 - Transmit Data Flag"]
973    #[inline]
974    pub fn tdf(&self) -> TDFR {
975        TDFR::_from({
976            const MASK: bool = true;
977            const OFFSET: u8 = 0;
978            ((self.bits >> OFFSET) & MASK as u32) != 0
979        })
980    }
981    #[doc = "Bit 1 - Receive Data Flag"]
982    #[inline]
983    pub fn rdf(&self) -> RDFR {
984        RDFR::_from({
985            const MASK: bool = true;
986            const OFFSET: u8 = 1;
987            ((self.bits >> OFFSET) & MASK as u32) != 0
988        })
989    }
990    #[doc = "Bit 8 - End Packet Flag"]
991    #[inline]
992    pub fn epf(&self) -> EPFR {
993        EPFR::_from({
994            const MASK: bool = true;
995            const OFFSET: u8 = 8;
996            ((self.bits >> OFFSET) & MASK as u32) != 0
997        })
998    }
999    #[doc = "Bit 9 - STOP Detect Flag"]
1000    #[inline]
1001    pub fn sdf(&self) -> SDFR {
1002        SDFR::_from({
1003            const MASK: bool = true;
1004            const OFFSET: u8 = 9;
1005            ((self.bits >> OFFSET) & MASK as u32) != 0
1006        })
1007    }
1008    #[doc = "Bit 10 - NACK Detect Flag"]
1009    #[inline]
1010    pub fn ndf(&self) -> NDFR {
1011        NDFR::_from({
1012            const MASK: bool = true;
1013            const OFFSET: u8 = 10;
1014            ((self.bits >> OFFSET) & MASK as u32) != 0
1015        })
1016    }
1017    #[doc = "Bit 11 - Arbitration Lost Flag"]
1018    #[inline]
1019    pub fn alf(&self) -> ALFR {
1020        ALFR::_from({
1021            const MASK: bool = true;
1022            const OFFSET: u8 = 11;
1023            ((self.bits >> OFFSET) & MASK as u32) != 0
1024        })
1025    }
1026    #[doc = "Bit 12 - FIFO Error Flag"]
1027    #[inline]
1028    pub fn fef(&self) -> FEFR {
1029        FEFR::_from({
1030            const MASK: bool = true;
1031            const OFFSET: u8 = 12;
1032            ((self.bits >> OFFSET) & MASK as u32) != 0
1033        })
1034    }
1035    #[doc = "Bit 13 - Pin Low Timeout Flag"]
1036    #[inline]
1037    pub fn pltf(&self) -> PLTFR {
1038        PLTFR::_from({
1039            const MASK: bool = true;
1040            const OFFSET: u8 = 13;
1041            ((self.bits >> OFFSET) & MASK as u32) != 0
1042        })
1043    }
1044    #[doc = "Bit 14 - Data Match Flag"]
1045    #[inline]
1046    pub fn dmf(&self) -> DMFR {
1047        DMFR::_from({
1048            const MASK: bool = true;
1049            const OFFSET: u8 = 14;
1050            ((self.bits >> OFFSET) & MASK as u32) != 0
1051        })
1052    }
1053    #[doc = "Bit 24 - Master Busy Flag"]
1054    #[inline]
1055    pub fn mbf(&self) -> MBFR {
1056        MBFR::_from({
1057            const MASK: bool = true;
1058            const OFFSET: u8 = 24;
1059            ((self.bits >> OFFSET) & MASK as u32) != 0
1060        })
1061    }
1062    #[doc = "Bit 25 - Bus Busy Flag"]
1063    #[inline]
1064    pub fn bbf(&self) -> BBFR {
1065        BBFR::_from({
1066            const MASK: bool = true;
1067            const OFFSET: u8 = 25;
1068            ((self.bits >> OFFSET) & MASK as u32) != 0
1069        })
1070    }
1071}
1072impl W {
1073    #[doc = r" Reset value of the register"]
1074    #[inline]
1075    pub fn reset_value() -> W {
1076        W { bits: 1 }
1077    }
1078    #[doc = r" Writes raw bits to the register"]
1079    #[inline]
1080    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1081        self.bits = bits;
1082        self
1083    }
1084    #[doc = "Bit 8 - End Packet Flag"]
1085    #[inline]
1086    pub fn epf(&mut self) -> _EPFW {
1087        _EPFW { w: self }
1088    }
1089    #[doc = "Bit 9 - STOP Detect Flag"]
1090    #[inline]
1091    pub fn sdf(&mut self) -> _SDFW {
1092        _SDFW { w: self }
1093    }
1094    #[doc = "Bit 10 - NACK Detect Flag"]
1095    #[inline]
1096    pub fn ndf(&mut self) -> _NDFW {
1097        _NDFW { w: self }
1098    }
1099    #[doc = "Bit 11 - Arbitration Lost Flag"]
1100    #[inline]
1101    pub fn alf(&mut self) -> _ALFW {
1102        _ALFW { w: self }
1103    }
1104    #[doc = "Bit 12 - FIFO Error Flag"]
1105    #[inline]
1106    pub fn fef(&mut self) -> _FEFW {
1107        _FEFW { w: self }
1108    }
1109    #[doc = "Bit 13 - Pin Low Timeout Flag"]
1110    #[inline]
1111    pub fn pltf(&mut self) -> _PLTFW {
1112        _PLTFW { w: self }
1113    }
1114    #[doc = "Bit 14 - Data Match Flag"]
1115    #[inline]
1116    pub fn dmf(&mut self) -> _DMFW {
1117        _DMFW { w: self }
1118    }
1119}