stm32l4x2_pac/i2c1/
cr1.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::CR1 {
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 {
26            bits: self.register.get(),
27        }
28    }
29    #[doc = r" Writes to the register"]
30    #[inline]
31    pub fn write<F>(&self, f: F)
32    where
33        F: FnOnce(&mut W) -> &mut W,
34    {
35        let mut w = W::reset_value();
36        f(&mut w);
37        self.register.set(w.bits);
38    }
39    #[doc = r" Writes the reset value to the register"]
40    #[inline]
41    pub fn reset(&self) {
42        self.write(|w| w)
43    }
44}
45#[doc = "Possible values of the field `PE`"]
46#[derive(Clone, Copy, Debug, PartialEq)]
47pub enum PER {
48    #[doc = "Peripheral disabled"]
49    DISABLED,
50    #[doc = "Peripheral enabled"]
51    ENABLED,
52}
53impl PER {
54    #[doc = r" Returns `true` if the bit is clear (0)"]
55    #[inline]
56    pub fn bit_is_clear(&self) -> bool {
57        !self.bit()
58    }
59    #[doc = r" Returns `true` if the bit is set (1)"]
60    #[inline]
61    pub fn bit_is_set(&self) -> bool {
62        self.bit()
63    }
64    #[doc = r" Value of the field as raw bits"]
65    #[inline]
66    pub fn bit(&self) -> bool {
67        match *self {
68            PER::DISABLED => false,
69            PER::ENABLED => true,
70        }
71    }
72    #[allow(missing_docs)]
73    #[doc(hidden)]
74    #[inline]
75    pub fn _from(value: bool) -> PER {
76        match value {
77            false => PER::DISABLED,
78            true => PER::ENABLED,
79        }
80    }
81    #[doc = "Checks if the value of the field is `DISABLED`"]
82    #[inline]
83    pub fn is_disabled(&self) -> bool {
84        *self == PER::DISABLED
85    }
86    #[doc = "Checks if the value of the field is `ENABLED`"]
87    #[inline]
88    pub fn is_enabled(&self) -> bool {
89        *self == PER::ENABLED
90    }
91}
92#[doc = "Possible values of the field `TXIE`"]
93#[derive(Clone, Copy, Debug, PartialEq)]
94pub enum TXIER {
95    #[doc = "Transmit (TXIS) interrupt disabled"]
96    DISABLED,
97    #[doc = "Transmit (TXIS) interrupt enabled"]
98    ENABLED,
99}
100impl TXIER {
101    #[doc = r" Returns `true` if the bit is clear (0)"]
102    #[inline]
103    pub fn bit_is_clear(&self) -> bool {
104        !self.bit()
105    }
106    #[doc = r" Returns `true` if the bit is set (1)"]
107    #[inline]
108    pub fn bit_is_set(&self) -> bool {
109        self.bit()
110    }
111    #[doc = r" Value of the field as raw bits"]
112    #[inline]
113    pub fn bit(&self) -> bool {
114        match *self {
115            TXIER::DISABLED => false,
116            TXIER::ENABLED => true,
117        }
118    }
119    #[allow(missing_docs)]
120    #[doc(hidden)]
121    #[inline]
122    pub fn _from(value: bool) -> TXIER {
123        match value {
124            false => TXIER::DISABLED,
125            true => TXIER::ENABLED,
126        }
127    }
128    #[doc = "Checks if the value of the field is `DISABLED`"]
129    #[inline]
130    pub fn is_disabled(&self) -> bool {
131        *self == TXIER::DISABLED
132    }
133    #[doc = "Checks if the value of the field is `ENABLED`"]
134    #[inline]
135    pub fn is_enabled(&self) -> bool {
136        *self == TXIER::ENABLED
137    }
138}
139#[doc = "Possible values of the field `RXIE`"]
140#[derive(Clone, Copy, Debug, PartialEq)]
141pub enum RXIER {
142    #[doc = "Receive (RXNE) interrupt disabled"]
143    DISABLED,
144    #[doc = "Receive (RXNE) interrupt enabled"]
145    ENABLED,
146}
147impl RXIER {
148    #[doc = r" Returns `true` if the bit is clear (0)"]
149    #[inline]
150    pub fn bit_is_clear(&self) -> bool {
151        !self.bit()
152    }
153    #[doc = r" Returns `true` if the bit is set (1)"]
154    #[inline]
155    pub fn bit_is_set(&self) -> bool {
156        self.bit()
157    }
158    #[doc = r" Value of the field as raw bits"]
159    #[inline]
160    pub fn bit(&self) -> bool {
161        match *self {
162            RXIER::DISABLED => false,
163            RXIER::ENABLED => true,
164        }
165    }
166    #[allow(missing_docs)]
167    #[doc(hidden)]
168    #[inline]
169    pub fn _from(value: bool) -> RXIER {
170        match value {
171            false => RXIER::DISABLED,
172            true => RXIER::ENABLED,
173        }
174    }
175    #[doc = "Checks if the value of the field is `DISABLED`"]
176    #[inline]
177    pub fn is_disabled(&self) -> bool {
178        *self == RXIER::DISABLED
179    }
180    #[doc = "Checks if the value of the field is `ENABLED`"]
181    #[inline]
182    pub fn is_enabled(&self) -> bool {
183        *self == RXIER::ENABLED
184    }
185}
186#[doc = "Possible values of the field `ADDRIE`"]
187#[derive(Clone, Copy, Debug, PartialEq)]
188pub enum ADDRIER {
189    #[doc = "Address match (ADDR) interrupts disabled"]
190    DISABLED,
191    #[doc = "Address match (ADDR) interrupts enabled"]
192    ENABLED,
193}
194impl ADDRIER {
195    #[doc = r" Returns `true` if the bit is clear (0)"]
196    #[inline]
197    pub fn bit_is_clear(&self) -> bool {
198        !self.bit()
199    }
200    #[doc = r" Returns `true` if the bit is set (1)"]
201    #[inline]
202    pub fn bit_is_set(&self) -> bool {
203        self.bit()
204    }
205    #[doc = r" Value of the field as raw bits"]
206    #[inline]
207    pub fn bit(&self) -> bool {
208        match *self {
209            ADDRIER::DISABLED => false,
210            ADDRIER::ENABLED => true,
211        }
212    }
213    #[allow(missing_docs)]
214    #[doc(hidden)]
215    #[inline]
216    pub fn _from(value: bool) -> ADDRIER {
217        match value {
218            false => ADDRIER::DISABLED,
219            true => ADDRIER::ENABLED,
220        }
221    }
222    #[doc = "Checks if the value of the field is `DISABLED`"]
223    #[inline]
224    pub fn is_disabled(&self) -> bool {
225        *self == ADDRIER::DISABLED
226    }
227    #[doc = "Checks if the value of the field is `ENABLED`"]
228    #[inline]
229    pub fn is_enabled(&self) -> bool {
230        *self == ADDRIER::ENABLED
231    }
232}
233#[doc = "Possible values of the field `NACKIE`"]
234#[derive(Clone, Copy, Debug, PartialEq)]
235pub enum NACKIER {
236    #[doc = "Not acknowledge (NACKF) received interrupts disabled"]
237    DISABLED,
238    #[doc = "Not acknowledge (NACKF) received interrupts enabled"]
239    ENABLED,
240}
241impl NACKIER {
242    #[doc = r" Returns `true` if the bit is clear (0)"]
243    #[inline]
244    pub fn bit_is_clear(&self) -> bool {
245        !self.bit()
246    }
247    #[doc = r" Returns `true` if the bit is set (1)"]
248    #[inline]
249    pub fn bit_is_set(&self) -> bool {
250        self.bit()
251    }
252    #[doc = r" Value of the field as raw bits"]
253    #[inline]
254    pub fn bit(&self) -> bool {
255        match *self {
256            NACKIER::DISABLED => false,
257            NACKIER::ENABLED => true,
258        }
259    }
260    #[allow(missing_docs)]
261    #[doc(hidden)]
262    #[inline]
263    pub fn _from(value: bool) -> NACKIER {
264        match value {
265            false => NACKIER::DISABLED,
266            true => NACKIER::ENABLED,
267        }
268    }
269    #[doc = "Checks if the value of the field is `DISABLED`"]
270    #[inline]
271    pub fn is_disabled(&self) -> bool {
272        *self == NACKIER::DISABLED
273    }
274    #[doc = "Checks if the value of the field is `ENABLED`"]
275    #[inline]
276    pub fn is_enabled(&self) -> bool {
277        *self == NACKIER::ENABLED
278    }
279}
280#[doc = "Possible values of the field `STOPIE`"]
281#[derive(Clone, Copy, Debug, PartialEq)]
282pub enum STOPIER {
283    #[doc = "Stop detection (STOPF) interrupt disabled"]
284    DISABLED,
285    #[doc = "Stop detection (STOPF) interrupt enabled"]
286    ENABLED,
287}
288impl STOPIER {
289    #[doc = r" Returns `true` if the bit is clear (0)"]
290    #[inline]
291    pub fn bit_is_clear(&self) -> bool {
292        !self.bit()
293    }
294    #[doc = r" Returns `true` if the bit is set (1)"]
295    #[inline]
296    pub fn bit_is_set(&self) -> bool {
297        self.bit()
298    }
299    #[doc = r" Value of the field as raw bits"]
300    #[inline]
301    pub fn bit(&self) -> bool {
302        match *self {
303            STOPIER::DISABLED => false,
304            STOPIER::ENABLED => true,
305        }
306    }
307    #[allow(missing_docs)]
308    #[doc(hidden)]
309    #[inline]
310    pub fn _from(value: bool) -> STOPIER {
311        match value {
312            false => STOPIER::DISABLED,
313            true => STOPIER::ENABLED,
314        }
315    }
316    #[doc = "Checks if the value of the field is `DISABLED`"]
317    #[inline]
318    pub fn is_disabled(&self) -> bool {
319        *self == STOPIER::DISABLED
320    }
321    #[doc = "Checks if the value of the field is `ENABLED`"]
322    #[inline]
323    pub fn is_enabled(&self) -> bool {
324        *self == STOPIER::ENABLED
325    }
326}
327#[doc = "Possible values of the field `TCIE`"]
328#[derive(Clone, Copy, Debug, PartialEq)]
329pub enum TCIER {
330    #[doc = "Transfer Complete interrupt disabled"]
331    DISABLED,
332    #[doc = "Transfer Complete interrupt enabled"]
333    ENABLED,
334}
335impl TCIER {
336    #[doc = r" Returns `true` if the bit is clear (0)"]
337    #[inline]
338    pub fn bit_is_clear(&self) -> bool {
339        !self.bit()
340    }
341    #[doc = r" Returns `true` if the bit is set (1)"]
342    #[inline]
343    pub fn bit_is_set(&self) -> bool {
344        self.bit()
345    }
346    #[doc = r" Value of the field as raw bits"]
347    #[inline]
348    pub fn bit(&self) -> bool {
349        match *self {
350            TCIER::DISABLED => false,
351            TCIER::ENABLED => true,
352        }
353    }
354    #[allow(missing_docs)]
355    #[doc(hidden)]
356    #[inline]
357    pub fn _from(value: bool) -> TCIER {
358        match value {
359            false => TCIER::DISABLED,
360            true => TCIER::ENABLED,
361        }
362    }
363    #[doc = "Checks if the value of the field is `DISABLED`"]
364    #[inline]
365    pub fn is_disabled(&self) -> bool {
366        *self == TCIER::DISABLED
367    }
368    #[doc = "Checks if the value of the field is `ENABLED`"]
369    #[inline]
370    pub fn is_enabled(&self) -> bool {
371        *self == TCIER::ENABLED
372    }
373}
374#[doc = "Possible values of the field `ERRIE`"]
375#[derive(Clone, Copy, Debug, PartialEq)]
376pub enum ERRIER {
377    #[doc = "Error detection interrupts disabled"]
378    DISABLED,
379    #[doc = "Error detection interrupts enabled"]
380    ENABLED,
381}
382impl ERRIER {
383    #[doc = r" Returns `true` if the bit is clear (0)"]
384    #[inline]
385    pub fn bit_is_clear(&self) -> bool {
386        !self.bit()
387    }
388    #[doc = r" Returns `true` if the bit is set (1)"]
389    #[inline]
390    pub fn bit_is_set(&self) -> bool {
391        self.bit()
392    }
393    #[doc = r" Value of the field as raw bits"]
394    #[inline]
395    pub fn bit(&self) -> bool {
396        match *self {
397            ERRIER::DISABLED => false,
398            ERRIER::ENABLED => true,
399        }
400    }
401    #[allow(missing_docs)]
402    #[doc(hidden)]
403    #[inline]
404    pub fn _from(value: bool) -> ERRIER {
405        match value {
406            false => ERRIER::DISABLED,
407            true => ERRIER::ENABLED,
408        }
409    }
410    #[doc = "Checks if the value of the field is `DISABLED`"]
411    #[inline]
412    pub fn is_disabled(&self) -> bool {
413        *self == ERRIER::DISABLED
414    }
415    #[doc = "Checks if the value of the field is `ENABLED`"]
416    #[inline]
417    pub fn is_enabled(&self) -> bool {
418        *self == ERRIER::ENABLED
419    }
420}
421#[doc = "Possible values of the field `DNF`"]
422#[derive(Clone, Copy, Debug, PartialEq)]
423pub enum DNFR {
424    #[doc = "Digital filter disabled"]
425    NOFILTER,
426    #[doc = "Digital filter enabled and filtering capability up to 1 tI2CCLK"]
427    FILTER1,
428    #[doc = "Digital filter enabled and filtering capability up to 2 tI2CCLK"]
429    FILTER2,
430    #[doc = "Digital filter enabled and filtering capability up to 3 tI2CCLK"]
431    FILTER3,
432    #[doc = "Digital filter enabled and filtering capability up to 4 tI2CCLK"]
433    FILTER4,
434    #[doc = "Digital filter enabled and filtering capability up to 5 tI2CCLK"]
435    FILTER5,
436    #[doc = "Digital filter enabled and filtering capability up to 6 tI2CCLK"]
437    FILTER6,
438    #[doc = "Digital filter enabled and filtering capability up to 7 tI2CCLK"]
439    FILTER7,
440    #[doc = "Digital filter enabled and filtering capability up to 8 tI2CCLK"]
441    FILTER8,
442    #[doc = "Digital filter enabled and filtering capability up to 9 tI2CCLK"]
443    FILTER9,
444    #[doc = "Digital filter enabled and filtering capability up to 10 tI2CCLK"]
445    FILTER10,
446    #[doc = "Digital filter enabled and filtering capability up to 11 tI2CCLK"]
447    FILTER11,
448    #[doc = "Digital filter enabled and filtering capability up to 12 tI2CCLK"]
449    FILTER12,
450    #[doc = "Digital filter enabled and filtering capability up to 13 tI2CCLK"]
451    FILTER13,
452    #[doc = "Digital filter enabled and filtering capability up to 14 tI2CCLK"]
453    FILTER14,
454    #[doc = "Digital filter enabled and filtering capability up to 15 tI2CCLK"]
455    FILTER15,
456}
457impl DNFR {
458    #[doc = r" Value of the field as raw bits"]
459    #[inline]
460    pub fn bits(&self) -> u8 {
461        match *self {
462            DNFR::NOFILTER => 0,
463            DNFR::FILTER1 => 1,
464            DNFR::FILTER2 => 2,
465            DNFR::FILTER3 => 3,
466            DNFR::FILTER4 => 4,
467            DNFR::FILTER5 => 5,
468            DNFR::FILTER6 => 6,
469            DNFR::FILTER7 => 7,
470            DNFR::FILTER8 => 8,
471            DNFR::FILTER9 => 9,
472            DNFR::FILTER10 => 10,
473            DNFR::FILTER11 => 11,
474            DNFR::FILTER12 => 12,
475            DNFR::FILTER13 => 13,
476            DNFR::FILTER14 => 14,
477            DNFR::FILTER15 => 15,
478        }
479    }
480    #[allow(missing_docs)]
481    #[doc(hidden)]
482    #[inline]
483    pub fn _from(value: u8) -> DNFR {
484        match value {
485            0 => DNFR::NOFILTER,
486            1 => DNFR::FILTER1,
487            2 => DNFR::FILTER2,
488            3 => DNFR::FILTER3,
489            4 => DNFR::FILTER4,
490            5 => DNFR::FILTER5,
491            6 => DNFR::FILTER6,
492            7 => DNFR::FILTER7,
493            8 => DNFR::FILTER8,
494            9 => DNFR::FILTER9,
495            10 => DNFR::FILTER10,
496            11 => DNFR::FILTER11,
497            12 => DNFR::FILTER12,
498            13 => DNFR::FILTER13,
499            14 => DNFR::FILTER14,
500            15 => DNFR::FILTER15,
501            _ => unreachable!(),
502        }
503    }
504    #[doc = "Checks if the value of the field is `NOFILTER`"]
505    #[inline]
506    pub fn is_no_filter(&self) -> bool {
507        *self == DNFR::NOFILTER
508    }
509    #[doc = "Checks if the value of the field is `FILTER1`"]
510    #[inline]
511    pub fn is_filter1(&self) -> bool {
512        *self == DNFR::FILTER1
513    }
514    #[doc = "Checks if the value of the field is `FILTER2`"]
515    #[inline]
516    pub fn is_filter2(&self) -> bool {
517        *self == DNFR::FILTER2
518    }
519    #[doc = "Checks if the value of the field is `FILTER3`"]
520    #[inline]
521    pub fn is_filter3(&self) -> bool {
522        *self == DNFR::FILTER3
523    }
524    #[doc = "Checks if the value of the field is `FILTER4`"]
525    #[inline]
526    pub fn is_filter4(&self) -> bool {
527        *self == DNFR::FILTER4
528    }
529    #[doc = "Checks if the value of the field is `FILTER5`"]
530    #[inline]
531    pub fn is_filter5(&self) -> bool {
532        *self == DNFR::FILTER5
533    }
534    #[doc = "Checks if the value of the field is `FILTER6`"]
535    #[inline]
536    pub fn is_filter6(&self) -> bool {
537        *self == DNFR::FILTER6
538    }
539    #[doc = "Checks if the value of the field is `FILTER7`"]
540    #[inline]
541    pub fn is_filter7(&self) -> bool {
542        *self == DNFR::FILTER7
543    }
544    #[doc = "Checks if the value of the field is `FILTER8`"]
545    #[inline]
546    pub fn is_filter8(&self) -> bool {
547        *self == DNFR::FILTER8
548    }
549    #[doc = "Checks if the value of the field is `FILTER9`"]
550    #[inline]
551    pub fn is_filter9(&self) -> bool {
552        *self == DNFR::FILTER9
553    }
554    #[doc = "Checks if the value of the field is `FILTER10`"]
555    #[inline]
556    pub fn is_filter10(&self) -> bool {
557        *self == DNFR::FILTER10
558    }
559    #[doc = "Checks if the value of the field is `FILTER11`"]
560    #[inline]
561    pub fn is_filter11(&self) -> bool {
562        *self == DNFR::FILTER11
563    }
564    #[doc = "Checks if the value of the field is `FILTER12`"]
565    #[inline]
566    pub fn is_filter12(&self) -> bool {
567        *self == DNFR::FILTER12
568    }
569    #[doc = "Checks if the value of the field is `FILTER13`"]
570    #[inline]
571    pub fn is_filter13(&self) -> bool {
572        *self == DNFR::FILTER13
573    }
574    #[doc = "Checks if the value of the field is `FILTER14`"]
575    #[inline]
576    pub fn is_filter14(&self) -> bool {
577        *self == DNFR::FILTER14
578    }
579    #[doc = "Checks if the value of the field is `FILTER15`"]
580    #[inline]
581    pub fn is_filter15(&self) -> bool {
582        *self == DNFR::FILTER15
583    }
584}
585#[doc = "Possible values of the field `ANFOFF`"]
586#[derive(Clone, Copy, Debug, PartialEq)]
587pub enum ANFOFFR {
588    #[doc = "Analog noise filter enabled"]
589    ENABLED,
590    #[doc = "Analog noise filter disabled"]
591    DISABLED,
592}
593impl ANFOFFR {
594    #[doc = r" Returns `true` if the bit is clear (0)"]
595    #[inline]
596    pub fn bit_is_clear(&self) -> bool {
597        !self.bit()
598    }
599    #[doc = r" Returns `true` if the bit is set (1)"]
600    #[inline]
601    pub fn bit_is_set(&self) -> bool {
602        self.bit()
603    }
604    #[doc = r" Value of the field as raw bits"]
605    #[inline]
606    pub fn bit(&self) -> bool {
607        match *self {
608            ANFOFFR::ENABLED => false,
609            ANFOFFR::DISABLED => true,
610        }
611    }
612    #[allow(missing_docs)]
613    #[doc(hidden)]
614    #[inline]
615    pub fn _from(value: bool) -> ANFOFFR {
616        match value {
617            false => ANFOFFR::ENABLED,
618            true => ANFOFFR::DISABLED,
619        }
620    }
621    #[doc = "Checks if the value of the field is `ENABLED`"]
622    #[inline]
623    pub fn is_enabled(&self) -> bool {
624        *self == ANFOFFR::ENABLED
625    }
626    #[doc = "Checks if the value of the field is `DISABLED`"]
627    #[inline]
628    pub fn is_disabled(&self) -> bool {
629        *self == ANFOFFR::DISABLED
630    }
631}
632#[doc = "Possible values of the field `TXDMAEN`"]
633#[derive(Clone, Copy, Debug, PartialEq)]
634pub enum TXDMAENR {
635    #[doc = "DMA mode disabled for transmission"]
636    DISABLED,
637    #[doc = "DMA mode enabled for transmission"]
638    ENABLED,
639}
640impl TXDMAENR {
641    #[doc = r" Returns `true` if the bit is clear (0)"]
642    #[inline]
643    pub fn bit_is_clear(&self) -> bool {
644        !self.bit()
645    }
646    #[doc = r" Returns `true` if the bit is set (1)"]
647    #[inline]
648    pub fn bit_is_set(&self) -> bool {
649        self.bit()
650    }
651    #[doc = r" Value of the field as raw bits"]
652    #[inline]
653    pub fn bit(&self) -> bool {
654        match *self {
655            TXDMAENR::DISABLED => false,
656            TXDMAENR::ENABLED => true,
657        }
658    }
659    #[allow(missing_docs)]
660    #[doc(hidden)]
661    #[inline]
662    pub fn _from(value: bool) -> TXDMAENR {
663        match value {
664            false => TXDMAENR::DISABLED,
665            true => TXDMAENR::ENABLED,
666        }
667    }
668    #[doc = "Checks if the value of the field is `DISABLED`"]
669    #[inline]
670    pub fn is_disabled(&self) -> bool {
671        *self == TXDMAENR::DISABLED
672    }
673    #[doc = "Checks if the value of the field is `ENABLED`"]
674    #[inline]
675    pub fn is_enabled(&self) -> bool {
676        *self == TXDMAENR::ENABLED
677    }
678}
679#[doc = "Possible values of the field `RXDMAEN`"]
680#[derive(Clone, Copy, Debug, PartialEq)]
681pub enum RXDMAENR {
682    #[doc = "DMA mode disabled for reception"]
683    DISABLED,
684    #[doc = "DMA mode enabled for reception"]
685    ENABLED,
686}
687impl RXDMAENR {
688    #[doc = r" Returns `true` if the bit is clear (0)"]
689    #[inline]
690    pub fn bit_is_clear(&self) -> bool {
691        !self.bit()
692    }
693    #[doc = r" Returns `true` if the bit is set (1)"]
694    #[inline]
695    pub fn bit_is_set(&self) -> bool {
696        self.bit()
697    }
698    #[doc = r" Value of the field as raw bits"]
699    #[inline]
700    pub fn bit(&self) -> bool {
701        match *self {
702            RXDMAENR::DISABLED => false,
703            RXDMAENR::ENABLED => true,
704        }
705    }
706    #[allow(missing_docs)]
707    #[doc(hidden)]
708    #[inline]
709    pub fn _from(value: bool) -> RXDMAENR {
710        match value {
711            false => RXDMAENR::DISABLED,
712            true => RXDMAENR::ENABLED,
713        }
714    }
715    #[doc = "Checks if the value of the field is `DISABLED`"]
716    #[inline]
717    pub fn is_disabled(&self) -> bool {
718        *self == RXDMAENR::DISABLED
719    }
720    #[doc = "Checks if the value of the field is `ENABLED`"]
721    #[inline]
722    pub fn is_enabled(&self) -> bool {
723        *self == RXDMAENR::ENABLED
724    }
725}
726#[doc = "Possible values of the field `SBC`"]
727#[derive(Clone, Copy, Debug, PartialEq)]
728pub enum SBCR {
729    #[doc = "Slave byte control disabled"]
730    DISABLED,
731    #[doc = "Slave byte control enabled"]
732    ENABLED,
733}
734impl SBCR {
735    #[doc = r" Returns `true` if the bit is clear (0)"]
736    #[inline]
737    pub fn bit_is_clear(&self) -> bool {
738        !self.bit()
739    }
740    #[doc = r" Returns `true` if the bit is set (1)"]
741    #[inline]
742    pub fn bit_is_set(&self) -> bool {
743        self.bit()
744    }
745    #[doc = r" Value of the field as raw bits"]
746    #[inline]
747    pub fn bit(&self) -> bool {
748        match *self {
749            SBCR::DISABLED => false,
750            SBCR::ENABLED => true,
751        }
752    }
753    #[allow(missing_docs)]
754    #[doc(hidden)]
755    #[inline]
756    pub fn _from(value: bool) -> SBCR {
757        match value {
758            false => SBCR::DISABLED,
759            true => SBCR::ENABLED,
760        }
761    }
762    #[doc = "Checks if the value of the field is `DISABLED`"]
763    #[inline]
764    pub fn is_disabled(&self) -> bool {
765        *self == SBCR::DISABLED
766    }
767    #[doc = "Checks if the value of the field is `ENABLED`"]
768    #[inline]
769    pub fn is_enabled(&self) -> bool {
770        *self == SBCR::ENABLED
771    }
772}
773#[doc = "Possible values of the field `NOSTRETCH`"]
774#[derive(Clone, Copy, Debug, PartialEq)]
775pub enum NOSTRETCHR {
776    #[doc = "Clock stretching enabled"]
777    ENABLED,
778    #[doc = "Clock stretching disabled"]
779    DISABLED,
780}
781impl NOSTRETCHR {
782    #[doc = r" Returns `true` if the bit is clear (0)"]
783    #[inline]
784    pub fn bit_is_clear(&self) -> bool {
785        !self.bit()
786    }
787    #[doc = r" Returns `true` if the bit is set (1)"]
788    #[inline]
789    pub fn bit_is_set(&self) -> bool {
790        self.bit()
791    }
792    #[doc = r" Value of the field as raw bits"]
793    #[inline]
794    pub fn bit(&self) -> bool {
795        match *self {
796            NOSTRETCHR::ENABLED => false,
797            NOSTRETCHR::DISABLED => true,
798        }
799    }
800    #[allow(missing_docs)]
801    #[doc(hidden)]
802    #[inline]
803    pub fn _from(value: bool) -> NOSTRETCHR {
804        match value {
805            false => NOSTRETCHR::ENABLED,
806            true => NOSTRETCHR::DISABLED,
807        }
808    }
809    #[doc = "Checks if the value of the field is `ENABLED`"]
810    #[inline]
811    pub fn is_enabled(&self) -> bool {
812        *self == NOSTRETCHR::ENABLED
813    }
814    #[doc = "Checks if the value of the field is `DISABLED`"]
815    #[inline]
816    pub fn is_disabled(&self) -> bool {
817        *self == NOSTRETCHR::DISABLED
818    }
819}
820#[doc = "Possible values of the field `WUPEN`"]
821#[derive(Clone, Copy, Debug, PartialEq)]
822pub enum WUPENR {
823    #[doc = "Wakeup from Stop mode disabled"]
824    DISABLED,
825    #[doc = "Wakeup from Stop mode enabled"]
826    ENABLED,
827}
828impl WUPENR {
829    #[doc = r" Returns `true` if the bit is clear (0)"]
830    #[inline]
831    pub fn bit_is_clear(&self) -> bool {
832        !self.bit()
833    }
834    #[doc = r" Returns `true` if the bit is set (1)"]
835    #[inline]
836    pub fn bit_is_set(&self) -> bool {
837        self.bit()
838    }
839    #[doc = r" Value of the field as raw bits"]
840    #[inline]
841    pub fn bit(&self) -> bool {
842        match *self {
843            WUPENR::DISABLED => false,
844            WUPENR::ENABLED => true,
845        }
846    }
847    #[allow(missing_docs)]
848    #[doc(hidden)]
849    #[inline]
850    pub fn _from(value: bool) -> WUPENR {
851        match value {
852            false => WUPENR::DISABLED,
853            true => WUPENR::ENABLED,
854        }
855    }
856    #[doc = "Checks if the value of the field is `DISABLED`"]
857    #[inline]
858    pub fn is_disabled(&self) -> bool {
859        *self == WUPENR::DISABLED
860    }
861    #[doc = "Checks if the value of the field is `ENABLED`"]
862    #[inline]
863    pub fn is_enabled(&self) -> bool {
864        *self == WUPENR::ENABLED
865    }
866}
867#[doc = "Possible values of the field `GCEN`"]
868#[derive(Clone, Copy, Debug, PartialEq)]
869pub enum GCENR {
870    #[doc = "General call disabled. Address 0b00000000 is NACKed"]
871    DISABLED,
872    #[doc = "General call enabled. Address 0b00000000 is ACKed"]
873    ENABLED,
874}
875impl GCENR {
876    #[doc = r" Returns `true` if the bit is clear (0)"]
877    #[inline]
878    pub fn bit_is_clear(&self) -> bool {
879        !self.bit()
880    }
881    #[doc = r" Returns `true` if the bit is set (1)"]
882    #[inline]
883    pub fn bit_is_set(&self) -> bool {
884        self.bit()
885    }
886    #[doc = r" Value of the field as raw bits"]
887    #[inline]
888    pub fn bit(&self) -> bool {
889        match *self {
890            GCENR::DISABLED => false,
891            GCENR::ENABLED => true,
892        }
893    }
894    #[allow(missing_docs)]
895    #[doc(hidden)]
896    #[inline]
897    pub fn _from(value: bool) -> GCENR {
898        match value {
899            false => GCENR::DISABLED,
900            true => GCENR::ENABLED,
901        }
902    }
903    #[doc = "Checks if the value of the field is `DISABLED`"]
904    #[inline]
905    pub fn is_disabled(&self) -> bool {
906        *self == GCENR::DISABLED
907    }
908    #[doc = "Checks if the value of the field is `ENABLED`"]
909    #[inline]
910    pub fn is_enabled(&self) -> bool {
911        *self == GCENR::ENABLED
912    }
913}
914#[doc = "Possible values of the field `SMBHEN`"]
915#[derive(Clone, Copy, Debug, PartialEq)]
916pub enum SMBHENR {
917    #[doc = "Host address disabled. Address 0b0001000x is NACKed"]
918    DISABLED,
919    #[doc = "Host address enabled. Address 0b0001000x is ACKed"]
920    ENABLED,
921}
922impl SMBHENR {
923    #[doc = r" Returns `true` if the bit is clear (0)"]
924    #[inline]
925    pub fn bit_is_clear(&self) -> bool {
926        !self.bit()
927    }
928    #[doc = r" Returns `true` if the bit is set (1)"]
929    #[inline]
930    pub fn bit_is_set(&self) -> bool {
931        self.bit()
932    }
933    #[doc = r" Value of the field as raw bits"]
934    #[inline]
935    pub fn bit(&self) -> bool {
936        match *self {
937            SMBHENR::DISABLED => false,
938            SMBHENR::ENABLED => true,
939        }
940    }
941    #[allow(missing_docs)]
942    #[doc(hidden)]
943    #[inline]
944    pub fn _from(value: bool) -> SMBHENR {
945        match value {
946            false => SMBHENR::DISABLED,
947            true => SMBHENR::ENABLED,
948        }
949    }
950    #[doc = "Checks if the value of the field is `DISABLED`"]
951    #[inline]
952    pub fn is_disabled(&self) -> bool {
953        *self == SMBHENR::DISABLED
954    }
955    #[doc = "Checks if the value of the field is `ENABLED`"]
956    #[inline]
957    pub fn is_enabled(&self) -> bool {
958        *self == SMBHENR::ENABLED
959    }
960}
961#[doc = "Possible values of the field `SMBDEN`"]
962#[derive(Clone, Copy, Debug, PartialEq)]
963pub enum SMBDENR {
964    #[doc = "Device default address disabled. Address 0b1100001x is NACKed"]
965    DISABLED,
966    #[doc = "Device default address enabled. Address 0b1100001x is ACKed"]
967    ENABLED,
968}
969impl SMBDENR {
970    #[doc = r" Returns `true` if the bit is clear (0)"]
971    #[inline]
972    pub fn bit_is_clear(&self) -> bool {
973        !self.bit()
974    }
975    #[doc = r" Returns `true` if the bit is set (1)"]
976    #[inline]
977    pub fn bit_is_set(&self) -> bool {
978        self.bit()
979    }
980    #[doc = r" Value of the field as raw bits"]
981    #[inline]
982    pub fn bit(&self) -> bool {
983        match *self {
984            SMBDENR::DISABLED => false,
985            SMBDENR::ENABLED => true,
986        }
987    }
988    #[allow(missing_docs)]
989    #[doc(hidden)]
990    #[inline]
991    pub fn _from(value: bool) -> SMBDENR {
992        match value {
993            false => SMBDENR::DISABLED,
994            true => SMBDENR::ENABLED,
995        }
996    }
997    #[doc = "Checks if the value of the field is `DISABLED`"]
998    #[inline]
999    pub fn is_disabled(&self) -> bool {
1000        *self == SMBDENR::DISABLED
1001    }
1002    #[doc = "Checks if the value of the field is `ENABLED`"]
1003    #[inline]
1004    pub fn is_enabled(&self) -> bool {
1005        *self == SMBDENR::ENABLED
1006    }
1007}
1008#[doc = "Possible values of the field `ALERTEN`"]
1009#[derive(Clone, Copy, Debug, PartialEq)]
1010pub enum ALERTENR {
1011    #[doc = "In device mode (SMBHEN=Disabled) Releases SMBA pin high and Alert Response Address Header disabled (0001100x) followed by NACK. In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) not supported"]
1012    DISABLED,
1013    #[doc = "In device mode (SMBHEN=Disabled) Drives SMBA pin low and Alert Response Address Header enabled (0001100x) followed by ACK.In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) supported"]
1014    ENABLED,
1015}
1016impl ALERTENR {
1017    #[doc = r" Returns `true` if the bit is clear (0)"]
1018    #[inline]
1019    pub fn bit_is_clear(&self) -> bool {
1020        !self.bit()
1021    }
1022    #[doc = r" Returns `true` if the bit is set (1)"]
1023    #[inline]
1024    pub fn bit_is_set(&self) -> bool {
1025        self.bit()
1026    }
1027    #[doc = r" Value of the field as raw bits"]
1028    #[inline]
1029    pub fn bit(&self) -> bool {
1030        match *self {
1031            ALERTENR::DISABLED => false,
1032            ALERTENR::ENABLED => true,
1033        }
1034    }
1035    #[allow(missing_docs)]
1036    #[doc(hidden)]
1037    #[inline]
1038    pub fn _from(value: bool) -> ALERTENR {
1039        match value {
1040            false => ALERTENR::DISABLED,
1041            true => ALERTENR::ENABLED,
1042        }
1043    }
1044    #[doc = "Checks if the value of the field is `DISABLED`"]
1045    #[inline]
1046    pub fn is_disabled(&self) -> bool {
1047        *self == ALERTENR::DISABLED
1048    }
1049    #[doc = "Checks if the value of the field is `ENABLED`"]
1050    #[inline]
1051    pub fn is_enabled(&self) -> bool {
1052        *self == ALERTENR::ENABLED
1053    }
1054}
1055#[doc = "Possible values of the field `PECEN`"]
1056#[derive(Clone, Copy, Debug, PartialEq)]
1057pub enum PECENR {
1058    #[doc = "PEC calculation disabled"]
1059    DISABLED,
1060    #[doc = "PEC calculation enabled"]
1061    ENABLED,
1062}
1063impl PECENR {
1064    #[doc = r" Returns `true` if the bit is clear (0)"]
1065    #[inline]
1066    pub fn bit_is_clear(&self) -> bool {
1067        !self.bit()
1068    }
1069    #[doc = r" Returns `true` if the bit is set (1)"]
1070    #[inline]
1071    pub fn bit_is_set(&self) -> bool {
1072        self.bit()
1073    }
1074    #[doc = r" Value of the field as raw bits"]
1075    #[inline]
1076    pub fn bit(&self) -> bool {
1077        match *self {
1078            PECENR::DISABLED => false,
1079            PECENR::ENABLED => true,
1080        }
1081    }
1082    #[allow(missing_docs)]
1083    #[doc(hidden)]
1084    #[inline]
1085    pub fn _from(value: bool) -> PECENR {
1086        match value {
1087            false => PECENR::DISABLED,
1088            true => PECENR::ENABLED,
1089        }
1090    }
1091    #[doc = "Checks if the value of the field is `DISABLED`"]
1092    #[inline]
1093    pub fn is_disabled(&self) -> bool {
1094        *self == PECENR::DISABLED
1095    }
1096    #[doc = "Checks if the value of the field is `ENABLED`"]
1097    #[inline]
1098    pub fn is_enabled(&self) -> bool {
1099        *self == PECENR::ENABLED
1100    }
1101}
1102#[doc = "Values that can be written to the field `PE`"]
1103pub enum PEW {
1104    #[doc = "Peripheral disabled"]
1105    DISABLED,
1106    #[doc = "Peripheral enabled"]
1107    ENABLED,
1108}
1109impl PEW {
1110    #[allow(missing_docs)]
1111    #[doc(hidden)]
1112    #[inline]
1113    pub fn _bits(&self) -> bool {
1114        match *self {
1115            PEW::DISABLED => false,
1116            PEW::ENABLED => true,
1117        }
1118    }
1119}
1120#[doc = r" Proxy"]
1121pub struct _PEW<'a> {
1122    w: &'a mut W,
1123}
1124impl<'a> _PEW<'a> {
1125    #[doc = r" Writes `variant` to the field"]
1126    #[inline]
1127    pub fn variant(self, variant: PEW) -> &'a mut W {
1128        {
1129            self.bit(variant._bits())
1130        }
1131    }
1132    #[doc = "Peripheral disabled"]
1133    #[inline]
1134    pub fn disabled(self) -> &'a mut W {
1135        self.variant(PEW::DISABLED)
1136    }
1137    #[doc = "Peripheral enabled"]
1138    #[inline]
1139    pub fn enabled(self) -> &'a mut W {
1140        self.variant(PEW::ENABLED)
1141    }
1142    #[doc = r" Sets the field bit"]
1143    pub fn set_bit(self) -> &'a mut W {
1144        self.bit(true)
1145    }
1146    #[doc = r" Clears the field bit"]
1147    pub fn clear_bit(self) -> &'a mut W {
1148        self.bit(false)
1149    }
1150    #[doc = r" Writes raw bits to the field"]
1151    #[inline]
1152    pub fn bit(self, value: bool) -> &'a mut W {
1153        const MASK: bool = true;
1154        const OFFSET: u8 = 0;
1155        self.w.bits &= !((MASK as u32) << OFFSET);
1156        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1157        self.w
1158    }
1159}
1160#[doc = "Values that can be written to the field `TXIE`"]
1161pub enum TXIEW {
1162    #[doc = "Transmit (TXIS) interrupt disabled"]
1163    DISABLED,
1164    #[doc = "Transmit (TXIS) interrupt enabled"]
1165    ENABLED,
1166}
1167impl TXIEW {
1168    #[allow(missing_docs)]
1169    #[doc(hidden)]
1170    #[inline]
1171    pub fn _bits(&self) -> bool {
1172        match *self {
1173            TXIEW::DISABLED => false,
1174            TXIEW::ENABLED => true,
1175        }
1176    }
1177}
1178#[doc = r" Proxy"]
1179pub struct _TXIEW<'a> {
1180    w: &'a mut W,
1181}
1182impl<'a> _TXIEW<'a> {
1183    #[doc = r" Writes `variant` to the field"]
1184    #[inline]
1185    pub fn variant(self, variant: TXIEW) -> &'a mut W {
1186        {
1187            self.bit(variant._bits())
1188        }
1189    }
1190    #[doc = "Transmit (TXIS) interrupt disabled"]
1191    #[inline]
1192    pub fn disabled(self) -> &'a mut W {
1193        self.variant(TXIEW::DISABLED)
1194    }
1195    #[doc = "Transmit (TXIS) interrupt enabled"]
1196    #[inline]
1197    pub fn enabled(self) -> &'a mut W {
1198        self.variant(TXIEW::ENABLED)
1199    }
1200    #[doc = r" Sets the field bit"]
1201    pub fn set_bit(self) -> &'a mut W {
1202        self.bit(true)
1203    }
1204    #[doc = r" Clears the field bit"]
1205    pub fn clear_bit(self) -> &'a mut W {
1206        self.bit(false)
1207    }
1208    #[doc = r" Writes raw bits to the field"]
1209    #[inline]
1210    pub fn bit(self, value: bool) -> &'a mut W {
1211        const MASK: bool = true;
1212        const OFFSET: u8 = 1;
1213        self.w.bits &= !((MASK as u32) << OFFSET);
1214        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1215        self.w
1216    }
1217}
1218#[doc = "Values that can be written to the field `RXIE`"]
1219pub enum RXIEW {
1220    #[doc = "Receive (RXNE) interrupt disabled"]
1221    DISABLED,
1222    #[doc = "Receive (RXNE) interrupt enabled"]
1223    ENABLED,
1224}
1225impl RXIEW {
1226    #[allow(missing_docs)]
1227    #[doc(hidden)]
1228    #[inline]
1229    pub fn _bits(&self) -> bool {
1230        match *self {
1231            RXIEW::DISABLED => false,
1232            RXIEW::ENABLED => true,
1233        }
1234    }
1235}
1236#[doc = r" Proxy"]
1237pub struct _RXIEW<'a> {
1238    w: &'a mut W,
1239}
1240impl<'a> _RXIEW<'a> {
1241    #[doc = r" Writes `variant` to the field"]
1242    #[inline]
1243    pub fn variant(self, variant: RXIEW) -> &'a mut W {
1244        {
1245            self.bit(variant._bits())
1246        }
1247    }
1248    #[doc = "Receive (RXNE) interrupt disabled"]
1249    #[inline]
1250    pub fn disabled(self) -> &'a mut W {
1251        self.variant(RXIEW::DISABLED)
1252    }
1253    #[doc = "Receive (RXNE) interrupt enabled"]
1254    #[inline]
1255    pub fn enabled(self) -> &'a mut W {
1256        self.variant(RXIEW::ENABLED)
1257    }
1258    #[doc = r" Sets the field bit"]
1259    pub fn set_bit(self) -> &'a mut W {
1260        self.bit(true)
1261    }
1262    #[doc = r" Clears the field bit"]
1263    pub fn clear_bit(self) -> &'a mut W {
1264        self.bit(false)
1265    }
1266    #[doc = r" Writes raw bits to the field"]
1267    #[inline]
1268    pub fn bit(self, value: bool) -> &'a mut W {
1269        const MASK: bool = true;
1270        const OFFSET: u8 = 2;
1271        self.w.bits &= !((MASK as u32) << OFFSET);
1272        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1273        self.w
1274    }
1275}
1276#[doc = "Values that can be written to the field `ADDRIE`"]
1277pub enum ADDRIEW {
1278    #[doc = "Address match (ADDR) interrupts disabled"]
1279    DISABLED,
1280    #[doc = "Address match (ADDR) interrupts enabled"]
1281    ENABLED,
1282}
1283impl ADDRIEW {
1284    #[allow(missing_docs)]
1285    #[doc(hidden)]
1286    #[inline]
1287    pub fn _bits(&self) -> bool {
1288        match *self {
1289            ADDRIEW::DISABLED => false,
1290            ADDRIEW::ENABLED => true,
1291        }
1292    }
1293}
1294#[doc = r" Proxy"]
1295pub struct _ADDRIEW<'a> {
1296    w: &'a mut W,
1297}
1298impl<'a> _ADDRIEW<'a> {
1299    #[doc = r" Writes `variant` to the field"]
1300    #[inline]
1301    pub fn variant(self, variant: ADDRIEW) -> &'a mut W {
1302        {
1303            self.bit(variant._bits())
1304        }
1305    }
1306    #[doc = "Address match (ADDR) interrupts disabled"]
1307    #[inline]
1308    pub fn disabled(self) -> &'a mut W {
1309        self.variant(ADDRIEW::DISABLED)
1310    }
1311    #[doc = "Address match (ADDR) interrupts enabled"]
1312    #[inline]
1313    pub fn enabled(self) -> &'a mut W {
1314        self.variant(ADDRIEW::ENABLED)
1315    }
1316    #[doc = r" Sets the field bit"]
1317    pub fn set_bit(self) -> &'a mut W {
1318        self.bit(true)
1319    }
1320    #[doc = r" Clears the field bit"]
1321    pub fn clear_bit(self) -> &'a mut W {
1322        self.bit(false)
1323    }
1324    #[doc = r" Writes raw bits to the field"]
1325    #[inline]
1326    pub fn bit(self, value: bool) -> &'a mut W {
1327        const MASK: bool = true;
1328        const OFFSET: u8 = 3;
1329        self.w.bits &= !((MASK as u32) << OFFSET);
1330        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1331        self.w
1332    }
1333}
1334#[doc = "Values that can be written to the field `NACKIE`"]
1335pub enum NACKIEW {
1336    #[doc = "Not acknowledge (NACKF) received interrupts disabled"]
1337    DISABLED,
1338    #[doc = "Not acknowledge (NACKF) received interrupts enabled"]
1339    ENABLED,
1340}
1341impl NACKIEW {
1342    #[allow(missing_docs)]
1343    #[doc(hidden)]
1344    #[inline]
1345    pub fn _bits(&self) -> bool {
1346        match *self {
1347            NACKIEW::DISABLED => false,
1348            NACKIEW::ENABLED => true,
1349        }
1350    }
1351}
1352#[doc = r" Proxy"]
1353pub struct _NACKIEW<'a> {
1354    w: &'a mut W,
1355}
1356impl<'a> _NACKIEW<'a> {
1357    #[doc = r" Writes `variant` to the field"]
1358    #[inline]
1359    pub fn variant(self, variant: NACKIEW) -> &'a mut W {
1360        {
1361            self.bit(variant._bits())
1362        }
1363    }
1364    #[doc = "Not acknowledge (NACKF) received interrupts disabled"]
1365    #[inline]
1366    pub fn disabled(self) -> &'a mut W {
1367        self.variant(NACKIEW::DISABLED)
1368    }
1369    #[doc = "Not acknowledge (NACKF) received interrupts enabled"]
1370    #[inline]
1371    pub fn enabled(self) -> &'a mut W {
1372        self.variant(NACKIEW::ENABLED)
1373    }
1374    #[doc = r" Sets the field bit"]
1375    pub fn set_bit(self) -> &'a mut W {
1376        self.bit(true)
1377    }
1378    #[doc = r" Clears the field bit"]
1379    pub fn clear_bit(self) -> &'a mut W {
1380        self.bit(false)
1381    }
1382    #[doc = r" Writes raw bits to the field"]
1383    #[inline]
1384    pub fn bit(self, value: bool) -> &'a mut W {
1385        const MASK: bool = true;
1386        const OFFSET: u8 = 4;
1387        self.w.bits &= !((MASK as u32) << OFFSET);
1388        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1389        self.w
1390    }
1391}
1392#[doc = "Values that can be written to the field `STOPIE`"]
1393pub enum STOPIEW {
1394    #[doc = "Stop detection (STOPF) interrupt disabled"]
1395    DISABLED,
1396    #[doc = "Stop detection (STOPF) interrupt enabled"]
1397    ENABLED,
1398}
1399impl STOPIEW {
1400    #[allow(missing_docs)]
1401    #[doc(hidden)]
1402    #[inline]
1403    pub fn _bits(&self) -> bool {
1404        match *self {
1405            STOPIEW::DISABLED => false,
1406            STOPIEW::ENABLED => true,
1407        }
1408    }
1409}
1410#[doc = r" Proxy"]
1411pub struct _STOPIEW<'a> {
1412    w: &'a mut W,
1413}
1414impl<'a> _STOPIEW<'a> {
1415    #[doc = r" Writes `variant` to the field"]
1416    #[inline]
1417    pub fn variant(self, variant: STOPIEW) -> &'a mut W {
1418        {
1419            self.bit(variant._bits())
1420        }
1421    }
1422    #[doc = "Stop detection (STOPF) interrupt disabled"]
1423    #[inline]
1424    pub fn disabled(self) -> &'a mut W {
1425        self.variant(STOPIEW::DISABLED)
1426    }
1427    #[doc = "Stop detection (STOPF) interrupt enabled"]
1428    #[inline]
1429    pub fn enabled(self) -> &'a mut W {
1430        self.variant(STOPIEW::ENABLED)
1431    }
1432    #[doc = r" Sets the field bit"]
1433    pub fn set_bit(self) -> &'a mut W {
1434        self.bit(true)
1435    }
1436    #[doc = r" Clears the field bit"]
1437    pub fn clear_bit(self) -> &'a mut W {
1438        self.bit(false)
1439    }
1440    #[doc = r" Writes raw bits to the field"]
1441    #[inline]
1442    pub fn bit(self, value: bool) -> &'a mut W {
1443        const MASK: bool = true;
1444        const OFFSET: u8 = 5;
1445        self.w.bits &= !((MASK as u32) << OFFSET);
1446        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1447        self.w
1448    }
1449}
1450#[doc = "Values that can be written to the field `TCIE`"]
1451pub enum TCIEW {
1452    #[doc = "Transfer Complete interrupt disabled"]
1453    DISABLED,
1454    #[doc = "Transfer Complete interrupt enabled"]
1455    ENABLED,
1456}
1457impl TCIEW {
1458    #[allow(missing_docs)]
1459    #[doc(hidden)]
1460    #[inline]
1461    pub fn _bits(&self) -> bool {
1462        match *self {
1463            TCIEW::DISABLED => false,
1464            TCIEW::ENABLED => true,
1465        }
1466    }
1467}
1468#[doc = r" Proxy"]
1469pub struct _TCIEW<'a> {
1470    w: &'a mut W,
1471}
1472impl<'a> _TCIEW<'a> {
1473    #[doc = r" Writes `variant` to the field"]
1474    #[inline]
1475    pub fn variant(self, variant: TCIEW) -> &'a mut W {
1476        {
1477            self.bit(variant._bits())
1478        }
1479    }
1480    #[doc = "Transfer Complete interrupt disabled"]
1481    #[inline]
1482    pub fn disabled(self) -> &'a mut W {
1483        self.variant(TCIEW::DISABLED)
1484    }
1485    #[doc = "Transfer Complete interrupt enabled"]
1486    #[inline]
1487    pub fn enabled(self) -> &'a mut W {
1488        self.variant(TCIEW::ENABLED)
1489    }
1490    #[doc = r" Sets the field bit"]
1491    pub fn set_bit(self) -> &'a mut W {
1492        self.bit(true)
1493    }
1494    #[doc = r" Clears the field bit"]
1495    pub fn clear_bit(self) -> &'a mut W {
1496        self.bit(false)
1497    }
1498    #[doc = r" Writes raw bits to the field"]
1499    #[inline]
1500    pub fn bit(self, value: bool) -> &'a mut W {
1501        const MASK: bool = true;
1502        const OFFSET: u8 = 6;
1503        self.w.bits &= !((MASK as u32) << OFFSET);
1504        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1505        self.w
1506    }
1507}
1508#[doc = "Values that can be written to the field `ERRIE`"]
1509pub enum ERRIEW {
1510    #[doc = "Error detection interrupts disabled"]
1511    DISABLED,
1512    #[doc = "Error detection interrupts enabled"]
1513    ENABLED,
1514}
1515impl ERRIEW {
1516    #[allow(missing_docs)]
1517    #[doc(hidden)]
1518    #[inline]
1519    pub fn _bits(&self) -> bool {
1520        match *self {
1521            ERRIEW::DISABLED => false,
1522            ERRIEW::ENABLED => true,
1523        }
1524    }
1525}
1526#[doc = r" Proxy"]
1527pub struct _ERRIEW<'a> {
1528    w: &'a mut W,
1529}
1530impl<'a> _ERRIEW<'a> {
1531    #[doc = r" Writes `variant` to the field"]
1532    #[inline]
1533    pub fn variant(self, variant: ERRIEW) -> &'a mut W {
1534        {
1535            self.bit(variant._bits())
1536        }
1537    }
1538    #[doc = "Error detection interrupts disabled"]
1539    #[inline]
1540    pub fn disabled(self) -> &'a mut W {
1541        self.variant(ERRIEW::DISABLED)
1542    }
1543    #[doc = "Error detection interrupts enabled"]
1544    #[inline]
1545    pub fn enabled(self) -> &'a mut W {
1546        self.variant(ERRIEW::ENABLED)
1547    }
1548    #[doc = r" Sets the field bit"]
1549    pub fn set_bit(self) -> &'a mut W {
1550        self.bit(true)
1551    }
1552    #[doc = r" Clears the field bit"]
1553    pub fn clear_bit(self) -> &'a mut W {
1554        self.bit(false)
1555    }
1556    #[doc = r" Writes raw bits to the field"]
1557    #[inline]
1558    pub fn bit(self, value: bool) -> &'a mut W {
1559        const MASK: bool = true;
1560        const OFFSET: u8 = 7;
1561        self.w.bits &= !((MASK as u32) << OFFSET);
1562        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1563        self.w
1564    }
1565}
1566#[doc = "Values that can be written to the field `DNF`"]
1567pub enum DNFW {
1568    #[doc = "Digital filter disabled"]
1569    NOFILTER,
1570    #[doc = "Digital filter enabled and filtering capability up to 1 tI2CCLK"]
1571    FILTER1,
1572    #[doc = "Digital filter enabled and filtering capability up to 2 tI2CCLK"]
1573    FILTER2,
1574    #[doc = "Digital filter enabled and filtering capability up to 3 tI2CCLK"]
1575    FILTER3,
1576    #[doc = "Digital filter enabled and filtering capability up to 4 tI2CCLK"]
1577    FILTER4,
1578    #[doc = "Digital filter enabled and filtering capability up to 5 tI2CCLK"]
1579    FILTER5,
1580    #[doc = "Digital filter enabled and filtering capability up to 6 tI2CCLK"]
1581    FILTER6,
1582    #[doc = "Digital filter enabled and filtering capability up to 7 tI2CCLK"]
1583    FILTER7,
1584    #[doc = "Digital filter enabled and filtering capability up to 8 tI2CCLK"]
1585    FILTER8,
1586    #[doc = "Digital filter enabled and filtering capability up to 9 tI2CCLK"]
1587    FILTER9,
1588    #[doc = "Digital filter enabled and filtering capability up to 10 tI2CCLK"]
1589    FILTER10,
1590    #[doc = "Digital filter enabled and filtering capability up to 11 tI2CCLK"]
1591    FILTER11,
1592    #[doc = "Digital filter enabled and filtering capability up to 12 tI2CCLK"]
1593    FILTER12,
1594    #[doc = "Digital filter enabled and filtering capability up to 13 tI2CCLK"]
1595    FILTER13,
1596    #[doc = "Digital filter enabled and filtering capability up to 14 tI2CCLK"]
1597    FILTER14,
1598    #[doc = "Digital filter enabled and filtering capability up to 15 tI2CCLK"]
1599    FILTER15,
1600}
1601impl DNFW {
1602    #[allow(missing_docs)]
1603    #[doc(hidden)]
1604    #[inline]
1605    pub fn _bits(&self) -> u8 {
1606        match *self {
1607            DNFW::NOFILTER => 0,
1608            DNFW::FILTER1 => 1,
1609            DNFW::FILTER2 => 2,
1610            DNFW::FILTER3 => 3,
1611            DNFW::FILTER4 => 4,
1612            DNFW::FILTER5 => 5,
1613            DNFW::FILTER6 => 6,
1614            DNFW::FILTER7 => 7,
1615            DNFW::FILTER8 => 8,
1616            DNFW::FILTER9 => 9,
1617            DNFW::FILTER10 => 10,
1618            DNFW::FILTER11 => 11,
1619            DNFW::FILTER12 => 12,
1620            DNFW::FILTER13 => 13,
1621            DNFW::FILTER14 => 14,
1622            DNFW::FILTER15 => 15,
1623        }
1624    }
1625}
1626#[doc = r" Proxy"]
1627pub struct _DNFW<'a> {
1628    w: &'a mut W,
1629}
1630impl<'a> _DNFW<'a> {
1631    #[doc = r" Writes `variant` to the field"]
1632    #[inline]
1633    pub fn variant(self, variant: DNFW) -> &'a mut W {
1634        {
1635            self.bits(variant._bits())
1636        }
1637    }
1638    #[doc = "Digital filter disabled"]
1639    #[inline]
1640    pub fn no_filter(self) -> &'a mut W {
1641        self.variant(DNFW::NOFILTER)
1642    }
1643    #[doc = "Digital filter enabled and filtering capability up to 1 tI2CCLK"]
1644    #[inline]
1645    pub fn filter1(self) -> &'a mut W {
1646        self.variant(DNFW::FILTER1)
1647    }
1648    #[doc = "Digital filter enabled and filtering capability up to 2 tI2CCLK"]
1649    #[inline]
1650    pub fn filter2(self) -> &'a mut W {
1651        self.variant(DNFW::FILTER2)
1652    }
1653    #[doc = "Digital filter enabled and filtering capability up to 3 tI2CCLK"]
1654    #[inline]
1655    pub fn filter3(self) -> &'a mut W {
1656        self.variant(DNFW::FILTER3)
1657    }
1658    #[doc = "Digital filter enabled and filtering capability up to 4 tI2CCLK"]
1659    #[inline]
1660    pub fn filter4(self) -> &'a mut W {
1661        self.variant(DNFW::FILTER4)
1662    }
1663    #[doc = "Digital filter enabled and filtering capability up to 5 tI2CCLK"]
1664    #[inline]
1665    pub fn filter5(self) -> &'a mut W {
1666        self.variant(DNFW::FILTER5)
1667    }
1668    #[doc = "Digital filter enabled and filtering capability up to 6 tI2CCLK"]
1669    #[inline]
1670    pub fn filter6(self) -> &'a mut W {
1671        self.variant(DNFW::FILTER6)
1672    }
1673    #[doc = "Digital filter enabled and filtering capability up to 7 tI2CCLK"]
1674    #[inline]
1675    pub fn filter7(self) -> &'a mut W {
1676        self.variant(DNFW::FILTER7)
1677    }
1678    #[doc = "Digital filter enabled and filtering capability up to 8 tI2CCLK"]
1679    #[inline]
1680    pub fn filter8(self) -> &'a mut W {
1681        self.variant(DNFW::FILTER8)
1682    }
1683    #[doc = "Digital filter enabled and filtering capability up to 9 tI2CCLK"]
1684    #[inline]
1685    pub fn filter9(self) -> &'a mut W {
1686        self.variant(DNFW::FILTER9)
1687    }
1688    #[doc = "Digital filter enabled and filtering capability up to 10 tI2CCLK"]
1689    #[inline]
1690    pub fn filter10(self) -> &'a mut W {
1691        self.variant(DNFW::FILTER10)
1692    }
1693    #[doc = "Digital filter enabled and filtering capability up to 11 tI2CCLK"]
1694    #[inline]
1695    pub fn filter11(self) -> &'a mut W {
1696        self.variant(DNFW::FILTER11)
1697    }
1698    #[doc = "Digital filter enabled and filtering capability up to 12 tI2CCLK"]
1699    #[inline]
1700    pub fn filter12(self) -> &'a mut W {
1701        self.variant(DNFW::FILTER12)
1702    }
1703    #[doc = "Digital filter enabled and filtering capability up to 13 tI2CCLK"]
1704    #[inline]
1705    pub fn filter13(self) -> &'a mut W {
1706        self.variant(DNFW::FILTER13)
1707    }
1708    #[doc = "Digital filter enabled and filtering capability up to 14 tI2CCLK"]
1709    #[inline]
1710    pub fn filter14(self) -> &'a mut W {
1711        self.variant(DNFW::FILTER14)
1712    }
1713    #[doc = "Digital filter enabled and filtering capability up to 15 tI2CCLK"]
1714    #[inline]
1715    pub fn filter15(self) -> &'a mut W {
1716        self.variant(DNFW::FILTER15)
1717    }
1718    #[doc = r" Writes raw bits to the field"]
1719    #[inline]
1720    pub fn bits(self, value: u8) -> &'a mut W {
1721        const MASK: u8 = 15;
1722        const OFFSET: u8 = 8;
1723        self.w.bits &= !((MASK as u32) << OFFSET);
1724        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1725        self.w
1726    }
1727}
1728#[doc = "Values that can be written to the field `ANFOFF`"]
1729pub enum ANFOFFW {
1730    #[doc = "Analog noise filter enabled"]
1731    ENABLED,
1732    #[doc = "Analog noise filter disabled"]
1733    DISABLED,
1734}
1735impl ANFOFFW {
1736    #[allow(missing_docs)]
1737    #[doc(hidden)]
1738    #[inline]
1739    pub fn _bits(&self) -> bool {
1740        match *self {
1741            ANFOFFW::ENABLED => false,
1742            ANFOFFW::DISABLED => true,
1743        }
1744    }
1745}
1746#[doc = r" Proxy"]
1747pub struct _ANFOFFW<'a> {
1748    w: &'a mut W,
1749}
1750impl<'a> _ANFOFFW<'a> {
1751    #[doc = r" Writes `variant` to the field"]
1752    #[inline]
1753    pub fn variant(self, variant: ANFOFFW) -> &'a mut W {
1754        {
1755            self.bit(variant._bits())
1756        }
1757    }
1758    #[doc = "Analog noise filter enabled"]
1759    #[inline]
1760    pub fn enabled(self) -> &'a mut W {
1761        self.variant(ANFOFFW::ENABLED)
1762    }
1763    #[doc = "Analog noise filter disabled"]
1764    #[inline]
1765    pub fn disabled(self) -> &'a mut W {
1766        self.variant(ANFOFFW::DISABLED)
1767    }
1768    #[doc = r" Sets the field bit"]
1769    pub fn set_bit(self) -> &'a mut W {
1770        self.bit(true)
1771    }
1772    #[doc = r" Clears the field bit"]
1773    pub fn clear_bit(self) -> &'a mut W {
1774        self.bit(false)
1775    }
1776    #[doc = r" Writes raw bits to the field"]
1777    #[inline]
1778    pub fn bit(self, value: bool) -> &'a mut W {
1779        const MASK: bool = true;
1780        const OFFSET: u8 = 12;
1781        self.w.bits &= !((MASK as u32) << OFFSET);
1782        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1783        self.w
1784    }
1785}
1786#[doc = "Values that can be written to the field `TXDMAEN`"]
1787pub enum TXDMAENW {
1788    #[doc = "DMA mode disabled for transmission"]
1789    DISABLED,
1790    #[doc = "DMA mode enabled for transmission"]
1791    ENABLED,
1792}
1793impl TXDMAENW {
1794    #[allow(missing_docs)]
1795    #[doc(hidden)]
1796    #[inline]
1797    pub fn _bits(&self) -> bool {
1798        match *self {
1799            TXDMAENW::DISABLED => false,
1800            TXDMAENW::ENABLED => true,
1801        }
1802    }
1803}
1804#[doc = r" Proxy"]
1805pub struct _TXDMAENW<'a> {
1806    w: &'a mut W,
1807}
1808impl<'a> _TXDMAENW<'a> {
1809    #[doc = r" Writes `variant` to the field"]
1810    #[inline]
1811    pub fn variant(self, variant: TXDMAENW) -> &'a mut W {
1812        {
1813            self.bit(variant._bits())
1814        }
1815    }
1816    #[doc = "DMA mode disabled for transmission"]
1817    #[inline]
1818    pub fn disabled(self) -> &'a mut W {
1819        self.variant(TXDMAENW::DISABLED)
1820    }
1821    #[doc = "DMA mode enabled for transmission"]
1822    #[inline]
1823    pub fn enabled(self) -> &'a mut W {
1824        self.variant(TXDMAENW::ENABLED)
1825    }
1826    #[doc = r" Sets the field bit"]
1827    pub fn set_bit(self) -> &'a mut W {
1828        self.bit(true)
1829    }
1830    #[doc = r" Clears the field bit"]
1831    pub fn clear_bit(self) -> &'a mut W {
1832        self.bit(false)
1833    }
1834    #[doc = r" Writes raw bits to the field"]
1835    #[inline]
1836    pub fn bit(self, value: bool) -> &'a mut W {
1837        const MASK: bool = true;
1838        const OFFSET: u8 = 14;
1839        self.w.bits &= !((MASK as u32) << OFFSET);
1840        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1841        self.w
1842    }
1843}
1844#[doc = "Values that can be written to the field `RXDMAEN`"]
1845pub enum RXDMAENW {
1846    #[doc = "DMA mode disabled for reception"]
1847    DISABLED,
1848    #[doc = "DMA mode enabled for reception"]
1849    ENABLED,
1850}
1851impl RXDMAENW {
1852    #[allow(missing_docs)]
1853    #[doc(hidden)]
1854    #[inline]
1855    pub fn _bits(&self) -> bool {
1856        match *self {
1857            RXDMAENW::DISABLED => false,
1858            RXDMAENW::ENABLED => true,
1859        }
1860    }
1861}
1862#[doc = r" Proxy"]
1863pub struct _RXDMAENW<'a> {
1864    w: &'a mut W,
1865}
1866impl<'a> _RXDMAENW<'a> {
1867    #[doc = r" Writes `variant` to the field"]
1868    #[inline]
1869    pub fn variant(self, variant: RXDMAENW) -> &'a mut W {
1870        {
1871            self.bit(variant._bits())
1872        }
1873    }
1874    #[doc = "DMA mode disabled for reception"]
1875    #[inline]
1876    pub fn disabled(self) -> &'a mut W {
1877        self.variant(RXDMAENW::DISABLED)
1878    }
1879    #[doc = "DMA mode enabled for reception"]
1880    #[inline]
1881    pub fn enabled(self) -> &'a mut W {
1882        self.variant(RXDMAENW::ENABLED)
1883    }
1884    #[doc = r" Sets the field bit"]
1885    pub fn set_bit(self) -> &'a mut W {
1886        self.bit(true)
1887    }
1888    #[doc = r" Clears the field bit"]
1889    pub fn clear_bit(self) -> &'a mut W {
1890        self.bit(false)
1891    }
1892    #[doc = r" Writes raw bits to the field"]
1893    #[inline]
1894    pub fn bit(self, value: bool) -> &'a mut W {
1895        const MASK: bool = true;
1896        const OFFSET: u8 = 15;
1897        self.w.bits &= !((MASK as u32) << OFFSET);
1898        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1899        self.w
1900    }
1901}
1902#[doc = "Values that can be written to the field `SBC`"]
1903pub enum SBCW {
1904    #[doc = "Slave byte control disabled"]
1905    DISABLED,
1906    #[doc = "Slave byte control enabled"]
1907    ENABLED,
1908}
1909impl SBCW {
1910    #[allow(missing_docs)]
1911    #[doc(hidden)]
1912    #[inline]
1913    pub fn _bits(&self) -> bool {
1914        match *self {
1915            SBCW::DISABLED => false,
1916            SBCW::ENABLED => true,
1917        }
1918    }
1919}
1920#[doc = r" Proxy"]
1921pub struct _SBCW<'a> {
1922    w: &'a mut W,
1923}
1924impl<'a> _SBCW<'a> {
1925    #[doc = r" Writes `variant` to the field"]
1926    #[inline]
1927    pub fn variant(self, variant: SBCW) -> &'a mut W {
1928        {
1929            self.bit(variant._bits())
1930        }
1931    }
1932    #[doc = "Slave byte control disabled"]
1933    #[inline]
1934    pub fn disabled(self) -> &'a mut W {
1935        self.variant(SBCW::DISABLED)
1936    }
1937    #[doc = "Slave byte control enabled"]
1938    #[inline]
1939    pub fn enabled(self) -> &'a mut W {
1940        self.variant(SBCW::ENABLED)
1941    }
1942    #[doc = r" Sets the field bit"]
1943    pub fn set_bit(self) -> &'a mut W {
1944        self.bit(true)
1945    }
1946    #[doc = r" Clears the field bit"]
1947    pub fn clear_bit(self) -> &'a mut W {
1948        self.bit(false)
1949    }
1950    #[doc = r" Writes raw bits to the field"]
1951    #[inline]
1952    pub fn bit(self, value: bool) -> &'a mut W {
1953        const MASK: bool = true;
1954        const OFFSET: u8 = 16;
1955        self.w.bits &= !((MASK as u32) << OFFSET);
1956        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1957        self.w
1958    }
1959}
1960#[doc = "Values that can be written to the field `NOSTRETCH`"]
1961pub enum NOSTRETCHW {
1962    #[doc = "Clock stretching enabled"]
1963    ENABLED,
1964    #[doc = "Clock stretching disabled"]
1965    DISABLED,
1966}
1967impl NOSTRETCHW {
1968    #[allow(missing_docs)]
1969    #[doc(hidden)]
1970    #[inline]
1971    pub fn _bits(&self) -> bool {
1972        match *self {
1973            NOSTRETCHW::ENABLED => false,
1974            NOSTRETCHW::DISABLED => true,
1975        }
1976    }
1977}
1978#[doc = r" Proxy"]
1979pub struct _NOSTRETCHW<'a> {
1980    w: &'a mut W,
1981}
1982impl<'a> _NOSTRETCHW<'a> {
1983    #[doc = r" Writes `variant` to the field"]
1984    #[inline]
1985    pub fn variant(self, variant: NOSTRETCHW) -> &'a mut W {
1986        {
1987            self.bit(variant._bits())
1988        }
1989    }
1990    #[doc = "Clock stretching enabled"]
1991    #[inline]
1992    pub fn enabled(self) -> &'a mut W {
1993        self.variant(NOSTRETCHW::ENABLED)
1994    }
1995    #[doc = "Clock stretching disabled"]
1996    #[inline]
1997    pub fn disabled(self) -> &'a mut W {
1998        self.variant(NOSTRETCHW::DISABLED)
1999    }
2000    #[doc = r" Sets the field bit"]
2001    pub fn set_bit(self) -> &'a mut W {
2002        self.bit(true)
2003    }
2004    #[doc = r" Clears the field bit"]
2005    pub fn clear_bit(self) -> &'a mut W {
2006        self.bit(false)
2007    }
2008    #[doc = r" Writes raw bits to the field"]
2009    #[inline]
2010    pub fn bit(self, value: bool) -> &'a mut W {
2011        const MASK: bool = true;
2012        const OFFSET: u8 = 17;
2013        self.w.bits &= !((MASK as u32) << OFFSET);
2014        self.w.bits |= ((value & MASK) as u32) << OFFSET;
2015        self.w
2016    }
2017}
2018#[doc = "Values that can be written to the field `WUPEN`"]
2019pub enum WUPENW {
2020    #[doc = "Wakeup from Stop mode disabled"]
2021    DISABLED,
2022    #[doc = "Wakeup from Stop mode enabled"]
2023    ENABLED,
2024}
2025impl WUPENW {
2026    #[allow(missing_docs)]
2027    #[doc(hidden)]
2028    #[inline]
2029    pub fn _bits(&self) -> bool {
2030        match *self {
2031            WUPENW::DISABLED => false,
2032            WUPENW::ENABLED => true,
2033        }
2034    }
2035}
2036#[doc = r" Proxy"]
2037pub struct _WUPENW<'a> {
2038    w: &'a mut W,
2039}
2040impl<'a> _WUPENW<'a> {
2041    #[doc = r" Writes `variant` to the field"]
2042    #[inline]
2043    pub fn variant(self, variant: WUPENW) -> &'a mut W {
2044        {
2045            self.bit(variant._bits())
2046        }
2047    }
2048    #[doc = "Wakeup from Stop mode disabled"]
2049    #[inline]
2050    pub fn disabled(self) -> &'a mut W {
2051        self.variant(WUPENW::DISABLED)
2052    }
2053    #[doc = "Wakeup from Stop mode enabled"]
2054    #[inline]
2055    pub fn enabled(self) -> &'a mut W {
2056        self.variant(WUPENW::ENABLED)
2057    }
2058    #[doc = r" Sets the field bit"]
2059    pub fn set_bit(self) -> &'a mut W {
2060        self.bit(true)
2061    }
2062    #[doc = r" Clears the field bit"]
2063    pub fn clear_bit(self) -> &'a mut W {
2064        self.bit(false)
2065    }
2066    #[doc = r" Writes raw bits to the field"]
2067    #[inline]
2068    pub fn bit(self, value: bool) -> &'a mut W {
2069        const MASK: bool = true;
2070        const OFFSET: u8 = 18;
2071        self.w.bits &= !((MASK as u32) << OFFSET);
2072        self.w.bits |= ((value & MASK) as u32) << OFFSET;
2073        self.w
2074    }
2075}
2076#[doc = "Values that can be written to the field `GCEN`"]
2077pub enum GCENW {
2078    #[doc = "General call disabled. Address 0b00000000 is NACKed"]
2079    DISABLED,
2080    #[doc = "General call enabled. Address 0b00000000 is ACKed"]
2081    ENABLED,
2082}
2083impl GCENW {
2084    #[allow(missing_docs)]
2085    #[doc(hidden)]
2086    #[inline]
2087    pub fn _bits(&self) -> bool {
2088        match *self {
2089            GCENW::DISABLED => false,
2090            GCENW::ENABLED => true,
2091        }
2092    }
2093}
2094#[doc = r" Proxy"]
2095pub struct _GCENW<'a> {
2096    w: &'a mut W,
2097}
2098impl<'a> _GCENW<'a> {
2099    #[doc = r" Writes `variant` to the field"]
2100    #[inline]
2101    pub fn variant(self, variant: GCENW) -> &'a mut W {
2102        {
2103            self.bit(variant._bits())
2104        }
2105    }
2106    #[doc = "General call disabled. Address 0b00000000 is NACKed"]
2107    #[inline]
2108    pub fn disabled(self) -> &'a mut W {
2109        self.variant(GCENW::DISABLED)
2110    }
2111    #[doc = "General call enabled. Address 0b00000000 is ACKed"]
2112    #[inline]
2113    pub fn enabled(self) -> &'a mut W {
2114        self.variant(GCENW::ENABLED)
2115    }
2116    #[doc = r" Sets the field bit"]
2117    pub fn set_bit(self) -> &'a mut W {
2118        self.bit(true)
2119    }
2120    #[doc = r" Clears the field bit"]
2121    pub fn clear_bit(self) -> &'a mut W {
2122        self.bit(false)
2123    }
2124    #[doc = r" Writes raw bits to the field"]
2125    #[inline]
2126    pub fn bit(self, value: bool) -> &'a mut W {
2127        const MASK: bool = true;
2128        const OFFSET: u8 = 19;
2129        self.w.bits &= !((MASK as u32) << OFFSET);
2130        self.w.bits |= ((value & MASK) as u32) << OFFSET;
2131        self.w
2132    }
2133}
2134#[doc = "Values that can be written to the field `SMBHEN`"]
2135pub enum SMBHENW {
2136    #[doc = "Host address disabled. Address 0b0001000x is NACKed"]
2137    DISABLED,
2138    #[doc = "Host address enabled. Address 0b0001000x is ACKed"]
2139    ENABLED,
2140}
2141impl SMBHENW {
2142    #[allow(missing_docs)]
2143    #[doc(hidden)]
2144    #[inline]
2145    pub fn _bits(&self) -> bool {
2146        match *self {
2147            SMBHENW::DISABLED => false,
2148            SMBHENW::ENABLED => true,
2149        }
2150    }
2151}
2152#[doc = r" Proxy"]
2153pub struct _SMBHENW<'a> {
2154    w: &'a mut W,
2155}
2156impl<'a> _SMBHENW<'a> {
2157    #[doc = r" Writes `variant` to the field"]
2158    #[inline]
2159    pub fn variant(self, variant: SMBHENW) -> &'a mut W {
2160        {
2161            self.bit(variant._bits())
2162        }
2163    }
2164    #[doc = "Host address disabled. Address 0b0001000x is NACKed"]
2165    #[inline]
2166    pub fn disabled(self) -> &'a mut W {
2167        self.variant(SMBHENW::DISABLED)
2168    }
2169    #[doc = "Host address enabled. Address 0b0001000x is ACKed"]
2170    #[inline]
2171    pub fn enabled(self) -> &'a mut W {
2172        self.variant(SMBHENW::ENABLED)
2173    }
2174    #[doc = r" Sets the field bit"]
2175    pub fn set_bit(self) -> &'a mut W {
2176        self.bit(true)
2177    }
2178    #[doc = r" Clears the field bit"]
2179    pub fn clear_bit(self) -> &'a mut W {
2180        self.bit(false)
2181    }
2182    #[doc = r" Writes raw bits to the field"]
2183    #[inline]
2184    pub fn bit(self, value: bool) -> &'a mut W {
2185        const MASK: bool = true;
2186        const OFFSET: u8 = 20;
2187        self.w.bits &= !((MASK as u32) << OFFSET);
2188        self.w.bits |= ((value & MASK) as u32) << OFFSET;
2189        self.w
2190    }
2191}
2192#[doc = "Values that can be written to the field `SMBDEN`"]
2193pub enum SMBDENW {
2194    #[doc = "Device default address disabled. Address 0b1100001x is NACKed"]
2195    DISABLED,
2196    #[doc = "Device default address enabled. Address 0b1100001x is ACKed"]
2197    ENABLED,
2198}
2199impl SMBDENW {
2200    #[allow(missing_docs)]
2201    #[doc(hidden)]
2202    #[inline]
2203    pub fn _bits(&self) -> bool {
2204        match *self {
2205            SMBDENW::DISABLED => false,
2206            SMBDENW::ENABLED => true,
2207        }
2208    }
2209}
2210#[doc = r" Proxy"]
2211pub struct _SMBDENW<'a> {
2212    w: &'a mut W,
2213}
2214impl<'a> _SMBDENW<'a> {
2215    #[doc = r" Writes `variant` to the field"]
2216    #[inline]
2217    pub fn variant(self, variant: SMBDENW) -> &'a mut W {
2218        {
2219            self.bit(variant._bits())
2220        }
2221    }
2222    #[doc = "Device default address disabled. Address 0b1100001x is NACKed"]
2223    #[inline]
2224    pub fn disabled(self) -> &'a mut W {
2225        self.variant(SMBDENW::DISABLED)
2226    }
2227    #[doc = "Device default address enabled. Address 0b1100001x is ACKed"]
2228    #[inline]
2229    pub fn enabled(self) -> &'a mut W {
2230        self.variant(SMBDENW::ENABLED)
2231    }
2232    #[doc = r" Sets the field bit"]
2233    pub fn set_bit(self) -> &'a mut W {
2234        self.bit(true)
2235    }
2236    #[doc = r" Clears the field bit"]
2237    pub fn clear_bit(self) -> &'a mut W {
2238        self.bit(false)
2239    }
2240    #[doc = r" Writes raw bits to the field"]
2241    #[inline]
2242    pub fn bit(self, value: bool) -> &'a mut W {
2243        const MASK: bool = true;
2244        const OFFSET: u8 = 21;
2245        self.w.bits &= !((MASK as u32) << OFFSET);
2246        self.w.bits |= ((value & MASK) as u32) << OFFSET;
2247        self.w
2248    }
2249}
2250#[doc = "Values that can be written to the field `ALERTEN`"]
2251pub enum ALERTENW {
2252    #[doc = "In device mode (SMBHEN=Disabled) Releases SMBA pin high and Alert Response Address Header disabled (0001100x) followed by NACK. In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) not supported"]
2253    DISABLED,
2254    #[doc = "In device mode (SMBHEN=Disabled) Drives SMBA pin low and Alert Response Address Header enabled (0001100x) followed by ACK.In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) supported"]
2255    ENABLED,
2256}
2257impl ALERTENW {
2258    #[allow(missing_docs)]
2259    #[doc(hidden)]
2260    #[inline]
2261    pub fn _bits(&self) -> bool {
2262        match *self {
2263            ALERTENW::DISABLED => false,
2264            ALERTENW::ENABLED => true,
2265        }
2266    }
2267}
2268#[doc = r" Proxy"]
2269pub struct _ALERTENW<'a> {
2270    w: &'a mut W,
2271}
2272impl<'a> _ALERTENW<'a> {
2273    #[doc = r" Writes `variant` to the field"]
2274    #[inline]
2275    pub fn variant(self, variant: ALERTENW) -> &'a mut W {
2276        {
2277            self.bit(variant._bits())
2278        }
2279    }
2280    #[doc = "In device mode (SMBHEN=Disabled) Releases SMBA pin high and Alert Response Address Header disabled (0001100x) followed by NACK. In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) not supported"]
2281    #[inline]
2282    pub fn disabled(self) -> &'a mut W {
2283        self.variant(ALERTENW::DISABLED)
2284    }
2285    #[doc = "In device mode (SMBHEN=Disabled) Drives SMBA pin low and Alert Response Address Header enabled (0001100x) followed by ACK.In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) supported"]
2286    #[inline]
2287    pub fn enabled(self) -> &'a mut W {
2288        self.variant(ALERTENW::ENABLED)
2289    }
2290    #[doc = r" Sets the field bit"]
2291    pub fn set_bit(self) -> &'a mut W {
2292        self.bit(true)
2293    }
2294    #[doc = r" Clears the field bit"]
2295    pub fn clear_bit(self) -> &'a mut W {
2296        self.bit(false)
2297    }
2298    #[doc = r" Writes raw bits to the field"]
2299    #[inline]
2300    pub fn bit(self, value: bool) -> &'a mut W {
2301        const MASK: bool = true;
2302        const OFFSET: u8 = 22;
2303        self.w.bits &= !((MASK as u32) << OFFSET);
2304        self.w.bits |= ((value & MASK) as u32) << OFFSET;
2305        self.w
2306    }
2307}
2308#[doc = "Values that can be written to the field `PECEN`"]
2309pub enum PECENW {
2310    #[doc = "PEC calculation disabled"]
2311    DISABLED,
2312    #[doc = "PEC calculation enabled"]
2313    ENABLED,
2314}
2315impl PECENW {
2316    #[allow(missing_docs)]
2317    #[doc(hidden)]
2318    #[inline]
2319    pub fn _bits(&self) -> bool {
2320        match *self {
2321            PECENW::DISABLED => false,
2322            PECENW::ENABLED => true,
2323        }
2324    }
2325}
2326#[doc = r" Proxy"]
2327pub struct _PECENW<'a> {
2328    w: &'a mut W,
2329}
2330impl<'a> _PECENW<'a> {
2331    #[doc = r" Writes `variant` to the field"]
2332    #[inline]
2333    pub fn variant(self, variant: PECENW) -> &'a mut W {
2334        {
2335            self.bit(variant._bits())
2336        }
2337    }
2338    #[doc = "PEC calculation disabled"]
2339    #[inline]
2340    pub fn disabled(self) -> &'a mut W {
2341        self.variant(PECENW::DISABLED)
2342    }
2343    #[doc = "PEC calculation enabled"]
2344    #[inline]
2345    pub fn enabled(self) -> &'a mut W {
2346        self.variant(PECENW::ENABLED)
2347    }
2348    #[doc = r" Sets the field bit"]
2349    pub fn set_bit(self) -> &'a mut W {
2350        self.bit(true)
2351    }
2352    #[doc = r" Clears the field bit"]
2353    pub fn clear_bit(self) -> &'a mut W {
2354        self.bit(false)
2355    }
2356    #[doc = r" Writes raw bits to the field"]
2357    #[inline]
2358    pub fn bit(self, value: bool) -> &'a mut W {
2359        const MASK: bool = true;
2360        const OFFSET: u8 = 23;
2361        self.w.bits &= !((MASK as u32) << OFFSET);
2362        self.w.bits |= ((value & MASK) as u32) << OFFSET;
2363        self.w
2364    }
2365}
2366impl R {
2367    #[doc = r" Value of the register as raw bits"]
2368    #[inline]
2369    pub fn bits(&self) -> u32 {
2370        self.bits
2371    }
2372    #[doc = "Bit 0 - Peripheral enable"]
2373    #[inline]
2374    pub fn pe(&self) -> PER {
2375        PER::_from({
2376            const MASK: bool = true;
2377            const OFFSET: u8 = 0;
2378            ((self.bits >> OFFSET) & MASK as u32) != 0
2379        })
2380    }
2381    #[doc = "Bit 1 - TX Interrupt enable"]
2382    #[inline]
2383    pub fn txie(&self) -> TXIER {
2384        TXIER::_from({
2385            const MASK: bool = true;
2386            const OFFSET: u8 = 1;
2387            ((self.bits >> OFFSET) & MASK as u32) != 0
2388        })
2389    }
2390    #[doc = "Bit 2 - RX Interrupt enable"]
2391    #[inline]
2392    pub fn rxie(&self) -> RXIER {
2393        RXIER::_from({
2394            const MASK: bool = true;
2395            const OFFSET: u8 = 2;
2396            ((self.bits >> OFFSET) & MASK as u32) != 0
2397        })
2398    }
2399    #[doc = "Bit 3 - Address match interrupt enable (slave only)"]
2400    #[inline]
2401    pub fn addrie(&self) -> ADDRIER {
2402        ADDRIER::_from({
2403            const MASK: bool = true;
2404            const OFFSET: u8 = 3;
2405            ((self.bits >> OFFSET) & MASK as u32) != 0
2406        })
2407    }
2408    #[doc = "Bit 4 - Not acknowledge received interrupt enable"]
2409    #[inline]
2410    pub fn nackie(&self) -> NACKIER {
2411        NACKIER::_from({
2412            const MASK: bool = true;
2413            const OFFSET: u8 = 4;
2414            ((self.bits >> OFFSET) & MASK as u32) != 0
2415        })
2416    }
2417    #[doc = "Bit 5 - STOP detection Interrupt enable"]
2418    #[inline]
2419    pub fn stopie(&self) -> STOPIER {
2420        STOPIER::_from({
2421            const MASK: bool = true;
2422            const OFFSET: u8 = 5;
2423            ((self.bits >> OFFSET) & MASK as u32) != 0
2424        })
2425    }
2426    #[doc = "Bit 6 - Transfer Complete interrupt enable"]
2427    #[inline]
2428    pub fn tcie(&self) -> TCIER {
2429        TCIER::_from({
2430            const MASK: bool = true;
2431            const OFFSET: u8 = 6;
2432            ((self.bits >> OFFSET) & MASK as u32) != 0
2433        })
2434    }
2435    #[doc = "Bit 7 - Error interrupts enable"]
2436    #[inline]
2437    pub fn errie(&self) -> ERRIER {
2438        ERRIER::_from({
2439            const MASK: bool = true;
2440            const OFFSET: u8 = 7;
2441            ((self.bits >> OFFSET) & MASK as u32) != 0
2442        })
2443    }
2444    #[doc = "Bits 8:11 - Digital noise filter"]
2445    #[inline]
2446    pub fn dnf(&self) -> DNFR {
2447        DNFR::_from({
2448            const MASK: u8 = 15;
2449            const OFFSET: u8 = 8;
2450            ((self.bits >> OFFSET) & MASK as u32) as u8
2451        })
2452    }
2453    #[doc = "Bit 12 - Analog noise filter OFF"]
2454    #[inline]
2455    pub fn anfoff(&self) -> ANFOFFR {
2456        ANFOFFR::_from({
2457            const MASK: bool = true;
2458            const OFFSET: u8 = 12;
2459            ((self.bits >> OFFSET) & MASK as u32) != 0
2460        })
2461    }
2462    #[doc = "Bit 14 - DMA transmission requests enable"]
2463    #[inline]
2464    pub fn txdmaen(&self) -> TXDMAENR {
2465        TXDMAENR::_from({
2466            const MASK: bool = true;
2467            const OFFSET: u8 = 14;
2468            ((self.bits >> OFFSET) & MASK as u32) != 0
2469        })
2470    }
2471    #[doc = "Bit 15 - DMA reception requests enable"]
2472    #[inline]
2473    pub fn rxdmaen(&self) -> RXDMAENR {
2474        RXDMAENR::_from({
2475            const MASK: bool = true;
2476            const OFFSET: u8 = 15;
2477            ((self.bits >> OFFSET) & MASK as u32) != 0
2478        })
2479    }
2480    #[doc = "Bit 16 - Slave byte control"]
2481    #[inline]
2482    pub fn sbc(&self) -> SBCR {
2483        SBCR::_from({
2484            const MASK: bool = true;
2485            const OFFSET: u8 = 16;
2486            ((self.bits >> OFFSET) & MASK as u32) != 0
2487        })
2488    }
2489    #[doc = "Bit 17 - Clock stretching disable"]
2490    #[inline]
2491    pub fn nostretch(&self) -> NOSTRETCHR {
2492        NOSTRETCHR::_from({
2493            const MASK: bool = true;
2494            const OFFSET: u8 = 17;
2495            ((self.bits >> OFFSET) & MASK as u32) != 0
2496        })
2497    }
2498    #[doc = "Bit 18 - Wakeup from STOP enable"]
2499    #[inline]
2500    pub fn wupen(&self) -> WUPENR {
2501        WUPENR::_from({
2502            const MASK: bool = true;
2503            const OFFSET: u8 = 18;
2504            ((self.bits >> OFFSET) & MASK as u32) != 0
2505        })
2506    }
2507    #[doc = "Bit 19 - General call enable"]
2508    #[inline]
2509    pub fn gcen(&self) -> GCENR {
2510        GCENR::_from({
2511            const MASK: bool = true;
2512            const OFFSET: u8 = 19;
2513            ((self.bits >> OFFSET) & MASK as u32) != 0
2514        })
2515    }
2516    #[doc = "Bit 20 - SMBus Host address enable"]
2517    #[inline]
2518    pub fn smbhen(&self) -> SMBHENR {
2519        SMBHENR::_from({
2520            const MASK: bool = true;
2521            const OFFSET: u8 = 20;
2522            ((self.bits >> OFFSET) & MASK as u32) != 0
2523        })
2524    }
2525    #[doc = "Bit 21 - SMBus Device Default address enable"]
2526    #[inline]
2527    pub fn smbden(&self) -> SMBDENR {
2528        SMBDENR::_from({
2529            const MASK: bool = true;
2530            const OFFSET: u8 = 21;
2531            ((self.bits >> OFFSET) & MASK as u32) != 0
2532        })
2533    }
2534    #[doc = "Bit 22 - SMBUS alert enable"]
2535    #[inline]
2536    pub fn alerten(&self) -> ALERTENR {
2537        ALERTENR::_from({
2538            const MASK: bool = true;
2539            const OFFSET: u8 = 22;
2540            ((self.bits >> OFFSET) & MASK as u32) != 0
2541        })
2542    }
2543    #[doc = "Bit 23 - PEC enable"]
2544    #[inline]
2545    pub fn pecen(&self) -> PECENR {
2546        PECENR::_from({
2547            const MASK: bool = true;
2548            const OFFSET: u8 = 23;
2549            ((self.bits >> OFFSET) & MASK as u32) != 0
2550        })
2551    }
2552}
2553impl W {
2554    #[doc = r" Reset value of the register"]
2555    #[inline]
2556    pub fn reset_value() -> W {
2557        W { bits: 0 }
2558    }
2559    #[doc = r" Writes raw bits to the register"]
2560    #[inline]
2561    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
2562        self.bits = bits;
2563        self
2564    }
2565    #[doc = "Bit 0 - Peripheral enable"]
2566    #[inline]
2567    pub fn pe(&mut self) -> _PEW {
2568        _PEW { w: self }
2569    }
2570    #[doc = "Bit 1 - TX Interrupt enable"]
2571    #[inline]
2572    pub fn txie(&mut self) -> _TXIEW {
2573        _TXIEW { w: self }
2574    }
2575    #[doc = "Bit 2 - RX Interrupt enable"]
2576    #[inline]
2577    pub fn rxie(&mut self) -> _RXIEW {
2578        _RXIEW { w: self }
2579    }
2580    #[doc = "Bit 3 - Address match interrupt enable (slave only)"]
2581    #[inline]
2582    pub fn addrie(&mut self) -> _ADDRIEW {
2583        _ADDRIEW { w: self }
2584    }
2585    #[doc = "Bit 4 - Not acknowledge received interrupt enable"]
2586    #[inline]
2587    pub fn nackie(&mut self) -> _NACKIEW {
2588        _NACKIEW { w: self }
2589    }
2590    #[doc = "Bit 5 - STOP detection Interrupt enable"]
2591    #[inline]
2592    pub fn stopie(&mut self) -> _STOPIEW {
2593        _STOPIEW { w: self }
2594    }
2595    #[doc = "Bit 6 - Transfer Complete interrupt enable"]
2596    #[inline]
2597    pub fn tcie(&mut self) -> _TCIEW {
2598        _TCIEW { w: self }
2599    }
2600    #[doc = "Bit 7 - Error interrupts enable"]
2601    #[inline]
2602    pub fn errie(&mut self) -> _ERRIEW {
2603        _ERRIEW { w: self }
2604    }
2605    #[doc = "Bits 8:11 - Digital noise filter"]
2606    #[inline]
2607    pub fn dnf(&mut self) -> _DNFW {
2608        _DNFW { w: self }
2609    }
2610    #[doc = "Bit 12 - Analog noise filter OFF"]
2611    #[inline]
2612    pub fn anfoff(&mut self) -> _ANFOFFW {
2613        _ANFOFFW { w: self }
2614    }
2615    #[doc = "Bit 14 - DMA transmission requests enable"]
2616    #[inline]
2617    pub fn txdmaen(&mut self) -> _TXDMAENW {
2618        _TXDMAENW { w: self }
2619    }
2620    #[doc = "Bit 15 - DMA reception requests enable"]
2621    #[inline]
2622    pub fn rxdmaen(&mut self) -> _RXDMAENW {
2623        _RXDMAENW { w: self }
2624    }
2625    #[doc = "Bit 16 - Slave byte control"]
2626    #[inline]
2627    pub fn sbc(&mut self) -> _SBCW {
2628        _SBCW { w: self }
2629    }
2630    #[doc = "Bit 17 - Clock stretching disable"]
2631    #[inline]
2632    pub fn nostretch(&mut self) -> _NOSTRETCHW {
2633        _NOSTRETCHW { w: self }
2634    }
2635    #[doc = "Bit 18 - Wakeup from STOP enable"]
2636    #[inline]
2637    pub fn wupen(&mut self) -> _WUPENW {
2638        _WUPENW { w: self }
2639    }
2640    #[doc = "Bit 19 - General call enable"]
2641    #[inline]
2642    pub fn gcen(&mut self) -> _GCENW {
2643        _GCENW { w: self }
2644    }
2645    #[doc = "Bit 20 - SMBus Host address enable"]
2646    #[inline]
2647    pub fn smbhen(&mut self) -> _SMBHENW {
2648        _SMBHENW { w: self }
2649    }
2650    #[doc = "Bit 21 - SMBus Device Default address enable"]
2651    #[inline]
2652    pub fn smbden(&mut self) -> _SMBDENW {
2653        _SMBDENW { w: self }
2654    }
2655    #[doc = "Bit 22 - SMBUS alert enable"]
2656    #[inline]
2657    pub fn alerten(&mut self) -> _ALERTENW {
2658        _ALERTENW { w: self }
2659    }
2660    #[doc = "Bit 23 - PEC enable"]
2661    #[inline]
2662    pub fn pecen(&mut self) -> _PECENW {
2663        _PECENW { w: self }
2664    }
2665}