stm32l4x2_pac/gpiob/
otyper.rs

1#[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::OTYPER {
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 `OT15`"]
46#[derive(Clone, Copy, Debug, PartialEq)]
47pub enum OT15R {
48    #[doc = "Output push-pull (reset state)"]
49    PUSHPULL,
50    #[doc = "Output open-drain"]
51    OPENDRAIN,
52}
53impl OT15R {
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            OT15R::PUSHPULL => false,
69            OT15R::OPENDRAIN => true,
70        }
71    }
72    #[allow(missing_docs)]
73    #[doc(hidden)]
74    #[inline]
75    pub fn _from(value: bool) -> OT15R {
76        match value {
77            false => OT15R::PUSHPULL,
78            true => OT15R::OPENDRAIN,
79        }
80    }
81    #[doc = "Checks if the value of the field is `PUSHPULL`"]
82    #[inline]
83    pub fn is_push_pull(&self) -> bool {
84        *self == OT15R::PUSHPULL
85    }
86    #[doc = "Checks if the value of the field is `OPENDRAIN`"]
87    #[inline]
88    pub fn is_open_drain(&self) -> bool {
89        *self == OT15R::OPENDRAIN
90    }
91}
92#[doc = "Possible values of the field `OT14`"]
93pub type OT14R = OT15R;
94#[doc = "Possible values of the field `OT13`"]
95pub type OT13R = OT15R;
96#[doc = "Possible values of the field `OT12`"]
97pub type OT12R = OT15R;
98#[doc = "Possible values of the field `OT11`"]
99pub type OT11R = OT15R;
100#[doc = "Possible values of the field `OT10`"]
101pub type OT10R = OT15R;
102#[doc = "Possible values of the field `OT9`"]
103pub type OT9R = OT15R;
104#[doc = "Possible values of the field `OT8`"]
105pub type OT8R = OT15R;
106#[doc = "Possible values of the field `OT7`"]
107pub type OT7R = OT15R;
108#[doc = "Possible values of the field `OT6`"]
109pub type OT6R = OT15R;
110#[doc = "Possible values of the field `OT5`"]
111pub type OT5R = OT15R;
112#[doc = "Possible values of the field `OT4`"]
113pub type OT4R = OT15R;
114#[doc = "Possible values of the field `OT3`"]
115pub type OT3R = OT15R;
116#[doc = "Possible values of the field `OT2`"]
117pub type OT2R = OT15R;
118#[doc = "Possible values of the field `OT1`"]
119pub type OT1R = OT15R;
120#[doc = "Possible values of the field `OT0`"]
121pub type OT0R = OT15R;
122#[doc = "Values that can be written to the field `OT15`"]
123pub enum OT15W {
124    #[doc = "Output push-pull (reset state)"]
125    PUSHPULL,
126    #[doc = "Output open-drain"]
127    OPENDRAIN,
128}
129impl OT15W {
130    #[allow(missing_docs)]
131    #[doc(hidden)]
132    #[inline]
133    pub fn _bits(&self) -> bool {
134        match *self {
135            OT15W::PUSHPULL => false,
136            OT15W::OPENDRAIN => true,
137        }
138    }
139}
140#[doc = r" Proxy"]
141pub struct _OT15W<'a> {
142    w: &'a mut W,
143}
144impl<'a> _OT15W<'a> {
145    #[doc = r" Writes `variant` to the field"]
146    #[inline]
147    pub fn variant(self, variant: OT15W) -> &'a mut W {
148        {
149            self.bit(variant._bits())
150        }
151    }
152    #[doc = "Output push-pull (reset state)"]
153    #[inline]
154    pub fn push_pull(self) -> &'a mut W {
155        self.variant(OT15W::PUSHPULL)
156    }
157    #[doc = "Output open-drain"]
158    #[inline]
159    pub fn open_drain(self) -> &'a mut W {
160        self.variant(OT15W::OPENDRAIN)
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 `OT14`"]
181pub type OT14W = OT15W;
182#[doc = r" Proxy"]
183pub struct _OT14W<'a> {
184    w: &'a mut W,
185}
186impl<'a> _OT14W<'a> {
187    #[doc = r" Writes `variant` to the field"]
188    #[inline]
189    pub fn variant(self, variant: OT14W) -> &'a mut W {
190        {
191            self.bit(variant._bits())
192        }
193    }
194    #[doc = "Output push-pull (reset state)"]
195    #[inline]
196    pub fn push_pull(self) -> &'a mut W {
197        self.variant(OT15W::PUSHPULL)
198    }
199    #[doc = "Output open-drain"]
200    #[inline]
201    pub fn open_drain(self) -> &'a mut W {
202        self.variant(OT15W::OPENDRAIN)
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 `OT13`"]
223pub type OT13W = OT15W;
224#[doc = r" Proxy"]
225pub struct _OT13W<'a> {
226    w: &'a mut W,
227}
228impl<'a> _OT13W<'a> {
229    #[doc = r" Writes `variant` to the field"]
230    #[inline]
231    pub fn variant(self, variant: OT13W) -> &'a mut W {
232        {
233            self.bit(variant._bits())
234        }
235    }
236    #[doc = "Output push-pull (reset state)"]
237    #[inline]
238    pub fn push_pull(self) -> &'a mut W {
239        self.variant(OT15W::PUSHPULL)
240    }
241    #[doc = "Output open-drain"]
242    #[inline]
243    pub fn open_drain(self) -> &'a mut W {
244        self.variant(OT15W::OPENDRAIN)
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 `OT12`"]
265pub type OT12W = OT15W;
266#[doc = r" Proxy"]
267pub struct _OT12W<'a> {
268    w: &'a mut W,
269}
270impl<'a> _OT12W<'a> {
271    #[doc = r" Writes `variant` to the field"]
272    #[inline]
273    pub fn variant(self, variant: OT12W) -> &'a mut W {
274        {
275            self.bit(variant._bits())
276        }
277    }
278    #[doc = "Output push-pull (reset state)"]
279    #[inline]
280    pub fn push_pull(self) -> &'a mut W {
281        self.variant(OT15W::PUSHPULL)
282    }
283    #[doc = "Output open-drain"]
284    #[inline]
285    pub fn open_drain(self) -> &'a mut W {
286        self.variant(OT15W::OPENDRAIN)
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 `OT11`"]
307pub type OT11W = OT15W;
308#[doc = r" Proxy"]
309pub struct _OT11W<'a> {
310    w: &'a mut W,
311}
312impl<'a> _OT11W<'a> {
313    #[doc = r" Writes `variant` to the field"]
314    #[inline]
315    pub fn variant(self, variant: OT11W) -> &'a mut W {
316        {
317            self.bit(variant._bits())
318        }
319    }
320    #[doc = "Output push-pull (reset state)"]
321    #[inline]
322    pub fn push_pull(self) -> &'a mut W {
323        self.variant(OT15W::PUSHPULL)
324    }
325    #[doc = "Output open-drain"]
326    #[inline]
327    pub fn open_drain(self) -> &'a mut W {
328        self.variant(OT15W::OPENDRAIN)
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 `OT10`"]
349pub type OT10W = OT15W;
350#[doc = r" Proxy"]
351pub struct _OT10W<'a> {
352    w: &'a mut W,
353}
354impl<'a> _OT10W<'a> {
355    #[doc = r" Writes `variant` to the field"]
356    #[inline]
357    pub fn variant(self, variant: OT10W) -> &'a mut W {
358        {
359            self.bit(variant._bits())
360        }
361    }
362    #[doc = "Output push-pull (reset state)"]
363    #[inline]
364    pub fn push_pull(self) -> &'a mut W {
365        self.variant(OT15W::PUSHPULL)
366    }
367    #[doc = "Output open-drain"]
368    #[inline]
369    pub fn open_drain(self) -> &'a mut W {
370        self.variant(OT15W::OPENDRAIN)
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 `OT9`"]
391pub type OT9W = OT15W;
392#[doc = r" Proxy"]
393pub struct _OT9W<'a> {
394    w: &'a mut W,
395}
396impl<'a> _OT9W<'a> {
397    #[doc = r" Writes `variant` to the field"]
398    #[inline]
399    pub fn variant(self, variant: OT9W) -> &'a mut W {
400        {
401            self.bit(variant._bits())
402        }
403    }
404    #[doc = "Output push-pull (reset state)"]
405    #[inline]
406    pub fn push_pull(self) -> &'a mut W {
407        self.variant(OT15W::PUSHPULL)
408    }
409    #[doc = "Output open-drain"]
410    #[inline]
411    pub fn open_drain(self) -> &'a mut W {
412        self.variant(OT15W::OPENDRAIN)
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 `OT8`"]
433pub type OT8W = OT15W;
434#[doc = r" Proxy"]
435pub struct _OT8W<'a> {
436    w: &'a mut W,
437}
438impl<'a> _OT8W<'a> {
439    #[doc = r" Writes `variant` to the field"]
440    #[inline]
441    pub fn variant(self, variant: OT8W) -> &'a mut W {
442        {
443            self.bit(variant._bits())
444        }
445    }
446    #[doc = "Output push-pull (reset state)"]
447    #[inline]
448    pub fn push_pull(self) -> &'a mut W {
449        self.variant(OT15W::PUSHPULL)
450    }
451    #[doc = "Output open-drain"]
452    #[inline]
453    pub fn open_drain(self) -> &'a mut W {
454        self.variant(OT15W::OPENDRAIN)
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 `OT7`"]
475pub type OT7W = OT15W;
476#[doc = r" Proxy"]
477pub struct _OT7W<'a> {
478    w: &'a mut W,
479}
480impl<'a> _OT7W<'a> {
481    #[doc = r" Writes `variant` to the field"]
482    #[inline]
483    pub fn variant(self, variant: OT7W) -> &'a mut W {
484        {
485            self.bit(variant._bits())
486        }
487    }
488    #[doc = "Output push-pull (reset state)"]
489    #[inline]
490    pub fn push_pull(self) -> &'a mut W {
491        self.variant(OT15W::PUSHPULL)
492    }
493    #[doc = "Output open-drain"]
494    #[inline]
495    pub fn open_drain(self) -> &'a mut W {
496        self.variant(OT15W::OPENDRAIN)
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 `OT6`"]
517pub type OT6W = OT15W;
518#[doc = r" Proxy"]
519pub struct _OT6W<'a> {
520    w: &'a mut W,
521}
522impl<'a> _OT6W<'a> {
523    #[doc = r" Writes `variant` to the field"]
524    #[inline]
525    pub fn variant(self, variant: OT6W) -> &'a mut W {
526        {
527            self.bit(variant._bits())
528        }
529    }
530    #[doc = "Output push-pull (reset state)"]
531    #[inline]
532    pub fn push_pull(self) -> &'a mut W {
533        self.variant(OT15W::PUSHPULL)
534    }
535    #[doc = "Output open-drain"]
536    #[inline]
537    pub fn open_drain(self) -> &'a mut W {
538        self.variant(OT15W::OPENDRAIN)
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 `OT5`"]
559pub type OT5W = OT15W;
560#[doc = r" Proxy"]
561pub struct _OT5W<'a> {
562    w: &'a mut W,
563}
564impl<'a> _OT5W<'a> {
565    #[doc = r" Writes `variant` to the field"]
566    #[inline]
567    pub fn variant(self, variant: OT5W) -> &'a mut W {
568        {
569            self.bit(variant._bits())
570        }
571    }
572    #[doc = "Output push-pull (reset state)"]
573    #[inline]
574    pub fn push_pull(self) -> &'a mut W {
575        self.variant(OT15W::PUSHPULL)
576    }
577    #[doc = "Output open-drain"]
578    #[inline]
579    pub fn open_drain(self) -> &'a mut W {
580        self.variant(OT15W::OPENDRAIN)
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 `OT4`"]
601pub type OT4W = OT15W;
602#[doc = r" Proxy"]
603pub struct _OT4W<'a> {
604    w: &'a mut W,
605}
606impl<'a> _OT4W<'a> {
607    #[doc = r" Writes `variant` to the field"]
608    #[inline]
609    pub fn variant(self, variant: OT4W) -> &'a mut W {
610        {
611            self.bit(variant._bits())
612        }
613    }
614    #[doc = "Output push-pull (reset state)"]
615    #[inline]
616    pub fn push_pull(self) -> &'a mut W {
617        self.variant(OT15W::PUSHPULL)
618    }
619    #[doc = "Output open-drain"]
620    #[inline]
621    pub fn open_drain(self) -> &'a mut W {
622        self.variant(OT15W::OPENDRAIN)
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 `OT3`"]
643pub type OT3W = OT15W;
644#[doc = r" Proxy"]
645pub struct _OT3W<'a> {
646    w: &'a mut W,
647}
648impl<'a> _OT3W<'a> {
649    #[doc = r" Writes `variant` to the field"]
650    #[inline]
651    pub fn variant(self, variant: OT3W) -> &'a mut W {
652        {
653            self.bit(variant._bits())
654        }
655    }
656    #[doc = "Output push-pull (reset state)"]
657    #[inline]
658    pub fn push_pull(self) -> &'a mut W {
659        self.variant(OT15W::PUSHPULL)
660    }
661    #[doc = "Output open-drain"]
662    #[inline]
663    pub fn open_drain(self) -> &'a mut W {
664        self.variant(OT15W::OPENDRAIN)
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 `OT2`"]
685pub type OT2W = OT15W;
686#[doc = r" Proxy"]
687pub struct _OT2W<'a> {
688    w: &'a mut W,
689}
690impl<'a> _OT2W<'a> {
691    #[doc = r" Writes `variant` to the field"]
692    #[inline]
693    pub fn variant(self, variant: OT2W) -> &'a mut W {
694        {
695            self.bit(variant._bits())
696        }
697    }
698    #[doc = "Output push-pull (reset state)"]
699    #[inline]
700    pub fn push_pull(self) -> &'a mut W {
701        self.variant(OT15W::PUSHPULL)
702    }
703    #[doc = "Output open-drain"]
704    #[inline]
705    pub fn open_drain(self) -> &'a mut W {
706        self.variant(OT15W::OPENDRAIN)
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 `OT1`"]
727pub type OT1W = OT15W;
728#[doc = r" Proxy"]
729pub struct _OT1W<'a> {
730    w: &'a mut W,
731}
732impl<'a> _OT1W<'a> {
733    #[doc = r" Writes `variant` to the field"]
734    #[inline]
735    pub fn variant(self, variant: OT1W) -> &'a mut W {
736        {
737            self.bit(variant._bits())
738        }
739    }
740    #[doc = "Output push-pull (reset state)"]
741    #[inline]
742    pub fn push_pull(self) -> &'a mut W {
743        self.variant(OT15W::PUSHPULL)
744    }
745    #[doc = "Output open-drain"]
746    #[inline]
747    pub fn open_drain(self) -> &'a mut W {
748        self.variant(OT15W::OPENDRAIN)
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 `OT0`"]
769pub type OT0W = OT15W;
770#[doc = r" Proxy"]
771pub struct _OT0W<'a> {
772    w: &'a mut W,
773}
774impl<'a> _OT0W<'a> {
775    #[doc = r" Writes `variant` to the field"]
776    #[inline]
777    pub fn variant(self, variant: OT0W) -> &'a mut W {
778        {
779            self.bit(variant._bits())
780        }
781    }
782    #[doc = "Output push-pull (reset state)"]
783    #[inline]
784    pub fn push_pull(self) -> &'a mut W {
785        self.variant(OT15W::PUSHPULL)
786    }
787    #[doc = "Output open-drain"]
788    #[inline]
789    pub fn open_drain(self) -> &'a mut W {
790        self.variant(OT15W::OPENDRAIN)
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 x configuration bits (y = 0..15)"]
817    #[inline]
818    pub fn ot15(&self) -> OT15R {
819        OT15R::_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 x configuration bits (y = 0..15)"]
826    #[inline]
827    pub fn ot14(&self) -> OT14R {
828        OT14R::_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 x configuration bits (y = 0..15)"]
835    #[inline]
836    pub fn ot13(&self) -> OT13R {
837        OT13R::_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 x configuration bits (y = 0..15)"]
844    #[inline]
845    pub fn ot12(&self) -> OT12R {
846        OT12R::_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 x configuration bits (y = 0..15)"]
853    #[inline]
854    pub fn ot11(&self) -> OT11R {
855        OT11R::_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 x configuration bits (y = 0..15)"]
862    #[inline]
863    pub fn ot10(&self) -> OT10R {
864        OT10R::_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 x configuration bits (y = 0..15)"]
871    #[inline]
872    pub fn ot9(&self) -> OT9R {
873        OT9R::_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 x configuration bits (y = 0..15)"]
880    #[inline]
881    pub fn ot8(&self) -> OT8R {
882        OT8R::_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 x configuration bits (y = 0..15)"]
889    #[inline]
890    pub fn ot7(&self) -> OT7R {
891        OT7R::_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 x configuration bits (y = 0..15)"]
898    #[inline]
899    pub fn ot6(&self) -> OT6R {
900        OT6R::_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 x configuration bits (y = 0..15)"]
907    #[inline]
908    pub fn ot5(&self) -> OT5R {
909        OT5R::_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 x configuration bits (y = 0..15)"]
916    #[inline]
917    pub fn ot4(&self) -> OT4R {
918        OT4R::_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 x configuration bits (y = 0..15)"]
925    #[inline]
926    pub fn ot3(&self) -> OT3R {
927        OT3R::_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 x configuration bits (y = 0..15)"]
934    #[inline]
935    pub fn ot2(&self) -> OT2R {
936        OT2R::_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 x configuration bits (y = 0..15)"]
943    #[inline]
944    pub fn ot1(&self) -> OT1R {
945        OT1R::_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 x configuration bits (y = 0..15)"]
952    #[inline]
953    pub fn ot0(&self) -> OT0R {
954        OT0R::_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 x configuration bits (y = 0..15)"]
974    #[inline]
975    pub fn ot15(&mut self) -> _OT15W {
976        _OT15W { w: self }
977    }
978    #[doc = "Bit 14 - Port x configuration bits (y = 0..15)"]
979    #[inline]
980    pub fn ot14(&mut self) -> _OT14W {
981        _OT14W { w: self }
982    }
983    #[doc = "Bit 13 - Port x configuration bits (y = 0..15)"]
984    #[inline]
985    pub fn ot13(&mut self) -> _OT13W {
986        _OT13W { w: self }
987    }
988    #[doc = "Bit 12 - Port x configuration bits (y = 0..15)"]
989    #[inline]
990    pub fn ot12(&mut self) -> _OT12W {
991        _OT12W { w: self }
992    }
993    #[doc = "Bit 11 - Port x configuration bits (y = 0..15)"]
994    #[inline]
995    pub fn ot11(&mut self) -> _OT11W {
996        _OT11W { w: self }
997    }
998    #[doc = "Bit 10 - Port x configuration bits (y = 0..15)"]
999    #[inline]
1000    pub fn ot10(&mut self) -> _OT10W {
1001        _OT10W { w: self }
1002    }
1003    #[doc = "Bit 9 - Port x configuration bits (y = 0..15)"]
1004    #[inline]
1005    pub fn ot9(&mut self) -> _OT9W {
1006        _OT9W { w: self }
1007    }
1008    #[doc = "Bit 8 - Port x configuration bits (y = 0..15)"]
1009    #[inline]
1010    pub fn ot8(&mut self) -> _OT8W {
1011        _OT8W { w: self }
1012    }
1013    #[doc = "Bit 7 - Port x configuration bits (y = 0..15)"]
1014    #[inline]
1015    pub fn ot7(&mut self) -> _OT7W {
1016        _OT7W { w: self }
1017    }
1018    #[doc = "Bit 6 - Port x configuration bits (y = 0..15)"]
1019    #[inline]
1020    pub fn ot6(&mut self) -> _OT6W {
1021        _OT6W { w: self }
1022    }
1023    #[doc = "Bit 5 - Port x configuration bits (y = 0..15)"]
1024    #[inline]
1025    pub fn ot5(&mut self) -> _OT5W {
1026        _OT5W { w: self }
1027    }
1028    #[doc = "Bit 4 - Port x configuration bits (y = 0..15)"]
1029    #[inline]
1030    pub fn ot4(&mut self) -> _OT4W {
1031        _OT4W { w: self }
1032    }
1033    #[doc = "Bit 3 - Port x configuration bits (y = 0..15)"]
1034    #[inline]
1035    pub fn ot3(&mut self) -> _OT3W {
1036        _OT3W { w: self }
1037    }
1038    #[doc = "Bit 2 - Port x configuration bits (y = 0..15)"]
1039    #[inline]
1040    pub fn ot2(&mut self) -> _OT2W {
1041        _OT2W { w: self }
1042    }
1043    #[doc = "Bit 1 - Port x configuration bits (y = 0..15)"]
1044    #[inline]
1045    pub fn ot1(&mut self) -> _OT1W {
1046        _OT1W { w: self }
1047    }
1048    #[doc = "Bit 0 - Port x configuration bits (y = 0..15)"]
1049    #[inline]
1050    pub fn ot0(&mut self) -> _OT0W {
1051        _OT0W { w: self }
1052    }
1053}