xmc4100 0.14.0

XMC4100 Cortex-M peripheral access library
Documentation
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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
#[doc = "Register `IES` reader"]
pub type R = crate::R<IES_SPEC>;
#[doc = "Register `IES` writer"]
pub type W = crate::W<IES_SPEC>;
#[doc = "External value switch function level selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SVLS_A {
    #[doc = "0: Function disabled"]
    VALUE1 = 0,
    #[doc = "1: Active when input is HIGH"]
    VALUE2 = 1,
    #[doc = "2: Active when input is LOW"]
    VALUE3 = 2,
}
impl From<SVLS_A> for u8 {
    #[inline(always)]
    fn from(variant: SVLS_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for SVLS_A {
    type Ux = u8;
}
impl crate::IsEnum for SVLS_A {}
#[doc = "Field `SVLS` reader - External value switch function level selection"]
pub type SVLS_R = crate::FieldReader<SVLS_A>;
impl SVLS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<SVLS_A> {
        match self.bits {
            0 => Some(SVLS_A::VALUE1),
            1 => Some(SVLS_A::VALUE2),
            2 => Some(SVLS_A::VALUE3),
            _ => None,
        }
    }
    #[doc = "Function disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == SVLS_A::VALUE1
    }
    #[doc = "Active when input is HIGH"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == SVLS_A::VALUE2
    }
    #[doc = "Active when input is LOW"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == SVLS_A::VALUE3
    }
}
#[doc = "Field `SVLS` writer - External value switch function level selection"]
pub type SVLS_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SVLS_A>;
impl<'a, REG> SVLS_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Function disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(SVLS_A::VALUE1)
    }
    #[doc = "Active when input is HIGH"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(SVLS_A::VALUE2)
    }
    #[doc = "Active when input is LOW"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(SVLS_A::VALUE3)
    }
}
#[doc = "External start function edge selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum STRES_A {
    #[doc = "0: Function disabled"]
    VALUE1 = 0,
    #[doc = "1: Active on rising edge"]
    VALUE2 = 1,
    #[doc = "2: Active on falling edge"]
    VALUE3 = 2,
    #[doc = "3: Active on both edges"]
    VALUE4 = 3,
}
impl From<STRES_A> for u8 {
    #[inline(always)]
    fn from(variant: STRES_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for STRES_A {
    type Ux = u8;
}
impl crate::IsEnum for STRES_A {}
#[doc = "Field `STRES` reader - External start function edge selection"]
pub type STRES_R = crate::FieldReader<STRES_A>;
impl STRES_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> STRES_A {
        match self.bits {
            0 => STRES_A::VALUE1,
            1 => STRES_A::VALUE2,
            2 => STRES_A::VALUE3,
            3 => STRES_A::VALUE4,
            _ => unreachable!(),
        }
    }
    #[doc = "Function disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == STRES_A::VALUE1
    }
    #[doc = "Active on rising edge"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == STRES_A::VALUE2
    }
    #[doc = "Active on falling edge"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == STRES_A::VALUE3
    }
    #[doc = "Active on both edges"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == STRES_A::VALUE4
    }
}
#[doc = "Field `STRES` writer - External start function edge selection"]
pub type STRES_W<'a, REG> = crate::FieldWriter<'a, REG, 2, STRES_A, crate::Safe>;
impl<'a, REG> STRES_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Function disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(STRES_A::VALUE1)
    }
    #[doc = "Active on rising edge"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(STRES_A::VALUE2)
    }
    #[doc = "Active on falling edge"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(STRES_A::VALUE3)
    }
    #[doc = "Active on both edges"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(STRES_A::VALUE4)
    }
}
#[doc = "External stop function edge selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum STPES_A {
    #[doc = "0: Function disabled"]
    VALUE1 = 0,
    #[doc = "1: Active on rising edge"]
    VALUE2 = 1,
    #[doc = "2: Active on falling edge"]
    VALUE3 = 2,
    #[doc = "3: Active on both edges"]
    VALUE4 = 3,
}
impl From<STPES_A> for u8 {
    #[inline(always)]
    fn from(variant: STPES_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for STPES_A {
    type Ux = u8;
}
impl crate::IsEnum for STPES_A {}
#[doc = "Field `STPES` reader - External stop function edge selection"]
pub type STPES_R = crate::FieldReader<STPES_A>;
impl STPES_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> STPES_A {
        match self.bits {
            0 => STPES_A::VALUE1,
            1 => STPES_A::VALUE2,
            2 => STPES_A::VALUE3,
            3 => STPES_A::VALUE4,
            _ => unreachable!(),
        }
    }
    #[doc = "Function disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == STPES_A::VALUE1
    }
    #[doc = "Active on rising edge"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == STPES_A::VALUE2
    }
    #[doc = "Active on falling edge"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == STPES_A::VALUE3
    }
    #[doc = "Active on both edges"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == STPES_A::VALUE4
    }
}
#[doc = "Field `STPES` writer - External stop function edge selection"]
pub type STPES_W<'a, REG> = crate::FieldWriter<'a, REG, 2, STPES_A, crate::Safe>;
impl<'a, REG> STPES_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Function disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(STPES_A::VALUE1)
    }
    #[doc = "Active on rising edge"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(STPES_A::VALUE2)
    }
    #[doc = "Active on falling edge"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(STPES_A::VALUE3)
    }
    #[doc = "Active on both edges"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(STPES_A::VALUE4)
    }
}
#[doc = "External trigger function edge selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TRGES_A {
    #[doc = "0: Function disabled"]
    VALUE1 = 0,
    #[doc = "1: Active on rising edge"]
    VALUE2 = 1,
    #[doc = "2: Active on falling edge"]
    VALUE3 = 2,
    #[doc = "3: Active on both edges"]
    VALUE4 = 3,
}
impl From<TRGES_A> for u8 {
    #[inline(always)]
    fn from(variant: TRGES_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for TRGES_A {
    type Ux = u8;
}
impl crate::IsEnum for TRGES_A {}
#[doc = "Field `TRGES` reader - External trigger function edge selection"]
pub type TRGES_R = crate::FieldReader<TRGES_A>;
impl TRGES_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> TRGES_A {
        match self.bits {
            0 => TRGES_A::VALUE1,
            1 => TRGES_A::VALUE2,
            2 => TRGES_A::VALUE3,
            3 => TRGES_A::VALUE4,
            _ => unreachable!(),
        }
    }
    #[doc = "Function disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == TRGES_A::VALUE1
    }
    #[doc = "Active on rising edge"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == TRGES_A::VALUE2
    }
    #[doc = "Active on falling edge"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == TRGES_A::VALUE3
    }
    #[doc = "Active on both edges"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == TRGES_A::VALUE4
    }
}
#[doc = "Field `TRGES` writer - External trigger function edge selection"]
pub type TRGES_W<'a, REG> = crate::FieldWriter<'a, REG, 2, TRGES_A, crate::Safe>;
impl<'a, REG> TRGES_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Function disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(TRGES_A::VALUE1)
    }
    #[doc = "Active on rising edge"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(TRGES_A::VALUE2)
    }
    #[doc = "Active on falling edge"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(TRGES_A::VALUE3)
    }
    #[doc = "Active on both edges"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(TRGES_A::VALUE4)
    }
}
#[doc = "External shadow transfer enable edge selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum STES_A {
    #[doc = "0: Function disabled"]
    VALUE1 = 0,
    #[doc = "1: Active on rising edge"]
    VALUE2 = 1,
    #[doc = "2: Active on falling edge"]
    VALUE3 = 2,
    #[doc = "3: Active on both edges"]
    VALUE4 = 3,
}
impl From<STES_A> for u8 {
    #[inline(always)]
    fn from(variant: STES_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for STES_A {
    type Ux = u8;
}
impl crate::IsEnum for STES_A {}
#[doc = "Field `STES` reader - External shadow transfer enable edge selection"]
pub type STES_R = crate::FieldReader<STES_A>;
impl STES_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> STES_A {
        match self.bits {
            0 => STES_A::VALUE1,
            1 => STES_A::VALUE2,
            2 => STES_A::VALUE3,
            3 => STES_A::VALUE4,
            _ => unreachable!(),
        }
    }
    #[doc = "Function disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == STES_A::VALUE1
    }
    #[doc = "Active on rising edge"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == STES_A::VALUE2
    }
    #[doc = "Active on falling edge"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == STES_A::VALUE3
    }
    #[doc = "Active on both edges"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == STES_A::VALUE4
    }
}
#[doc = "Field `STES` writer - External shadow transfer enable edge selection"]
pub type STES_W<'a, REG> = crate::FieldWriter<'a, REG, 2, STES_A, crate::Safe>;
impl<'a, REG> STES_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Function disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(STES_A::VALUE1)
    }
    #[doc = "Active on rising edge"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(STES_A::VALUE2)
    }
    #[doc = "Active on falling edge"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(STES_A::VALUE3)
    }
    #[doc = "Active on both edges"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(STES_A::VALUE4)
    }
}
impl R {
    #[doc = "Bits 0:1 - External value switch function level selection"]
    #[inline(always)]
    pub fn svls(&self) -> SVLS_R {
        SVLS_R::new((self.bits & 3) as u8)
    }
    #[doc = "Bits 2:3 - External start function edge selection"]
    #[inline(always)]
    pub fn stres(&self) -> STRES_R {
        STRES_R::new(((self.bits >> 2) & 3) as u8)
    }
    #[doc = "Bits 4:5 - External stop function edge selection"]
    #[inline(always)]
    pub fn stpes(&self) -> STPES_R {
        STPES_R::new(((self.bits >> 4) & 3) as u8)
    }
    #[doc = "Bits 6:7 - External trigger function edge selection"]
    #[inline(always)]
    pub fn trges(&self) -> TRGES_R {
        TRGES_R::new(((self.bits >> 6) & 3) as u8)
    }
    #[doc = "Bits 8:9 - External shadow transfer enable edge selection"]
    #[inline(always)]
    pub fn stes(&self) -> STES_R {
        STES_R::new(((self.bits >> 8) & 3) as u8)
    }
}
impl W {
    #[doc = "Bits 0:1 - External value switch function level selection"]
    #[inline(always)]
    pub fn svls(&mut self) -> SVLS_W<IES_SPEC> {
        SVLS_W::new(self, 0)
    }
    #[doc = "Bits 2:3 - External start function edge selection"]
    #[inline(always)]
    pub fn stres(&mut self) -> STRES_W<IES_SPEC> {
        STRES_W::new(self, 2)
    }
    #[doc = "Bits 4:5 - External stop function edge selection"]
    #[inline(always)]
    pub fn stpes(&mut self) -> STPES_W<IES_SPEC> {
        STPES_W::new(self, 4)
    }
    #[doc = "Bits 6:7 - External trigger function edge selection"]
    #[inline(always)]
    pub fn trges(&mut self) -> TRGES_W<IES_SPEC> {
        TRGES_W::new(self, 6)
    }
    #[doc = "Bits 8:9 - External shadow transfer enable edge selection"]
    #[inline(always)]
    pub fn stes(&mut self) -> STES_W<IES_SPEC> {
        STES_W::new(self, 8)
    }
}
#[doc = "External input selection\n\nYou can [`read`](crate::Reg::read) this register and get [`ies::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ies::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct IES_SPEC;
impl crate::RegisterSpec for IES_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [`ies::R`](R) reader structure"]
impl crate::Readable for IES_SPEC {}
#[doc = "`write(|w| ..)` method takes [`ies::W`](W) writer structure"]
impl crate::Writable for IES_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 IES to value 0"]
impl crate::Resettable for IES_SPEC {
    const RESET_VALUE: u32 = 0;
}