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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
#[doc = "Register `GLOBTF` reader"]
pub type R = crate::R<GLOBTF_SPEC>;
#[doc = "Register `GLOBTF` writer"]
pub type W = crate::W<GLOBTF_SPEC>;
#[doc = "Field `CDGR` reader - Converter Diagnostics Group"]
pub type CDGR_R = crate::FieldReader;
#[doc = "Field `CDGR` writer - Converter Diagnostics Group"]
pub type CDGR_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
#[doc = "Converter Diagnostics Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CDEN_A {
    #[doc = "0: All diagnostic pull devices are disconnected"]
    VALUE1 = 0,
    #[doc = "1: Diagnostic pull devices connected as selected by bitfield CDSEL"]
    VALUE2 = 1,
}
impl From<CDEN_A> for bool {
    #[inline(always)]
    fn from(variant: CDEN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CDEN` reader - Converter Diagnostics Enable"]
pub type CDEN_R = crate::BitReader<CDEN_A>;
impl CDEN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> CDEN_A {
        match self.bits {
            false => CDEN_A::VALUE1,
            true => CDEN_A::VALUE2,
        }
    }
    #[doc = "All diagnostic pull devices are disconnected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == CDEN_A::VALUE1
    }
    #[doc = "Diagnostic pull devices connected as selected by bitfield CDSEL"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == CDEN_A::VALUE2
    }
}
#[doc = "Field `CDEN` writer - Converter Diagnostics Enable"]
pub type CDEN_W<'a, REG> = crate::BitWriter<'a, REG, CDEN_A>;
impl<'a, REG> CDEN_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "All diagnostic pull devices are disconnected"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(CDEN_A::VALUE1)
    }
    #[doc = "Diagnostic pull devices connected as selected by bitfield CDSEL"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(CDEN_A::VALUE2)
    }
}
#[doc = "Converter Diagnostics Pull-Devices Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CDSEL_A {
    #[doc = "0: Connected to VAREF"]
    VALUE1 = 0,
    #[doc = "1: Connected to VAGND"]
    VALUE2 = 1,
    #[doc = "2: Connected to 1/3rd VAREF"]
    VALUE3 = 2,
    #[doc = "3: Connected to 2/3rd VAREF"]
    VALUE4 = 3,
}
impl From<CDSEL_A> for u8 {
    #[inline(always)]
    fn from(variant: CDSEL_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for CDSEL_A {
    type Ux = u8;
}
impl crate::IsEnum for CDSEL_A {}
#[doc = "Field `CDSEL` reader - Converter Diagnostics Pull-Devices Select"]
pub type CDSEL_R = crate::FieldReader<CDSEL_A>;
impl CDSEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> CDSEL_A {
        match self.bits {
            0 => CDSEL_A::VALUE1,
            1 => CDSEL_A::VALUE2,
            2 => CDSEL_A::VALUE3,
            3 => CDSEL_A::VALUE4,
            _ => unreachable!(),
        }
    }
    #[doc = "Connected to VAREF"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == CDSEL_A::VALUE1
    }
    #[doc = "Connected to VAGND"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == CDSEL_A::VALUE2
    }
    #[doc = "Connected to 1/3rd VAREF"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == CDSEL_A::VALUE3
    }
    #[doc = "Connected to 2/3rd VAREF"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == CDSEL_A::VALUE4
    }
}
#[doc = "Field `CDSEL` writer - Converter Diagnostics Pull-Devices Select"]
pub type CDSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CDSEL_A, crate::Safe>;
impl<'a, REG> CDSEL_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Connected to VAREF"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(CDSEL_A::VALUE1)
    }
    #[doc = "Connected to VAGND"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(CDSEL_A::VALUE2)
    }
    #[doc = "Connected to 1/3rd VAREF"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(CDSEL_A::VALUE3)
    }
    #[doc = "Connected to 2/3rd VAREF"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(CDSEL_A::VALUE4)
    }
}
#[doc = "Write Control for Conversion Diagnostics\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CDWC_A {
    #[doc = "0: No write access to parameters"]
    VALUE1 = 0,
    #[doc = "1: Bitfields CDSEL, CDEN, CDGR can be written"]
    VALUE2 = 1,
}
impl From<CDWC_A> for bool {
    #[inline(always)]
    fn from(variant: CDWC_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CDWC` writer - Write Control for Conversion Diagnostics"]
pub type CDWC_W<'a, REG> = crate::BitWriter<'a, REG, CDWC_A>;
impl<'a, REG> CDWC_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No write access to parameters"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(CDWC_A::VALUE1)
    }
    #[doc = "Bitfields CDSEL, CDEN, CDGR can be written"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(CDWC_A::VALUE2)
    }
}
#[doc = "Pull-Down Diagnostics Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PDD_A {
    #[doc = "0: Disconnected"]
    VALUE1 = 0,
    #[doc = "1: The pull-down diagnostics device is active"]
    VALUE2 = 1,
}
impl From<PDD_A> for bool {
    #[inline(always)]
    fn from(variant: PDD_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `PDD` reader - Pull-Down Diagnostics Enable"]
pub type PDD_R = crate::BitReader<PDD_A>;
impl PDD_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> PDD_A {
        match self.bits {
            false => PDD_A::VALUE1,
            true => PDD_A::VALUE2,
        }
    }
    #[doc = "Disconnected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == PDD_A::VALUE1
    }
    #[doc = "The pull-down diagnostics device is active"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == PDD_A::VALUE2
    }
}
#[doc = "Field `PDD` writer - Pull-Down Diagnostics Enable"]
pub type PDD_W<'a, REG> = crate::BitWriter<'a, REG, PDD_A>;
impl<'a, REG> PDD_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disconnected"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(PDD_A::VALUE1)
    }
    #[doc = "The pull-down diagnostics device is active"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(PDD_A::VALUE2)
    }
}
#[doc = "Write Control for Multiplexer Diagnostics\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MDWC_A {
    #[doc = "0: No write access to parameters"]
    VALUE1 = 0,
    #[doc = "1: Bitfield PDD can be written"]
    VALUE2 = 1,
}
impl From<MDWC_A> for bool {
    #[inline(always)]
    fn from(variant: MDWC_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `MDWC` writer - Write Control for Multiplexer Diagnostics"]
pub type MDWC_W<'a, REG> = crate::BitWriter<'a, REG, MDWC_A>;
impl<'a, REG> MDWC_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No write access to parameters"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(MDWC_A::VALUE1)
    }
    #[doc = "Bitfield PDD can be written"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(MDWC_A::VALUE2)
    }
}
impl R {
    #[doc = "Bits 4:7 - Converter Diagnostics Group"]
    #[inline(always)]
    pub fn cdgr(&self) -> CDGR_R {
        CDGR_R::new(((self.bits >> 4) & 0x0f) as u8)
    }
    #[doc = "Bit 8 - Converter Diagnostics Enable"]
    #[inline(always)]
    pub fn cden(&self) -> CDEN_R {
        CDEN_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bits 9:10 - Converter Diagnostics Pull-Devices Select"]
    #[inline(always)]
    pub fn cdsel(&self) -> CDSEL_R {
        CDSEL_R::new(((self.bits >> 9) & 3) as u8)
    }
    #[doc = "Bit 16 - Pull-Down Diagnostics Enable"]
    #[inline(always)]
    pub fn pdd(&self) -> PDD_R {
        PDD_R::new(((self.bits >> 16) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 4:7 - Converter Diagnostics Group"]
    #[inline(always)]
    #[must_use]
    pub fn cdgr(&mut self) -> CDGR_W<GLOBTF_SPEC> {
        CDGR_W::new(self, 4)
    }
    #[doc = "Bit 8 - Converter Diagnostics Enable"]
    #[inline(always)]
    #[must_use]
    pub fn cden(&mut self) -> CDEN_W<GLOBTF_SPEC> {
        CDEN_W::new(self, 8)
    }
    #[doc = "Bits 9:10 - Converter Diagnostics Pull-Devices Select"]
    #[inline(always)]
    #[must_use]
    pub fn cdsel(&mut self) -> CDSEL_W<GLOBTF_SPEC> {
        CDSEL_W::new(self, 9)
    }
    #[doc = "Bit 15 - Write Control for Conversion Diagnostics"]
    #[inline(always)]
    #[must_use]
    pub fn cdwc(&mut self) -> CDWC_W<GLOBTF_SPEC> {
        CDWC_W::new(self, 15)
    }
    #[doc = "Bit 16 - Pull-Down Diagnostics Enable"]
    #[inline(always)]
    #[must_use]
    pub fn pdd(&mut self) -> PDD_W<GLOBTF_SPEC> {
        PDD_W::new(self, 16)
    }
    #[doc = "Bit 23 - Write Control for Multiplexer Diagnostics"]
    #[inline(always)]
    #[must_use]
    pub fn mdwc(&mut self) -> MDWC_W<GLOBTF_SPEC> {
        MDWC_W::new(self, 23)
    }
}
#[doc = "Global Test Functions Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globtf::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 [`globtf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct GLOBTF_SPEC;
impl crate::RegisterSpec for GLOBTF_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [`globtf::R`](R) reader structure"]
impl crate::Readable for GLOBTF_SPEC {}
#[doc = "`write(|w| ..)` method takes [`globtf::W`](W) writer structure"]
impl crate::Writable for GLOBTF_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 GLOBTF to value 0"]
impl crate::Resettable for GLOBTF_SPEC {
    const RESET_VALUE: u32 = 0;
}