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