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
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
#[doc = "Reader of register CAPTIOCTL"]
pub type R = crate::R<u16, super::CAPTIOCTL>;
#[doc = "Writer for register CAPTIOCTL"]
pub type W = crate::W<u16, super::CAPTIOCTL>;
#[doc = "Register CAPTIOCTL `reset()`'s with value 0"]
impl crate::ResetValue for super::CAPTIOCTL {
    type Type = u16;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Capacitive Touch IO pin select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CAPTIOPISEL_A {
    #[doc = "0: Px.0"]
    CAPTIOPISEL_0,
    #[doc = "1: Px.1"]
    CAPTIOPISEL_1,
    #[doc = "2: Px.2"]
    CAPTIOPISEL_2,
    #[doc = "3: Px.3"]
    CAPTIOPISEL_3,
    #[doc = "4: Px.4"]
    CAPTIOPISEL_4,
    #[doc = "5: Px.5"]
    CAPTIOPISEL_5,
    #[doc = "6: Px.6"]
    CAPTIOPISEL_6,
    #[doc = "7: Px.7"]
    CAPTIOPISEL_7,
}
impl From<CAPTIOPISEL_A> for u8 {
    #[inline(always)]
    fn from(variant: CAPTIOPISEL_A) -> Self {
        match variant {
            CAPTIOPISEL_A::CAPTIOPISEL_0 => 0,
            CAPTIOPISEL_A::CAPTIOPISEL_1 => 1,
            CAPTIOPISEL_A::CAPTIOPISEL_2 => 2,
            CAPTIOPISEL_A::CAPTIOPISEL_3 => 3,
            CAPTIOPISEL_A::CAPTIOPISEL_4 => 4,
            CAPTIOPISEL_A::CAPTIOPISEL_5 => 5,
            CAPTIOPISEL_A::CAPTIOPISEL_6 => 6,
            CAPTIOPISEL_A::CAPTIOPISEL_7 => 7,
        }
    }
}
#[doc = "Reader of field `CAPTIOPISEL`"]
pub type CAPTIOPISEL_R = crate::R<u8, CAPTIOPISEL_A>;
impl CAPTIOPISEL_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CAPTIOPISEL_A {
        match self.bits {
            0 => CAPTIOPISEL_A::CAPTIOPISEL_0,
            1 => CAPTIOPISEL_A::CAPTIOPISEL_1,
            2 => CAPTIOPISEL_A::CAPTIOPISEL_2,
            3 => CAPTIOPISEL_A::CAPTIOPISEL_3,
            4 => CAPTIOPISEL_A::CAPTIOPISEL_4,
            5 => CAPTIOPISEL_A::CAPTIOPISEL_5,
            6 => CAPTIOPISEL_A::CAPTIOPISEL_6,
            7 => CAPTIOPISEL_A::CAPTIOPISEL_7,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `CAPTIOPISEL_0`"]
    #[inline(always)]
    pub fn is_captiopisel_0(&self) -> bool {
        *self == CAPTIOPISEL_A::CAPTIOPISEL_0
    }
    #[doc = "Checks if the value of the field is `CAPTIOPISEL_1`"]
    #[inline(always)]
    pub fn is_captiopisel_1(&self) -> bool {
        *self == CAPTIOPISEL_A::CAPTIOPISEL_1
    }
    #[doc = "Checks if the value of the field is `CAPTIOPISEL_2`"]
    #[inline(always)]
    pub fn is_captiopisel_2(&self) -> bool {
        *self == CAPTIOPISEL_A::CAPTIOPISEL_2
    }
    #[doc = "Checks if the value of the field is `CAPTIOPISEL_3`"]
    #[inline(always)]
    pub fn is_captiopisel_3(&self) -> bool {
        *self == CAPTIOPISEL_A::CAPTIOPISEL_3
    }
    #[doc = "Checks if the value of the field is `CAPTIOPISEL_4`"]
    #[inline(always)]
    pub fn is_captiopisel_4(&self) -> bool {
        *self == CAPTIOPISEL_A::CAPTIOPISEL_4
    }
    #[doc = "Checks if the value of the field is `CAPTIOPISEL_5`"]
    #[inline(always)]
    pub fn is_captiopisel_5(&self) -> bool {
        *self == CAPTIOPISEL_A::CAPTIOPISEL_5
    }
    #[doc = "Checks if the value of the field is `CAPTIOPISEL_6`"]
    #[inline(always)]
    pub fn is_captiopisel_6(&self) -> bool {
        *self == CAPTIOPISEL_A::CAPTIOPISEL_6
    }
    #[doc = "Checks if the value of the field is `CAPTIOPISEL_7`"]
    #[inline(always)]
    pub fn is_captiopisel_7(&self) -> bool {
        *self == CAPTIOPISEL_A::CAPTIOPISEL_7
    }
}
#[doc = "Write proxy for field `CAPTIOPISEL`"]
pub struct CAPTIOPISEL_W<'a> {
    w: &'a mut W,
}
impl<'a> CAPTIOPISEL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CAPTIOPISEL_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "Px.0"]
    #[inline(always)]
    pub fn captiopisel_0(self) -> &'a mut W {
        self.variant(CAPTIOPISEL_A::CAPTIOPISEL_0)
    }
    #[doc = "Px.1"]
    #[inline(always)]
    pub fn captiopisel_1(self) -> &'a mut W {
        self.variant(CAPTIOPISEL_A::CAPTIOPISEL_1)
    }
    #[doc = "Px.2"]
    #[inline(always)]
    pub fn captiopisel_2(self) -> &'a mut W {
        self.variant(CAPTIOPISEL_A::CAPTIOPISEL_2)
    }
    #[doc = "Px.3"]
    #[inline(always)]
    pub fn captiopisel_3(self) -> &'a mut W {
        self.variant(CAPTIOPISEL_A::CAPTIOPISEL_3)
    }
    #[doc = "Px.4"]
    #[inline(always)]
    pub fn captiopisel_4(self) -> &'a mut W {
        self.variant(CAPTIOPISEL_A::CAPTIOPISEL_4)
    }
    #[doc = "Px.5"]
    #[inline(always)]
    pub fn captiopisel_5(self) -> &'a mut W {
        self.variant(CAPTIOPISEL_A::CAPTIOPISEL_5)
    }
    #[doc = "Px.6"]
    #[inline(always)]
    pub fn captiopisel_6(self) -> &'a mut W {
        self.variant(CAPTIOPISEL_A::CAPTIOPISEL_6)
    }
    #[doc = "Px.7"]
    #[inline(always)]
    pub fn captiopisel_7(self) -> &'a mut W {
        self.variant(CAPTIOPISEL_A::CAPTIOPISEL_7)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 1)) | (((value as u16) & 0x07) << 1);
        self.w
    }
}
#[doc = "Capacitive Touch IO port select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CAPTIOPOSEL_A {
    #[doc = "0: Px = PJ"]
    PJ,
    #[doc = "1: Px = P1"]
    P1,
    #[doc = "2: Px = P2"]
    P2,
    #[doc = "3: Px = P3"]
    P3,
    #[doc = "4: Px = P4"]
    P4,
    #[doc = "5: Px = P5"]
    P5,
    #[doc = "6: Px = P6"]
    P6,
    #[doc = "7: Px = P7"]
    P7,
    #[doc = "8: Px = P8"]
    P8,
    #[doc = "9: Px = P9"]
    P9,
    #[doc = "10: Px = P10"]
    P10,
    #[doc = "11: Px = P11"]
    P11,
    #[doc = "12: Px = P12"]
    P12,
    #[doc = "13: Px = P13"]
    P13,
    #[doc = "14: Px = P14"]
    P14,
    #[doc = "15: Px = P15"]
    P15,
}
impl From<CAPTIOPOSEL_A> for u8 {
    #[inline(always)]
    fn from(variant: CAPTIOPOSEL_A) -> Self {
        match variant {
            CAPTIOPOSEL_A::PJ => 0,
            CAPTIOPOSEL_A::P1 => 1,
            CAPTIOPOSEL_A::P2 => 2,
            CAPTIOPOSEL_A::P3 => 3,
            CAPTIOPOSEL_A::P4 => 4,
            CAPTIOPOSEL_A::P5 => 5,
            CAPTIOPOSEL_A::P6 => 6,
            CAPTIOPOSEL_A::P7 => 7,
            CAPTIOPOSEL_A::P8 => 8,
            CAPTIOPOSEL_A::P9 => 9,
            CAPTIOPOSEL_A::P10 => 10,
            CAPTIOPOSEL_A::P11 => 11,
            CAPTIOPOSEL_A::P12 => 12,
            CAPTIOPOSEL_A::P13 => 13,
            CAPTIOPOSEL_A::P14 => 14,
            CAPTIOPOSEL_A::P15 => 15,
        }
    }
}
#[doc = "Reader of field `CAPTIOPOSEL`"]
pub type CAPTIOPOSEL_R = crate::R<u8, CAPTIOPOSEL_A>;
impl CAPTIOPOSEL_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CAPTIOPOSEL_A {
        match self.bits {
            0 => CAPTIOPOSEL_A::PJ,
            1 => CAPTIOPOSEL_A::P1,
            2 => CAPTIOPOSEL_A::P2,
            3 => CAPTIOPOSEL_A::P3,
            4 => CAPTIOPOSEL_A::P4,
            5 => CAPTIOPOSEL_A::P5,
            6 => CAPTIOPOSEL_A::P6,
            7 => CAPTIOPOSEL_A::P7,
            8 => CAPTIOPOSEL_A::P8,
            9 => CAPTIOPOSEL_A::P9,
            10 => CAPTIOPOSEL_A::P10,
            11 => CAPTIOPOSEL_A::P11,
            12 => CAPTIOPOSEL_A::P12,
            13 => CAPTIOPOSEL_A::P13,
            14 => CAPTIOPOSEL_A::P14,
            15 => CAPTIOPOSEL_A::P15,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `PJ`"]
    #[inline(always)]
    pub fn is_pj(&self) -> bool {
        *self == CAPTIOPOSEL_A::PJ
    }
    #[doc = "Checks if the value of the field is `P1`"]
    #[inline(always)]
    pub fn is_p1(&self) -> bool {
        *self == CAPTIOPOSEL_A::P1
    }
    #[doc = "Checks if the value of the field is `P2`"]
    #[inline(always)]
    pub fn is_p2(&self) -> bool {
        *self == CAPTIOPOSEL_A::P2
    }
    #[doc = "Checks if the value of the field is `P3`"]
    #[inline(always)]
    pub fn is_p3(&self) -> bool {
        *self == CAPTIOPOSEL_A::P3
    }
    #[doc = "Checks if the value of the field is `P4`"]
    #[inline(always)]
    pub fn is_p4(&self) -> bool {
        *self == CAPTIOPOSEL_A::P4
    }
    #[doc = "Checks if the value of the field is `P5`"]
    #[inline(always)]
    pub fn is_p5(&self) -> bool {
        *self == CAPTIOPOSEL_A::P5
    }
    #[doc = "Checks if the value of the field is `P6`"]
    #[inline(always)]
    pub fn is_p6(&self) -> bool {
        *self == CAPTIOPOSEL_A::P6
    }
    #[doc = "Checks if the value of the field is `P7`"]
    #[inline(always)]
    pub fn is_p7(&self) -> bool {
        *self == CAPTIOPOSEL_A::P7
    }
    #[doc = "Checks if the value of the field is `P8`"]
    #[inline(always)]
    pub fn is_p8(&self) -> bool {
        *self == CAPTIOPOSEL_A::P8
    }
    #[doc = "Checks if the value of the field is `P9`"]
    #[inline(always)]
    pub fn is_p9(&self) -> bool {
        *self == CAPTIOPOSEL_A::P9
    }
    #[doc = "Checks if the value of the field is `P10`"]
    #[inline(always)]
    pub fn is_p10(&self) -> bool {
        *self == CAPTIOPOSEL_A::P10
    }
    #[doc = "Checks if the value of the field is `P11`"]
    #[inline(always)]
    pub fn is_p11(&self) -> bool {
        *self == CAPTIOPOSEL_A::P11
    }
    #[doc = "Checks if the value of the field is `P12`"]
    #[inline(always)]
    pub fn is_p12(&self) -> bool {
        *self == CAPTIOPOSEL_A::P12
    }
    #[doc = "Checks if the value of the field is `P13`"]
    #[inline(always)]
    pub fn is_p13(&self) -> bool {
        *self == CAPTIOPOSEL_A::P13
    }
    #[doc = "Checks if the value of the field is `P14`"]
    #[inline(always)]
    pub fn is_p14(&self) -> bool {
        *self == CAPTIOPOSEL_A::P14
    }
    #[doc = "Checks if the value of the field is `P15`"]
    #[inline(always)]
    pub fn is_p15(&self) -> bool {
        *self == CAPTIOPOSEL_A::P15
    }
}
#[doc = "Write proxy for field `CAPTIOPOSEL`"]
pub struct CAPTIOPOSEL_W<'a> {
    w: &'a mut W,
}
impl<'a> CAPTIOPOSEL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CAPTIOPOSEL_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "Px = PJ"]
    #[inline(always)]
    pub fn pj(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::PJ)
    }
    #[doc = "Px = P1"]
    #[inline(always)]
    pub fn p1(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P1)
    }
    #[doc = "Px = P2"]
    #[inline(always)]
    pub fn p2(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P2)
    }
    #[doc = "Px = P3"]
    #[inline(always)]
    pub fn p3(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P3)
    }
    #[doc = "Px = P4"]
    #[inline(always)]
    pub fn p4(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P4)
    }
    #[doc = "Px = P5"]
    #[inline(always)]
    pub fn p5(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P5)
    }
    #[doc = "Px = P6"]
    #[inline(always)]
    pub fn p6(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P6)
    }
    #[doc = "Px = P7"]
    #[inline(always)]
    pub fn p7(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P7)
    }
    #[doc = "Px = P8"]
    #[inline(always)]
    pub fn p8(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P8)
    }
    #[doc = "Px = P9"]
    #[inline(always)]
    pub fn p9(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P9)
    }
    #[doc = "Px = P10"]
    #[inline(always)]
    pub fn p10(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P10)
    }
    #[doc = "Px = P11"]
    #[inline(always)]
    pub fn p11(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P11)
    }
    #[doc = "Px = P12"]
    #[inline(always)]
    pub fn p12(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P12)
    }
    #[doc = "Px = P13"]
    #[inline(always)]
    pub fn p13(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P13)
    }
    #[doc = "Px = P14"]
    #[inline(always)]
    pub fn p14(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P14)
    }
    #[doc = "Px = P15"]
    #[inline(always)]
    pub fn p15(self) -> &'a mut W {
        self.variant(CAPTIOPOSEL_A::P15)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u16) & 0x0f) << 4);
        self.w
    }
}
#[doc = "Capacitive Touch IO enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CAPTIOEN_A {
    #[doc = "0: All Capacitive Touch IOs are disabled. Signal towards timers is 0."]
    OFF,
    #[doc = "1: Selected Capacitive Touch IO is enabled"]
    ON,
}
impl From<CAPTIOEN_A> for bool {
    #[inline(always)]
    fn from(variant: CAPTIOEN_A) -> Self {
        match variant {
            CAPTIOEN_A::OFF => false,
            CAPTIOEN_A::ON => true,
        }
    }
}
#[doc = "Reader of field `CAPTIOEN`"]
pub type CAPTIOEN_R = crate::R<bool, CAPTIOEN_A>;
impl CAPTIOEN_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CAPTIOEN_A {
        match self.bits {
            false => CAPTIOEN_A::OFF,
            true => CAPTIOEN_A::ON,
        }
    }
    #[doc = "Checks if the value of the field is `OFF`"]
    #[inline(always)]
    pub fn is_off(&self) -> bool {
        *self == CAPTIOEN_A::OFF
    }
    #[doc = "Checks if the value of the field is `ON`"]
    #[inline(always)]
    pub fn is_on(&self) -> bool {
        *self == CAPTIOEN_A::ON
    }
}
#[doc = "Write proxy for field `CAPTIOEN`"]
pub struct CAPTIOEN_W<'a> {
    w: &'a mut W,
}
impl<'a> CAPTIOEN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CAPTIOEN_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "All Capacitive Touch IOs are disabled. Signal towards timers is 0."]
    #[inline(always)]
    pub fn off(self) -> &'a mut W {
        self.variant(CAPTIOEN_A::OFF)
    }
    #[doc = "Selected Capacitive Touch IO is enabled"]
    #[inline(always)]
    pub fn on(self) -> &'a mut W {
        self.variant(CAPTIOEN_A::ON)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u16) & 0x01) << 8);
        self.w
    }
}
#[doc = "Capacitive Touch IO state\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CAPTIO_A {
    #[doc = "0: Curent state 0 or Capacitive Touch IO is disabled"]
    CAPTIO_0,
    #[doc = "1: Current state 1"]
    CAPTIO_1,
}
impl From<CAPTIO_A> for bool {
    #[inline(always)]
    fn from(variant: CAPTIO_A) -> Self {
        match variant {
            CAPTIO_A::CAPTIO_0 => false,
            CAPTIO_A::CAPTIO_1 => true,
        }
    }
}
#[doc = "Reader of field `CAPTIO`"]
pub type CAPTIO_R = crate::R<bool, CAPTIO_A>;
impl CAPTIO_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CAPTIO_A {
        match self.bits {
            false => CAPTIO_A::CAPTIO_0,
            true => CAPTIO_A::CAPTIO_1,
        }
    }
    #[doc = "Checks if the value of the field is `CAPTIO_0`"]
    #[inline(always)]
    pub fn is_captio_0(&self) -> bool {
        *self == CAPTIO_A::CAPTIO_0
    }
    #[doc = "Checks if the value of the field is `CAPTIO_1`"]
    #[inline(always)]
    pub fn is_captio_1(&self) -> bool {
        *self == CAPTIO_A::CAPTIO_1
    }
}
impl R {
    #[doc = "Bits 1:3 - Capacitive Touch IO pin select"]
    #[inline(always)]
    pub fn captiopisel(&self) -> CAPTIOPISEL_R {
        CAPTIOPISEL_R::new(((self.bits >> 1) & 0x07) as u8)
    }
    #[doc = "Bits 4:7 - Capacitive Touch IO port select"]
    #[inline(always)]
    pub fn captioposel(&self) -> CAPTIOPOSEL_R {
        CAPTIOPOSEL_R::new(((self.bits >> 4) & 0x0f) as u8)
    }
    #[doc = "Bit 8 - Capacitive Touch IO enable"]
    #[inline(always)]
    pub fn captioen(&self) -> CAPTIOEN_R {
        CAPTIOEN_R::new(((self.bits >> 8) & 0x01) != 0)
    }
    #[doc = "Bit 9 - Capacitive Touch IO state"]
    #[inline(always)]
    pub fn captio(&self) -> CAPTIO_R {
        CAPTIO_R::new(((self.bits >> 9) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bits 1:3 - Capacitive Touch IO pin select"]
    #[inline(always)]
    pub fn captiopisel(&mut self) -> CAPTIOPISEL_W {
        CAPTIOPISEL_W { w: self }
    }
    #[doc = "Bits 4:7 - Capacitive Touch IO port select"]
    #[inline(always)]
    pub fn captioposel(&mut self) -> CAPTIOPOSEL_W {
        CAPTIOPOSEL_W { w: self }
    }
    #[doc = "Bit 8 - Capacitive Touch IO enable"]
    #[inline(always)]
    pub fn captioen(&mut self) -> CAPTIOEN_W {
        CAPTIOEN_W { w: self }
    }
}