stm32l4x2_pac/gpioa/
odr.rs1#[doc = r" Value read from the register"]
2pub struct R {
3 bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7 bits: u32,
8}
9impl super::ODR {
10 #[doc = r" Modifies the contents of the register"]
11 #[inline]
12 pub fn modify<F>(&self, f: F)
13 where
14 for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15 {
16 let bits = self.register.get();
17 let r = R { bits: bits };
18 let mut w = W { bits: bits };
19 f(&r, &mut w);
20 self.register.set(w.bits);
21 }
22 #[doc = r" Reads the contents of the register"]
23 #[inline]
24 pub fn read(&self) -> R {
25 R {
26 bits: self.register.get(),
27 }
28 }
29 #[doc = r" Writes to the register"]
30 #[inline]
31 pub fn write<F>(&self, f: F)
32 where
33 F: FnOnce(&mut W) -> &mut W,
34 {
35 let mut w = W::reset_value();
36 f(&mut w);
37 self.register.set(w.bits);
38 }
39 #[doc = r" Writes the reset value to the register"]
40 #[inline]
41 pub fn reset(&self) {
42 self.write(|w| w)
43 }
44}
45#[doc = "Possible values of the field `ODR15`"]
46#[derive(Clone, Copy, Debug, PartialEq)]
47pub enum ODR15R {
48 #[doc = "Set output to logic high"]
49 HIGH,
50 #[doc = "Set output to logic low"]
51 LOW,
52}
53impl ODR15R {
54 #[doc = r" Returns `true` if the bit is clear (0)"]
55 #[inline]
56 pub fn bit_is_clear(&self) -> bool {
57 !self.bit()
58 }
59 #[doc = r" Returns `true` if the bit is set (1)"]
60 #[inline]
61 pub fn bit_is_set(&self) -> bool {
62 self.bit()
63 }
64 #[doc = r" Value of the field as raw bits"]
65 #[inline]
66 pub fn bit(&self) -> bool {
67 match *self {
68 ODR15R::HIGH => true,
69 ODR15R::LOW => false,
70 }
71 }
72 #[allow(missing_docs)]
73 #[doc(hidden)]
74 #[inline]
75 pub fn _from(value: bool) -> ODR15R {
76 match value {
77 true => ODR15R::HIGH,
78 false => ODR15R::LOW,
79 }
80 }
81 #[doc = "Checks if the value of the field is `HIGH`"]
82 #[inline]
83 pub fn is_high(&self) -> bool {
84 *self == ODR15R::HIGH
85 }
86 #[doc = "Checks if the value of the field is `LOW`"]
87 #[inline]
88 pub fn is_low(&self) -> bool {
89 *self == ODR15R::LOW
90 }
91}
92#[doc = "Possible values of the field `ODR14`"]
93pub type ODR14R = ODR15R;
94#[doc = "Possible values of the field `ODR13`"]
95pub type ODR13R = ODR15R;
96#[doc = "Possible values of the field `ODR12`"]
97pub type ODR12R = ODR15R;
98#[doc = "Possible values of the field `ODR11`"]
99pub type ODR11R = ODR15R;
100#[doc = "Possible values of the field `ODR10`"]
101pub type ODR10R = ODR15R;
102#[doc = "Possible values of the field `ODR9`"]
103pub type ODR9R = ODR15R;
104#[doc = "Possible values of the field `ODR8`"]
105pub type ODR8R = ODR15R;
106#[doc = "Possible values of the field `ODR7`"]
107pub type ODR7R = ODR15R;
108#[doc = "Possible values of the field `ODR6`"]
109pub type ODR6R = ODR15R;
110#[doc = "Possible values of the field `ODR5`"]
111pub type ODR5R = ODR15R;
112#[doc = "Possible values of the field `ODR4`"]
113pub type ODR4R = ODR15R;
114#[doc = "Possible values of the field `ODR3`"]
115pub type ODR3R = ODR15R;
116#[doc = "Possible values of the field `ODR2`"]
117pub type ODR2R = ODR15R;
118#[doc = "Possible values of the field `ODR1`"]
119pub type ODR1R = ODR15R;
120#[doc = "Possible values of the field `ODR0`"]
121pub type ODR0R = ODR15R;
122#[doc = "Values that can be written to the field `ODR15`"]
123pub enum ODR15W {
124 #[doc = "Set output to logic high"]
125 HIGH,
126 #[doc = "Set output to logic low"]
127 LOW,
128}
129impl ODR15W {
130 #[allow(missing_docs)]
131 #[doc(hidden)]
132 #[inline]
133 pub fn _bits(&self) -> bool {
134 match *self {
135 ODR15W::HIGH => true,
136 ODR15W::LOW => false,
137 }
138 }
139}
140#[doc = r" Proxy"]
141pub struct _ODR15W<'a> {
142 w: &'a mut W,
143}
144impl<'a> _ODR15W<'a> {
145 #[doc = r" Writes `variant` to the field"]
146 #[inline]
147 pub fn variant(self, variant: ODR15W) -> &'a mut W {
148 {
149 self.bit(variant._bits())
150 }
151 }
152 #[doc = "Set output to logic high"]
153 #[inline]
154 pub fn high(self) -> &'a mut W {
155 self.variant(ODR15W::HIGH)
156 }
157 #[doc = "Set output to logic low"]
158 #[inline]
159 pub fn low(self) -> &'a mut W {
160 self.variant(ODR15W::LOW)
161 }
162 #[doc = r" Sets the field bit"]
163 pub fn set_bit(self) -> &'a mut W {
164 self.bit(true)
165 }
166 #[doc = r" Clears the field bit"]
167 pub fn clear_bit(self) -> &'a mut W {
168 self.bit(false)
169 }
170 #[doc = r" Writes raw bits to the field"]
171 #[inline]
172 pub fn bit(self, value: bool) -> &'a mut W {
173 const MASK: bool = true;
174 const OFFSET: u8 = 15;
175 self.w.bits &= !((MASK as u32) << OFFSET);
176 self.w.bits |= ((value & MASK) as u32) << OFFSET;
177 self.w
178 }
179}
180#[doc = "Values that can be written to the field `ODR14`"]
181pub type ODR14W = ODR15W;
182#[doc = r" Proxy"]
183pub struct _ODR14W<'a> {
184 w: &'a mut W,
185}
186impl<'a> _ODR14W<'a> {
187 #[doc = r" Writes `variant` to the field"]
188 #[inline]
189 pub fn variant(self, variant: ODR14W) -> &'a mut W {
190 {
191 self.bit(variant._bits())
192 }
193 }
194 #[doc = "Set output to logic high"]
195 #[inline]
196 pub fn high(self) -> &'a mut W {
197 self.variant(ODR15W::HIGH)
198 }
199 #[doc = "Set output to logic low"]
200 #[inline]
201 pub fn low(self) -> &'a mut W {
202 self.variant(ODR15W::LOW)
203 }
204 #[doc = r" Sets the field bit"]
205 pub fn set_bit(self) -> &'a mut W {
206 self.bit(true)
207 }
208 #[doc = r" Clears the field bit"]
209 pub fn clear_bit(self) -> &'a mut W {
210 self.bit(false)
211 }
212 #[doc = r" Writes raw bits to the field"]
213 #[inline]
214 pub fn bit(self, value: bool) -> &'a mut W {
215 const MASK: bool = true;
216 const OFFSET: u8 = 14;
217 self.w.bits &= !((MASK as u32) << OFFSET);
218 self.w.bits |= ((value & MASK) as u32) << OFFSET;
219 self.w
220 }
221}
222#[doc = "Values that can be written to the field `ODR13`"]
223pub type ODR13W = ODR15W;
224#[doc = r" Proxy"]
225pub struct _ODR13W<'a> {
226 w: &'a mut W,
227}
228impl<'a> _ODR13W<'a> {
229 #[doc = r" Writes `variant` to the field"]
230 #[inline]
231 pub fn variant(self, variant: ODR13W) -> &'a mut W {
232 {
233 self.bit(variant._bits())
234 }
235 }
236 #[doc = "Set output to logic high"]
237 #[inline]
238 pub fn high(self) -> &'a mut W {
239 self.variant(ODR15W::HIGH)
240 }
241 #[doc = "Set output to logic low"]
242 #[inline]
243 pub fn low(self) -> &'a mut W {
244 self.variant(ODR15W::LOW)
245 }
246 #[doc = r" Sets the field bit"]
247 pub fn set_bit(self) -> &'a mut W {
248 self.bit(true)
249 }
250 #[doc = r" Clears the field bit"]
251 pub fn clear_bit(self) -> &'a mut W {
252 self.bit(false)
253 }
254 #[doc = r" Writes raw bits to the field"]
255 #[inline]
256 pub fn bit(self, value: bool) -> &'a mut W {
257 const MASK: bool = true;
258 const OFFSET: u8 = 13;
259 self.w.bits &= !((MASK as u32) << OFFSET);
260 self.w.bits |= ((value & MASK) as u32) << OFFSET;
261 self.w
262 }
263}
264#[doc = "Values that can be written to the field `ODR12`"]
265pub type ODR12W = ODR15W;
266#[doc = r" Proxy"]
267pub struct _ODR12W<'a> {
268 w: &'a mut W,
269}
270impl<'a> _ODR12W<'a> {
271 #[doc = r" Writes `variant` to the field"]
272 #[inline]
273 pub fn variant(self, variant: ODR12W) -> &'a mut W {
274 {
275 self.bit(variant._bits())
276 }
277 }
278 #[doc = "Set output to logic high"]
279 #[inline]
280 pub fn high(self) -> &'a mut W {
281 self.variant(ODR15W::HIGH)
282 }
283 #[doc = "Set output to logic low"]
284 #[inline]
285 pub fn low(self) -> &'a mut W {
286 self.variant(ODR15W::LOW)
287 }
288 #[doc = r" Sets the field bit"]
289 pub fn set_bit(self) -> &'a mut W {
290 self.bit(true)
291 }
292 #[doc = r" Clears the field bit"]
293 pub fn clear_bit(self) -> &'a mut W {
294 self.bit(false)
295 }
296 #[doc = r" Writes raw bits to the field"]
297 #[inline]
298 pub fn bit(self, value: bool) -> &'a mut W {
299 const MASK: bool = true;
300 const OFFSET: u8 = 12;
301 self.w.bits &= !((MASK as u32) << OFFSET);
302 self.w.bits |= ((value & MASK) as u32) << OFFSET;
303 self.w
304 }
305}
306#[doc = "Values that can be written to the field `ODR11`"]
307pub type ODR11W = ODR15W;
308#[doc = r" Proxy"]
309pub struct _ODR11W<'a> {
310 w: &'a mut W,
311}
312impl<'a> _ODR11W<'a> {
313 #[doc = r" Writes `variant` to the field"]
314 #[inline]
315 pub fn variant(self, variant: ODR11W) -> &'a mut W {
316 {
317 self.bit(variant._bits())
318 }
319 }
320 #[doc = "Set output to logic high"]
321 #[inline]
322 pub fn high(self) -> &'a mut W {
323 self.variant(ODR15W::HIGH)
324 }
325 #[doc = "Set output to logic low"]
326 #[inline]
327 pub fn low(self) -> &'a mut W {
328 self.variant(ODR15W::LOW)
329 }
330 #[doc = r" Sets the field bit"]
331 pub fn set_bit(self) -> &'a mut W {
332 self.bit(true)
333 }
334 #[doc = r" Clears the field bit"]
335 pub fn clear_bit(self) -> &'a mut W {
336 self.bit(false)
337 }
338 #[doc = r" Writes raw bits to the field"]
339 #[inline]
340 pub fn bit(self, value: bool) -> &'a mut W {
341 const MASK: bool = true;
342 const OFFSET: u8 = 11;
343 self.w.bits &= !((MASK as u32) << OFFSET);
344 self.w.bits |= ((value & MASK) as u32) << OFFSET;
345 self.w
346 }
347}
348#[doc = "Values that can be written to the field `ODR10`"]
349pub type ODR10W = ODR15W;
350#[doc = r" Proxy"]
351pub struct _ODR10W<'a> {
352 w: &'a mut W,
353}
354impl<'a> _ODR10W<'a> {
355 #[doc = r" Writes `variant` to the field"]
356 #[inline]
357 pub fn variant(self, variant: ODR10W) -> &'a mut W {
358 {
359 self.bit(variant._bits())
360 }
361 }
362 #[doc = "Set output to logic high"]
363 #[inline]
364 pub fn high(self) -> &'a mut W {
365 self.variant(ODR15W::HIGH)
366 }
367 #[doc = "Set output to logic low"]
368 #[inline]
369 pub fn low(self) -> &'a mut W {
370 self.variant(ODR15W::LOW)
371 }
372 #[doc = r" Sets the field bit"]
373 pub fn set_bit(self) -> &'a mut W {
374 self.bit(true)
375 }
376 #[doc = r" Clears the field bit"]
377 pub fn clear_bit(self) -> &'a mut W {
378 self.bit(false)
379 }
380 #[doc = r" Writes raw bits to the field"]
381 #[inline]
382 pub fn bit(self, value: bool) -> &'a mut W {
383 const MASK: bool = true;
384 const OFFSET: u8 = 10;
385 self.w.bits &= !((MASK as u32) << OFFSET);
386 self.w.bits |= ((value & MASK) as u32) << OFFSET;
387 self.w
388 }
389}
390#[doc = "Values that can be written to the field `ODR9`"]
391pub type ODR9W = ODR15W;
392#[doc = r" Proxy"]
393pub struct _ODR9W<'a> {
394 w: &'a mut W,
395}
396impl<'a> _ODR9W<'a> {
397 #[doc = r" Writes `variant` to the field"]
398 #[inline]
399 pub fn variant(self, variant: ODR9W) -> &'a mut W {
400 {
401 self.bit(variant._bits())
402 }
403 }
404 #[doc = "Set output to logic high"]
405 #[inline]
406 pub fn high(self) -> &'a mut W {
407 self.variant(ODR15W::HIGH)
408 }
409 #[doc = "Set output to logic low"]
410 #[inline]
411 pub fn low(self) -> &'a mut W {
412 self.variant(ODR15W::LOW)
413 }
414 #[doc = r" Sets the field bit"]
415 pub fn set_bit(self) -> &'a mut W {
416 self.bit(true)
417 }
418 #[doc = r" Clears the field bit"]
419 pub fn clear_bit(self) -> &'a mut W {
420 self.bit(false)
421 }
422 #[doc = r" Writes raw bits to the field"]
423 #[inline]
424 pub fn bit(self, value: bool) -> &'a mut W {
425 const MASK: bool = true;
426 const OFFSET: u8 = 9;
427 self.w.bits &= !((MASK as u32) << OFFSET);
428 self.w.bits |= ((value & MASK) as u32) << OFFSET;
429 self.w
430 }
431}
432#[doc = "Values that can be written to the field `ODR8`"]
433pub type ODR8W = ODR15W;
434#[doc = r" Proxy"]
435pub struct _ODR8W<'a> {
436 w: &'a mut W,
437}
438impl<'a> _ODR8W<'a> {
439 #[doc = r" Writes `variant` to the field"]
440 #[inline]
441 pub fn variant(self, variant: ODR8W) -> &'a mut W {
442 {
443 self.bit(variant._bits())
444 }
445 }
446 #[doc = "Set output to logic high"]
447 #[inline]
448 pub fn high(self) -> &'a mut W {
449 self.variant(ODR15W::HIGH)
450 }
451 #[doc = "Set output to logic low"]
452 #[inline]
453 pub fn low(self) -> &'a mut W {
454 self.variant(ODR15W::LOW)
455 }
456 #[doc = r" Sets the field bit"]
457 pub fn set_bit(self) -> &'a mut W {
458 self.bit(true)
459 }
460 #[doc = r" Clears the field bit"]
461 pub fn clear_bit(self) -> &'a mut W {
462 self.bit(false)
463 }
464 #[doc = r" Writes raw bits to the field"]
465 #[inline]
466 pub fn bit(self, value: bool) -> &'a mut W {
467 const MASK: bool = true;
468 const OFFSET: u8 = 8;
469 self.w.bits &= !((MASK as u32) << OFFSET);
470 self.w.bits |= ((value & MASK) as u32) << OFFSET;
471 self.w
472 }
473}
474#[doc = "Values that can be written to the field `ODR7`"]
475pub type ODR7W = ODR15W;
476#[doc = r" Proxy"]
477pub struct _ODR7W<'a> {
478 w: &'a mut W,
479}
480impl<'a> _ODR7W<'a> {
481 #[doc = r" Writes `variant` to the field"]
482 #[inline]
483 pub fn variant(self, variant: ODR7W) -> &'a mut W {
484 {
485 self.bit(variant._bits())
486 }
487 }
488 #[doc = "Set output to logic high"]
489 #[inline]
490 pub fn high(self) -> &'a mut W {
491 self.variant(ODR15W::HIGH)
492 }
493 #[doc = "Set output to logic low"]
494 #[inline]
495 pub fn low(self) -> &'a mut W {
496 self.variant(ODR15W::LOW)
497 }
498 #[doc = r" Sets the field bit"]
499 pub fn set_bit(self) -> &'a mut W {
500 self.bit(true)
501 }
502 #[doc = r" Clears the field bit"]
503 pub fn clear_bit(self) -> &'a mut W {
504 self.bit(false)
505 }
506 #[doc = r" Writes raw bits to the field"]
507 #[inline]
508 pub fn bit(self, value: bool) -> &'a mut W {
509 const MASK: bool = true;
510 const OFFSET: u8 = 7;
511 self.w.bits &= !((MASK as u32) << OFFSET);
512 self.w.bits |= ((value & MASK) as u32) << OFFSET;
513 self.w
514 }
515}
516#[doc = "Values that can be written to the field `ODR6`"]
517pub type ODR6W = ODR15W;
518#[doc = r" Proxy"]
519pub struct _ODR6W<'a> {
520 w: &'a mut W,
521}
522impl<'a> _ODR6W<'a> {
523 #[doc = r" Writes `variant` to the field"]
524 #[inline]
525 pub fn variant(self, variant: ODR6W) -> &'a mut W {
526 {
527 self.bit(variant._bits())
528 }
529 }
530 #[doc = "Set output to logic high"]
531 #[inline]
532 pub fn high(self) -> &'a mut W {
533 self.variant(ODR15W::HIGH)
534 }
535 #[doc = "Set output to logic low"]
536 #[inline]
537 pub fn low(self) -> &'a mut W {
538 self.variant(ODR15W::LOW)
539 }
540 #[doc = r" Sets the field bit"]
541 pub fn set_bit(self) -> &'a mut W {
542 self.bit(true)
543 }
544 #[doc = r" Clears the field bit"]
545 pub fn clear_bit(self) -> &'a mut W {
546 self.bit(false)
547 }
548 #[doc = r" Writes raw bits to the field"]
549 #[inline]
550 pub fn bit(self, value: bool) -> &'a mut W {
551 const MASK: bool = true;
552 const OFFSET: u8 = 6;
553 self.w.bits &= !((MASK as u32) << OFFSET);
554 self.w.bits |= ((value & MASK) as u32) << OFFSET;
555 self.w
556 }
557}
558#[doc = "Values that can be written to the field `ODR5`"]
559pub type ODR5W = ODR15W;
560#[doc = r" Proxy"]
561pub struct _ODR5W<'a> {
562 w: &'a mut W,
563}
564impl<'a> _ODR5W<'a> {
565 #[doc = r" Writes `variant` to the field"]
566 #[inline]
567 pub fn variant(self, variant: ODR5W) -> &'a mut W {
568 {
569 self.bit(variant._bits())
570 }
571 }
572 #[doc = "Set output to logic high"]
573 #[inline]
574 pub fn high(self) -> &'a mut W {
575 self.variant(ODR15W::HIGH)
576 }
577 #[doc = "Set output to logic low"]
578 #[inline]
579 pub fn low(self) -> &'a mut W {
580 self.variant(ODR15W::LOW)
581 }
582 #[doc = r" Sets the field bit"]
583 pub fn set_bit(self) -> &'a mut W {
584 self.bit(true)
585 }
586 #[doc = r" Clears the field bit"]
587 pub fn clear_bit(self) -> &'a mut W {
588 self.bit(false)
589 }
590 #[doc = r" Writes raw bits to the field"]
591 #[inline]
592 pub fn bit(self, value: bool) -> &'a mut W {
593 const MASK: bool = true;
594 const OFFSET: u8 = 5;
595 self.w.bits &= !((MASK as u32) << OFFSET);
596 self.w.bits |= ((value & MASK) as u32) << OFFSET;
597 self.w
598 }
599}
600#[doc = "Values that can be written to the field `ODR4`"]
601pub type ODR4W = ODR15W;
602#[doc = r" Proxy"]
603pub struct _ODR4W<'a> {
604 w: &'a mut W,
605}
606impl<'a> _ODR4W<'a> {
607 #[doc = r" Writes `variant` to the field"]
608 #[inline]
609 pub fn variant(self, variant: ODR4W) -> &'a mut W {
610 {
611 self.bit(variant._bits())
612 }
613 }
614 #[doc = "Set output to logic high"]
615 #[inline]
616 pub fn high(self) -> &'a mut W {
617 self.variant(ODR15W::HIGH)
618 }
619 #[doc = "Set output to logic low"]
620 #[inline]
621 pub fn low(self) -> &'a mut W {
622 self.variant(ODR15W::LOW)
623 }
624 #[doc = r" Sets the field bit"]
625 pub fn set_bit(self) -> &'a mut W {
626 self.bit(true)
627 }
628 #[doc = r" Clears the field bit"]
629 pub fn clear_bit(self) -> &'a mut W {
630 self.bit(false)
631 }
632 #[doc = r" Writes raw bits to the field"]
633 #[inline]
634 pub fn bit(self, value: bool) -> &'a mut W {
635 const MASK: bool = true;
636 const OFFSET: u8 = 4;
637 self.w.bits &= !((MASK as u32) << OFFSET);
638 self.w.bits |= ((value & MASK) as u32) << OFFSET;
639 self.w
640 }
641}
642#[doc = "Values that can be written to the field `ODR3`"]
643pub type ODR3W = ODR15W;
644#[doc = r" Proxy"]
645pub struct _ODR3W<'a> {
646 w: &'a mut W,
647}
648impl<'a> _ODR3W<'a> {
649 #[doc = r" Writes `variant` to the field"]
650 #[inline]
651 pub fn variant(self, variant: ODR3W) -> &'a mut W {
652 {
653 self.bit(variant._bits())
654 }
655 }
656 #[doc = "Set output to logic high"]
657 #[inline]
658 pub fn high(self) -> &'a mut W {
659 self.variant(ODR15W::HIGH)
660 }
661 #[doc = "Set output to logic low"]
662 #[inline]
663 pub fn low(self) -> &'a mut W {
664 self.variant(ODR15W::LOW)
665 }
666 #[doc = r" Sets the field bit"]
667 pub fn set_bit(self) -> &'a mut W {
668 self.bit(true)
669 }
670 #[doc = r" Clears the field bit"]
671 pub fn clear_bit(self) -> &'a mut W {
672 self.bit(false)
673 }
674 #[doc = r" Writes raw bits to the field"]
675 #[inline]
676 pub fn bit(self, value: bool) -> &'a mut W {
677 const MASK: bool = true;
678 const OFFSET: u8 = 3;
679 self.w.bits &= !((MASK as u32) << OFFSET);
680 self.w.bits |= ((value & MASK) as u32) << OFFSET;
681 self.w
682 }
683}
684#[doc = "Values that can be written to the field `ODR2`"]
685pub type ODR2W = ODR15W;
686#[doc = r" Proxy"]
687pub struct _ODR2W<'a> {
688 w: &'a mut W,
689}
690impl<'a> _ODR2W<'a> {
691 #[doc = r" Writes `variant` to the field"]
692 #[inline]
693 pub fn variant(self, variant: ODR2W) -> &'a mut W {
694 {
695 self.bit(variant._bits())
696 }
697 }
698 #[doc = "Set output to logic high"]
699 #[inline]
700 pub fn high(self) -> &'a mut W {
701 self.variant(ODR15W::HIGH)
702 }
703 #[doc = "Set output to logic low"]
704 #[inline]
705 pub fn low(self) -> &'a mut W {
706 self.variant(ODR15W::LOW)
707 }
708 #[doc = r" Sets the field bit"]
709 pub fn set_bit(self) -> &'a mut W {
710 self.bit(true)
711 }
712 #[doc = r" Clears the field bit"]
713 pub fn clear_bit(self) -> &'a mut W {
714 self.bit(false)
715 }
716 #[doc = r" Writes raw bits to the field"]
717 #[inline]
718 pub fn bit(self, value: bool) -> &'a mut W {
719 const MASK: bool = true;
720 const OFFSET: u8 = 2;
721 self.w.bits &= !((MASK as u32) << OFFSET);
722 self.w.bits |= ((value & MASK) as u32) << OFFSET;
723 self.w
724 }
725}
726#[doc = "Values that can be written to the field `ODR1`"]
727pub type ODR1W = ODR15W;
728#[doc = r" Proxy"]
729pub struct _ODR1W<'a> {
730 w: &'a mut W,
731}
732impl<'a> _ODR1W<'a> {
733 #[doc = r" Writes `variant` to the field"]
734 #[inline]
735 pub fn variant(self, variant: ODR1W) -> &'a mut W {
736 {
737 self.bit(variant._bits())
738 }
739 }
740 #[doc = "Set output to logic high"]
741 #[inline]
742 pub fn high(self) -> &'a mut W {
743 self.variant(ODR15W::HIGH)
744 }
745 #[doc = "Set output to logic low"]
746 #[inline]
747 pub fn low(self) -> &'a mut W {
748 self.variant(ODR15W::LOW)
749 }
750 #[doc = r" Sets the field bit"]
751 pub fn set_bit(self) -> &'a mut W {
752 self.bit(true)
753 }
754 #[doc = r" Clears the field bit"]
755 pub fn clear_bit(self) -> &'a mut W {
756 self.bit(false)
757 }
758 #[doc = r" Writes raw bits to the field"]
759 #[inline]
760 pub fn bit(self, value: bool) -> &'a mut W {
761 const MASK: bool = true;
762 const OFFSET: u8 = 1;
763 self.w.bits &= !((MASK as u32) << OFFSET);
764 self.w.bits |= ((value & MASK) as u32) << OFFSET;
765 self.w
766 }
767}
768#[doc = "Values that can be written to the field `ODR0`"]
769pub type ODR0W = ODR15W;
770#[doc = r" Proxy"]
771pub struct _ODR0W<'a> {
772 w: &'a mut W,
773}
774impl<'a> _ODR0W<'a> {
775 #[doc = r" Writes `variant` to the field"]
776 #[inline]
777 pub fn variant(self, variant: ODR0W) -> &'a mut W {
778 {
779 self.bit(variant._bits())
780 }
781 }
782 #[doc = "Set output to logic high"]
783 #[inline]
784 pub fn high(self) -> &'a mut W {
785 self.variant(ODR15W::HIGH)
786 }
787 #[doc = "Set output to logic low"]
788 #[inline]
789 pub fn low(self) -> &'a mut W {
790 self.variant(ODR15W::LOW)
791 }
792 #[doc = r" Sets the field bit"]
793 pub fn set_bit(self) -> &'a mut W {
794 self.bit(true)
795 }
796 #[doc = r" Clears the field bit"]
797 pub fn clear_bit(self) -> &'a mut W {
798 self.bit(false)
799 }
800 #[doc = r" Writes raw bits to the field"]
801 #[inline]
802 pub fn bit(self, value: bool) -> &'a mut W {
803 const MASK: bool = true;
804 const OFFSET: u8 = 0;
805 self.w.bits &= !((MASK as u32) << OFFSET);
806 self.w.bits |= ((value & MASK) as u32) << OFFSET;
807 self.w
808 }
809}
810impl R {
811 #[doc = r" Value of the register as raw bits"]
812 #[inline]
813 pub fn bits(&self) -> u32 {
814 self.bits
815 }
816 #[doc = "Bit 15 - Port output data (y = 0..15)"]
817 #[inline]
818 pub fn odr15(&self) -> ODR15R {
819 ODR15R::_from({
820 const MASK: bool = true;
821 const OFFSET: u8 = 15;
822 ((self.bits >> OFFSET) & MASK as u32) != 0
823 })
824 }
825 #[doc = "Bit 14 - Port output data (y = 0..15)"]
826 #[inline]
827 pub fn odr14(&self) -> ODR14R {
828 ODR14R::_from({
829 const MASK: bool = true;
830 const OFFSET: u8 = 14;
831 ((self.bits >> OFFSET) & MASK as u32) != 0
832 })
833 }
834 #[doc = "Bit 13 - Port output data (y = 0..15)"]
835 #[inline]
836 pub fn odr13(&self) -> ODR13R {
837 ODR13R::_from({
838 const MASK: bool = true;
839 const OFFSET: u8 = 13;
840 ((self.bits >> OFFSET) & MASK as u32) != 0
841 })
842 }
843 #[doc = "Bit 12 - Port output data (y = 0..15)"]
844 #[inline]
845 pub fn odr12(&self) -> ODR12R {
846 ODR12R::_from({
847 const MASK: bool = true;
848 const OFFSET: u8 = 12;
849 ((self.bits >> OFFSET) & MASK as u32) != 0
850 })
851 }
852 #[doc = "Bit 11 - Port output data (y = 0..15)"]
853 #[inline]
854 pub fn odr11(&self) -> ODR11R {
855 ODR11R::_from({
856 const MASK: bool = true;
857 const OFFSET: u8 = 11;
858 ((self.bits >> OFFSET) & MASK as u32) != 0
859 })
860 }
861 #[doc = "Bit 10 - Port output data (y = 0..15)"]
862 #[inline]
863 pub fn odr10(&self) -> ODR10R {
864 ODR10R::_from({
865 const MASK: bool = true;
866 const OFFSET: u8 = 10;
867 ((self.bits >> OFFSET) & MASK as u32) != 0
868 })
869 }
870 #[doc = "Bit 9 - Port output data (y = 0..15)"]
871 #[inline]
872 pub fn odr9(&self) -> ODR9R {
873 ODR9R::_from({
874 const MASK: bool = true;
875 const OFFSET: u8 = 9;
876 ((self.bits >> OFFSET) & MASK as u32) != 0
877 })
878 }
879 #[doc = "Bit 8 - Port output data (y = 0..15)"]
880 #[inline]
881 pub fn odr8(&self) -> ODR8R {
882 ODR8R::_from({
883 const MASK: bool = true;
884 const OFFSET: u8 = 8;
885 ((self.bits >> OFFSET) & MASK as u32) != 0
886 })
887 }
888 #[doc = "Bit 7 - Port output data (y = 0..15)"]
889 #[inline]
890 pub fn odr7(&self) -> ODR7R {
891 ODR7R::_from({
892 const MASK: bool = true;
893 const OFFSET: u8 = 7;
894 ((self.bits >> OFFSET) & MASK as u32) != 0
895 })
896 }
897 #[doc = "Bit 6 - Port output data (y = 0..15)"]
898 #[inline]
899 pub fn odr6(&self) -> ODR6R {
900 ODR6R::_from({
901 const MASK: bool = true;
902 const OFFSET: u8 = 6;
903 ((self.bits >> OFFSET) & MASK as u32) != 0
904 })
905 }
906 #[doc = "Bit 5 - Port output data (y = 0..15)"]
907 #[inline]
908 pub fn odr5(&self) -> ODR5R {
909 ODR5R::_from({
910 const MASK: bool = true;
911 const OFFSET: u8 = 5;
912 ((self.bits >> OFFSET) & MASK as u32) != 0
913 })
914 }
915 #[doc = "Bit 4 - Port output data (y = 0..15)"]
916 #[inline]
917 pub fn odr4(&self) -> ODR4R {
918 ODR4R::_from({
919 const MASK: bool = true;
920 const OFFSET: u8 = 4;
921 ((self.bits >> OFFSET) & MASK as u32) != 0
922 })
923 }
924 #[doc = "Bit 3 - Port output data (y = 0..15)"]
925 #[inline]
926 pub fn odr3(&self) -> ODR3R {
927 ODR3R::_from({
928 const MASK: bool = true;
929 const OFFSET: u8 = 3;
930 ((self.bits >> OFFSET) & MASK as u32) != 0
931 })
932 }
933 #[doc = "Bit 2 - Port output data (y = 0..15)"]
934 #[inline]
935 pub fn odr2(&self) -> ODR2R {
936 ODR2R::_from({
937 const MASK: bool = true;
938 const OFFSET: u8 = 2;
939 ((self.bits >> OFFSET) & MASK as u32) != 0
940 })
941 }
942 #[doc = "Bit 1 - Port output data (y = 0..15)"]
943 #[inline]
944 pub fn odr1(&self) -> ODR1R {
945 ODR1R::_from({
946 const MASK: bool = true;
947 const OFFSET: u8 = 1;
948 ((self.bits >> OFFSET) & MASK as u32) != 0
949 })
950 }
951 #[doc = "Bit 0 - Port output data (y = 0..15)"]
952 #[inline]
953 pub fn odr0(&self) -> ODR0R {
954 ODR0R::_from({
955 const MASK: bool = true;
956 const OFFSET: u8 = 0;
957 ((self.bits >> OFFSET) & MASK as u32) != 0
958 })
959 }
960}
961impl W {
962 #[doc = r" Reset value of the register"]
963 #[inline]
964 pub fn reset_value() -> W {
965 W { bits: 0 }
966 }
967 #[doc = r" Writes raw bits to the register"]
968 #[inline]
969 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
970 self.bits = bits;
971 self
972 }
973 #[doc = "Bit 15 - Port output data (y = 0..15)"]
974 #[inline]
975 pub fn odr15(&mut self) -> _ODR15W {
976 _ODR15W { w: self }
977 }
978 #[doc = "Bit 14 - Port output data (y = 0..15)"]
979 #[inline]
980 pub fn odr14(&mut self) -> _ODR14W {
981 _ODR14W { w: self }
982 }
983 #[doc = "Bit 13 - Port output data (y = 0..15)"]
984 #[inline]
985 pub fn odr13(&mut self) -> _ODR13W {
986 _ODR13W { w: self }
987 }
988 #[doc = "Bit 12 - Port output data (y = 0..15)"]
989 #[inline]
990 pub fn odr12(&mut self) -> _ODR12W {
991 _ODR12W { w: self }
992 }
993 #[doc = "Bit 11 - Port output data (y = 0..15)"]
994 #[inline]
995 pub fn odr11(&mut self) -> _ODR11W {
996 _ODR11W { w: self }
997 }
998 #[doc = "Bit 10 - Port output data (y = 0..15)"]
999 #[inline]
1000 pub fn odr10(&mut self) -> _ODR10W {
1001 _ODR10W { w: self }
1002 }
1003 #[doc = "Bit 9 - Port output data (y = 0..15)"]
1004 #[inline]
1005 pub fn odr9(&mut self) -> _ODR9W {
1006 _ODR9W { w: self }
1007 }
1008 #[doc = "Bit 8 - Port output data (y = 0..15)"]
1009 #[inline]
1010 pub fn odr8(&mut self) -> _ODR8W {
1011 _ODR8W { w: self }
1012 }
1013 #[doc = "Bit 7 - Port output data (y = 0..15)"]
1014 #[inline]
1015 pub fn odr7(&mut self) -> _ODR7W {
1016 _ODR7W { w: self }
1017 }
1018 #[doc = "Bit 6 - Port output data (y = 0..15)"]
1019 #[inline]
1020 pub fn odr6(&mut self) -> _ODR6W {
1021 _ODR6W { w: self }
1022 }
1023 #[doc = "Bit 5 - Port output data (y = 0..15)"]
1024 #[inline]
1025 pub fn odr5(&mut self) -> _ODR5W {
1026 _ODR5W { w: self }
1027 }
1028 #[doc = "Bit 4 - Port output data (y = 0..15)"]
1029 #[inline]
1030 pub fn odr4(&mut self) -> _ODR4W {
1031 _ODR4W { w: self }
1032 }
1033 #[doc = "Bit 3 - Port output data (y = 0..15)"]
1034 #[inline]
1035 pub fn odr3(&mut self) -> _ODR3W {
1036 _ODR3W { w: self }
1037 }
1038 #[doc = "Bit 2 - Port output data (y = 0..15)"]
1039 #[inline]
1040 pub fn odr2(&mut self) -> _ODR2W {
1041 _ODR2W { w: self }
1042 }
1043 #[doc = "Bit 1 - Port output data (y = 0..15)"]
1044 #[inline]
1045 pub fn odr1(&mut self) -> _ODR1W {
1046 _ODR1W { w: self }
1047 }
1048 #[doc = "Bit 0 - Port output data (y = 0..15)"]
1049 #[inline]
1050 pub fn odr0(&mut self) -> _ODR0W {
1051 _ODR0W { w: self }
1052 }
1053}