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
#[doc = "Register `FCFGC` reader"]
pub type R = crate::R<FCFGC_SPEC>;
#[doc = "Register `FCFGC` writer"]
pub type W = crate::W<FCFGC_SPEC>;
#[doc = "Field `CFMDF` reader - CIC Filter (Main Chain) Decimation Factor"]
pub type CFMDF_R = crate::FieldReader;
#[doc = "Field `CFMDF` writer - CIC Filter (Main Chain) Decimation Factor"]
pub type CFMDF_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
#[doc = "CIC Filter (Main Chain) Configuration\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CFMC_A {
    #[doc = "0: CIC1"]
    VALUE1 = 0,
    #[doc = "1: CIC2"]
    VALUE2 = 1,
    #[doc = "2: CIC3"]
    VALUE3 = 2,
    #[doc = "3: CICF"]
    VALUE4 = 3,
}
impl From<CFMC_A> for u8 {
    #[inline(always)]
    fn from(variant: CFMC_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for CFMC_A {
    type Ux = u8;
}
impl crate::IsEnum for CFMC_A {}
#[doc = "Field `CFMC` reader - CIC Filter (Main Chain) Configuration"]
pub type CFMC_R = crate::FieldReader<CFMC_A>;
impl CFMC_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> CFMC_A {
        match self.bits {
            0 => CFMC_A::VALUE1,
            1 => CFMC_A::VALUE2,
            2 => CFMC_A::VALUE3,
            3 => CFMC_A::VALUE4,
            _ => unreachable!(),
        }
    }
    #[doc = "CIC1"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == CFMC_A::VALUE1
    }
    #[doc = "CIC2"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == CFMC_A::VALUE2
    }
    #[doc = "CIC3"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == CFMC_A::VALUE3
    }
    #[doc = "CICF"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == CFMC_A::VALUE4
    }
}
#[doc = "Field `CFMC` writer - CIC Filter (Main Chain) Configuration"]
pub type CFMC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CFMC_A, crate::Safe>;
impl<'a, REG> CFMC_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "CIC1"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(CFMC_A::VALUE1)
    }
    #[doc = "CIC2"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(CFMC_A::VALUE2)
    }
    #[doc = "CIC3"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(CFMC_A::VALUE3)
    }
    #[doc = "CICF"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(CFMC_A::VALUE4)
    }
}
#[doc = "CIC Filter Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CFEN_A {
    #[doc = "0: CIC filter disabled and bypassed"]
    VALUE1 = 0,
    #[doc = "1: Enable CIC filter"]
    VALUE2 = 1,
}
impl From<CFEN_A> for bool {
    #[inline(always)]
    fn from(variant: CFEN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CFEN` reader - CIC Filter Enable"]
pub type CFEN_R = crate::BitReader<CFEN_A>;
impl CFEN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> CFEN_A {
        match self.bits {
            false => CFEN_A::VALUE1,
            true => CFEN_A::VALUE2,
        }
    }
    #[doc = "CIC filter disabled and bypassed"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == CFEN_A::VALUE1
    }
    #[doc = "Enable CIC filter"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == CFEN_A::VALUE2
    }
}
#[doc = "Field `CFEN` writer - CIC Filter Enable"]
pub type CFEN_W<'a, REG> = crate::BitWriter<'a, REG, CFEN_A>;
impl<'a, REG> CFEN_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "CIC filter disabled and bypassed"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(CFEN_A::VALUE1)
    }
    #[doc = "Enable CIC filter"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(CFEN_A::VALUE2)
    }
}
#[doc = "Service Request Generation Main Chain\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SRGM_A {
    #[doc = "0: Never, service requests disabled"]
    VALUE1 = 0,
    #[doc = "3: Always, for each new result value"]
    VALUE4 = 3,
}
impl From<SRGM_A> for u8 {
    #[inline(always)]
    fn from(variant: SRGM_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for SRGM_A {
    type Ux = u8;
}
impl crate::IsEnum for SRGM_A {}
#[doc = "Field `SRGM` reader - Service Request Generation Main Chain"]
pub type SRGM_R = crate::FieldReader<SRGM_A>;
impl SRGM_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<SRGM_A> {
        match self.bits {
            0 => Some(SRGM_A::VALUE1),
            3 => Some(SRGM_A::VALUE4),
            _ => None,
        }
    }
    #[doc = "Never, service requests disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == SRGM_A::VALUE1
    }
    #[doc = "Always, for each new result value"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == SRGM_A::VALUE4
    }
}
#[doc = "Field `SRGM` writer - Service Request Generation Main Chain"]
pub type SRGM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SRGM_A>;
impl<'a, REG> SRGM_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Never, service requests disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(SRGM_A::VALUE1)
    }
    #[doc = "Always, for each new result value"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(SRGM_A::VALUE4)
    }
}
#[doc = "Field `CFMSV` reader - CIC Filter (Main Chain) Start Value"]
pub type CFMSV_R = crate::FieldReader;
#[doc = "Field `CFMSV` writer - CIC Filter (Main Chain) Start Value"]
pub type CFMSV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
#[doc = "Field `CFMDCNT` reader - CIC Filter (Main Chain) Decimation Counter"]
pub type CFMDCNT_R = crate::FieldReader;
impl R {
    #[doc = "Bits 0:7 - CIC Filter (Main Chain) Decimation Factor"]
    #[inline(always)]
    pub fn cfmdf(&self) -> CFMDF_R {
        CFMDF_R::new((self.bits & 0xff) as u8)
    }
    #[doc = "Bits 8:9 - CIC Filter (Main Chain) Configuration"]
    #[inline(always)]
    pub fn cfmc(&self) -> CFMC_R {
        CFMC_R::new(((self.bits >> 8) & 3) as u8)
    }
    #[doc = "Bit 10 - CIC Filter Enable"]
    #[inline(always)]
    pub fn cfen(&self) -> CFEN_R {
        CFEN_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bits 14:15 - Service Request Generation Main Chain"]
    #[inline(always)]
    pub fn srgm(&self) -> SRGM_R {
        SRGM_R::new(((self.bits >> 14) & 3) as u8)
    }
    #[doc = "Bits 16:23 - CIC Filter (Main Chain) Start Value"]
    #[inline(always)]
    pub fn cfmsv(&self) -> CFMSV_R {
        CFMSV_R::new(((self.bits >> 16) & 0xff) as u8)
    }
    #[doc = "Bits 24:31 - CIC Filter (Main Chain) Decimation Counter"]
    #[inline(always)]
    pub fn cfmdcnt(&self) -> CFMDCNT_R {
        CFMDCNT_R::new(((self.bits >> 24) & 0xff) as u8)
    }
}
impl W {
    #[doc = "Bits 0:7 - CIC Filter (Main Chain) Decimation Factor"]
    #[inline(always)]
    #[must_use]
    pub fn cfmdf(&mut self) -> CFMDF_W<FCFGC_SPEC> {
        CFMDF_W::new(self, 0)
    }
    #[doc = "Bits 8:9 - CIC Filter (Main Chain) Configuration"]
    #[inline(always)]
    #[must_use]
    pub fn cfmc(&mut self) -> CFMC_W<FCFGC_SPEC> {
        CFMC_W::new(self, 8)
    }
    #[doc = "Bit 10 - CIC Filter Enable"]
    #[inline(always)]
    #[must_use]
    pub fn cfen(&mut self) -> CFEN_W<FCFGC_SPEC> {
        CFEN_W::new(self, 10)
    }
    #[doc = "Bits 14:15 - Service Request Generation Main Chain"]
    #[inline(always)]
    #[must_use]
    pub fn srgm(&mut self) -> SRGM_W<FCFGC_SPEC> {
        SRGM_W::new(self, 14)
    }
    #[doc = "Bits 16:23 - CIC Filter (Main Chain) Start Value"]
    #[inline(always)]
    #[must_use]
    pub fn cfmsv(&mut self) -> CFMSV_W<FCFGC_SPEC> {
        CFMSV_W::new(self, 16)
    }
}
#[doc = "Filter Configuration Register, Main CIC Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fcfgc::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 [`fcfgc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct FCFGC_SPEC;
impl crate::RegisterSpec for FCFGC_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [`fcfgc::R`](R) reader structure"]
impl crate::Readable for FCFGC_SPEC {}
#[doc = "`write(|w| ..)` method takes [`fcfgc::W`](W) writer structure"]
impl crate::Writable for FCFGC_SPEC {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets FCFGC to value 0"]
impl crate::Resettable for FCFGC_SPEC {
    const RESET_VALUE: u32 = 0;
}