1#[doc = "Register `PORTD_MODEL` reader"]
2pub struct R(crate::R<PORTD_MODEL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PORTD_MODEL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PORTD_MODEL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PORTD_MODEL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `PORTD_MODEL` writer"]
17pub struct W(crate::W<PORTD_MODEL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<PORTD_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<PORTD_MODEL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<PORTD_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, PORTD_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, PORTD_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, PORTD_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, PORTD_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}
977impl R {
978 #[doc = "Bits 0:3 - MODE n"]
979 #[inline(always)]
980 pub fn mode0(&self) -> MODE0_R {
981 MODE0_R::new((self.bits & 0x0f) as u8)
982 }
983 #[doc = "Bits 4:7 - MODE n"]
984 #[inline(always)]
985 pub fn mode1(&self) -> MODE1_R {
986 MODE1_R::new(((self.bits >> 4) & 0x0f) as u8)
987 }
988 #[doc = "Bits 8:11 - MODE n"]
989 #[inline(always)]
990 pub fn mode2(&self) -> MODE2_R {
991 MODE2_R::new(((self.bits >> 8) & 0x0f) as u8)
992 }
993 #[doc = "Bits 12:15 - MODE n"]
994 #[inline(always)]
995 pub fn mode3(&self) -> MODE3_R {
996 MODE3_R::new(((self.bits >> 12) & 0x0f) as u8)
997 }
998}
999impl W {
1000 #[doc = "Bits 0:3 - MODE n"]
1001 #[inline(always)]
1002 #[must_use]
1003 pub fn mode0(&mut self) -> MODE0_W<0> {
1004 MODE0_W::new(self)
1005 }
1006 #[doc = "Bits 4:7 - MODE n"]
1007 #[inline(always)]
1008 #[must_use]
1009 pub fn mode1(&mut self) -> MODE1_W<4> {
1010 MODE1_W::new(self)
1011 }
1012 #[doc = "Bits 8:11 - MODE n"]
1013 #[inline(always)]
1014 #[must_use]
1015 pub fn mode2(&mut self) -> MODE2_W<8> {
1016 MODE2_W::new(self)
1017 }
1018 #[doc = "Bits 12:15 - MODE n"]
1019 #[inline(always)]
1020 #[must_use]
1021 pub fn mode3(&mut self) -> MODE3_W<12> {
1022 MODE3_W::new(self)
1023 }
1024 #[doc = "Writes raw bits to the register."]
1025 #[inline(always)]
1026 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1027 self.0.bits(bits);
1028 self
1029 }
1030}
1031#[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 [portd_model](index.html) module"]
1032pub struct PORTD_MODEL_SPEC;
1033impl crate::RegisterSpec for PORTD_MODEL_SPEC {
1034 type Ux = u32;
1035}
1036#[doc = "`read()` method returns [portd_model::R](R) reader structure"]
1037impl crate::Readable for PORTD_MODEL_SPEC {
1038 type Reader = R;
1039}
1040#[doc = "`write(|w| ..)` method takes [portd_model::W](W) writer structure"]
1041impl crate::Writable for PORTD_MODEL_SPEC {
1042 type Writer = W;
1043 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
1044 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
1045}
1046#[doc = "`reset()` method sets PORTD_MODEL to value 0"]
1047impl crate::Resettable for PORTD_MODEL_SPEC {
1048 const RESET_VALUE: Self::Ux = 0;
1049}