1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#[doc = "Register `CTL1` reader"]
pub type R = crate::R<Ctl1Spec>;
#[doc = "Register `CTL1` writer"]
pub type W = crate::W<Ctl1Spec>;
#[doc = "IRC14M Internal 14M RC oscillator Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Irc14men {
    #[doc = "0: Clock Off"]
    Off = 0,
    #[doc = "1: Clock On"]
    On = 1,
}
impl From<Irc14men> for bool {
    #[inline(always)]
    fn from(variant: Irc14men) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IRC14MEN` reader - IRC14M Internal 14M RC oscillator Enable"]
pub type Irc14menR = crate::BitReader<Irc14men>;
impl Irc14menR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Irc14men {
        match self.bits {
            false => Irc14men::Off,
            true => Irc14men::On,
        }
    }
    #[doc = "Clock Off"]
    #[inline(always)]
    pub fn is_off(&self) -> bool {
        *self == Irc14men::Off
    }
    #[doc = "Clock On"]
    #[inline(always)]
    pub fn is_on(&self) -> bool {
        *self == Irc14men::On
    }
}
#[doc = "Field `IRC14MEN` writer - IRC14M Internal 14M RC oscillator Enable"]
pub type Irc14menW<'a, REG> = crate::BitWriter<'a, REG, Irc14men>;
impl<'a, REG> Irc14menW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Clock Off"]
    #[inline(always)]
    pub fn off(self) -> &'a mut crate::W<REG> {
        self.variant(Irc14men::Off)
    }
    #[doc = "Clock On"]
    #[inline(always)]
    pub fn on(self) -> &'a mut crate::W<REG> {
        self.variant(Irc14men::On)
    }
}
#[doc = "IRC14M Internal 14M RC Oscillator stabilization Flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Irc14mstbr {
    #[doc = "0: IRC14M is not stable"]
    NotReady = 0,
    #[doc = "1: IRC14M is stable"]
    Ready = 1,
}
impl From<Irc14mstbr> for bool {
    #[inline(always)]
    fn from(variant: Irc14mstbr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IRC14MSTB` reader - IRC14M Internal 14M RC Oscillator stabilization Flag"]
pub type Irc14mstbR = crate::BitReader<Irc14mstbr>;
impl Irc14mstbR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Irc14mstbr {
        match self.bits {
            false => Irc14mstbr::NotReady,
            true => Irc14mstbr::Ready,
        }
    }
    #[doc = "IRC14M is not stable"]
    #[inline(always)]
    pub fn is_not_ready(&self) -> bool {
        *self == Irc14mstbr::NotReady
    }
    #[doc = "IRC14M is stable"]
    #[inline(always)]
    pub fn is_ready(&self) -> bool {
        *self == Irc14mstbr::Ready
    }
}
#[doc = "Field `IRC14MADJ` reader - Internal 14M RC Oscillator clock trim adjust value"]
pub type Irc14madjR = crate::FieldReader;
#[doc = "Field `IRC14MADJ` writer - Internal 14M RC Oscillator clock trim adjust value"]
pub type Irc14madjW<'a, REG> = crate::FieldWriterSafe<'a, REG, 5>;
#[doc = "Field `IRC14MCALIB` reader - Internal 14M RC Oscillator calibration value register"]
pub type Irc14mcalibR = crate::FieldReader;
impl R {
    #[doc = "Bit 0 - IRC14M Internal 14M RC oscillator Enable"]
    #[inline(always)]
    pub fn irc14men(&self) -> Irc14menR {
        Irc14menR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - IRC14M Internal 14M RC Oscillator stabilization Flag"]
    #[inline(always)]
    pub fn irc14mstb(&self) -> Irc14mstbR {
        Irc14mstbR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bits 3:7 - Internal 14M RC Oscillator clock trim adjust value"]
    #[inline(always)]
    pub fn irc14madj(&self) -> Irc14madjR {
        Irc14madjR::new(((self.bits >> 3) & 0x1f) as u8)
    }
    #[doc = "Bits 8:15 - Internal 14M RC Oscillator calibration value register"]
    #[inline(always)]
    pub fn irc14mcalib(&self) -> Irc14mcalibR {
        Irc14mcalibR::new(((self.bits >> 8) & 0xff) as u8)
    }
}
impl W {
    #[doc = "Bit 0 - IRC14M Internal 14M RC oscillator Enable"]
    #[inline(always)]
    #[must_use]
    pub fn irc14men(&mut self) -> Irc14menW<Ctl1Spec> {
        Irc14menW::new(self, 0)
    }
    #[doc = "Bits 3:7 - Internal 14M RC Oscillator clock trim adjust value"]
    #[inline(always)]
    #[must_use]
    pub fn irc14madj(&mut self) -> Irc14madjW<Ctl1Spec> {
        Irc14madjW::new(self, 3)
    }
}
#[doc = "Control register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctl1::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctl1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Ctl1Spec;
impl crate::RegisterSpec for Ctl1Spec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`ctl1::R`](R) reader structure"]
impl crate::Readable for Ctl1Spec {}
#[doc = "`write(|w| ..)` method takes [`ctl1::W`](W) writer structure"]
impl crate::Writable for Ctl1Spec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets CTL1 to value 0x80"]
impl crate::Resettable for Ctl1Spec {
    const RESET_VALUE: u32 = 0x80;
}