efm32g230_pac/gpio/
pd_model.rs

1#[doc = "Register `PD_MODEL` reader"]
2pub struct R(crate::R<PD_MODEL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PD_MODEL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PD_MODEL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PD_MODEL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PD_MODEL` writer"]
17pub struct W(crate::W<PD_MODEL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PD_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<PD_MODEL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PD_MODEL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Pin 0 Mode\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum MODE0_A {
41    #[doc = "0: Input disabled. Pullup if DOUT is set."]
42    DISABLED = 0,
43    #[doc = "1: Input enabled. Filter if DOUT is set"]
44    INPUT = 1,
45    #[doc = "2: Input enabled. DOUT determines pull direction"]
46    INPUTPULL = 2,
47    #[doc = "3: Input enabled with filter. DOUT determines pull direction"]
48    INPUTPULLFILTER = 3,
49    #[doc = "4: Push-pull output"]
50    PUSHPULL = 4,
51    #[doc = "5: Push-pull output with drive-strength set by DRIVEMODE"]
52    PUSHPULLDRIVE = 5,
53    #[doc = "6: Wired-or output"]
54    WIREDOR = 6,
55    #[doc = "7: Wired-or output with pull-down"]
56    WIREDORPULLDOWN = 7,
57    #[doc = "8: Open-drain output"]
58    WIREDAND = 8,
59    #[doc = "9: Open-drain output with filter"]
60    WIREDANDFILTER = 9,
61    #[doc = "10: Open-drain output with pullup"]
62    WIREDANDPULLUP = 10,
63    #[doc = "11: Open-drain output with filter and pullup"]
64    WIREDANDPULLUPFILTER = 11,
65    #[doc = "12: Open-drain output with drive-strength set by DRIVEMODE"]
66    WIREDANDDRIVE = 12,
67    #[doc = "13: Open-drain output with filter and drive-strength set by DRIVEMODE"]
68    WIREDANDDRIVEFILTER = 13,
69    #[doc = "14: Open-drain output with pullup and drive-strength set by DRIVEMODE"]
70    WIREDANDDRIVEPULLUP = 14,
71    #[doc = "15: Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
72    WIREDANDDRIVEPULLUPFILTER = 15,
73}
74impl From<MODE0_A> for u8 {
75    #[inline(always)]
76    fn from(variant: MODE0_A) -> Self {
77        variant as _
78    }
79}
80#[doc = "Field `MODE0` reader - Pin 0 Mode"]
81pub type MODE0_R = crate::FieldReader<u8, MODE0_A>;
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::PUSHPULLDRIVE,
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::WIREDANDDRIVE,
100            13 => MODE0_A::WIREDANDDRIVEFILTER,
101            14 => MODE0_A::WIREDANDDRIVEPULLUP,
102            15 => MODE0_A::WIREDANDDRIVEPULLUPFILTER,
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 `PUSHPULLDRIVE`"]
132    #[inline(always)]
133    pub fn is_pushpulldrive(&self) -> bool {
134        *self == MODE0_A::PUSHPULLDRIVE
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 `WIREDANDDRIVE`"]
167    #[inline(always)]
168    pub fn is_wiredanddrive(&self) -> bool {
169        *self == MODE0_A::WIREDANDDRIVE
170    }
171    #[doc = "Checks if the value of the field is `WIREDANDDRIVEFILTER`"]
172    #[inline(always)]
173    pub fn is_wiredanddrivefilter(&self) -> bool {
174        *self == MODE0_A::WIREDANDDRIVEFILTER
175    }
176    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUP`"]
177    #[inline(always)]
178    pub fn is_wiredanddrivepullup(&self) -> bool {
179        *self == MODE0_A::WIREDANDDRIVEPULLUP
180    }
181    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUPFILTER`"]
182    #[inline(always)]
183    pub fn is_wiredanddrivepullupfilter(&self) -> bool {
184        *self == MODE0_A::WIREDANDDRIVEPULLUPFILTER
185    }
186}
187#[doc = "Field `MODE0` writer - Pin 0 Mode"]
188pub type MODE0_W<'a> = crate::FieldWriterSafe<'a, u32, PD_MODEL_SPEC, u8, MODE0_A, 4, 0>;
189impl<'a> MODE0_W<'a> {
190    #[doc = "Input disabled. Pullup if DOUT is set."]
191    #[inline(always)]
192    pub fn disabled(self) -> &'a mut W {
193        self.variant(MODE0_A::DISABLED)
194    }
195    #[doc = "Input enabled. Filter if DOUT is set"]
196    #[inline(always)]
197    pub fn input(self) -> &'a mut W {
198        self.variant(MODE0_A::INPUT)
199    }
200    #[doc = "Input enabled. DOUT determines pull direction"]
201    #[inline(always)]
202    pub fn inputpull(self) -> &'a mut W {
203        self.variant(MODE0_A::INPUTPULL)
204    }
205    #[doc = "Input enabled with filter. DOUT determines pull direction"]
206    #[inline(always)]
207    pub fn inputpullfilter(self) -> &'a mut W {
208        self.variant(MODE0_A::INPUTPULLFILTER)
209    }
210    #[doc = "Push-pull output"]
211    #[inline(always)]
212    pub fn pushpull(self) -> &'a mut W {
213        self.variant(MODE0_A::PUSHPULL)
214    }
215    #[doc = "Push-pull output with drive-strength set by DRIVEMODE"]
216    #[inline(always)]
217    pub fn pushpulldrive(self) -> &'a mut W {
218        self.variant(MODE0_A::PUSHPULLDRIVE)
219    }
220    #[doc = "Wired-or output"]
221    #[inline(always)]
222    pub fn wiredor(self) -> &'a mut W {
223        self.variant(MODE0_A::WIREDOR)
224    }
225    #[doc = "Wired-or output with pull-down"]
226    #[inline(always)]
227    pub fn wiredorpulldown(self) -> &'a mut W {
228        self.variant(MODE0_A::WIREDORPULLDOWN)
229    }
230    #[doc = "Open-drain output"]
231    #[inline(always)]
232    pub fn wiredand(self) -> &'a mut W {
233        self.variant(MODE0_A::WIREDAND)
234    }
235    #[doc = "Open-drain output with filter"]
236    #[inline(always)]
237    pub fn wiredandfilter(self) -> &'a mut W {
238        self.variant(MODE0_A::WIREDANDFILTER)
239    }
240    #[doc = "Open-drain output with pullup"]
241    #[inline(always)]
242    pub fn wiredandpullup(self) -> &'a mut W {
243        self.variant(MODE0_A::WIREDANDPULLUP)
244    }
245    #[doc = "Open-drain output with filter and pullup"]
246    #[inline(always)]
247    pub fn wiredandpullupfilter(self) -> &'a mut W {
248        self.variant(MODE0_A::WIREDANDPULLUPFILTER)
249    }
250    #[doc = "Open-drain output with drive-strength set by DRIVEMODE"]
251    #[inline(always)]
252    pub fn wiredanddrive(self) -> &'a mut W {
253        self.variant(MODE0_A::WIREDANDDRIVE)
254    }
255    #[doc = "Open-drain output with filter and drive-strength set by DRIVEMODE"]
256    #[inline(always)]
257    pub fn wiredanddrivefilter(self) -> &'a mut W {
258        self.variant(MODE0_A::WIREDANDDRIVEFILTER)
259    }
260    #[doc = "Open-drain output with pullup and drive-strength set by DRIVEMODE"]
261    #[inline(always)]
262    pub fn wiredanddrivepullup(self) -> &'a mut W {
263        self.variant(MODE0_A::WIREDANDDRIVEPULLUP)
264    }
265    #[doc = "Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
266    #[inline(always)]
267    pub fn wiredanddrivepullupfilter(self) -> &'a mut W {
268        self.variant(MODE0_A::WIREDANDDRIVEPULLUPFILTER)
269    }
270}
271#[doc = "Pin 1 Mode\n\nValue on reset: 0"]
272#[derive(Clone, Copy, Debug, PartialEq)]
273#[repr(u8)]
274pub enum MODE1_A {
275    #[doc = "0: Input disabled. Pullup if DOUT is set."]
276    DISABLED = 0,
277    #[doc = "1: Input enabled. Filter if DOUT is set"]
278    INPUT = 1,
279    #[doc = "2: Input enabled. DOUT determines pull direction"]
280    INPUTPULL = 2,
281    #[doc = "3: Input enabled with filter. DOUT determines pull direction"]
282    INPUTPULLFILTER = 3,
283    #[doc = "4: Push-pull output"]
284    PUSHPULL = 4,
285    #[doc = "5: Push-pull output with drive-strength set by DRIVEMODE"]
286    PUSHPULLDRIVE = 5,
287    #[doc = "6: Wired-or output"]
288    WIREDOR = 6,
289    #[doc = "7: Wired-or output with pull-down"]
290    WIREDORPULLDOWN = 7,
291    #[doc = "8: Open-drain output"]
292    WIREDAND = 8,
293    #[doc = "9: Open-drain output with filter"]
294    WIREDANDFILTER = 9,
295    #[doc = "10: Open-drain output with pullup"]
296    WIREDANDPULLUP = 10,
297    #[doc = "11: Open-drain output with filter and pullup"]
298    WIREDANDPULLUPFILTER = 11,
299    #[doc = "12: Open-drain output with drive-strength set by DRIVEMODE"]
300    WIREDANDDRIVE = 12,
301    #[doc = "13: Open-drain output with filter and drive-strength set by DRIVEMODE"]
302    WIREDANDDRIVEFILTER = 13,
303    #[doc = "14: Open-drain output with pullup and drive-strength set by DRIVEMODE"]
304    WIREDANDDRIVEPULLUP = 14,
305    #[doc = "15: Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
306    WIREDANDDRIVEPULLUPFILTER = 15,
307}
308impl From<MODE1_A> for u8 {
309    #[inline(always)]
310    fn from(variant: MODE1_A) -> Self {
311        variant as _
312    }
313}
314#[doc = "Field `MODE1` reader - Pin 1 Mode"]
315pub type MODE1_R = crate::FieldReader<u8, MODE1_A>;
316impl MODE1_R {
317    #[doc = "Get enumerated values variant"]
318    #[inline(always)]
319    pub fn variant(&self) -> MODE1_A {
320        match self.bits {
321            0 => MODE1_A::DISABLED,
322            1 => MODE1_A::INPUT,
323            2 => MODE1_A::INPUTPULL,
324            3 => MODE1_A::INPUTPULLFILTER,
325            4 => MODE1_A::PUSHPULL,
326            5 => MODE1_A::PUSHPULLDRIVE,
327            6 => MODE1_A::WIREDOR,
328            7 => MODE1_A::WIREDORPULLDOWN,
329            8 => MODE1_A::WIREDAND,
330            9 => MODE1_A::WIREDANDFILTER,
331            10 => MODE1_A::WIREDANDPULLUP,
332            11 => MODE1_A::WIREDANDPULLUPFILTER,
333            12 => MODE1_A::WIREDANDDRIVE,
334            13 => MODE1_A::WIREDANDDRIVEFILTER,
335            14 => MODE1_A::WIREDANDDRIVEPULLUP,
336            15 => MODE1_A::WIREDANDDRIVEPULLUPFILTER,
337            _ => unreachable!(),
338        }
339    }
340    #[doc = "Checks if the value of the field is `DISABLED`"]
341    #[inline(always)]
342    pub fn is_disabled(&self) -> bool {
343        *self == MODE1_A::DISABLED
344    }
345    #[doc = "Checks if the value of the field is `INPUT`"]
346    #[inline(always)]
347    pub fn is_input(&self) -> bool {
348        *self == MODE1_A::INPUT
349    }
350    #[doc = "Checks if the value of the field is `INPUTPULL`"]
351    #[inline(always)]
352    pub fn is_inputpull(&self) -> bool {
353        *self == MODE1_A::INPUTPULL
354    }
355    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
356    #[inline(always)]
357    pub fn is_inputpullfilter(&self) -> bool {
358        *self == MODE1_A::INPUTPULLFILTER
359    }
360    #[doc = "Checks if the value of the field is `PUSHPULL`"]
361    #[inline(always)]
362    pub fn is_pushpull(&self) -> bool {
363        *self == MODE1_A::PUSHPULL
364    }
365    #[doc = "Checks if the value of the field is `PUSHPULLDRIVE`"]
366    #[inline(always)]
367    pub fn is_pushpulldrive(&self) -> bool {
368        *self == MODE1_A::PUSHPULLDRIVE
369    }
370    #[doc = "Checks if the value of the field is `WIREDOR`"]
371    #[inline(always)]
372    pub fn is_wiredor(&self) -> bool {
373        *self == MODE1_A::WIREDOR
374    }
375    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
376    #[inline(always)]
377    pub fn is_wiredorpulldown(&self) -> bool {
378        *self == MODE1_A::WIREDORPULLDOWN
379    }
380    #[doc = "Checks if the value of the field is `WIREDAND`"]
381    #[inline(always)]
382    pub fn is_wiredand(&self) -> bool {
383        *self == MODE1_A::WIREDAND
384    }
385    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
386    #[inline(always)]
387    pub fn is_wiredandfilter(&self) -> bool {
388        *self == MODE1_A::WIREDANDFILTER
389    }
390    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
391    #[inline(always)]
392    pub fn is_wiredandpullup(&self) -> bool {
393        *self == MODE1_A::WIREDANDPULLUP
394    }
395    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
396    #[inline(always)]
397    pub fn is_wiredandpullupfilter(&self) -> bool {
398        *self == MODE1_A::WIREDANDPULLUPFILTER
399    }
400    #[doc = "Checks if the value of the field is `WIREDANDDRIVE`"]
401    #[inline(always)]
402    pub fn is_wiredanddrive(&self) -> bool {
403        *self == MODE1_A::WIREDANDDRIVE
404    }
405    #[doc = "Checks if the value of the field is `WIREDANDDRIVEFILTER`"]
406    #[inline(always)]
407    pub fn is_wiredanddrivefilter(&self) -> bool {
408        *self == MODE1_A::WIREDANDDRIVEFILTER
409    }
410    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUP`"]
411    #[inline(always)]
412    pub fn is_wiredanddrivepullup(&self) -> bool {
413        *self == MODE1_A::WIREDANDDRIVEPULLUP
414    }
415    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUPFILTER`"]
416    #[inline(always)]
417    pub fn is_wiredanddrivepullupfilter(&self) -> bool {
418        *self == MODE1_A::WIREDANDDRIVEPULLUPFILTER
419    }
420}
421#[doc = "Field `MODE1` writer - Pin 1 Mode"]
422pub type MODE1_W<'a> = crate::FieldWriterSafe<'a, u32, PD_MODEL_SPEC, u8, MODE1_A, 4, 4>;
423impl<'a> MODE1_W<'a> {
424    #[doc = "Input disabled. Pullup if DOUT is set."]
425    #[inline(always)]
426    pub fn disabled(self) -> &'a mut W {
427        self.variant(MODE1_A::DISABLED)
428    }
429    #[doc = "Input enabled. Filter if DOUT is set"]
430    #[inline(always)]
431    pub fn input(self) -> &'a mut W {
432        self.variant(MODE1_A::INPUT)
433    }
434    #[doc = "Input enabled. DOUT determines pull direction"]
435    #[inline(always)]
436    pub fn inputpull(self) -> &'a mut W {
437        self.variant(MODE1_A::INPUTPULL)
438    }
439    #[doc = "Input enabled with filter. DOUT determines pull direction"]
440    #[inline(always)]
441    pub fn inputpullfilter(self) -> &'a mut W {
442        self.variant(MODE1_A::INPUTPULLFILTER)
443    }
444    #[doc = "Push-pull output"]
445    #[inline(always)]
446    pub fn pushpull(self) -> &'a mut W {
447        self.variant(MODE1_A::PUSHPULL)
448    }
449    #[doc = "Push-pull output with drive-strength set by DRIVEMODE"]
450    #[inline(always)]
451    pub fn pushpulldrive(self) -> &'a mut W {
452        self.variant(MODE1_A::PUSHPULLDRIVE)
453    }
454    #[doc = "Wired-or output"]
455    #[inline(always)]
456    pub fn wiredor(self) -> &'a mut W {
457        self.variant(MODE1_A::WIREDOR)
458    }
459    #[doc = "Wired-or output with pull-down"]
460    #[inline(always)]
461    pub fn wiredorpulldown(self) -> &'a mut W {
462        self.variant(MODE1_A::WIREDORPULLDOWN)
463    }
464    #[doc = "Open-drain output"]
465    #[inline(always)]
466    pub fn wiredand(self) -> &'a mut W {
467        self.variant(MODE1_A::WIREDAND)
468    }
469    #[doc = "Open-drain output with filter"]
470    #[inline(always)]
471    pub fn wiredandfilter(self) -> &'a mut W {
472        self.variant(MODE1_A::WIREDANDFILTER)
473    }
474    #[doc = "Open-drain output with pullup"]
475    #[inline(always)]
476    pub fn wiredandpullup(self) -> &'a mut W {
477        self.variant(MODE1_A::WIREDANDPULLUP)
478    }
479    #[doc = "Open-drain output with filter and pullup"]
480    #[inline(always)]
481    pub fn wiredandpullupfilter(self) -> &'a mut W {
482        self.variant(MODE1_A::WIREDANDPULLUPFILTER)
483    }
484    #[doc = "Open-drain output with drive-strength set by DRIVEMODE"]
485    #[inline(always)]
486    pub fn wiredanddrive(self) -> &'a mut W {
487        self.variant(MODE1_A::WIREDANDDRIVE)
488    }
489    #[doc = "Open-drain output with filter and drive-strength set by DRIVEMODE"]
490    #[inline(always)]
491    pub fn wiredanddrivefilter(self) -> &'a mut W {
492        self.variant(MODE1_A::WIREDANDDRIVEFILTER)
493    }
494    #[doc = "Open-drain output with pullup and drive-strength set by DRIVEMODE"]
495    #[inline(always)]
496    pub fn wiredanddrivepullup(self) -> &'a mut W {
497        self.variant(MODE1_A::WIREDANDDRIVEPULLUP)
498    }
499    #[doc = "Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
500    #[inline(always)]
501    pub fn wiredanddrivepullupfilter(self) -> &'a mut W {
502        self.variant(MODE1_A::WIREDANDDRIVEPULLUPFILTER)
503    }
504}
505#[doc = "Pin 2 Mode\n\nValue on reset: 0"]
506#[derive(Clone, Copy, Debug, PartialEq)]
507#[repr(u8)]
508pub enum MODE2_A {
509    #[doc = "0: Input disabled. Pullup if DOUT is set."]
510    DISABLED = 0,
511    #[doc = "1: Input enabled. Filter if DOUT is set"]
512    INPUT = 1,
513    #[doc = "2: Input enabled. DOUT determines pull direction"]
514    INPUTPULL = 2,
515    #[doc = "3: Input enabled with filter. DOUT determines pull direction"]
516    INPUTPULLFILTER = 3,
517    #[doc = "4: Push-pull output"]
518    PUSHPULL = 4,
519    #[doc = "5: Push-pull output with drive-strength set by DRIVEMODE"]
520    PUSHPULLDRIVE = 5,
521    #[doc = "6: Wired-or output"]
522    WIREDOR = 6,
523    #[doc = "7: Wired-or output with pull-down"]
524    WIREDORPULLDOWN = 7,
525    #[doc = "8: Open-drain output"]
526    WIREDAND = 8,
527    #[doc = "9: Open-drain output with filter"]
528    WIREDANDFILTER = 9,
529    #[doc = "10: Open-drain output with pullup"]
530    WIREDANDPULLUP = 10,
531    #[doc = "11: Open-drain output with filter and pullup"]
532    WIREDANDPULLUPFILTER = 11,
533    #[doc = "12: Open-drain output with drive-strength set by DRIVEMODE"]
534    WIREDANDDRIVE = 12,
535    #[doc = "13: Open-drain output with filter and drive-strength set by DRIVEMODE"]
536    WIREDANDDRIVEFILTER = 13,
537    #[doc = "14: Open-drain output with pullup and drive-strength set by DRIVEMODE"]
538    WIREDANDDRIVEPULLUP = 14,
539    #[doc = "15: Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
540    WIREDANDDRIVEPULLUPFILTER = 15,
541}
542impl From<MODE2_A> for u8 {
543    #[inline(always)]
544    fn from(variant: MODE2_A) -> Self {
545        variant as _
546    }
547}
548#[doc = "Field `MODE2` reader - Pin 2 Mode"]
549pub type MODE2_R = crate::FieldReader<u8, MODE2_A>;
550impl MODE2_R {
551    #[doc = "Get enumerated values variant"]
552    #[inline(always)]
553    pub fn variant(&self) -> MODE2_A {
554        match self.bits {
555            0 => MODE2_A::DISABLED,
556            1 => MODE2_A::INPUT,
557            2 => MODE2_A::INPUTPULL,
558            3 => MODE2_A::INPUTPULLFILTER,
559            4 => MODE2_A::PUSHPULL,
560            5 => MODE2_A::PUSHPULLDRIVE,
561            6 => MODE2_A::WIREDOR,
562            7 => MODE2_A::WIREDORPULLDOWN,
563            8 => MODE2_A::WIREDAND,
564            9 => MODE2_A::WIREDANDFILTER,
565            10 => MODE2_A::WIREDANDPULLUP,
566            11 => MODE2_A::WIREDANDPULLUPFILTER,
567            12 => MODE2_A::WIREDANDDRIVE,
568            13 => MODE2_A::WIREDANDDRIVEFILTER,
569            14 => MODE2_A::WIREDANDDRIVEPULLUP,
570            15 => MODE2_A::WIREDANDDRIVEPULLUPFILTER,
571            _ => unreachable!(),
572        }
573    }
574    #[doc = "Checks if the value of the field is `DISABLED`"]
575    #[inline(always)]
576    pub fn is_disabled(&self) -> bool {
577        *self == MODE2_A::DISABLED
578    }
579    #[doc = "Checks if the value of the field is `INPUT`"]
580    #[inline(always)]
581    pub fn is_input(&self) -> bool {
582        *self == MODE2_A::INPUT
583    }
584    #[doc = "Checks if the value of the field is `INPUTPULL`"]
585    #[inline(always)]
586    pub fn is_inputpull(&self) -> bool {
587        *self == MODE2_A::INPUTPULL
588    }
589    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
590    #[inline(always)]
591    pub fn is_inputpullfilter(&self) -> bool {
592        *self == MODE2_A::INPUTPULLFILTER
593    }
594    #[doc = "Checks if the value of the field is `PUSHPULL`"]
595    #[inline(always)]
596    pub fn is_pushpull(&self) -> bool {
597        *self == MODE2_A::PUSHPULL
598    }
599    #[doc = "Checks if the value of the field is `PUSHPULLDRIVE`"]
600    #[inline(always)]
601    pub fn is_pushpulldrive(&self) -> bool {
602        *self == MODE2_A::PUSHPULLDRIVE
603    }
604    #[doc = "Checks if the value of the field is `WIREDOR`"]
605    #[inline(always)]
606    pub fn is_wiredor(&self) -> bool {
607        *self == MODE2_A::WIREDOR
608    }
609    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
610    #[inline(always)]
611    pub fn is_wiredorpulldown(&self) -> bool {
612        *self == MODE2_A::WIREDORPULLDOWN
613    }
614    #[doc = "Checks if the value of the field is `WIREDAND`"]
615    #[inline(always)]
616    pub fn is_wiredand(&self) -> bool {
617        *self == MODE2_A::WIREDAND
618    }
619    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
620    #[inline(always)]
621    pub fn is_wiredandfilter(&self) -> bool {
622        *self == MODE2_A::WIREDANDFILTER
623    }
624    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
625    #[inline(always)]
626    pub fn is_wiredandpullup(&self) -> bool {
627        *self == MODE2_A::WIREDANDPULLUP
628    }
629    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
630    #[inline(always)]
631    pub fn is_wiredandpullupfilter(&self) -> bool {
632        *self == MODE2_A::WIREDANDPULLUPFILTER
633    }
634    #[doc = "Checks if the value of the field is `WIREDANDDRIVE`"]
635    #[inline(always)]
636    pub fn is_wiredanddrive(&self) -> bool {
637        *self == MODE2_A::WIREDANDDRIVE
638    }
639    #[doc = "Checks if the value of the field is `WIREDANDDRIVEFILTER`"]
640    #[inline(always)]
641    pub fn is_wiredanddrivefilter(&self) -> bool {
642        *self == MODE2_A::WIREDANDDRIVEFILTER
643    }
644    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUP`"]
645    #[inline(always)]
646    pub fn is_wiredanddrivepullup(&self) -> bool {
647        *self == MODE2_A::WIREDANDDRIVEPULLUP
648    }
649    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUPFILTER`"]
650    #[inline(always)]
651    pub fn is_wiredanddrivepullupfilter(&self) -> bool {
652        *self == MODE2_A::WIREDANDDRIVEPULLUPFILTER
653    }
654}
655#[doc = "Field `MODE2` writer - Pin 2 Mode"]
656pub type MODE2_W<'a> = crate::FieldWriterSafe<'a, u32, PD_MODEL_SPEC, u8, MODE2_A, 4, 8>;
657impl<'a> MODE2_W<'a> {
658    #[doc = "Input disabled. Pullup if DOUT is set."]
659    #[inline(always)]
660    pub fn disabled(self) -> &'a mut W {
661        self.variant(MODE2_A::DISABLED)
662    }
663    #[doc = "Input enabled. Filter if DOUT is set"]
664    #[inline(always)]
665    pub fn input(self) -> &'a mut W {
666        self.variant(MODE2_A::INPUT)
667    }
668    #[doc = "Input enabled. DOUT determines pull direction"]
669    #[inline(always)]
670    pub fn inputpull(self) -> &'a mut W {
671        self.variant(MODE2_A::INPUTPULL)
672    }
673    #[doc = "Input enabled with filter. DOUT determines pull direction"]
674    #[inline(always)]
675    pub fn inputpullfilter(self) -> &'a mut W {
676        self.variant(MODE2_A::INPUTPULLFILTER)
677    }
678    #[doc = "Push-pull output"]
679    #[inline(always)]
680    pub fn pushpull(self) -> &'a mut W {
681        self.variant(MODE2_A::PUSHPULL)
682    }
683    #[doc = "Push-pull output with drive-strength set by DRIVEMODE"]
684    #[inline(always)]
685    pub fn pushpulldrive(self) -> &'a mut W {
686        self.variant(MODE2_A::PUSHPULLDRIVE)
687    }
688    #[doc = "Wired-or output"]
689    #[inline(always)]
690    pub fn wiredor(self) -> &'a mut W {
691        self.variant(MODE2_A::WIREDOR)
692    }
693    #[doc = "Wired-or output with pull-down"]
694    #[inline(always)]
695    pub fn wiredorpulldown(self) -> &'a mut W {
696        self.variant(MODE2_A::WIREDORPULLDOWN)
697    }
698    #[doc = "Open-drain output"]
699    #[inline(always)]
700    pub fn wiredand(self) -> &'a mut W {
701        self.variant(MODE2_A::WIREDAND)
702    }
703    #[doc = "Open-drain output with filter"]
704    #[inline(always)]
705    pub fn wiredandfilter(self) -> &'a mut W {
706        self.variant(MODE2_A::WIREDANDFILTER)
707    }
708    #[doc = "Open-drain output with pullup"]
709    #[inline(always)]
710    pub fn wiredandpullup(self) -> &'a mut W {
711        self.variant(MODE2_A::WIREDANDPULLUP)
712    }
713    #[doc = "Open-drain output with filter and pullup"]
714    #[inline(always)]
715    pub fn wiredandpullupfilter(self) -> &'a mut W {
716        self.variant(MODE2_A::WIREDANDPULLUPFILTER)
717    }
718    #[doc = "Open-drain output with drive-strength set by DRIVEMODE"]
719    #[inline(always)]
720    pub fn wiredanddrive(self) -> &'a mut W {
721        self.variant(MODE2_A::WIREDANDDRIVE)
722    }
723    #[doc = "Open-drain output with filter and drive-strength set by DRIVEMODE"]
724    #[inline(always)]
725    pub fn wiredanddrivefilter(self) -> &'a mut W {
726        self.variant(MODE2_A::WIREDANDDRIVEFILTER)
727    }
728    #[doc = "Open-drain output with pullup and drive-strength set by DRIVEMODE"]
729    #[inline(always)]
730    pub fn wiredanddrivepullup(self) -> &'a mut W {
731        self.variant(MODE2_A::WIREDANDDRIVEPULLUP)
732    }
733    #[doc = "Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
734    #[inline(always)]
735    pub fn wiredanddrivepullupfilter(self) -> &'a mut W {
736        self.variant(MODE2_A::WIREDANDDRIVEPULLUPFILTER)
737    }
738}
739#[doc = "Pin 3 Mode\n\nValue on reset: 0"]
740#[derive(Clone, Copy, Debug, PartialEq)]
741#[repr(u8)]
742pub enum MODE3_A {
743    #[doc = "0: Input disabled. Pullup if DOUT is set."]
744    DISABLED = 0,
745    #[doc = "1: Input enabled. Filter if DOUT is set"]
746    INPUT = 1,
747    #[doc = "2: Input enabled. DOUT determines pull direction"]
748    INPUTPULL = 2,
749    #[doc = "3: Input enabled with filter. DOUT determines pull direction"]
750    INPUTPULLFILTER = 3,
751    #[doc = "4: Push-pull output"]
752    PUSHPULL = 4,
753    #[doc = "5: Push-pull output with drive-strength set by DRIVEMODE"]
754    PUSHPULLDRIVE = 5,
755    #[doc = "6: Wired-or output"]
756    WIREDOR = 6,
757    #[doc = "7: Wired-or output with pull-down"]
758    WIREDORPULLDOWN = 7,
759    #[doc = "8: Open-drain output"]
760    WIREDAND = 8,
761    #[doc = "9: Open-drain output with filter"]
762    WIREDANDFILTER = 9,
763    #[doc = "10: Open-drain output with pullup"]
764    WIREDANDPULLUP = 10,
765    #[doc = "11: Open-drain output with filter and pullup"]
766    WIREDANDPULLUPFILTER = 11,
767    #[doc = "12: Open-drain output with drive-strength set by DRIVEMODE"]
768    WIREDANDDRIVE = 12,
769    #[doc = "13: Open-drain output with filter and drive-strength set by DRIVEMODE"]
770    WIREDANDDRIVEFILTER = 13,
771    #[doc = "14: Open-drain output with pullup and drive-strength set by DRIVEMODE"]
772    WIREDANDDRIVEPULLUP = 14,
773    #[doc = "15: Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
774    WIREDANDDRIVEPULLUPFILTER = 15,
775}
776impl From<MODE3_A> for u8 {
777    #[inline(always)]
778    fn from(variant: MODE3_A) -> Self {
779        variant as _
780    }
781}
782#[doc = "Field `MODE3` reader - Pin 3 Mode"]
783pub type MODE3_R = crate::FieldReader<u8, MODE3_A>;
784impl MODE3_R {
785    #[doc = "Get enumerated values variant"]
786    #[inline(always)]
787    pub fn variant(&self) -> MODE3_A {
788        match self.bits {
789            0 => MODE3_A::DISABLED,
790            1 => MODE3_A::INPUT,
791            2 => MODE3_A::INPUTPULL,
792            3 => MODE3_A::INPUTPULLFILTER,
793            4 => MODE3_A::PUSHPULL,
794            5 => MODE3_A::PUSHPULLDRIVE,
795            6 => MODE3_A::WIREDOR,
796            7 => MODE3_A::WIREDORPULLDOWN,
797            8 => MODE3_A::WIREDAND,
798            9 => MODE3_A::WIREDANDFILTER,
799            10 => MODE3_A::WIREDANDPULLUP,
800            11 => MODE3_A::WIREDANDPULLUPFILTER,
801            12 => MODE3_A::WIREDANDDRIVE,
802            13 => MODE3_A::WIREDANDDRIVEFILTER,
803            14 => MODE3_A::WIREDANDDRIVEPULLUP,
804            15 => MODE3_A::WIREDANDDRIVEPULLUPFILTER,
805            _ => unreachable!(),
806        }
807    }
808    #[doc = "Checks if the value of the field is `DISABLED`"]
809    #[inline(always)]
810    pub fn is_disabled(&self) -> bool {
811        *self == MODE3_A::DISABLED
812    }
813    #[doc = "Checks if the value of the field is `INPUT`"]
814    #[inline(always)]
815    pub fn is_input(&self) -> bool {
816        *self == MODE3_A::INPUT
817    }
818    #[doc = "Checks if the value of the field is `INPUTPULL`"]
819    #[inline(always)]
820    pub fn is_inputpull(&self) -> bool {
821        *self == MODE3_A::INPUTPULL
822    }
823    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
824    #[inline(always)]
825    pub fn is_inputpullfilter(&self) -> bool {
826        *self == MODE3_A::INPUTPULLFILTER
827    }
828    #[doc = "Checks if the value of the field is `PUSHPULL`"]
829    #[inline(always)]
830    pub fn is_pushpull(&self) -> bool {
831        *self == MODE3_A::PUSHPULL
832    }
833    #[doc = "Checks if the value of the field is `PUSHPULLDRIVE`"]
834    #[inline(always)]
835    pub fn is_pushpulldrive(&self) -> bool {
836        *self == MODE3_A::PUSHPULLDRIVE
837    }
838    #[doc = "Checks if the value of the field is `WIREDOR`"]
839    #[inline(always)]
840    pub fn is_wiredor(&self) -> bool {
841        *self == MODE3_A::WIREDOR
842    }
843    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
844    #[inline(always)]
845    pub fn is_wiredorpulldown(&self) -> bool {
846        *self == MODE3_A::WIREDORPULLDOWN
847    }
848    #[doc = "Checks if the value of the field is `WIREDAND`"]
849    #[inline(always)]
850    pub fn is_wiredand(&self) -> bool {
851        *self == MODE3_A::WIREDAND
852    }
853    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
854    #[inline(always)]
855    pub fn is_wiredandfilter(&self) -> bool {
856        *self == MODE3_A::WIREDANDFILTER
857    }
858    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
859    #[inline(always)]
860    pub fn is_wiredandpullup(&self) -> bool {
861        *self == MODE3_A::WIREDANDPULLUP
862    }
863    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
864    #[inline(always)]
865    pub fn is_wiredandpullupfilter(&self) -> bool {
866        *self == MODE3_A::WIREDANDPULLUPFILTER
867    }
868    #[doc = "Checks if the value of the field is `WIREDANDDRIVE`"]
869    #[inline(always)]
870    pub fn is_wiredanddrive(&self) -> bool {
871        *self == MODE3_A::WIREDANDDRIVE
872    }
873    #[doc = "Checks if the value of the field is `WIREDANDDRIVEFILTER`"]
874    #[inline(always)]
875    pub fn is_wiredanddrivefilter(&self) -> bool {
876        *self == MODE3_A::WIREDANDDRIVEFILTER
877    }
878    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUP`"]
879    #[inline(always)]
880    pub fn is_wiredanddrivepullup(&self) -> bool {
881        *self == MODE3_A::WIREDANDDRIVEPULLUP
882    }
883    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUPFILTER`"]
884    #[inline(always)]
885    pub fn is_wiredanddrivepullupfilter(&self) -> bool {
886        *self == MODE3_A::WIREDANDDRIVEPULLUPFILTER
887    }
888}
889#[doc = "Field `MODE3` writer - Pin 3 Mode"]
890pub type MODE3_W<'a> = crate::FieldWriterSafe<'a, u32, PD_MODEL_SPEC, u8, MODE3_A, 4, 12>;
891impl<'a> MODE3_W<'a> {
892    #[doc = "Input disabled. Pullup if DOUT is set."]
893    #[inline(always)]
894    pub fn disabled(self) -> &'a mut W {
895        self.variant(MODE3_A::DISABLED)
896    }
897    #[doc = "Input enabled. Filter if DOUT is set"]
898    #[inline(always)]
899    pub fn input(self) -> &'a mut W {
900        self.variant(MODE3_A::INPUT)
901    }
902    #[doc = "Input enabled. DOUT determines pull direction"]
903    #[inline(always)]
904    pub fn inputpull(self) -> &'a mut W {
905        self.variant(MODE3_A::INPUTPULL)
906    }
907    #[doc = "Input enabled with filter. DOUT determines pull direction"]
908    #[inline(always)]
909    pub fn inputpullfilter(self) -> &'a mut W {
910        self.variant(MODE3_A::INPUTPULLFILTER)
911    }
912    #[doc = "Push-pull output"]
913    #[inline(always)]
914    pub fn pushpull(self) -> &'a mut W {
915        self.variant(MODE3_A::PUSHPULL)
916    }
917    #[doc = "Push-pull output with drive-strength set by DRIVEMODE"]
918    #[inline(always)]
919    pub fn pushpulldrive(self) -> &'a mut W {
920        self.variant(MODE3_A::PUSHPULLDRIVE)
921    }
922    #[doc = "Wired-or output"]
923    #[inline(always)]
924    pub fn wiredor(self) -> &'a mut W {
925        self.variant(MODE3_A::WIREDOR)
926    }
927    #[doc = "Wired-or output with pull-down"]
928    #[inline(always)]
929    pub fn wiredorpulldown(self) -> &'a mut W {
930        self.variant(MODE3_A::WIREDORPULLDOWN)
931    }
932    #[doc = "Open-drain output"]
933    #[inline(always)]
934    pub fn wiredand(self) -> &'a mut W {
935        self.variant(MODE3_A::WIREDAND)
936    }
937    #[doc = "Open-drain output with filter"]
938    #[inline(always)]
939    pub fn wiredandfilter(self) -> &'a mut W {
940        self.variant(MODE3_A::WIREDANDFILTER)
941    }
942    #[doc = "Open-drain output with pullup"]
943    #[inline(always)]
944    pub fn wiredandpullup(self) -> &'a mut W {
945        self.variant(MODE3_A::WIREDANDPULLUP)
946    }
947    #[doc = "Open-drain output with filter and pullup"]
948    #[inline(always)]
949    pub fn wiredandpullupfilter(self) -> &'a mut W {
950        self.variant(MODE3_A::WIREDANDPULLUPFILTER)
951    }
952    #[doc = "Open-drain output with drive-strength set by DRIVEMODE"]
953    #[inline(always)]
954    pub fn wiredanddrive(self) -> &'a mut W {
955        self.variant(MODE3_A::WIREDANDDRIVE)
956    }
957    #[doc = "Open-drain output with filter and drive-strength set by DRIVEMODE"]
958    #[inline(always)]
959    pub fn wiredanddrivefilter(self) -> &'a mut W {
960        self.variant(MODE3_A::WIREDANDDRIVEFILTER)
961    }
962    #[doc = "Open-drain output with pullup and drive-strength set by DRIVEMODE"]
963    #[inline(always)]
964    pub fn wiredanddrivepullup(self) -> &'a mut W {
965        self.variant(MODE3_A::WIREDANDDRIVEPULLUP)
966    }
967    #[doc = "Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
968    #[inline(always)]
969    pub fn wiredanddrivepullupfilter(self) -> &'a mut W {
970        self.variant(MODE3_A::WIREDANDDRIVEPULLUPFILTER)
971    }
972}
973#[doc = "Pin 4 Mode\n\nValue on reset: 0"]
974#[derive(Clone, Copy, Debug, PartialEq)]
975#[repr(u8)]
976pub enum MODE4_A {
977    #[doc = "0: Input disabled. Pullup if DOUT is set."]
978    DISABLED = 0,
979    #[doc = "1: Input enabled. Filter if DOUT is set"]
980    INPUT = 1,
981    #[doc = "2: Input enabled. DOUT determines pull direction"]
982    INPUTPULL = 2,
983    #[doc = "3: Input enabled with filter. DOUT determines pull direction"]
984    INPUTPULLFILTER = 3,
985    #[doc = "4: Push-pull output"]
986    PUSHPULL = 4,
987    #[doc = "5: Push-pull output with drive-strength set by DRIVEMODE"]
988    PUSHPULLDRIVE = 5,
989    #[doc = "6: Wired-or output"]
990    WIREDOR = 6,
991    #[doc = "7: Wired-or output with pull-down"]
992    WIREDORPULLDOWN = 7,
993    #[doc = "8: Open-drain output"]
994    WIREDAND = 8,
995    #[doc = "9: Open-drain output with filter"]
996    WIREDANDFILTER = 9,
997    #[doc = "10: Open-drain output with pullup"]
998    WIREDANDPULLUP = 10,
999    #[doc = "11: Open-drain output with filter and pullup"]
1000    WIREDANDPULLUPFILTER = 11,
1001    #[doc = "12: Open-drain output with drive-strength set by DRIVEMODE"]
1002    WIREDANDDRIVE = 12,
1003    #[doc = "13: Open-drain output with filter and drive-strength set by DRIVEMODE"]
1004    WIREDANDDRIVEFILTER = 13,
1005    #[doc = "14: Open-drain output with pullup and drive-strength set by DRIVEMODE"]
1006    WIREDANDDRIVEPULLUP = 14,
1007    #[doc = "15: Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
1008    WIREDANDDRIVEPULLUPFILTER = 15,
1009}
1010impl From<MODE4_A> for u8 {
1011    #[inline(always)]
1012    fn from(variant: MODE4_A) -> Self {
1013        variant as _
1014    }
1015}
1016#[doc = "Field `MODE4` reader - Pin 4 Mode"]
1017pub type MODE4_R = crate::FieldReader<u8, MODE4_A>;
1018impl MODE4_R {
1019    #[doc = "Get enumerated values variant"]
1020    #[inline(always)]
1021    pub fn variant(&self) -> MODE4_A {
1022        match self.bits {
1023            0 => MODE4_A::DISABLED,
1024            1 => MODE4_A::INPUT,
1025            2 => MODE4_A::INPUTPULL,
1026            3 => MODE4_A::INPUTPULLFILTER,
1027            4 => MODE4_A::PUSHPULL,
1028            5 => MODE4_A::PUSHPULLDRIVE,
1029            6 => MODE4_A::WIREDOR,
1030            7 => MODE4_A::WIREDORPULLDOWN,
1031            8 => MODE4_A::WIREDAND,
1032            9 => MODE4_A::WIREDANDFILTER,
1033            10 => MODE4_A::WIREDANDPULLUP,
1034            11 => MODE4_A::WIREDANDPULLUPFILTER,
1035            12 => MODE4_A::WIREDANDDRIVE,
1036            13 => MODE4_A::WIREDANDDRIVEFILTER,
1037            14 => MODE4_A::WIREDANDDRIVEPULLUP,
1038            15 => MODE4_A::WIREDANDDRIVEPULLUPFILTER,
1039            _ => unreachable!(),
1040        }
1041    }
1042    #[doc = "Checks if the value of the field is `DISABLED`"]
1043    #[inline(always)]
1044    pub fn is_disabled(&self) -> bool {
1045        *self == MODE4_A::DISABLED
1046    }
1047    #[doc = "Checks if the value of the field is `INPUT`"]
1048    #[inline(always)]
1049    pub fn is_input(&self) -> bool {
1050        *self == MODE4_A::INPUT
1051    }
1052    #[doc = "Checks if the value of the field is `INPUTPULL`"]
1053    #[inline(always)]
1054    pub fn is_inputpull(&self) -> bool {
1055        *self == MODE4_A::INPUTPULL
1056    }
1057    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
1058    #[inline(always)]
1059    pub fn is_inputpullfilter(&self) -> bool {
1060        *self == MODE4_A::INPUTPULLFILTER
1061    }
1062    #[doc = "Checks if the value of the field is `PUSHPULL`"]
1063    #[inline(always)]
1064    pub fn is_pushpull(&self) -> bool {
1065        *self == MODE4_A::PUSHPULL
1066    }
1067    #[doc = "Checks if the value of the field is `PUSHPULLDRIVE`"]
1068    #[inline(always)]
1069    pub fn is_pushpulldrive(&self) -> bool {
1070        *self == MODE4_A::PUSHPULLDRIVE
1071    }
1072    #[doc = "Checks if the value of the field is `WIREDOR`"]
1073    #[inline(always)]
1074    pub fn is_wiredor(&self) -> bool {
1075        *self == MODE4_A::WIREDOR
1076    }
1077    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
1078    #[inline(always)]
1079    pub fn is_wiredorpulldown(&self) -> bool {
1080        *self == MODE4_A::WIREDORPULLDOWN
1081    }
1082    #[doc = "Checks if the value of the field is `WIREDAND`"]
1083    #[inline(always)]
1084    pub fn is_wiredand(&self) -> bool {
1085        *self == MODE4_A::WIREDAND
1086    }
1087    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
1088    #[inline(always)]
1089    pub fn is_wiredandfilter(&self) -> bool {
1090        *self == MODE4_A::WIREDANDFILTER
1091    }
1092    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
1093    #[inline(always)]
1094    pub fn is_wiredandpullup(&self) -> bool {
1095        *self == MODE4_A::WIREDANDPULLUP
1096    }
1097    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
1098    #[inline(always)]
1099    pub fn is_wiredandpullupfilter(&self) -> bool {
1100        *self == MODE4_A::WIREDANDPULLUPFILTER
1101    }
1102    #[doc = "Checks if the value of the field is `WIREDANDDRIVE`"]
1103    #[inline(always)]
1104    pub fn is_wiredanddrive(&self) -> bool {
1105        *self == MODE4_A::WIREDANDDRIVE
1106    }
1107    #[doc = "Checks if the value of the field is `WIREDANDDRIVEFILTER`"]
1108    #[inline(always)]
1109    pub fn is_wiredanddrivefilter(&self) -> bool {
1110        *self == MODE4_A::WIREDANDDRIVEFILTER
1111    }
1112    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUP`"]
1113    #[inline(always)]
1114    pub fn is_wiredanddrivepullup(&self) -> bool {
1115        *self == MODE4_A::WIREDANDDRIVEPULLUP
1116    }
1117    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUPFILTER`"]
1118    #[inline(always)]
1119    pub fn is_wiredanddrivepullupfilter(&self) -> bool {
1120        *self == MODE4_A::WIREDANDDRIVEPULLUPFILTER
1121    }
1122}
1123#[doc = "Field `MODE4` writer - Pin 4 Mode"]
1124pub type MODE4_W<'a> = crate::FieldWriterSafe<'a, u32, PD_MODEL_SPEC, u8, MODE4_A, 4, 16>;
1125impl<'a> MODE4_W<'a> {
1126    #[doc = "Input disabled. Pullup if DOUT is set."]
1127    #[inline(always)]
1128    pub fn disabled(self) -> &'a mut W {
1129        self.variant(MODE4_A::DISABLED)
1130    }
1131    #[doc = "Input enabled. Filter if DOUT is set"]
1132    #[inline(always)]
1133    pub fn input(self) -> &'a mut W {
1134        self.variant(MODE4_A::INPUT)
1135    }
1136    #[doc = "Input enabled. DOUT determines pull direction"]
1137    #[inline(always)]
1138    pub fn inputpull(self) -> &'a mut W {
1139        self.variant(MODE4_A::INPUTPULL)
1140    }
1141    #[doc = "Input enabled with filter. DOUT determines pull direction"]
1142    #[inline(always)]
1143    pub fn inputpullfilter(self) -> &'a mut W {
1144        self.variant(MODE4_A::INPUTPULLFILTER)
1145    }
1146    #[doc = "Push-pull output"]
1147    #[inline(always)]
1148    pub fn pushpull(self) -> &'a mut W {
1149        self.variant(MODE4_A::PUSHPULL)
1150    }
1151    #[doc = "Push-pull output with drive-strength set by DRIVEMODE"]
1152    #[inline(always)]
1153    pub fn pushpulldrive(self) -> &'a mut W {
1154        self.variant(MODE4_A::PUSHPULLDRIVE)
1155    }
1156    #[doc = "Wired-or output"]
1157    #[inline(always)]
1158    pub fn wiredor(self) -> &'a mut W {
1159        self.variant(MODE4_A::WIREDOR)
1160    }
1161    #[doc = "Wired-or output with pull-down"]
1162    #[inline(always)]
1163    pub fn wiredorpulldown(self) -> &'a mut W {
1164        self.variant(MODE4_A::WIREDORPULLDOWN)
1165    }
1166    #[doc = "Open-drain output"]
1167    #[inline(always)]
1168    pub fn wiredand(self) -> &'a mut W {
1169        self.variant(MODE4_A::WIREDAND)
1170    }
1171    #[doc = "Open-drain output with filter"]
1172    #[inline(always)]
1173    pub fn wiredandfilter(self) -> &'a mut W {
1174        self.variant(MODE4_A::WIREDANDFILTER)
1175    }
1176    #[doc = "Open-drain output with pullup"]
1177    #[inline(always)]
1178    pub fn wiredandpullup(self) -> &'a mut W {
1179        self.variant(MODE4_A::WIREDANDPULLUP)
1180    }
1181    #[doc = "Open-drain output with filter and pullup"]
1182    #[inline(always)]
1183    pub fn wiredandpullupfilter(self) -> &'a mut W {
1184        self.variant(MODE4_A::WIREDANDPULLUPFILTER)
1185    }
1186    #[doc = "Open-drain output with drive-strength set by DRIVEMODE"]
1187    #[inline(always)]
1188    pub fn wiredanddrive(self) -> &'a mut W {
1189        self.variant(MODE4_A::WIREDANDDRIVE)
1190    }
1191    #[doc = "Open-drain output with filter and drive-strength set by DRIVEMODE"]
1192    #[inline(always)]
1193    pub fn wiredanddrivefilter(self) -> &'a mut W {
1194        self.variant(MODE4_A::WIREDANDDRIVEFILTER)
1195    }
1196    #[doc = "Open-drain output with pullup and drive-strength set by DRIVEMODE"]
1197    #[inline(always)]
1198    pub fn wiredanddrivepullup(self) -> &'a mut W {
1199        self.variant(MODE4_A::WIREDANDDRIVEPULLUP)
1200    }
1201    #[doc = "Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
1202    #[inline(always)]
1203    pub fn wiredanddrivepullupfilter(self) -> &'a mut W {
1204        self.variant(MODE4_A::WIREDANDDRIVEPULLUPFILTER)
1205    }
1206}
1207#[doc = "Pin 5 Mode\n\nValue on reset: 0"]
1208#[derive(Clone, Copy, Debug, PartialEq)]
1209#[repr(u8)]
1210pub enum MODE5_A {
1211    #[doc = "0: Input disabled. Pullup if DOUT is set."]
1212    DISABLED = 0,
1213    #[doc = "1: Input enabled. Filter if DOUT is set"]
1214    INPUT = 1,
1215    #[doc = "2: Input enabled. DOUT determines pull direction"]
1216    INPUTPULL = 2,
1217    #[doc = "3: Input enabled with filter. DOUT determines pull direction"]
1218    INPUTPULLFILTER = 3,
1219    #[doc = "4: Push-pull output"]
1220    PUSHPULL = 4,
1221    #[doc = "5: Push-pull output with drive-strength set by DRIVEMODE"]
1222    PUSHPULLDRIVE = 5,
1223    #[doc = "6: Wired-or output"]
1224    WIREDOR = 6,
1225    #[doc = "7: Wired-or output with pull-down"]
1226    WIREDORPULLDOWN = 7,
1227    #[doc = "8: Open-drain output"]
1228    WIREDAND = 8,
1229    #[doc = "9: Open-drain output with filter"]
1230    WIREDANDFILTER = 9,
1231    #[doc = "10: Open-drain output with pullup"]
1232    WIREDANDPULLUP = 10,
1233    #[doc = "11: Open-drain output with filter and pullup"]
1234    WIREDANDPULLUPFILTER = 11,
1235    #[doc = "12: Open-drain output with drive-strength set by DRIVEMODE"]
1236    WIREDANDDRIVE = 12,
1237    #[doc = "13: Open-drain output with filter and drive-strength set by DRIVEMODE"]
1238    WIREDANDDRIVEFILTER = 13,
1239    #[doc = "14: Open-drain output with pullup and drive-strength set by DRIVEMODE"]
1240    WIREDANDDRIVEPULLUP = 14,
1241    #[doc = "15: Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
1242    WIREDANDDRIVEPULLUPFILTER = 15,
1243}
1244impl From<MODE5_A> for u8 {
1245    #[inline(always)]
1246    fn from(variant: MODE5_A) -> Self {
1247        variant as _
1248    }
1249}
1250#[doc = "Field `MODE5` reader - Pin 5 Mode"]
1251pub type MODE5_R = crate::FieldReader<u8, MODE5_A>;
1252impl MODE5_R {
1253    #[doc = "Get enumerated values variant"]
1254    #[inline(always)]
1255    pub fn variant(&self) -> MODE5_A {
1256        match self.bits {
1257            0 => MODE5_A::DISABLED,
1258            1 => MODE5_A::INPUT,
1259            2 => MODE5_A::INPUTPULL,
1260            3 => MODE5_A::INPUTPULLFILTER,
1261            4 => MODE5_A::PUSHPULL,
1262            5 => MODE5_A::PUSHPULLDRIVE,
1263            6 => MODE5_A::WIREDOR,
1264            7 => MODE5_A::WIREDORPULLDOWN,
1265            8 => MODE5_A::WIREDAND,
1266            9 => MODE5_A::WIREDANDFILTER,
1267            10 => MODE5_A::WIREDANDPULLUP,
1268            11 => MODE5_A::WIREDANDPULLUPFILTER,
1269            12 => MODE5_A::WIREDANDDRIVE,
1270            13 => MODE5_A::WIREDANDDRIVEFILTER,
1271            14 => MODE5_A::WIREDANDDRIVEPULLUP,
1272            15 => MODE5_A::WIREDANDDRIVEPULLUPFILTER,
1273            _ => unreachable!(),
1274        }
1275    }
1276    #[doc = "Checks if the value of the field is `DISABLED`"]
1277    #[inline(always)]
1278    pub fn is_disabled(&self) -> bool {
1279        *self == MODE5_A::DISABLED
1280    }
1281    #[doc = "Checks if the value of the field is `INPUT`"]
1282    #[inline(always)]
1283    pub fn is_input(&self) -> bool {
1284        *self == MODE5_A::INPUT
1285    }
1286    #[doc = "Checks if the value of the field is `INPUTPULL`"]
1287    #[inline(always)]
1288    pub fn is_inputpull(&self) -> bool {
1289        *self == MODE5_A::INPUTPULL
1290    }
1291    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
1292    #[inline(always)]
1293    pub fn is_inputpullfilter(&self) -> bool {
1294        *self == MODE5_A::INPUTPULLFILTER
1295    }
1296    #[doc = "Checks if the value of the field is `PUSHPULL`"]
1297    #[inline(always)]
1298    pub fn is_pushpull(&self) -> bool {
1299        *self == MODE5_A::PUSHPULL
1300    }
1301    #[doc = "Checks if the value of the field is `PUSHPULLDRIVE`"]
1302    #[inline(always)]
1303    pub fn is_pushpulldrive(&self) -> bool {
1304        *self == MODE5_A::PUSHPULLDRIVE
1305    }
1306    #[doc = "Checks if the value of the field is `WIREDOR`"]
1307    #[inline(always)]
1308    pub fn is_wiredor(&self) -> bool {
1309        *self == MODE5_A::WIREDOR
1310    }
1311    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
1312    #[inline(always)]
1313    pub fn is_wiredorpulldown(&self) -> bool {
1314        *self == MODE5_A::WIREDORPULLDOWN
1315    }
1316    #[doc = "Checks if the value of the field is `WIREDAND`"]
1317    #[inline(always)]
1318    pub fn is_wiredand(&self) -> bool {
1319        *self == MODE5_A::WIREDAND
1320    }
1321    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
1322    #[inline(always)]
1323    pub fn is_wiredandfilter(&self) -> bool {
1324        *self == MODE5_A::WIREDANDFILTER
1325    }
1326    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
1327    #[inline(always)]
1328    pub fn is_wiredandpullup(&self) -> bool {
1329        *self == MODE5_A::WIREDANDPULLUP
1330    }
1331    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
1332    #[inline(always)]
1333    pub fn is_wiredandpullupfilter(&self) -> bool {
1334        *self == MODE5_A::WIREDANDPULLUPFILTER
1335    }
1336    #[doc = "Checks if the value of the field is `WIREDANDDRIVE`"]
1337    #[inline(always)]
1338    pub fn is_wiredanddrive(&self) -> bool {
1339        *self == MODE5_A::WIREDANDDRIVE
1340    }
1341    #[doc = "Checks if the value of the field is `WIREDANDDRIVEFILTER`"]
1342    #[inline(always)]
1343    pub fn is_wiredanddrivefilter(&self) -> bool {
1344        *self == MODE5_A::WIREDANDDRIVEFILTER
1345    }
1346    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUP`"]
1347    #[inline(always)]
1348    pub fn is_wiredanddrivepullup(&self) -> bool {
1349        *self == MODE5_A::WIREDANDDRIVEPULLUP
1350    }
1351    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUPFILTER`"]
1352    #[inline(always)]
1353    pub fn is_wiredanddrivepullupfilter(&self) -> bool {
1354        *self == MODE5_A::WIREDANDDRIVEPULLUPFILTER
1355    }
1356}
1357#[doc = "Field `MODE5` writer - Pin 5 Mode"]
1358pub type MODE5_W<'a> = crate::FieldWriterSafe<'a, u32, PD_MODEL_SPEC, u8, MODE5_A, 4, 20>;
1359impl<'a> MODE5_W<'a> {
1360    #[doc = "Input disabled. Pullup if DOUT is set."]
1361    #[inline(always)]
1362    pub fn disabled(self) -> &'a mut W {
1363        self.variant(MODE5_A::DISABLED)
1364    }
1365    #[doc = "Input enabled. Filter if DOUT is set"]
1366    #[inline(always)]
1367    pub fn input(self) -> &'a mut W {
1368        self.variant(MODE5_A::INPUT)
1369    }
1370    #[doc = "Input enabled. DOUT determines pull direction"]
1371    #[inline(always)]
1372    pub fn inputpull(self) -> &'a mut W {
1373        self.variant(MODE5_A::INPUTPULL)
1374    }
1375    #[doc = "Input enabled with filter. DOUT determines pull direction"]
1376    #[inline(always)]
1377    pub fn inputpullfilter(self) -> &'a mut W {
1378        self.variant(MODE5_A::INPUTPULLFILTER)
1379    }
1380    #[doc = "Push-pull output"]
1381    #[inline(always)]
1382    pub fn pushpull(self) -> &'a mut W {
1383        self.variant(MODE5_A::PUSHPULL)
1384    }
1385    #[doc = "Push-pull output with drive-strength set by DRIVEMODE"]
1386    #[inline(always)]
1387    pub fn pushpulldrive(self) -> &'a mut W {
1388        self.variant(MODE5_A::PUSHPULLDRIVE)
1389    }
1390    #[doc = "Wired-or output"]
1391    #[inline(always)]
1392    pub fn wiredor(self) -> &'a mut W {
1393        self.variant(MODE5_A::WIREDOR)
1394    }
1395    #[doc = "Wired-or output with pull-down"]
1396    #[inline(always)]
1397    pub fn wiredorpulldown(self) -> &'a mut W {
1398        self.variant(MODE5_A::WIREDORPULLDOWN)
1399    }
1400    #[doc = "Open-drain output"]
1401    #[inline(always)]
1402    pub fn wiredand(self) -> &'a mut W {
1403        self.variant(MODE5_A::WIREDAND)
1404    }
1405    #[doc = "Open-drain output with filter"]
1406    #[inline(always)]
1407    pub fn wiredandfilter(self) -> &'a mut W {
1408        self.variant(MODE5_A::WIREDANDFILTER)
1409    }
1410    #[doc = "Open-drain output with pullup"]
1411    #[inline(always)]
1412    pub fn wiredandpullup(self) -> &'a mut W {
1413        self.variant(MODE5_A::WIREDANDPULLUP)
1414    }
1415    #[doc = "Open-drain output with filter and pullup"]
1416    #[inline(always)]
1417    pub fn wiredandpullupfilter(self) -> &'a mut W {
1418        self.variant(MODE5_A::WIREDANDPULLUPFILTER)
1419    }
1420    #[doc = "Open-drain output with drive-strength set by DRIVEMODE"]
1421    #[inline(always)]
1422    pub fn wiredanddrive(self) -> &'a mut W {
1423        self.variant(MODE5_A::WIREDANDDRIVE)
1424    }
1425    #[doc = "Open-drain output with filter and drive-strength set by DRIVEMODE"]
1426    #[inline(always)]
1427    pub fn wiredanddrivefilter(self) -> &'a mut W {
1428        self.variant(MODE5_A::WIREDANDDRIVEFILTER)
1429    }
1430    #[doc = "Open-drain output with pullup and drive-strength set by DRIVEMODE"]
1431    #[inline(always)]
1432    pub fn wiredanddrivepullup(self) -> &'a mut W {
1433        self.variant(MODE5_A::WIREDANDDRIVEPULLUP)
1434    }
1435    #[doc = "Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
1436    #[inline(always)]
1437    pub fn wiredanddrivepullupfilter(self) -> &'a mut W {
1438        self.variant(MODE5_A::WIREDANDDRIVEPULLUPFILTER)
1439    }
1440}
1441#[doc = "Pin 6 Mode\n\nValue on reset: 0"]
1442#[derive(Clone, Copy, Debug, PartialEq)]
1443#[repr(u8)]
1444pub enum MODE6_A {
1445    #[doc = "0: Input disabled. Pullup if DOUT is set."]
1446    DISABLED = 0,
1447    #[doc = "1: Input enabled. Filter if DOUT is set"]
1448    INPUT = 1,
1449    #[doc = "2: Input enabled. DOUT determines pull direction"]
1450    INPUTPULL = 2,
1451    #[doc = "3: Input enabled with filter. DOUT determines pull direction"]
1452    INPUTPULLFILTER = 3,
1453    #[doc = "4: Push-pull output"]
1454    PUSHPULL = 4,
1455    #[doc = "5: Push-pull output with drive-strength set by DRIVEMODE"]
1456    PUSHPULLDRIVE = 5,
1457    #[doc = "6: Wired-or output"]
1458    WIREDOR = 6,
1459    #[doc = "7: Wired-or output with pull-down"]
1460    WIREDORPULLDOWN = 7,
1461    #[doc = "8: Open-drain output"]
1462    WIREDAND = 8,
1463    #[doc = "9: Open-drain output with filter"]
1464    WIREDANDFILTER = 9,
1465    #[doc = "10: Open-drain output with pullup"]
1466    WIREDANDPULLUP = 10,
1467    #[doc = "11: Open-drain output with filter and pullup"]
1468    WIREDANDPULLUPFILTER = 11,
1469    #[doc = "12: Open-drain output with drive-strength set by DRIVEMODE"]
1470    WIREDANDDRIVE = 12,
1471    #[doc = "13: Open-drain output with filter and drive-strength set by DRIVEMODE"]
1472    WIREDANDDRIVEFILTER = 13,
1473    #[doc = "14: Open-drain output with pullup and drive-strength set by DRIVEMODE"]
1474    WIREDANDDRIVEPULLUP = 14,
1475    #[doc = "15: Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
1476    WIREDANDDRIVEPULLUPFILTER = 15,
1477}
1478impl From<MODE6_A> for u8 {
1479    #[inline(always)]
1480    fn from(variant: MODE6_A) -> Self {
1481        variant as _
1482    }
1483}
1484#[doc = "Field `MODE6` reader - Pin 6 Mode"]
1485pub type MODE6_R = crate::FieldReader<u8, MODE6_A>;
1486impl MODE6_R {
1487    #[doc = "Get enumerated values variant"]
1488    #[inline(always)]
1489    pub fn variant(&self) -> MODE6_A {
1490        match self.bits {
1491            0 => MODE6_A::DISABLED,
1492            1 => MODE6_A::INPUT,
1493            2 => MODE6_A::INPUTPULL,
1494            3 => MODE6_A::INPUTPULLFILTER,
1495            4 => MODE6_A::PUSHPULL,
1496            5 => MODE6_A::PUSHPULLDRIVE,
1497            6 => MODE6_A::WIREDOR,
1498            7 => MODE6_A::WIREDORPULLDOWN,
1499            8 => MODE6_A::WIREDAND,
1500            9 => MODE6_A::WIREDANDFILTER,
1501            10 => MODE6_A::WIREDANDPULLUP,
1502            11 => MODE6_A::WIREDANDPULLUPFILTER,
1503            12 => MODE6_A::WIREDANDDRIVE,
1504            13 => MODE6_A::WIREDANDDRIVEFILTER,
1505            14 => MODE6_A::WIREDANDDRIVEPULLUP,
1506            15 => MODE6_A::WIREDANDDRIVEPULLUPFILTER,
1507            _ => unreachable!(),
1508        }
1509    }
1510    #[doc = "Checks if the value of the field is `DISABLED`"]
1511    #[inline(always)]
1512    pub fn is_disabled(&self) -> bool {
1513        *self == MODE6_A::DISABLED
1514    }
1515    #[doc = "Checks if the value of the field is `INPUT`"]
1516    #[inline(always)]
1517    pub fn is_input(&self) -> bool {
1518        *self == MODE6_A::INPUT
1519    }
1520    #[doc = "Checks if the value of the field is `INPUTPULL`"]
1521    #[inline(always)]
1522    pub fn is_inputpull(&self) -> bool {
1523        *self == MODE6_A::INPUTPULL
1524    }
1525    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
1526    #[inline(always)]
1527    pub fn is_inputpullfilter(&self) -> bool {
1528        *self == MODE6_A::INPUTPULLFILTER
1529    }
1530    #[doc = "Checks if the value of the field is `PUSHPULL`"]
1531    #[inline(always)]
1532    pub fn is_pushpull(&self) -> bool {
1533        *self == MODE6_A::PUSHPULL
1534    }
1535    #[doc = "Checks if the value of the field is `PUSHPULLDRIVE`"]
1536    #[inline(always)]
1537    pub fn is_pushpulldrive(&self) -> bool {
1538        *self == MODE6_A::PUSHPULLDRIVE
1539    }
1540    #[doc = "Checks if the value of the field is `WIREDOR`"]
1541    #[inline(always)]
1542    pub fn is_wiredor(&self) -> bool {
1543        *self == MODE6_A::WIREDOR
1544    }
1545    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
1546    #[inline(always)]
1547    pub fn is_wiredorpulldown(&self) -> bool {
1548        *self == MODE6_A::WIREDORPULLDOWN
1549    }
1550    #[doc = "Checks if the value of the field is `WIREDAND`"]
1551    #[inline(always)]
1552    pub fn is_wiredand(&self) -> bool {
1553        *self == MODE6_A::WIREDAND
1554    }
1555    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
1556    #[inline(always)]
1557    pub fn is_wiredandfilter(&self) -> bool {
1558        *self == MODE6_A::WIREDANDFILTER
1559    }
1560    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
1561    #[inline(always)]
1562    pub fn is_wiredandpullup(&self) -> bool {
1563        *self == MODE6_A::WIREDANDPULLUP
1564    }
1565    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
1566    #[inline(always)]
1567    pub fn is_wiredandpullupfilter(&self) -> bool {
1568        *self == MODE6_A::WIREDANDPULLUPFILTER
1569    }
1570    #[doc = "Checks if the value of the field is `WIREDANDDRIVE`"]
1571    #[inline(always)]
1572    pub fn is_wiredanddrive(&self) -> bool {
1573        *self == MODE6_A::WIREDANDDRIVE
1574    }
1575    #[doc = "Checks if the value of the field is `WIREDANDDRIVEFILTER`"]
1576    #[inline(always)]
1577    pub fn is_wiredanddrivefilter(&self) -> bool {
1578        *self == MODE6_A::WIREDANDDRIVEFILTER
1579    }
1580    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUP`"]
1581    #[inline(always)]
1582    pub fn is_wiredanddrivepullup(&self) -> bool {
1583        *self == MODE6_A::WIREDANDDRIVEPULLUP
1584    }
1585    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUPFILTER`"]
1586    #[inline(always)]
1587    pub fn is_wiredanddrivepullupfilter(&self) -> bool {
1588        *self == MODE6_A::WIREDANDDRIVEPULLUPFILTER
1589    }
1590}
1591#[doc = "Field `MODE6` writer - Pin 6 Mode"]
1592pub type MODE6_W<'a> = crate::FieldWriterSafe<'a, u32, PD_MODEL_SPEC, u8, MODE6_A, 4, 24>;
1593impl<'a> MODE6_W<'a> {
1594    #[doc = "Input disabled. Pullup if DOUT is set."]
1595    #[inline(always)]
1596    pub fn disabled(self) -> &'a mut W {
1597        self.variant(MODE6_A::DISABLED)
1598    }
1599    #[doc = "Input enabled. Filter if DOUT is set"]
1600    #[inline(always)]
1601    pub fn input(self) -> &'a mut W {
1602        self.variant(MODE6_A::INPUT)
1603    }
1604    #[doc = "Input enabled. DOUT determines pull direction"]
1605    #[inline(always)]
1606    pub fn inputpull(self) -> &'a mut W {
1607        self.variant(MODE6_A::INPUTPULL)
1608    }
1609    #[doc = "Input enabled with filter. DOUT determines pull direction"]
1610    #[inline(always)]
1611    pub fn inputpullfilter(self) -> &'a mut W {
1612        self.variant(MODE6_A::INPUTPULLFILTER)
1613    }
1614    #[doc = "Push-pull output"]
1615    #[inline(always)]
1616    pub fn pushpull(self) -> &'a mut W {
1617        self.variant(MODE6_A::PUSHPULL)
1618    }
1619    #[doc = "Push-pull output with drive-strength set by DRIVEMODE"]
1620    #[inline(always)]
1621    pub fn pushpulldrive(self) -> &'a mut W {
1622        self.variant(MODE6_A::PUSHPULLDRIVE)
1623    }
1624    #[doc = "Wired-or output"]
1625    #[inline(always)]
1626    pub fn wiredor(self) -> &'a mut W {
1627        self.variant(MODE6_A::WIREDOR)
1628    }
1629    #[doc = "Wired-or output with pull-down"]
1630    #[inline(always)]
1631    pub fn wiredorpulldown(self) -> &'a mut W {
1632        self.variant(MODE6_A::WIREDORPULLDOWN)
1633    }
1634    #[doc = "Open-drain output"]
1635    #[inline(always)]
1636    pub fn wiredand(self) -> &'a mut W {
1637        self.variant(MODE6_A::WIREDAND)
1638    }
1639    #[doc = "Open-drain output with filter"]
1640    #[inline(always)]
1641    pub fn wiredandfilter(self) -> &'a mut W {
1642        self.variant(MODE6_A::WIREDANDFILTER)
1643    }
1644    #[doc = "Open-drain output with pullup"]
1645    #[inline(always)]
1646    pub fn wiredandpullup(self) -> &'a mut W {
1647        self.variant(MODE6_A::WIREDANDPULLUP)
1648    }
1649    #[doc = "Open-drain output with filter and pullup"]
1650    #[inline(always)]
1651    pub fn wiredandpullupfilter(self) -> &'a mut W {
1652        self.variant(MODE6_A::WIREDANDPULLUPFILTER)
1653    }
1654    #[doc = "Open-drain output with drive-strength set by DRIVEMODE"]
1655    #[inline(always)]
1656    pub fn wiredanddrive(self) -> &'a mut W {
1657        self.variant(MODE6_A::WIREDANDDRIVE)
1658    }
1659    #[doc = "Open-drain output with filter and drive-strength set by DRIVEMODE"]
1660    #[inline(always)]
1661    pub fn wiredanddrivefilter(self) -> &'a mut W {
1662        self.variant(MODE6_A::WIREDANDDRIVEFILTER)
1663    }
1664    #[doc = "Open-drain output with pullup and drive-strength set by DRIVEMODE"]
1665    #[inline(always)]
1666    pub fn wiredanddrivepullup(self) -> &'a mut W {
1667        self.variant(MODE6_A::WIREDANDDRIVEPULLUP)
1668    }
1669    #[doc = "Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
1670    #[inline(always)]
1671    pub fn wiredanddrivepullupfilter(self) -> &'a mut W {
1672        self.variant(MODE6_A::WIREDANDDRIVEPULLUPFILTER)
1673    }
1674}
1675#[doc = "Pin 7 Mode\n\nValue on reset: 0"]
1676#[derive(Clone, Copy, Debug, PartialEq)]
1677#[repr(u8)]
1678pub enum MODE7_A {
1679    #[doc = "0: Input disabled. Pullup if DOUT is set."]
1680    DISABLED = 0,
1681    #[doc = "1: Input enabled. Filter if DOUT is set"]
1682    INPUT = 1,
1683    #[doc = "2: Input enabled. DOUT determines pull direction"]
1684    INPUTPULL = 2,
1685    #[doc = "3: Input enabled with filter. DOUT determines pull direction"]
1686    INPUTPULLFILTER = 3,
1687    #[doc = "4: Push-pull output"]
1688    PUSHPULL = 4,
1689    #[doc = "5: Push-pull output with drive-strength set by DRIVEMODE"]
1690    PUSHPULLDRIVE = 5,
1691    #[doc = "6: Wired-or output"]
1692    WIREDOR = 6,
1693    #[doc = "7: Wired-or output with pull-down"]
1694    WIREDORPULLDOWN = 7,
1695    #[doc = "8: Open-drain output"]
1696    WIREDAND = 8,
1697    #[doc = "9: Open-drain output with filter"]
1698    WIREDANDFILTER = 9,
1699    #[doc = "10: Open-drain output with pullup"]
1700    WIREDANDPULLUP = 10,
1701    #[doc = "11: Open-drain output with filter and pullup"]
1702    WIREDANDPULLUPFILTER = 11,
1703    #[doc = "12: Open-drain output with drive-strength set by DRIVEMODE"]
1704    WIREDANDDRIVE = 12,
1705    #[doc = "13: Open-drain output with filter and drive-strength set by DRIVEMODE"]
1706    WIREDANDDRIVEFILTER = 13,
1707    #[doc = "14: Open-drain output with pullup and drive-strength set by DRIVEMODE"]
1708    WIREDANDDRIVEPULLUP = 14,
1709    #[doc = "15: Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
1710    WIREDANDDRIVEPULLUPFILTER = 15,
1711}
1712impl From<MODE7_A> for u8 {
1713    #[inline(always)]
1714    fn from(variant: MODE7_A) -> Self {
1715        variant as _
1716    }
1717}
1718#[doc = "Field `MODE7` reader - Pin 7 Mode"]
1719pub type MODE7_R = crate::FieldReader<u8, MODE7_A>;
1720impl MODE7_R {
1721    #[doc = "Get enumerated values variant"]
1722    #[inline(always)]
1723    pub fn variant(&self) -> MODE7_A {
1724        match self.bits {
1725            0 => MODE7_A::DISABLED,
1726            1 => MODE7_A::INPUT,
1727            2 => MODE7_A::INPUTPULL,
1728            3 => MODE7_A::INPUTPULLFILTER,
1729            4 => MODE7_A::PUSHPULL,
1730            5 => MODE7_A::PUSHPULLDRIVE,
1731            6 => MODE7_A::WIREDOR,
1732            7 => MODE7_A::WIREDORPULLDOWN,
1733            8 => MODE7_A::WIREDAND,
1734            9 => MODE7_A::WIREDANDFILTER,
1735            10 => MODE7_A::WIREDANDPULLUP,
1736            11 => MODE7_A::WIREDANDPULLUPFILTER,
1737            12 => MODE7_A::WIREDANDDRIVE,
1738            13 => MODE7_A::WIREDANDDRIVEFILTER,
1739            14 => MODE7_A::WIREDANDDRIVEPULLUP,
1740            15 => MODE7_A::WIREDANDDRIVEPULLUPFILTER,
1741            _ => unreachable!(),
1742        }
1743    }
1744    #[doc = "Checks if the value of the field is `DISABLED`"]
1745    #[inline(always)]
1746    pub fn is_disabled(&self) -> bool {
1747        *self == MODE7_A::DISABLED
1748    }
1749    #[doc = "Checks if the value of the field is `INPUT`"]
1750    #[inline(always)]
1751    pub fn is_input(&self) -> bool {
1752        *self == MODE7_A::INPUT
1753    }
1754    #[doc = "Checks if the value of the field is `INPUTPULL`"]
1755    #[inline(always)]
1756    pub fn is_inputpull(&self) -> bool {
1757        *self == MODE7_A::INPUTPULL
1758    }
1759    #[doc = "Checks if the value of the field is `INPUTPULLFILTER`"]
1760    #[inline(always)]
1761    pub fn is_inputpullfilter(&self) -> bool {
1762        *self == MODE7_A::INPUTPULLFILTER
1763    }
1764    #[doc = "Checks if the value of the field is `PUSHPULL`"]
1765    #[inline(always)]
1766    pub fn is_pushpull(&self) -> bool {
1767        *self == MODE7_A::PUSHPULL
1768    }
1769    #[doc = "Checks if the value of the field is `PUSHPULLDRIVE`"]
1770    #[inline(always)]
1771    pub fn is_pushpulldrive(&self) -> bool {
1772        *self == MODE7_A::PUSHPULLDRIVE
1773    }
1774    #[doc = "Checks if the value of the field is `WIREDOR`"]
1775    #[inline(always)]
1776    pub fn is_wiredor(&self) -> bool {
1777        *self == MODE7_A::WIREDOR
1778    }
1779    #[doc = "Checks if the value of the field is `WIREDORPULLDOWN`"]
1780    #[inline(always)]
1781    pub fn is_wiredorpulldown(&self) -> bool {
1782        *self == MODE7_A::WIREDORPULLDOWN
1783    }
1784    #[doc = "Checks if the value of the field is `WIREDAND`"]
1785    #[inline(always)]
1786    pub fn is_wiredand(&self) -> bool {
1787        *self == MODE7_A::WIREDAND
1788    }
1789    #[doc = "Checks if the value of the field is `WIREDANDFILTER`"]
1790    #[inline(always)]
1791    pub fn is_wiredandfilter(&self) -> bool {
1792        *self == MODE7_A::WIREDANDFILTER
1793    }
1794    #[doc = "Checks if the value of the field is `WIREDANDPULLUP`"]
1795    #[inline(always)]
1796    pub fn is_wiredandpullup(&self) -> bool {
1797        *self == MODE7_A::WIREDANDPULLUP
1798    }
1799    #[doc = "Checks if the value of the field is `WIREDANDPULLUPFILTER`"]
1800    #[inline(always)]
1801    pub fn is_wiredandpullupfilter(&self) -> bool {
1802        *self == MODE7_A::WIREDANDPULLUPFILTER
1803    }
1804    #[doc = "Checks if the value of the field is `WIREDANDDRIVE`"]
1805    #[inline(always)]
1806    pub fn is_wiredanddrive(&self) -> bool {
1807        *self == MODE7_A::WIREDANDDRIVE
1808    }
1809    #[doc = "Checks if the value of the field is `WIREDANDDRIVEFILTER`"]
1810    #[inline(always)]
1811    pub fn is_wiredanddrivefilter(&self) -> bool {
1812        *self == MODE7_A::WIREDANDDRIVEFILTER
1813    }
1814    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUP`"]
1815    #[inline(always)]
1816    pub fn is_wiredanddrivepullup(&self) -> bool {
1817        *self == MODE7_A::WIREDANDDRIVEPULLUP
1818    }
1819    #[doc = "Checks if the value of the field is `WIREDANDDRIVEPULLUPFILTER`"]
1820    #[inline(always)]
1821    pub fn is_wiredanddrivepullupfilter(&self) -> bool {
1822        *self == MODE7_A::WIREDANDDRIVEPULLUPFILTER
1823    }
1824}
1825#[doc = "Field `MODE7` writer - Pin 7 Mode"]
1826pub type MODE7_W<'a> = crate::FieldWriterSafe<'a, u32, PD_MODEL_SPEC, u8, MODE7_A, 4, 28>;
1827impl<'a> MODE7_W<'a> {
1828    #[doc = "Input disabled. Pullup if DOUT is set."]
1829    #[inline(always)]
1830    pub fn disabled(self) -> &'a mut W {
1831        self.variant(MODE7_A::DISABLED)
1832    }
1833    #[doc = "Input enabled. Filter if DOUT is set"]
1834    #[inline(always)]
1835    pub fn input(self) -> &'a mut W {
1836        self.variant(MODE7_A::INPUT)
1837    }
1838    #[doc = "Input enabled. DOUT determines pull direction"]
1839    #[inline(always)]
1840    pub fn inputpull(self) -> &'a mut W {
1841        self.variant(MODE7_A::INPUTPULL)
1842    }
1843    #[doc = "Input enabled with filter. DOUT determines pull direction"]
1844    #[inline(always)]
1845    pub fn inputpullfilter(self) -> &'a mut W {
1846        self.variant(MODE7_A::INPUTPULLFILTER)
1847    }
1848    #[doc = "Push-pull output"]
1849    #[inline(always)]
1850    pub fn pushpull(self) -> &'a mut W {
1851        self.variant(MODE7_A::PUSHPULL)
1852    }
1853    #[doc = "Push-pull output with drive-strength set by DRIVEMODE"]
1854    #[inline(always)]
1855    pub fn pushpulldrive(self) -> &'a mut W {
1856        self.variant(MODE7_A::PUSHPULLDRIVE)
1857    }
1858    #[doc = "Wired-or output"]
1859    #[inline(always)]
1860    pub fn wiredor(self) -> &'a mut W {
1861        self.variant(MODE7_A::WIREDOR)
1862    }
1863    #[doc = "Wired-or output with pull-down"]
1864    #[inline(always)]
1865    pub fn wiredorpulldown(self) -> &'a mut W {
1866        self.variant(MODE7_A::WIREDORPULLDOWN)
1867    }
1868    #[doc = "Open-drain output"]
1869    #[inline(always)]
1870    pub fn wiredand(self) -> &'a mut W {
1871        self.variant(MODE7_A::WIREDAND)
1872    }
1873    #[doc = "Open-drain output with filter"]
1874    #[inline(always)]
1875    pub fn wiredandfilter(self) -> &'a mut W {
1876        self.variant(MODE7_A::WIREDANDFILTER)
1877    }
1878    #[doc = "Open-drain output with pullup"]
1879    #[inline(always)]
1880    pub fn wiredandpullup(self) -> &'a mut W {
1881        self.variant(MODE7_A::WIREDANDPULLUP)
1882    }
1883    #[doc = "Open-drain output with filter and pullup"]
1884    #[inline(always)]
1885    pub fn wiredandpullupfilter(self) -> &'a mut W {
1886        self.variant(MODE7_A::WIREDANDPULLUPFILTER)
1887    }
1888    #[doc = "Open-drain output with drive-strength set by DRIVEMODE"]
1889    #[inline(always)]
1890    pub fn wiredanddrive(self) -> &'a mut W {
1891        self.variant(MODE7_A::WIREDANDDRIVE)
1892    }
1893    #[doc = "Open-drain output with filter and drive-strength set by DRIVEMODE"]
1894    #[inline(always)]
1895    pub fn wiredanddrivefilter(self) -> &'a mut W {
1896        self.variant(MODE7_A::WIREDANDDRIVEFILTER)
1897    }
1898    #[doc = "Open-drain output with pullup and drive-strength set by DRIVEMODE"]
1899    #[inline(always)]
1900    pub fn wiredanddrivepullup(self) -> &'a mut W {
1901        self.variant(MODE7_A::WIREDANDDRIVEPULLUP)
1902    }
1903    #[doc = "Open-drain output with filter, pullup and drive-strength set by DRIVEMODE"]
1904    #[inline(always)]
1905    pub fn wiredanddrivepullupfilter(self) -> &'a mut W {
1906        self.variant(MODE7_A::WIREDANDDRIVEPULLUPFILTER)
1907    }
1908}
1909impl R {
1910    #[doc = "Bits 0:3 - Pin 0 Mode"]
1911    #[inline(always)]
1912    pub fn mode0(&self) -> MODE0_R {
1913        MODE0_R::new((self.bits & 0x0f) as u8)
1914    }
1915    #[doc = "Bits 4:7 - Pin 1 Mode"]
1916    #[inline(always)]
1917    pub fn mode1(&self) -> MODE1_R {
1918        MODE1_R::new(((self.bits >> 4) & 0x0f) as u8)
1919    }
1920    #[doc = "Bits 8:11 - Pin 2 Mode"]
1921    #[inline(always)]
1922    pub fn mode2(&self) -> MODE2_R {
1923        MODE2_R::new(((self.bits >> 8) & 0x0f) as u8)
1924    }
1925    #[doc = "Bits 12:15 - Pin 3 Mode"]
1926    #[inline(always)]
1927    pub fn mode3(&self) -> MODE3_R {
1928        MODE3_R::new(((self.bits >> 12) & 0x0f) as u8)
1929    }
1930    #[doc = "Bits 16:19 - Pin 4 Mode"]
1931    #[inline(always)]
1932    pub fn mode4(&self) -> MODE4_R {
1933        MODE4_R::new(((self.bits >> 16) & 0x0f) as u8)
1934    }
1935    #[doc = "Bits 20:23 - Pin 5 Mode"]
1936    #[inline(always)]
1937    pub fn mode5(&self) -> MODE5_R {
1938        MODE5_R::new(((self.bits >> 20) & 0x0f) as u8)
1939    }
1940    #[doc = "Bits 24:27 - Pin 6 Mode"]
1941    #[inline(always)]
1942    pub fn mode6(&self) -> MODE6_R {
1943        MODE6_R::new(((self.bits >> 24) & 0x0f) as u8)
1944    }
1945    #[doc = "Bits 28:31 - Pin 7 Mode"]
1946    #[inline(always)]
1947    pub fn mode7(&self) -> MODE7_R {
1948        MODE7_R::new(((self.bits >> 28) & 0x0f) as u8)
1949    }
1950}
1951impl W {
1952    #[doc = "Bits 0:3 - Pin 0 Mode"]
1953    #[inline(always)]
1954    pub fn mode0(&mut self) -> MODE0_W {
1955        MODE0_W::new(self)
1956    }
1957    #[doc = "Bits 4:7 - Pin 1 Mode"]
1958    #[inline(always)]
1959    pub fn mode1(&mut self) -> MODE1_W {
1960        MODE1_W::new(self)
1961    }
1962    #[doc = "Bits 8:11 - Pin 2 Mode"]
1963    #[inline(always)]
1964    pub fn mode2(&mut self) -> MODE2_W {
1965        MODE2_W::new(self)
1966    }
1967    #[doc = "Bits 12:15 - Pin 3 Mode"]
1968    #[inline(always)]
1969    pub fn mode3(&mut self) -> MODE3_W {
1970        MODE3_W::new(self)
1971    }
1972    #[doc = "Bits 16:19 - Pin 4 Mode"]
1973    #[inline(always)]
1974    pub fn mode4(&mut self) -> MODE4_W {
1975        MODE4_W::new(self)
1976    }
1977    #[doc = "Bits 20:23 - Pin 5 Mode"]
1978    #[inline(always)]
1979    pub fn mode5(&mut self) -> MODE5_W {
1980        MODE5_W::new(self)
1981    }
1982    #[doc = "Bits 24:27 - Pin 6 Mode"]
1983    #[inline(always)]
1984    pub fn mode6(&mut self) -> MODE6_W {
1985        MODE6_W::new(self)
1986    }
1987    #[doc = "Bits 28:31 - Pin 7 Mode"]
1988    #[inline(always)]
1989    pub fn mode7(&mut self) -> MODE7_W {
1990        MODE7_W::new(self)
1991    }
1992    #[doc = "Writes raw bits to the register."]
1993    #[inline(always)]
1994    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1995        self.0.bits(bits);
1996        self
1997    }
1998}
1999#[doc = "Port Pin Mode Low Register\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 [pd_model](index.html) module"]
2000pub struct PD_MODEL_SPEC;
2001impl crate::RegisterSpec for PD_MODEL_SPEC {
2002    type Ux = u32;
2003}
2004#[doc = "`read()` method returns [pd_model::R](R) reader structure"]
2005impl crate::Readable for PD_MODEL_SPEC {
2006    type Reader = R;
2007}
2008#[doc = "`write(|w| ..)` method takes [pd_model::W](W) writer structure"]
2009impl crate::Writable for PD_MODEL_SPEC {
2010    type Writer = W;
2011}
2012#[doc = "`reset()` method sets PD_MODEL to value 0"]
2013impl crate::Resettable for PD_MODEL_SPEC {
2014    #[inline(always)]
2015    fn reset_value() -> Self::Ux {
2016        0
2017    }
2018}