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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
#[doc = "Register `PARAMETER` reader"]
pub struct R(crate::R<PARAMETER_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<PARAMETER_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<PARAMETER_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<PARAMETER_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Field `DT` reader - Digital Tuner"]
pub type DT_R = crate::BitReader<DTSELECT_A>;
#[doc = "Digital Tuner\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DTSELECT_A {
    #[doc = "0: Digital tuner off"]
    OFF = 0,
    #[doc = "1: Digital tuner on"]
    ON = 1,
}
impl From<DTSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: DTSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl DT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DTSELECT_A {
        match self.bits {
            false => DTSELECT_A::OFF,
            true => DTSELECT_A::ON,
        }
    }
    #[doc = "Checks if the value of the field is `OFF`"]
    #[inline(always)]
    pub fn is_off(&self) -> bool {
        *self == DTSELECT_A::OFF
    }
    #[doc = "Checks if the value of the field is `ON`"]
    #[inline(always)]
    pub fn is_on(&self) -> bool {
        *self == DTSELECT_A::ON
    }
}
#[doc = "Field `DTEXPWA` reader - Digital Tuner Exponent Writeable"]
pub type DTEXPWA_R = crate::BitReader<DTEXPWASELECT_A>;
#[doc = "Digital Tuner Exponent Writeable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DTEXPWASELECT_A {
    #[doc = "0: Digital tuner exponent is a constant value. Writes to EXP bitfield in DTR will be discarded."]
    _0 = 0,
    #[doc = "1: Digital tuner exponent is chosen by writing to EXP bitfield in DTR"]
    _1 = 1,
}
impl From<DTEXPWASELECT_A> for bool {
    #[inline(always)]
    fn from(variant: DTEXPWASELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl DTEXPWA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DTEXPWASELECT_A {
        match self.bits {
            false => DTEXPWASELECT_A::_0,
            true => DTEXPWASELECT_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == DTEXPWASELECT_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == DTEXPWASELECT_A::_1
    }
}
#[doc = "Field `DTEXPVALUE` reader - Digital Tuner Exponent Value"]
pub type DTEXPVALUE_R = crate::FieldReader<u8, u8>;
#[doc = "Field `NUMAR` reader - Number of alarm comparators"]
pub type NUMAR_R = crate::FieldReader<u8, NUMARSELECT_A>;
#[doc = "Number of alarm comparators\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum NUMARSELECT_A {
    #[doc = "0: No alarm comparators"]
    ZERO = 0,
    #[doc = "1: One alarm comparator"]
    ONE = 1,
    #[doc = "2: Two alarm comparators"]
    TWO = 2,
}
impl From<NUMARSELECT_A> for u8 {
    #[inline(always)]
    fn from(variant: NUMARSELECT_A) -> Self {
        variant as _
    }
}
impl NUMAR_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<NUMARSELECT_A> {
        match self.bits {
            0 => Some(NUMARSELECT_A::ZERO),
            1 => Some(NUMARSELECT_A::ONE),
            2 => Some(NUMARSELECT_A::TWO),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `ZERO`"]
    #[inline(always)]
    pub fn is_zero(&self) -> bool {
        *self == NUMARSELECT_A::ZERO
    }
    #[doc = "Checks if the value of the field is `ONE`"]
    #[inline(always)]
    pub fn is_one(&self) -> bool {
        *self == NUMARSELECT_A::ONE
    }
    #[doc = "Checks if the value of the field is `TWO`"]
    #[inline(always)]
    pub fn is_two(&self) -> bool {
        *self == NUMARSELECT_A::TWO
    }
}
#[doc = "Field `NUMPIR` reader - Number of periodic comparators"]
pub type NUMPIR_R = crate::BitReader<NUMPIRSELECT_A>;
#[doc = "Number of periodic comparators\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NUMPIRSELECT_A {
    #[doc = "0: One periodic comparator"]
    ONE = 0,
    #[doc = "1: Two periodic comparators"]
    TWO = 1,
}
impl From<NUMPIRSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: NUMPIRSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl NUMPIR_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NUMPIRSELECT_A {
        match self.bits {
            false => NUMPIRSELECT_A::ONE,
            true => NUMPIRSELECT_A::TWO,
        }
    }
    #[doc = "Checks if the value of the field is `ONE`"]
    #[inline(always)]
    pub fn is_one(&self) -> bool {
        *self == NUMPIRSELECT_A::ONE
    }
    #[doc = "Checks if the value of the field is `TWO`"]
    #[inline(always)]
    pub fn is_two(&self) -> bool {
        *self == NUMPIRSELECT_A::TWO
    }
}
#[doc = "Field `PIR0WA` reader - Periodic Interval 0 Writeable"]
pub type PIR0WA_R = crate::BitReader<PIR0WASELECT_A>;
#[doc = "Periodic Interval 0 Writeable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PIR0WASELECT_A {
    #[doc = "0: Periodic alarm prescaler 0 tapping is a constant value. Writes to INSEL bitfield in PIR0 will be discarded."]
    _0 = 0,
    #[doc = "1: Periodic alarm prescaler 0 tapping is chosen by writing to INSEL bitfield in PIR0"]
    _1 = 1,
}
impl From<PIR0WASELECT_A> for bool {
    #[inline(always)]
    fn from(variant: PIR0WASELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl PIR0WA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PIR0WASELECT_A {
        match self.bits {
            false => PIR0WASELECT_A::_0,
            true => PIR0WASELECT_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == PIR0WASELECT_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == PIR0WASELECT_A::_1
    }
}
#[doc = "Field `PIR1WA` reader - Periodic Interval 1 Writeable"]
pub type PIR1WA_R = crate::BitReader<PIR1WASELECT_A>;
#[doc = "Periodic Interval 1 Writeable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PIR1WASELECT_A {
    #[doc = "0: Writes to PIR1 will be discarded"]
    _0 = 0,
    #[doc = "1: PIR1 can be written"]
    _1 = 1,
}
impl From<PIR1WASELECT_A> for bool {
    #[inline(always)]
    fn from(variant: PIR1WASELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl PIR1WA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PIR1WASELECT_A {
        match self.bits {
            false => PIR1WASELECT_A::_0,
            true => PIR1WASELECT_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == PIR1WASELECT_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == PIR1WASELECT_A::_1
    }
}
#[doc = "Field `PER0VALUE` reader - Periodic Interval 0 Value"]
pub type PER0VALUE_R = crate::FieldReader<u8, u8>;
#[doc = "Field `PER1VALUE` reader - Periodic Interval 1 Value"]
pub type PER1VALUE_R = crate::FieldReader<u8, u8>;
impl R {
    #[doc = "Bit 0 - Digital Tuner"]
    #[inline(always)]
    pub fn dt(&self) -> DT_R {
        DT_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Digital Tuner Exponent Writeable"]
    #[inline(always)]
    pub fn dtexpwa(&self) -> DTEXPWA_R {
        DTEXPWA_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bits 2:6 - Digital Tuner Exponent Value"]
    #[inline(always)]
    pub fn dtexpvalue(&self) -> DTEXPVALUE_R {
        DTEXPVALUE_R::new(((self.bits >> 2) & 0x1f) as u8)
    }
    #[doc = "Bits 8:9 - Number of alarm comparators"]
    #[inline(always)]
    pub fn numar(&self) -> NUMAR_R {
        NUMAR_R::new(((self.bits >> 8) & 3) as u8)
    }
    #[doc = "Bit 12 - Number of periodic comparators"]
    #[inline(always)]
    pub fn numpir(&self) -> NUMPIR_R {
        NUMPIR_R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 14 - Periodic Interval 0 Writeable"]
    #[inline(always)]
    pub fn pir0wa(&self) -> PIR0WA_R {
        PIR0WA_R::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 15 - Periodic Interval 1 Writeable"]
    #[inline(always)]
    pub fn pir1wa(&self) -> PIR1WA_R {
        PIR1WA_R::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bits 16:20 - Periodic Interval 0 Value"]
    #[inline(always)]
    pub fn per0value(&self) -> PER0VALUE_R {
        PER0VALUE_R::new(((self.bits >> 16) & 0x1f) as u8)
    }
    #[doc = "Bits 24:28 - Periodic Interval 1 Value"]
    #[inline(always)]
    pub fn per1value(&self) -> PER1VALUE_R {
        PER1VALUE_R::new(((self.bits >> 24) & 0x1f) as u8)
    }
}
#[doc = "Parameter Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [parameter](index.html) module"]
pub struct PARAMETER_SPEC;
impl crate::RegisterSpec for PARAMETER_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [parameter::R](R) reader structure"]
impl crate::Readable for PARAMETER_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets PARAMETER to value 0"]
impl crate::Resettable for PARAMETER_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}