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
#[doc = "Register `FCFGC` reader"]
pub type R = crate::R<FcfgcSpec>;
#[doc = "Register `FCFGC` writer"]
pub type W = crate::W<FcfgcSpec>;
#[doc = "Field `CFMDF` reader - CIC Filter (Main Chain) Decimation Factor"]
pub type CfmdfR = crate::FieldReader;
#[doc = "Field `CFMDF` writer - CIC Filter (Main Chain) Decimation Factor"]
pub type CfmdfW<'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 {
    #[doc = "0: CIC1"]
    Value1 = 0,
    #[doc = "1: CIC2"]
    Value2 = 1,
    #[doc = "2: CIC3"]
    Value3 = 2,
    #[doc = "3: CICF"]
    Value4 = 3,
}
impl From<Cfmc> for u8 {
    #[inline(always)]
    fn from(variant: Cfmc) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Cfmc {
    type Ux = u8;
}
#[doc = "Field `CFMC` reader - CIC Filter (Main Chain) Configuration"]
pub type CfmcR = crate::FieldReader<Cfmc>;
impl CfmcR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cfmc {
        match self.bits {
            0 => Cfmc::Value1,
            1 => Cfmc::Value2,
            2 => Cfmc::Value3,
            3 => Cfmc::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "CIC1"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Cfmc::Value1
    }
    #[doc = "CIC2"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Cfmc::Value2
    }
    #[doc = "CIC3"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Cfmc::Value3
    }
    #[doc = "CICF"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Cfmc::Value4
    }
}
#[doc = "Field `CFMC` writer - CIC Filter (Main Chain) Configuration"]
pub type CfmcW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Cfmc>;
impl<'a, REG> CfmcW<'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::Value1)
    }
    #[doc = "CIC2"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Cfmc::Value2)
    }
    #[doc = "CIC3"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Cfmc::Value3)
    }
    #[doc = "CICF"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Cfmc::Value4)
    }
}
#[doc = "CIC Filter Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cfen {
    #[doc = "0: CIC filter disabled and bypassed"]
    Value1 = 0,
    #[doc = "1: Enable CIC filter"]
    Value2 = 1,
}
impl From<Cfen> for bool {
    #[inline(always)]
    fn from(variant: Cfen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CFEN` reader - CIC Filter Enable"]
pub type CfenR = crate::BitReader<Cfen>;
impl CfenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cfen {
        match self.bits {
            false => Cfen::Value1,
            true => Cfen::Value2,
        }
    }
    #[doc = "CIC filter disabled and bypassed"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Cfen::Value1
    }
    #[doc = "Enable CIC filter"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Cfen::Value2
    }
}
#[doc = "Field `CFEN` writer - CIC Filter Enable"]
pub type CfenW<'a, REG> = crate::BitWriter<'a, REG, Cfen>;
impl<'a, REG> CfenW<'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::Value1)
    }
    #[doc = "Enable CIC filter"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Cfen::Value2)
    }
}
#[doc = "Service Request Generation Main Chain\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Srgm {
    #[doc = "0: Never, service requests disabled"]
    Value1 = 0,
    #[doc = "3: Always, for each new result value"]
    Value4 = 3,
}
impl From<Srgm> for u8 {
    #[inline(always)]
    fn from(variant: Srgm) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Srgm {
    type Ux = u8;
}
#[doc = "Field `SRGM` reader - Service Request Generation Main Chain"]
pub type SrgmR = crate::FieldReader<Srgm>;
impl SrgmR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Srgm> {
        match self.bits {
            0 => Some(Srgm::Value1),
            3 => Some(Srgm::Value4),
            _ => None,
        }
    }
    #[doc = "Never, service requests disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Srgm::Value1
    }
    #[doc = "Always, for each new result value"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Srgm::Value4
    }
}
#[doc = "Field `SRGM` writer - Service Request Generation Main Chain"]
pub type SrgmW<'a, REG> = crate::FieldWriter<'a, REG, 2, Srgm>;
impl<'a, REG> SrgmW<'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::Value1)
    }
    #[doc = "Always, for each new result value"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Srgm::Value4)
    }
}
#[doc = "Field `CFMSV` reader - CIC Filter (Main Chain) Start Value"]
pub type CfmsvR = crate::FieldReader;
#[doc = "Field `CFMSV` writer - CIC Filter (Main Chain) Start Value"]
pub type CfmsvW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
#[doc = "Field `CFMDCNT` reader - CIC Filter (Main Chain) Decimation Counter"]
pub type CfmdcntR = crate::FieldReader;
impl R {
    #[doc = "Bits 0:7 - CIC Filter (Main Chain) Decimation Factor"]
    #[inline(always)]
    pub fn cfmdf(&self) -> CfmdfR {
        CfmdfR::new((self.bits & 0xff) as u8)
    }
    #[doc = "Bits 8:9 - CIC Filter (Main Chain) Configuration"]
    #[inline(always)]
    pub fn cfmc(&self) -> CfmcR {
        CfmcR::new(((self.bits >> 8) & 3) as u8)
    }
    #[doc = "Bit 10 - CIC Filter Enable"]
    #[inline(always)]
    pub fn cfen(&self) -> CfenR {
        CfenR::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bits 14:15 - Service Request Generation Main Chain"]
    #[inline(always)]
    pub fn srgm(&self) -> SrgmR {
        SrgmR::new(((self.bits >> 14) & 3) as u8)
    }
    #[doc = "Bits 16:23 - CIC Filter (Main Chain) Start Value"]
    #[inline(always)]
    pub fn cfmsv(&self) -> CfmsvR {
        CfmsvR::new(((self.bits >> 16) & 0xff) as u8)
    }
    #[doc = "Bits 24:31 - CIC Filter (Main Chain) Decimation Counter"]
    #[inline(always)]
    pub fn cfmdcnt(&self) -> CfmdcntR {
        CfmdcntR::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) -> CfmdfW<FcfgcSpec> {
        CfmdfW::new(self, 0)
    }
    #[doc = "Bits 8:9 - CIC Filter (Main Chain) Configuration"]
    #[inline(always)]
    #[must_use]
    pub fn cfmc(&mut self) -> CfmcW<FcfgcSpec> {
        CfmcW::new(self, 8)
    }
    #[doc = "Bit 10 - CIC Filter Enable"]
    #[inline(always)]
    #[must_use]
    pub fn cfen(&mut self) -> CfenW<FcfgcSpec> {
        CfenW::new(self, 10)
    }
    #[doc = "Bits 14:15 - Service Request Generation Main Chain"]
    #[inline(always)]
    #[must_use]
    pub fn srgm(&mut self) -> SrgmW<FcfgcSpec> {
        SrgmW::new(self, 14)
    }
    #[doc = "Bits 16:23 - CIC Filter (Main Chain) Start Value"]
    #[inline(always)]
    #[must_use]
    pub fn cfmsv(&mut self) -> CfmsvW<FcfgcSpec> {
        CfmsvW::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 FcfgcSpec;
impl crate::RegisterSpec for FcfgcSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`fcfgc::R`](R) reader structure"]
impl crate::Readable for FcfgcSpec {}
#[doc = "`write(|w| ..)` method takes [`fcfgc::W`](W) writer structure"]
impl crate::Writable for FcfgcSpec {
    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 FcfgcSpec {
    const RESET_VALUE: u32 = 0;
}