mk20d7/ptc/ptor/
mod.rs

1#[doc = r" Value to write to the register"]
2pub struct W {
3    bits: u32,
4}
5impl super::PTOR {
6    #[doc = r" Writes to the register"]
7    #[inline]
8    pub fn write<F>(&self, f: F)
9    where
10        F: FnOnce(&mut W) -> &mut W,
11    {
12        let mut w = W::reset_value();
13        f(&mut w);
14        self.register.set(w.bits);
15    }
16}
17#[doc = "Values that can be written to the field `PTTO`"]
18pub enum PTTOW {
19    #[doc = "Corresponding bit in PDORn does not change."]
20    _0,
21    #[doc = "Corresponding bit in PDORn is set to the inverse of its existing logic state."]
22    _1,
23}
24impl PTTOW {
25    #[allow(missing_docs)]
26    #[doc(hidden)]
27    #[inline]
28    pub fn _bits(&self) -> u32 {
29        match *self {
30            PTTOW::_0 => 0,
31            PTTOW::_1 => 1,
32        }
33    }
34}
35#[doc = r" Proxy"]
36pub struct _PTTOW<'a> {
37    w: &'a mut W,
38}
39impl<'a> _PTTOW<'a> {
40    #[doc = r" Writes `variant` to the field"]
41    #[inline]
42    pub fn variant(self, variant: PTTOW) -> &'a mut W {
43        unsafe { self.bits(variant._bits()) }
44    }
45    #[doc = "Corresponding bit in PDORn does not change."]
46    #[inline]
47    pub fn _0(self) -> &'a mut W {
48        self.variant(PTTOW::_0)
49    }
50    #[doc = "Corresponding bit in PDORn is set to the inverse of its existing logic state."]
51    #[inline]
52    pub fn _1(self) -> &'a mut W {
53        self.variant(PTTOW::_1)
54    }
55    #[doc = r" Writes raw bits to the field"]
56    #[inline]
57    pub unsafe fn bits(self, value: u32) -> &'a mut W {
58        const MASK: u32 = 4294967295;
59        const OFFSET: u8 = 0;
60        self.w.bits &= !((MASK as u32) << OFFSET);
61        self.w.bits |= ((value & MASK) as u32) << OFFSET;
62        self.w
63    }
64}
65impl W {
66    #[doc = r" Reset value of the register"]
67    #[inline]
68    pub fn reset_value() -> W {
69        W { bits: 0 }
70    }
71    #[doc = r" Writes raw bits to the register"]
72    #[inline]
73    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
74        self.bits = bits;
75        self
76    }
77    #[doc = "Bits 0:31 - Port Toggle Output"]
78    #[inline]
79    pub fn ptto(&mut self) -> _PTTOW {
80        _PTTOW { w: self }
81    }
82}