efm32pg22_pac/efm32pg22c200/gpio_s/
portb_model.rs

1#[doc = "Register `PORTB_MODEL` reader"]
2pub struct R(crate::R<PORTB_MODEL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PORTB_MODEL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PORTB_MODEL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PORTB_MODEL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PORTB_MODEL` writer"]
17pub struct W(crate::W<PORTB_MODEL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PORTB_MODEL_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<PORTB_MODEL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PORTB_MODEL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `MODE0` reader - MODE n"]
38pub type MODE0_R = crate::FieldReader<u8, MODE0_A>;
39#[doc = "MODE n\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum MODE0_A {
43    #[doc = "0: Input disabled. Pullup if DOUT is set."]
44    DISABLED = 0,
45    #[doc = "1: Input enabled. Filter if DOUT is set."]
46    INPUT = 1,
47    #[doc = "2: Input enabled. DOUT determines pull direction."]
48    INPUTPULL = 2,
49    #[doc = "3: Input enabled with filter. DOUT determines pull direction."]
50    INPUTPULLFILTER = 3,
51    #[doc = "4: Push-pull output."]
52    PUSHPULL = 4,
53    #[doc = "5: Push-pull using alternate control."]
54    PUSHPULLALT = 5,
55    #[doc = "6: Wired-or output."]
56    WIREDOR = 6,
57    #[doc = "7: Wired-or output with pull-down."]
58    WIREDORPULLDOWN = 7,
59    #[doc = "8: Open-drain output."]
60    WIREDAND = 8,
61    #[doc = "9: Open-drain output with filter."]
62    WIREDANDFILTER = 9,
63    #[doc = "10: Open-drain output with pullup."]
64    WIREDANDPULLUP = 10,
65    #[doc = "11: Open-drain output with filter and pullup."]
66    WIREDANDPULLUPFILTER = 11,
67    #[doc = "12: Open-drain output using alternate control."]
68    WIREDANDALT = 12,
69    #[doc = "13: Open-drain output using alternate control with filter."]
70    WIREDANDALTFILTER = 13,
71    #[doc = "14: Open-drain output using alternate control with pullup."]
72    WIREDANDALTPULLUP = 14,
73    #[doc = "15: Open-drain output using alternate control with filter and pullup."]
74    WIREDANDALTPULLUPFILTER = 15,
75}
76impl From<MODE0_A> for u8 {
77    #[inline(always)]
78    fn from(variant: MODE0_A) -> Self {
79        variant as _
80    }
81}
82impl MODE0_R {
83    #[doc = "Get enumerated values variant"]
84    #[inline(always)]
85    pub fn variant(&self) -> MODE0_A {
86        match self.bits {
87            0 => MODE0_A::DISABLED,
88            1 => MODE0_A::INPUT,
89            2 => MODE0_A::INPUTPULL,
90            3 => MODE0_A::INPUTPULLFILTER,
91            4 => MODE0_A::PUSHPULL,
92            5 => MODE0_A::PUSHPULLALT,
93            6 => MODE0_A::WIREDOR,
94            7 => MODE0_A::WIREDORPULLDOWN,
95            8 => MODE0_A::WIREDAND,
96            9 => MODE0_A::WIREDANDFILTER,
97            10 => MODE0_A::WIREDANDPULLUP,
98            11 => MODE0_A::WIREDANDPULLUPFILTER,
99            12 => MODE0_A::WIREDANDALT,
100            13 => MODE0_A::WIREDANDALTFILTER,
101            14 => MODE0_A::WIREDANDALTPULLUP,
102            15 => MODE0_A::WIREDANDALTPULLUPFILTER,
103            _ => unreachable!(),
104        }
105    }
106    #[doc = "Checks if the value of the field is `DISABLED`"]
107    #[inline(always)]
108    pub fn is_disabled(&self) -> bool {
109        *self == MODE0_A::DISABLED
110    }
111    #[doc = "Checks if the value of the field is `INPUT`"]
112    #[inline(always)]
113    pub fn is_input(&self) -> bool {
114        *self == MODE0_A::INPUT
115    }
116    #[doc = "Checks if the value of the field is `INPUTPULL`"]
117    #[inline(always)]
118    pub fn is_inputpull(&self) -> bool {
119        *self == MODE0_A::INPUTPULL
120    }
121    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
122    #[inline(always)]
123    pub fn is_inputpullfilter(&self) -> bool {
124        *self == MODE0_A::INPUTPULLFILTER
125    }
126    #[doc = "Checks if the value of the field is `PUSHPULL`"]
127    #[inline(always)]
128    pub fn is_pushpull(&self) -> bool {
129        *self == MODE0_A::PUSHPULL
130    }
131    #[doc = "Checks if the value of the field is `PUSHPULLALT`"]
132    #[inline(always)]
133    pub fn is_pushpullalt(&self) -> bool {
134        *self == MODE0_A::PUSHPULLALT
135    }
136    #[doc = "Checks if the value of the field is `WIREDOR`"]
137    #[inline(always)]
138    pub fn is_wiredor(&self) -> bool {
139        *self == MODE0_A::WIREDOR
140    }
141    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
142    #[inline(always)]
143    pub fn is_wiredorpulldown(&self) -> bool {
144        *self == MODE0_A::WIREDORPULLDOWN
145    }
146    #[doc = "Checks if the value of the field is `WIREDAND`"]
147    #[inline(always)]
148    pub fn is_wiredand(&self) -> bool {
149        *self == MODE0_A::WIREDAND
150    }
151    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
152    #[inline(always)]
153    pub fn is_wiredandfilter(&self) -> bool {
154        *self == MODE0_A::WIREDANDFILTER
155    }
156    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
157    #[inline(always)]
158    pub fn is_wiredandpullup(&self) -> bool {
159        *self == MODE0_A::WIREDANDPULLUP
160    }
161    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
162    #[inline(always)]
163    pub fn is_wiredandpullupfilter(&self) -> bool {
164        *self == MODE0_A::WIREDANDPULLUPFILTER
165    }
166    #[doc = "Checks if the value of the field is `WIREDANDALT`"]
167    #[inline(always)]
168    pub fn is_wiredandalt(&self) -> bool {
169        *self == MODE0_A::WIREDANDALT
170    }
171    #[doc = "Checks if the value of the field is `WIREDANDALTFILTER`"]
172    #[inline(always)]
173    pub fn is_wiredandaltfilter(&self) -> bool {
174        *self == MODE0_A::WIREDANDALTFILTER
175    }
176    #[doc = "Checks if the value of the field is `WIREDANDALTPULLUP`"]
177    #[inline(always)]
178    pub fn is_wiredandaltpullup(&self) -> bool {
179        *self == MODE0_A::WIREDANDALTPULLUP
180    }
181    #[doc = "Checks if the value of the field is `WIREDANDALTPULLUPFILTER`"]
182    #[inline(always)]
183    pub fn is_wiredandaltpullupfilter(&self) -> bool {
184        *self == MODE0_A::WIREDANDALTPULLUPFILTER
185    }
186}
187#[doc = "Field `MODE0` writer - MODE n"]
188pub type MODE0_W<'a, const O: u8> =
189    crate::FieldWriterSafe<'a, u32, PORTB_MODEL_SPEC, u8, MODE0_A, 4, O>;
190impl<'a, const O: u8> MODE0_W<'a, O> {
191    #[doc = "Input disabled. Pullup if DOUT is set."]
192    #[inline(always)]
193    pub fn disabled(self) -> &'a mut W {
194        self.variant(MODE0_A::DISABLED)
195    }
196    #[doc = "Input enabled. Filter if DOUT is set."]
197    #[inline(always)]
198    pub fn input(self) -> &'a mut W {
199        self.variant(MODE0_A::INPUT)
200    }
201    #[doc = "Input enabled. DOUT determines pull direction."]
202    #[inline(always)]
203    pub fn inputpull(self) -> &'a mut W {
204        self.variant(MODE0_A::INPUTPULL)
205    }
206    #[doc = "Input enabled with filter. DOUT determines pull direction."]
207    #[inline(always)]
208    pub fn inputpullfilter(self) -> &'a mut W {
209        self.variant(MODE0_A::INPUTPULLFILTER)
210    }
211    #[doc = "Push-pull output."]
212    #[inline(always)]
213    pub fn pushpull(self) -> &'a mut W {
214        self.variant(MODE0_A::PUSHPULL)
215    }
216    #[doc = "Push-pull using alternate control."]
217    #[inline(always)]
218    pub fn pushpullalt(self) -> &'a mut W {
219        self.variant(MODE0_A::PUSHPULLALT)
220    }
221    #[doc = "Wired-or output."]
222    #[inline(always)]
223    pub fn wiredor(self) -> &'a mut W {
224        self.variant(MODE0_A::WIREDOR)
225    }
226    #[doc = "Wired-or output with pull-down."]
227    #[inline(always)]
228    pub fn wiredorpulldown(self) -> &'a mut W {
229        self.variant(MODE0_A::WIREDORPULLDOWN)
230    }
231    #[doc = "Open-drain output."]
232    #[inline(always)]
233    pub fn wiredand(self) -> &'a mut W {
234        self.variant(MODE0_A::WIREDAND)
235    }
236    #[doc = "Open-drain output with filter."]
237    #[inline(always)]
238    pub fn wiredandfilter(self) -> &'a mut W {
239        self.variant(MODE0_A::WIREDANDFILTER)
240    }
241    #[doc = "Open-drain output with pullup."]
242    #[inline(always)]
243    pub fn wiredandpullup(self) -> &'a mut W {
244        self.variant(MODE0_A::WIREDANDPULLUP)
245    }
246    #[doc = "Open-drain output with filter and pullup."]
247    #[inline(always)]
248    pub fn wiredandpullupfilter(self) -> &'a mut W {
249        self.variant(MODE0_A::WIREDANDPULLUPFILTER)
250    }
251    #[doc = "Open-drain output using alternate control."]
252    #[inline(always)]
253    pub fn wiredandalt(self) -> &'a mut W {
254        self.variant(MODE0_A::WIREDANDALT)
255    }
256    #[doc = "Open-drain output using alternate control with filter."]
257    #[inline(always)]
258    pub fn wiredandaltfilter(self) -> &'a mut W {
259        self.variant(MODE0_A::WIREDANDALTFILTER)
260    }
261    #[doc = "Open-drain output using alternate control with pullup."]
262    #[inline(always)]
263    pub fn wiredandaltpullup(self) -> &'a mut W {
264        self.variant(MODE0_A::WIREDANDALTPULLUP)
265    }
266    #[doc = "Open-drain output using alternate control with filter and pullup."]
267    #[inline(always)]
268    pub fn wiredandaltpullupfilter(self) -> &'a mut W {
269        self.variant(MODE0_A::WIREDANDALTPULLUPFILTER)
270    }
271}
272#[doc = "Field `MODE1` reader - MODE n"]
273pub type MODE1_R = crate::FieldReader<u8, MODE1_A>;
274#[doc = "MODE n\n\nValue on reset: 0"]
275#[derive(Clone, Copy, Debug, PartialEq, Eq)]
276#[repr(u8)]
277pub enum MODE1_A {
278    #[doc = "0: Input disabled. Pullup if DOUT is set."]
279    DISABLED = 0,
280    #[doc = "1: Input enabled. Filter if DOUT is set."]
281    INPUT = 1,
282    #[doc = "2: Input enabled. DOUT determines pull direction."]
283    INPUTPULL = 2,
284    #[doc = "3: Input enabled with filter. DOUT determines pull direction."]
285    INPUTPULLFILTER = 3,
286    #[doc = "4: Push-pull output."]
287    PUSHPULL = 4,
288    #[doc = "5: Push-pull using alternate control."]
289    PUSHPULLALT = 5,
290    #[doc = "6: Wired-or output."]
291    WIREDOR = 6,
292    #[doc = "7: Wired-or output with pull-down."]
293    WIREDORPULLDOWN = 7,
294    #[doc = "8: Open-drain output."]
295    WIREDAND = 8,
296    #[doc = "9: Open-drain output with filter."]
297    WIREDANDFILTER = 9,
298    #[doc = "10: Open-drain output with pullup."]
299    WIREDANDPULLUP = 10,
300    #[doc = "11: Open-drain output with filter and pullup."]
301    WIREDANDPULLUPFILTER = 11,
302    #[doc = "12: Open-drain output using alternate control."]
303    WIREDANDALT = 12,
304    #[doc = "13: Open-drain output using alternate control with filter."]
305    WIREDANDALTFILTER = 13,
306    #[doc = "14: Open-drain output using alternate control with pullup."]
307    WIREDANDALTPULLUP = 14,
308    #[doc = "15: Open-drain output using alternate control with filter and pullup."]
309    WIREDANDALTPULLUPFILTER = 15,
310}
311impl From<MODE1_A> for u8 {
312    #[inline(always)]
313    fn from(variant: MODE1_A) -> Self {
314        variant as _
315    }
316}
317impl MODE1_R {
318    #[doc = "Get enumerated values variant"]
319    #[inline(always)]
320    pub fn variant(&self) -> MODE1_A {
321        match self.bits {
322            0 => MODE1_A::DISABLED,
323            1 => MODE1_A::INPUT,
324            2 => MODE1_A::INPUTPULL,
325            3 => MODE1_A::INPUTPULLFILTER,
326            4 => MODE1_A::PUSHPULL,
327            5 => MODE1_A::PUSHPULLALT,
328            6 => MODE1_A::WIREDOR,
329            7 => MODE1_A::WIREDORPULLDOWN,
330            8 => MODE1_A::WIREDAND,
331            9 => MODE1_A::WIREDANDFILTER,
332            10 => MODE1_A::WIREDANDPULLUP,
333            11 => MODE1_A::WIREDANDPULLUPFILTER,
334            12 => MODE1_A::WIREDANDALT,
335            13 => MODE1_A::WIREDANDALTFILTER,
336            14 => MODE1_A::WIREDANDALTPULLUP,
337            15 => MODE1_A::WIREDANDALTPULLUPFILTER,
338            _ => unreachable!(),
339        }
340    }
341    #[doc = "Checks if the value of the field is `DISABLED`"]
342    #[inline(always)]
343    pub fn is_disabled(&self) -> bool {
344        *self == MODE1_A::DISABLED
345    }
346    #[doc = "Checks if the value of the field is `INPUT`"]
347    #[inline(always)]
348    pub fn is_input(&self) -> bool {
349        *self == MODE1_A::INPUT
350    }
351    #[doc = "Checks if the value of the field is `INPUTPULL`"]
352    #[inline(always)]
353    pub fn is_inputpull(&self) -> bool {
354        *self == MODE1_A::INPUTPULL
355    }
356    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
357    #[inline(always)]
358    pub fn is_inputpullfilter(&self) -> bool {
359        *self == MODE1_A::INPUTPULLFILTER
360    }
361    #[doc = "Checks if the value of the field is `PUSHPULL`"]
362    #[inline(always)]
363    pub fn is_pushpull(&self) -> bool {
364        *self == MODE1_A::PUSHPULL
365    }
366    #[doc = "Checks if the value of the field is `PUSHPULLALT`"]
367    #[inline(always)]
368    pub fn is_pushpullalt(&self) -> bool {
369        *self == MODE1_A::PUSHPULLALT
370    }
371    #[doc = "Checks if the value of the field is `WIREDOR`"]
372    #[inline(always)]
373    pub fn is_wiredor(&self) -> bool {
374        *self == MODE1_A::WIREDOR
375    }
376    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
377    #[inline(always)]
378    pub fn is_wiredorpulldown(&self) -> bool {
379        *self == MODE1_A::WIREDORPULLDOWN
380    }
381    #[doc = "Checks if the value of the field is `WIREDAND`"]
382    #[inline(always)]
383    pub fn is_wiredand(&self) -> bool {
384        *self == MODE1_A::WIREDAND
385    }
386    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
387    #[inline(always)]
388    pub fn is_wiredandfilter(&self) -> bool {
389        *self == MODE1_A::WIREDANDFILTER
390    }
391    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
392    #[inline(always)]
393    pub fn is_wiredandpullup(&self) -> bool {
394        *self == MODE1_A::WIREDANDPULLUP
395    }
396    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
397    #[inline(always)]
398    pub fn is_wiredandpullupfilter(&self) -> bool {
399        *self == MODE1_A::WIREDANDPULLUPFILTER
400    }
401    #[doc = "Checks if the value of the field is `WIREDANDALT`"]
402    #[inline(always)]
403    pub fn is_wiredandalt(&self) -> bool {
404        *self == MODE1_A::WIREDANDALT
405    }
406    #[doc = "Checks if the value of the field is `WIREDANDALTFILTER`"]
407    #[inline(always)]
408    pub fn is_wiredandaltfilter(&self) -> bool {
409        *self == MODE1_A::WIREDANDALTFILTER
410    }
411    #[doc = "Checks if the value of the field is `WIREDANDALTPULLUP`"]
412    #[inline(always)]
413    pub fn is_wiredandaltpullup(&self) -> bool {
414        *self == MODE1_A::WIREDANDALTPULLUP
415    }
416    #[doc = "Checks if the value of the field is `WIREDANDALTPULLUPFILTER`"]
417    #[inline(always)]
418    pub fn is_wiredandaltpullupfilter(&self) -> bool {
419        *self == MODE1_A::WIREDANDALTPULLUPFILTER
420    }
421}
422#[doc = "Field `MODE1` writer - MODE n"]
423pub type MODE1_W<'a, const O: u8> =
424    crate::FieldWriterSafe<'a, u32, PORTB_MODEL_SPEC, u8, MODE1_A, 4, O>;
425impl<'a, const O: u8> MODE1_W<'a, O> {
426    #[doc = "Input disabled. Pullup if DOUT is set."]
427    #[inline(always)]
428    pub fn disabled(self) -> &'a mut W {
429        self.variant(MODE1_A::DISABLED)
430    }
431    #[doc = "Input enabled. Filter if DOUT is set."]
432    #[inline(always)]
433    pub fn input(self) -> &'a mut W {
434        self.variant(MODE1_A::INPUT)
435    }
436    #[doc = "Input enabled. DOUT determines pull direction."]
437    #[inline(always)]
438    pub fn inputpull(self) -> &'a mut W {
439        self.variant(MODE1_A::INPUTPULL)
440    }
441    #[doc = "Input enabled with filter. DOUT determines pull direction."]
442    #[inline(always)]
443    pub fn inputpullfilter(self) -> &'a mut W {
444        self.variant(MODE1_A::INPUTPULLFILTER)
445    }
446    #[doc = "Push-pull output."]
447    #[inline(always)]
448    pub fn pushpull(self) -> &'a mut W {
449        self.variant(MODE1_A::PUSHPULL)
450    }
451    #[doc = "Push-pull using alternate control."]
452    #[inline(always)]
453    pub fn pushpullalt(self) -> &'a mut W {
454        self.variant(MODE1_A::PUSHPULLALT)
455    }
456    #[doc = "Wired-or output."]
457    #[inline(always)]
458    pub fn wiredor(self) -> &'a mut W {
459        self.variant(MODE1_A::WIREDOR)
460    }
461    #[doc = "Wired-or output with pull-down."]
462    #[inline(always)]
463    pub fn wiredorpulldown(self) -> &'a mut W {
464        self.variant(MODE1_A::WIREDORPULLDOWN)
465    }
466    #[doc = "Open-drain output."]
467    #[inline(always)]
468    pub fn wiredand(self) -> &'a mut W {
469        self.variant(MODE1_A::WIREDAND)
470    }
471    #[doc = "Open-drain output with filter."]
472    #[inline(always)]
473    pub fn wiredandfilter(self) -> &'a mut W {
474        self.variant(MODE1_A::WIREDANDFILTER)
475    }
476    #[doc = "Open-drain output with pullup."]
477    #[inline(always)]
478    pub fn wiredandpullup(self) -> &'a mut W {
479        self.variant(MODE1_A::WIREDANDPULLUP)
480    }
481    #[doc = "Open-drain output with filter and pullup."]
482    #[inline(always)]
483    pub fn wiredandpullupfilter(self) -> &'a mut W {
484        self.variant(MODE1_A::WIREDANDPULLUPFILTER)
485    }
486    #[doc = "Open-drain output using alternate control."]
487    #[inline(always)]
488    pub fn wiredandalt(self) -> &'a mut W {
489        self.variant(MODE1_A::WIREDANDALT)
490    }
491    #[doc = "Open-drain output using alternate control with filter."]
492    #[inline(always)]
493    pub fn wiredandaltfilter(self) -> &'a mut W {
494        self.variant(MODE1_A::WIREDANDALTFILTER)
495    }
496    #[doc = "Open-drain output using alternate control with pullup."]
497    #[inline(always)]
498    pub fn wiredandaltpullup(self) -> &'a mut W {
499        self.variant(MODE1_A::WIREDANDALTPULLUP)
500    }
501    #[doc = "Open-drain output using alternate control with filter and pullup."]
502    #[inline(always)]
503    pub fn wiredandaltpullupfilter(self) -> &'a mut W {
504        self.variant(MODE1_A::WIREDANDALTPULLUPFILTER)
505    }
506}
507#[doc = "Field `MODE2` reader - MODE n"]
508pub type MODE2_R = crate::FieldReader<u8, MODE2_A>;
509#[doc = "MODE n\n\nValue on reset: 0"]
510#[derive(Clone, Copy, Debug, PartialEq, Eq)]
511#[repr(u8)]
512pub enum MODE2_A {
513    #[doc = "0: Input disabled. Pullup if DOUT is set."]
514    DISABLED = 0,
515    #[doc = "1: Input enabled. Filter if DOUT is set."]
516    INPUT = 1,
517    #[doc = "2: Input enabled. DOUT determines pull direction."]
518    INPUTPULL = 2,
519    #[doc = "3: Input enabled with filter. DOUT determines pull direction."]
520    INPUTPULLFILTER = 3,
521    #[doc = "4: Push-pull output."]
522    PUSHPULL = 4,
523    #[doc = "5: Push-pull using alternate control."]
524    PUSHPULLALT = 5,
525    #[doc = "6: Wired-or output."]
526    WIREDOR = 6,
527    #[doc = "7: Wired-or output with pull-down."]
528    WIREDORPULLDOWN = 7,
529    #[doc = "8: Open-drain output."]
530    WIREDAND = 8,
531    #[doc = "9: Open-drain output with filter."]
532    WIREDANDFILTER = 9,
533    #[doc = "10: Open-drain output with pullup."]
534    WIREDANDPULLUP = 10,
535    #[doc = "11: Open-drain output with filter and pullup."]
536    WIREDANDPULLUPFILTER = 11,
537    #[doc = "12: Open-drain output using alternate control."]
538    WIREDANDALT = 12,
539    #[doc = "13: Open-drain output using alternate control with filter."]
540    WIREDANDALTFILTER = 13,
541    #[doc = "14: Open-drain output using alternate control with pullup."]
542    WIREDANDALTPULLUP = 14,
543    #[doc = "15: Open-drain output using alternate control with filter and pullup."]
544    WIREDANDALTPULLUPFILTER = 15,
545}
546impl From<MODE2_A> for u8 {
547    #[inline(always)]
548    fn from(variant: MODE2_A) -> Self {
549        variant as _
550    }
551}
552impl MODE2_R {
553    #[doc = "Get enumerated values variant"]
554    #[inline(always)]
555    pub fn variant(&self) -> MODE2_A {
556        match self.bits {
557            0 => MODE2_A::DISABLED,
558            1 => MODE2_A::INPUT,
559            2 => MODE2_A::INPUTPULL,
560            3 => MODE2_A::INPUTPULLFILTER,
561            4 => MODE2_A::PUSHPULL,
562            5 => MODE2_A::PUSHPULLALT,
563            6 => MODE2_A::WIREDOR,
564            7 => MODE2_A::WIREDORPULLDOWN,
565            8 => MODE2_A::WIREDAND,
566            9 => MODE2_A::WIREDANDFILTER,
567            10 => MODE2_A::WIREDANDPULLUP,
568            11 => MODE2_A::WIREDANDPULLUPFILTER,
569            12 => MODE2_A::WIREDANDALT,
570            13 => MODE2_A::WIREDANDALTFILTER,
571            14 => MODE2_A::WIREDANDALTPULLUP,
572            15 => MODE2_A::WIREDANDALTPULLUPFILTER,
573            _ => unreachable!(),
574        }
575    }
576    #[doc = "Checks if the value of the field is `DISABLED`"]
577    #[inline(always)]
578    pub fn is_disabled(&self) -> bool {
579        *self == MODE2_A::DISABLED
580    }
581    #[doc = "Checks if the value of the field is `INPUT`"]
582    #[inline(always)]
583    pub fn is_input(&self) -> bool {
584        *self == MODE2_A::INPUT
585    }
586    #[doc = "Checks if the value of the field is `INPUTPULL`"]
587    #[inline(always)]
588    pub fn is_inputpull(&self) -> bool {
589        *self == MODE2_A::INPUTPULL
590    }
591    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
592    #[inline(always)]
593    pub fn is_inputpullfilter(&self) -> bool {
594        *self == MODE2_A::INPUTPULLFILTER
595    }
596    #[doc = "Checks if the value of the field is `PUSHPULL`"]
597    #[inline(always)]
598    pub fn is_pushpull(&self) -> bool {
599        *self == MODE2_A::PUSHPULL
600    }
601    #[doc = "Checks if the value of the field is `PUSHPULLALT`"]
602    #[inline(always)]
603    pub fn is_pushpullalt(&self) -> bool {
604        *self == MODE2_A::PUSHPULLALT
605    }
606    #[doc = "Checks if the value of the field is `WIREDOR`"]
607    #[inline(always)]
608    pub fn is_wiredor(&self) -> bool {
609        *self == MODE2_A::WIREDOR
610    }
611    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
612    #[inline(always)]
613    pub fn is_wiredorpulldown(&self) -> bool {
614        *self == MODE2_A::WIREDORPULLDOWN
615    }
616    #[doc = "Checks if the value of the field is `WIREDAND`"]
617    #[inline(always)]
618    pub fn is_wiredand(&self) -> bool {
619        *self == MODE2_A::WIREDAND
620    }
621    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
622    #[inline(always)]
623    pub fn is_wiredandfilter(&self) -> bool {
624        *self == MODE2_A::WIREDANDFILTER
625    }
626    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
627    #[inline(always)]
628    pub fn is_wiredandpullup(&self) -> bool {
629        *self == MODE2_A::WIREDANDPULLUP
630    }
631    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
632    #[inline(always)]
633    pub fn is_wiredandpullupfilter(&self) -> bool {
634        *self == MODE2_A::WIREDANDPULLUPFILTER
635    }
636    #[doc = "Checks if the value of the field is `WIREDANDALT`"]
637    #[inline(always)]
638    pub fn is_wiredandalt(&self) -> bool {
639        *self == MODE2_A::WIREDANDALT
640    }
641    #[doc = "Checks if the value of the field is `WIREDANDALTFILTER`"]
642    #[inline(always)]
643    pub fn is_wiredandaltfilter(&self) -> bool {
644        *self == MODE2_A::WIREDANDALTFILTER
645    }
646    #[doc = "Checks if the value of the field is `WIREDANDALTPULLUP`"]
647    #[inline(always)]
648    pub fn is_wiredandaltpullup(&self) -> bool {
649        *self == MODE2_A::WIREDANDALTPULLUP
650    }
651    #[doc = "Checks if the value of the field is `WIREDANDALTPULLUPFILTER`"]
652    #[inline(always)]
653    pub fn is_wiredandaltpullupfilter(&self) -> bool {
654        *self == MODE2_A::WIREDANDALTPULLUPFILTER
655    }
656}
657#[doc = "Field `MODE2` writer - MODE n"]
658pub type MODE2_W<'a, const O: u8> =
659    crate::FieldWriterSafe<'a, u32, PORTB_MODEL_SPEC, u8, MODE2_A, 4, O>;
660impl<'a, const O: u8> MODE2_W<'a, O> {
661    #[doc = "Input disabled. Pullup if DOUT is set."]
662    #[inline(always)]
663    pub fn disabled(self) -> &'a mut W {
664        self.variant(MODE2_A::DISABLED)
665    }
666    #[doc = "Input enabled. Filter if DOUT is set."]
667    #[inline(always)]
668    pub fn input(self) -> &'a mut W {
669        self.variant(MODE2_A::INPUT)
670    }
671    #[doc = "Input enabled. DOUT determines pull direction."]
672    #[inline(always)]
673    pub fn inputpull(self) -> &'a mut W {
674        self.variant(MODE2_A::INPUTPULL)
675    }
676    #[doc = "Input enabled with filter. DOUT determines pull direction."]
677    #[inline(always)]
678    pub fn inputpullfilter(self) -> &'a mut W {
679        self.variant(MODE2_A::INPUTPULLFILTER)
680    }
681    #[doc = "Push-pull output."]
682    #[inline(always)]
683    pub fn pushpull(self) -> &'a mut W {
684        self.variant(MODE2_A::PUSHPULL)
685    }
686    #[doc = "Push-pull using alternate control."]
687    #[inline(always)]
688    pub fn pushpullalt(self) -> &'a mut W {
689        self.variant(MODE2_A::PUSHPULLALT)
690    }
691    #[doc = "Wired-or output."]
692    #[inline(always)]
693    pub fn wiredor(self) -> &'a mut W {
694        self.variant(MODE2_A::WIREDOR)
695    }
696    #[doc = "Wired-or output with pull-down."]
697    #[inline(always)]
698    pub fn wiredorpulldown(self) -> &'a mut W {
699        self.variant(MODE2_A::WIREDORPULLDOWN)
700    }
701    #[doc = "Open-drain output."]
702    #[inline(always)]
703    pub fn wiredand(self) -> &'a mut W {
704        self.variant(MODE2_A::WIREDAND)
705    }
706    #[doc = "Open-drain output with filter."]
707    #[inline(always)]
708    pub fn wiredandfilter(self) -> &'a mut W {
709        self.variant(MODE2_A::WIREDANDFILTER)
710    }
711    #[doc = "Open-drain output with pullup."]
712    #[inline(always)]
713    pub fn wiredandpullup(self) -> &'a mut W {
714        self.variant(MODE2_A::WIREDANDPULLUP)
715    }
716    #[doc = "Open-drain output with filter and pullup."]
717    #[inline(always)]
718    pub fn wiredandpullupfilter(self) -> &'a mut W {
719        self.variant(MODE2_A::WIREDANDPULLUPFILTER)
720    }
721    #[doc = "Open-drain output using alternate control."]
722    #[inline(always)]
723    pub fn wiredandalt(self) -> &'a mut W {
724        self.variant(MODE2_A::WIREDANDALT)
725    }
726    #[doc = "Open-drain output using alternate control with filter."]
727    #[inline(always)]
728    pub fn wiredandaltfilter(self) -> &'a mut W {
729        self.variant(MODE2_A::WIREDANDALTFILTER)
730    }
731    #[doc = "Open-drain output using alternate control with pullup."]
732    #[inline(always)]
733    pub fn wiredandaltpullup(self) -> &'a mut W {
734        self.variant(MODE2_A::WIREDANDALTPULLUP)
735    }
736    #[doc = "Open-drain output using alternate control with filter and pullup."]
737    #[inline(always)]
738    pub fn wiredandaltpullupfilter(self) -> &'a mut W {
739        self.variant(MODE2_A::WIREDANDALTPULLUPFILTER)
740    }
741}
742#[doc = "Field `MODE3` reader - MODE n"]
743pub type MODE3_R = crate::FieldReader<u8, MODE3_A>;
744#[doc = "MODE n\n\nValue on reset: 0"]
745#[derive(Clone, Copy, Debug, PartialEq, Eq)]
746#[repr(u8)]
747pub enum MODE3_A {
748    #[doc = "0: Input disabled. Pullup if DOUT is set."]
749    DISABLED = 0,
750    #[doc = "1: Input enabled. Filter if DOUT is set."]
751    INPUT = 1,
752    #[doc = "2: Input enabled. DOUT determines pull direction."]
753    INPUTPULL = 2,
754    #[doc = "3: Input enabled with filter. DOUT determines pull direction."]
755    INPUTPULLFILTER = 3,
756    #[doc = "4: Push-pull output."]
757    PUSHPULL = 4,
758    #[doc = "5: Push-pull using alternate control."]
759    PUSHPULLALT = 5,
760    #[doc = "6: Wired-or output."]
761    WIREDOR = 6,
762    #[doc = "7: Wired-or output with pull-down."]
763    WIREDORPULLDOWN = 7,
764    #[doc = "8: Open-drain output."]
765    WIREDAND = 8,
766    #[doc = "9: Open-drain output with filter."]
767    WIREDANDFILTER = 9,
768    #[doc = "10: Open-drain output with pullup."]
769    WIREDANDPULLUP = 10,
770    #[doc = "11: Open-drain output with filter and pullup."]
771    WIREDANDPULLUPFILTER = 11,
772    #[doc = "12: Open-drain output using alternate control."]
773    WIREDANDALT = 12,
774    #[doc = "13: Open-drain output using alternate control with filter."]
775    WIREDANDALTFILTER = 13,
776    #[doc = "14: Open-drain output using alternate control with pullup."]
777    WIREDANDALTPULLUP = 14,
778    #[doc = "15: Open-drain output using alternate control with filter and pullup."]
779    WIREDANDALTPULLUPFILTER = 15,
780}
781impl From<MODE3_A> for u8 {
782    #[inline(always)]
783    fn from(variant: MODE3_A) -> Self {
784        variant as _
785    }
786}
787impl MODE3_R {
788    #[doc = "Get enumerated values variant"]
789    #[inline(always)]
790    pub fn variant(&self) -> MODE3_A {
791        match self.bits {
792            0 => MODE3_A::DISABLED,
793            1 => MODE3_A::INPUT,
794            2 => MODE3_A::INPUTPULL,
795            3 => MODE3_A::INPUTPULLFILTER,
796            4 => MODE3_A::PUSHPULL,
797            5 => MODE3_A::PUSHPULLALT,
798            6 => MODE3_A::WIREDOR,
799            7 => MODE3_A::WIREDORPULLDOWN,
800            8 => MODE3_A::WIREDAND,
801            9 => MODE3_A::WIREDANDFILTER,
802            10 => MODE3_A::WIREDANDPULLUP,
803            11 => MODE3_A::WIREDANDPULLUPFILTER,
804            12 => MODE3_A::WIREDANDALT,
805            13 => MODE3_A::WIREDANDALTFILTER,
806            14 => MODE3_A::WIREDANDALTPULLUP,
807            15 => MODE3_A::WIREDANDALTPULLUPFILTER,
808            _ => unreachable!(),
809        }
810    }
811    #[doc = "Checks if the value of the field is `DISABLED`"]
812    #[inline(always)]
813    pub fn is_disabled(&self) -> bool {
814        *self == MODE3_A::DISABLED
815    }
816    #[doc = "Checks if the value of the field is `INPUT`"]
817    #[inline(always)]
818    pub fn is_input(&self) -> bool {
819        *self == MODE3_A::INPUT
820    }
821    #[doc = "Checks if the value of the field is `INPUTPULL`"]
822    #[inline(always)]
823    pub fn is_inputpull(&self) -> bool {
824        *self == MODE3_A::INPUTPULL
825    }
826    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
827    #[inline(always)]
828    pub fn is_inputpullfilter(&self) -> bool {
829        *self == MODE3_A::INPUTPULLFILTER
830    }
831    #[doc = "Checks if the value of the field is `PUSHPULL`"]
832    #[inline(always)]
833    pub fn is_pushpull(&self) -> bool {
834        *self == MODE3_A::PUSHPULL
835    }
836    #[doc = "Checks if the value of the field is `PUSHPULLALT`"]
837    #[inline(always)]
838    pub fn is_pushpullalt(&self) -> bool {
839        *self == MODE3_A::PUSHPULLALT
840    }
841    #[doc = "Checks if the value of the field is `WIREDOR`"]
842    #[inline(always)]
843    pub fn is_wiredor(&self) -> bool {
844        *self == MODE3_A::WIREDOR
845    }
846    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
847    #[inline(always)]
848    pub fn is_wiredorpulldown(&self) -> bool {
849        *self == MODE3_A::WIREDORPULLDOWN
850    }
851    #[doc = "Checks if the value of the field is `WIREDAND`"]
852    #[inline(always)]
853    pub fn is_wiredand(&self) -> bool {
854        *self == MODE3_A::WIREDAND
855    }
856    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
857    #[inline(always)]
858    pub fn is_wiredandfilter(&self) -> bool {
859        *self == MODE3_A::WIREDANDFILTER
860    }
861    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
862    #[inline(always)]
863    pub fn is_wiredandpullup(&self) -> bool {
864        *self == MODE3_A::WIREDANDPULLUP
865    }
866    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
867    #[inline(always)]
868    pub fn is_wiredandpullupfilter(&self) -> bool {
869        *self == MODE3_A::WIREDANDPULLUPFILTER
870    }
871    #[doc = "Checks if the value of the field is `WIREDANDALT`"]
872    #[inline(always)]
873    pub fn is_wiredandalt(&self) -> bool {
874        *self == MODE3_A::WIREDANDALT
875    }
876    #[doc = "Checks if the value of the field is `WIREDANDALTFILTER`"]
877    #[inline(always)]
878    pub fn is_wiredandaltfilter(&self) -> bool {
879        *self == MODE3_A::WIREDANDALTFILTER
880    }
881    #[doc = "Checks if the value of the field is `WIREDANDALTPULLUP`"]
882    #[inline(always)]
883    pub fn is_wiredandaltpullup(&self) -> bool {
884        *self == MODE3_A::WIREDANDALTPULLUP
885    }
886    #[doc = "Checks if the value of the field is `WIREDANDALTPULLUPFILTER`"]
887    #[inline(always)]
888    pub fn is_wiredandaltpullupfilter(&self) -> bool {
889        *self == MODE3_A::WIREDANDALTPULLUPFILTER
890    }
891}
892#[doc = "Field `MODE3` writer - MODE n"]
893pub type MODE3_W<'a, const O: u8> =
894    crate::FieldWriterSafe<'a, u32, PORTB_MODEL_SPEC, u8, MODE3_A, 4, O>;
895impl<'a, const O: u8> MODE3_W<'a, O> {
896    #[doc = "Input disabled. Pullup if DOUT is set."]
897    #[inline(always)]
898    pub fn disabled(self) -> &'a mut W {
899        self.variant(MODE3_A::DISABLED)
900    }
901    #[doc = "Input enabled. Filter if DOUT is set."]
902    #[inline(always)]
903    pub fn input(self) -> &'a mut W {
904        self.variant(MODE3_A::INPUT)
905    }
906    #[doc = "Input enabled. DOUT determines pull direction."]
907    #[inline(always)]
908    pub fn inputpull(self) -> &'a mut W {
909        self.variant(MODE3_A::INPUTPULL)
910    }
911    #[doc = "Input enabled with filter. DOUT determines pull direction."]
912    #[inline(always)]
913    pub fn inputpullfilter(self) -> &'a mut W {
914        self.variant(MODE3_A::INPUTPULLFILTER)
915    }
916    #[doc = "Push-pull output."]
917    #[inline(always)]
918    pub fn pushpull(self) -> &'a mut W {
919        self.variant(MODE3_A::PUSHPULL)
920    }
921    #[doc = "Push-pull using alternate control."]
922    #[inline(always)]
923    pub fn pushpullalt(self) -> &'a mut W {
924        self.variant(MODE3_A::PUSHPULLALT)
925    }
926    #[doc = "Wired-or output."]
927    #[inline(always)]
928    pub fn wiredor(self) -> &'a mut W {
929        self.variant(MODE3_A::WIREDOR)
930    }
931    #[doc = "Wired-or output with pull-down."]
932    #[inline(always)]
933    pub fn wiredorpulldown(self) -> &'a mut W {
934        self.variant(MODE3_A::WIREDORPULLDOWN)
935    }
936    #[doc = "Open-drain output."]
937    #[inline(always)]
938    pub fn wiredand(self) -> &'a mut W {
939        self.variant(MODE3_A::WIREDAND)
940    }
941    #[doc = "Open-drain output with filter."]
942    #[inline(always)]
943    pub fn wiredandfilter(self) -> &'a mut W {
944        self.variant(MODE3_A::WIREDANDFILTER)
945    }
946    #[doc = "Open-drain output with pullup."]
947    #[inline(always)]
948    pub fn wiredandpullup(self) -> &'a mut W {
949        self.variant(MODE3_A::WIREDANDPULLUP)
950    }
951    #[doc = "Open-drain output with filter and pullup."]
952    #[inline(always)]
953    pub fn wiredandpullupfilter(self) -> &'a mut W {
954        self.variant(MODE3_A::WIREDANDPULLUPFILTER)
955    }
956    #[doc = "Open-drain output using alternate control."]
957    #[inline(always)]
958    pub fn wiredandalt(self) -> &'a mut W {
959        self.variant(MODE3_A::WIREDANDALT)
960    }
961    #[doc = "Open-drain output using alternate control with filter."]
962    #[inline(always)]
963    pub fn wiredandaltfilter(self) -> &'a mut W {
964        self.variant(MODE3_A::WIREDANDALTFILTER)
965    }
966    #[doc = "Open-drain output using alternate control with pullup."]
967    #[inline(always)]
968    pub fn wiredandaltpullup(self) -> &'a mut W {
969        self.variant(MODE3_A::WIREDANDALTPULLUP)
970    }
971    #[doc = "Open-drain output using alternate control with filter and pullup."]
972    #[inline(always)]
973    pub fn wiredandaltpullupfilter(self) -> &'a mut W {
974        self.variant(MODE3_A::WIREDANDALTPULLUPFILTER)
975    }
976}
977#[doc = "Field `MODE4` reader - MODE n"]
978pub type MODE4_R = crate::FieldReader<u8, MODE4_A>;
979#[doc = "MODE n\n\nValue on reset: 0"]
980#[derive(Clone, Copy, Debug, PartialEq, Eq)]
981#[repr(u8)]
982pub enum MODE4_A {
983    #[doc = "0: Input disabled. Pullup if DOUT is set."]
984    DISABLED = 0,
985    #[doc = "1: Input enabled. Filter if DOUT is set."]
986    INPUT = 1,
987    #[doc = "2: Input enabled. DOUT determines pull direction."]
988    INPUTPULL = 2,
989    #[doc = "3: Input enabled with filter. DOUT determines pull direction."]
990    INPUTPULLFILTER = 3,
991    #[doc = "4: Push-pull output."]
992    PUSHPULL = 4,
993    #[doc = "5: Push-pull using alternate control."]
994    PUSHPULLALT = 5,
995    #[doc = "6: Wired-or output."]
996    WIREDOR = 6,
997    #[doc = "7: Wired-or output with pull-down."]
998    WIREDORPULLDOWN = 7,
999    #[doc = "8: Open-drain output."]
1000    WIREDAND = 8,
1001    #[doc = "9: Open-drain output with filter."]
1002    WIREDANDFILTER = 9,
1003    #[doc = "10: Open-drain output with pullup."]
1004    WIREDANDPULLUP = 10,
1005    #[doc = "11: Open-drain output with filter and pullup."]
1006    WIREDANDPULLUPFILTER = 11,
1007    #[doc = "12: Open-drain output using alternate control."]
1008    WIREDANDALT = 12,
1009    #[doc = "13: Open-drain output using alternate control with filter."]
1010    WIREDANDALTFILTER = 13,
1011    #[doc = "14: Open-drain output using alternate control with pullup."]
1012    WIREDANDALTPULLUP = 14,
1013    #[doc = "15: Open-drain output using alternate control with filter and pullup."]
1014    WIREDANDALTPULLUPFILTER = 15,
1015}
1016impl From<MODE4_A> for u8 {
1017    #[inline(always)]
1018    fn from(variant: MODE4_A) -> Self {
1019        variant as _
1020    }
1021}
1022impl MODE4_R {
1023    #[doc = "Get enumerated values variant"]
1024    #[inline(always)]
1025    pub fn variant(&self) -> MODE4_A {
1026        match self.bits {
1027            0 => MODE4_A::DISABLED,
1028            1 => MODE4_A::INPUT,
1029            2 => MODE4_A::INPUTPULL,
1030            3 => MODE4_A::INPUTPULLFILTER,
1031            4 => MODE4_A::PUSHPULL,
1032            5 => MODE4_A::PUSHPULLALT,
1033            6 => MODE4_A::WIREDOR,
1034            7 => MODE4_A::WIREDORPULLDOWN,
1035            8 => MODE4_A::WIREDAND,
1036            9 => MODE4_A::WIREDANDFILTER,
1037            10 => MODE4_A::WIREDANDPULLUP,
1038            11 => MODE4_A::WIREDANDPULLUPFILTER,
1039            12 => MODE4_A::WIREDANDALT,
1040            13 => MODE4_A::WIREDANDALTFILTER,
1041            14 => MODE4_A::WIREDANDALTPULLUP,
1042            15 => MODE4_A::WIREDANDALTPULLUPFILTER,
1043            _ => unreachable!(),
1044        }
1045    }
1046    #[doc = "Checks if the value of the field is `DISABLED`"]
1047    #[inline(always)]
1048    pub fn is_disabled(&self) -> bool {
1049        *self == MODE4_A::DISABLED
1050    }
1051    #[doc = "Checks if the value of the field is `INPUT`"]
1052    #[inline(always)]
1053    pub fn is_input(&self) -> bool {
1054        *self == MODE4_A::INPUT
1055    }
1056    #[doc = "Checks if the value of the field is `INPUTPULL`"]
1057    #[inline(always)]
1058    pub fn is_inputpull(&self) -> bool {
1059        *self == MODE4_A::INPUTPULL
1060    }
1061    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
1062    #[inline(always)]
1063    pub fn is_inputpullfilter(&self) -> bool {
1064        *self == MODE4_A::INPUTPULLFILTER
1065    }
1066    #[doc = "Checks if the value of the field is `PUSHPULL`"]
1067    #[inline(always)]
1068    pub fn is_pushpull(&self) -> bool {
1069        *self == MODE4_A::PUSHPULL
1070    }
1071    #[doc = "Checks if the value of the field is `PUSHPULLALT`"]
1072    #[inline(always)]
1073    pub fn is_pushpullalt(&self) -> bool {
1074        *self == MODE4_A::PUSHPULLALT
1075    }
1076    #[doc = "Checks if the value of the field is `WIREDOR`"]
1077    #[inline(always)]
1078    pub fn is_wiredor(&self) -> bool {
1079        *self == MODE4_A::WIREDOR
1080    }
1081    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
1082    #[inline(always)]
1083    pub fn is_wiredorpulldown(&self) -> bool {
1084        *self == MODE4_A::WIREDORPULLDOWN
1085    }
1086    #[doc = "Checks if the value of the field is `WIREDAND`"]
1087    #[inline(always)]
1088    pub fn is_wiredand(&self) -> bool {
1089        *self == MODE4_A::WIREDAND
1090    }
1091    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
1092    #[inline(always)]
1093    pub fn is_wiredandfilter(&self) -> bool {
1094        *self == MODE4_A::WIREDANDFILTER
1095    }
1096    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
1097    #[inline(always)]
1098    pub fn is_wiredandpullup(&self) -> bool {
1099        *self == MODE4_A::WIREDANDPULLUP
1100    }
1101    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
1102    #[inline(always)]
1103    pub fn is_wiredandpullupfilter(&self) -> bool {
1104        *self == MODE4_A::WIREDANDPULLUPFILTER
1105    }
1106    #[doc = "Checks if the value of the field is `WIREDANDALT`"]
1107    #[inline(always)]
1108    pub fn is_wiredandalt(&self) -> bool {
1109        *self == MODE4_A::WIREDANDALT
1110    }
1111    #[doc = "Checks if the value of the field is `WIREDANDALTFILTER`"]
1112    #[inline(always)]
1113    pub fn is_wiredandaltfilter(&self) -> bool {
1114        *self == MODE4_A::WIREDANDALTFILTER
1115    }
1116    #[doc = "Checks if the value of the field is `WIREDANDALTPULLUP`"]
1117    #[inline(always)]
1118    pub fn is_wiredandaltpullup(&self) -> bool {
1119        *self == MODE4_A::WIREDANDALTPULLUP
1120    }
1121    #[doc = "Checks if the value of the field is `WIREDANDALTPULLUPFILTER`"]
1122    #[inline(always)]
1123    pub fn is_wiredandaltpullupfilter(&self) -> bool {
1124        *self == MODE4_A::WIREDANDALTPULLUPFILTER
1125    }
1126}
1127#[doc = "Field `MODE4` writer - MODE n"]
1128pub type MODE4_W<'a, const O: u8> =
1129    crate::FieldWriterSafe<'a, u32, PORTB_MODEL_SPEC, u8, MODE4_A, 4, O>;
1130impl<'a, const O: u8> MODE4_W<'a, O> {
1131    #[doc = "Input disabled. Pullup if DOUT is set."]
1132    #[inline(always)]
1133    pub fn disabled(self) -> &'a mut W {
1134        self.variant(MODE4_A::DISABLED)
1135    }
1136    #[doc = "Input enabled. Filter if DOUT is set."]
1137    #[inline(always)]
1138    pub fn input(self) -> &'a mut W {
1139        self.variant(MODE4_A::INPUT)
1140    }
1141    #[doc = "Input enabled. DOUT determines pull direction."]
1142    #[inline(always)]
1143    pub fn inputpull(self) -> &'a mut W {
1144        self.variant(MODE4_A::INPUTPULL)
1145    }
1146    #[doc = "Input enabled with filter. DOUT determines pull direction."]
1147    #[inline(always)]
1148    pub fn inputpullfilter(self) -> &'a mut W {
1149        self.variant(MODE4_A::INPUTPULLFILTER)
1150    }
1151    #[doc = "Push-pull output."]
1152    #[inline(always)]
1153    pub fn pushpull(self) -> &'a mut W {
1154        self.variant(MODE4_A::PUSHPULL)
1155    }
1156    #[doc = "Push-pull using alternate control."]
1157    #[inline(always)]
1158    pub fn pushpullalt(self) -> &'a mut W {
1159        self.variant(MODE4_A::PUSHPULLALT)
1160    }
1161    #[doc = "Wired-or output."]
1162    #[inline(always)]
1163    pub fn wiredor(self) -> &'a mut W {
1164        self.variant(MODE4_A::WIREDOR)
1165    }
1166    #[doc = "Wired-or output with pull-down."]
1167    #[inline(always)]
1168    pub fn wiredorpulldown(self) -> &'a mut W {
1169        self.variant(MODE4_A::WIREDORPULLDOWN)
1170    }
1171    #[doc = "Open-drain output."]
1172    #[inline(always)]
1173    pub fn wiredand(self) -> &'a mut W {
1174        self.variant(MODE4_A::WIREDAND)
1175    }
1176    #[doc = "Open-drain output with filter."]
1177    #[inline(always)]
1178    pub fn wiredandfilter(self) -> &'a mut W {
1179        self.variant(MODE4_A::WIREDANDFILTER)
1180    }
1181    #[doc = "Open-drain output with pullup."]
1182    #[inline(always)]
1183    pub fn wiredandpullup(self) -> &'a mut W {
1184        self.variant(MODE4_A::WIREDANDPULLUP)
1185    }
1186    #[doc = "Open-drain output with filter and pullup."]
1187    #[inline(always)]
1188    pub fn wiredandpullupfilter(self) -> &'a mut W {
1189        self.variant(MODE4_A::WIREDANDPULLUPFILTER)
1190    }
1191    #[doc = "Open-drain output using alternate control."]
1192    #[inline(always)]
1193    pub fn wiredandalt(self) -> &'a mut W {
1194        self.variant(MODE4_A::WIREDANDALT)
1195    }
1196    #[doc = "Open-drain output using alternate control with filter."]
1197    #[inline(always)]
1198    pub fn wiredandaltfilter(self) -> &'a mut W {
1199        self.variant(MODE4_A::WIREDANDALTFILTER)
1200    }
1201    #[doc = "Open-drain output using alternate control with pullup."]
1202    #[inline(always)]
1203    pub fn wiredandaltpullup(self) -> &'a mut W {
1204        self.variant(MODE4_A::WIREDANDALTPULLUP)
1205    }
1206    #[doc = "Open-drain output using alternate control with filter and pullup."]
1207    #[inline(always)]
1208    pub fn wiredandaltpullupfilter(self) -> &'a mut W {
1209        self.variant(MODE4_A::WIREDANDALTPULLUPFILTER)
1210    }
1211}
1212impl R {
1213    #[doc = "Bits 0:3 - MODE n"]
1214    #[inline(always)]
1215    pub fn mode0(&self) -> MODE0_R {
1216        MODE0_R::new((self.bits & 0x0f) as u8)
1217    }
1218    #[doc = "Bits 4:7 - MODE n"]
1219    #[inline(always)]
1220    pub fn mode1(&self) -> MODE1_R {
1221        MODE1_R::new(((self.bits >> 4) & 0x0f) as u8)
1222    }
1223    #[doc = "Bits 8:11 - MODE n"]
1224    #[inline(always)]
1225    pub fn mode2(&self) -> MODE2_R {
1226        MODE2_R::new(((self.bits >> 8) & 0x0f) as u8)
1227    }
1228    #[doc = "Bits 12:15 - MODE n"]
1229    #[inline(always)]
1230    pub fn mode3(&self) -> MODE3_R {
1231        MODE3_R::new(((self.bits >> 12) & 0x0f) as u8)
1232    }
1233    #[doc = "Bits 16:19 - MODE n"]
1234    #[inline(always)]
1235    pub fn mode4(&self) -> MODE4_R {
1236        MODE4_R::new(((self.bits >> 16) & 0x0f) as u8)
1237    }
1238}
1239impl W {
1240    #[doc = "Bits 0:3 - MODE n"]
1241    #[inline(always)]
1242    #[must_use]
1243    pub fn mode0(&mut self) -> MODE0_W<0> {
1244        MODE0_W::new(self)
1245    }
1246    #[doc = "Bits 4:7 - MODE n"]
1247    #[inline(always)]
1248    #[must_use]
1249    pub fn mode1(&mut self) -> MODE1_W<4> {
1250        MODE1_W::new(self)
1251    }
1252    #[doc = "Bits 8:11 - MODE n"]
1253    #[inline(always)]
1254    #[must_use]
1255    pub fn mode2(&mut self) -> MODE2_W<8> {
1256        MODE2_W::new(self)
1257    }
1258    #[doc = "Bits 12:15 - MODE n"]
1259    #[inline(always)]
1260    #[must_use]
1261    pub fn mode3(&mut self) -> MODE3_W<12> {
1262        MODE3_W::new(self)
1263    }
1264    #[doc = "Bits 16:19 - MODE n"]
1265    #[inline(always)]
1266    #[must_use]
1267    pub fn mode4(&mut self) -> MODE4_W<16> {
1268        MODE4_W::new(self)
1269    }
1270    #[doc = "Writes raw bits to the register."]
1271    #[inline(always)]
1272    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1273        self.0.bits(bits);
1274        self
1275    }
1276}
1277#[doc = "mode low\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [portb_model](index.html) module"]
1278pub struct PORTB_MODEL_SPEC;
1279impl crate::RegisterSpec for PORTB_MODEL_SPEC {
1280    type Ux = u32;
1281}
1282#[doc = "`read()` method returns [portb_model::R](R) reader structure"]
1283impl crate::Readable for PORTB_MODEL_SPEC {
1284    type Reader = R;
1285}
1286#[doc = "`write(|w| ..)` method takes [portb_model::W](W) writer structure"]
1287impl crate::Writable for PORTB_MODEL_SPEC {
1288    type Writer = W;
1289    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
1290    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
1291}
1292#[doc = "`reset()` method sets PORTB_MODEL to value 0"]
1293impl crate::Resettable for PORTB_MODEL_SPEC {
1294    const RESET_VALUE: Self::Ux = 0;
1295}