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
587
588
589
590
591
592
593
594
#[doc = "Reader of register PIGEON_11_0"]
pub type R = crate::R<u32, super::PIGEON_11_0>;
#[doc = "Writer for register PIGEON_11_0"]
pub type W = crate::W<u32, super::PIGEON_11_0>;
#[doc = "Register PIGEON_11_0 `reset()`'s with value 0"]
impl crate::ResetValue for super::PIGEON_11_0 {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Reader of field `EN`"]
pub type EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `EN`"]
pub struct EN_W<'a> {
    w: &'a mut W,
}
impl<'a> EN_W<'a> {
    #[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) | ((value as u32) & 0x01);
        self.w
    }
}
#[doc = "Polarity of signal output\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum POL_A {
    #[doc = "0: Normal Signal (Active high)"]
    ACTIVE_HIGH = 0,
    #[doc = "1: Inverted signal (Active low)"]
    ACTIVE_LOW = 1,
}
impl From<POL_A> for bool {
    #[inline(always)]
    fn from(variant: POL_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `POL`"]
pub type POL_R = crate::R<bool, POL_A>;
impl POL_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> POL_A {
        match self.bits {
            false => POL_A::ACTIVE_HIGH,
            true => POL_A::ACTIVE_LOW,
        }
    }
    #[doc = "Checks if the value of the field is `ACTIVE_HIGH`"]
    #[inline(always)]
    pub fn is_active_high(&self) -> bool {
        *self == POL_A::ACTIVE_HIGH
    }
    #[doc = "Checks if the value of the field is `ACTIVE_LOW`"]
    #[inline(always)]
    pub fn is_active_low(&self) -> bool {
        *self == POL_A::ACTIVE_LOW
    }
}
#[doc = "Write proxy for field `POL`"]
pub struct POL_W<'a> {
    w: &'a mut W,
}
impl<'a> POL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: POL_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Normal Signal (Active high)"]
    #[inline(always)]
    pub fn active_high(self) -> &'a mut W {
        self.variant(POL_A::ACTIVE_HIGH)
    }
    #[doc = "Inverted signal (Active low)"]
    #[inline(always)]
    pub fn active_low(self) -> &'a mut W {
        self.variant(POL_A::ACTIVE_LOW)
    }
    #[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 << 1)) | (((value as u32) & 0x01) << 1);
        self.w
    }
}
#[doc = "Event to incrment local counter\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum INC_SEL_A {
    #[doc = "0: pclk"]
    PCLK = 0,
    #[doc = "1: Line start pulse"]
    LINE = 1,
    #[doc = "2: Frame start pulse"]
    FRAME = 2,
    #[doc = "3: Use another signal as tick event"]
    SIG_ANOTHER = 3,
}
impl From<INC_SEL_A> for u8 {
    #[inline(always)]
    fn from(variant: INC_SEL_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `INC_SEL`"]
pub type INC_SEL_R = crate::R<u8, INC_SEL_A>;
impl INC_SEL_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> INC_SEL_A {
        match self.bits {
            0 => INC_SEL_A::PCLK,
            1 => INC_SEL_A::LINE,
            2 => INC_SEL_A::FRAME,
            3 => INC_SEL_A::SIG_ANOTHER,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `PCLK`"]
    #[inline(always)]
    pub fn is_pclk(&self) -> bool {
        *self == INC_SEL_A::PCLK
    }
    #[doc = "Checks if the value of the field is `LINE`"]
    #[inline(always)]
    pub fn is_line(&self) -> bool {
        *self == INC_SEL_A::LINE
    }
    #[doc = "Checks if the value of the field is `FRAME`"]
    #[inline(always)]
    pub fn is_frame(&self) -> bool {
        *self == INC_SEL_A::FRAME
    }
    #[doc = "Checks if the value of the field is `SIG_ANOTHER`"]
    #[inline(always)]
    pub fn is_sig_another(&self) -> bool {
        *self == INC_SEL_A::SIG_ANOTHER
    }
}
#[doc = "Write proxy for field `INC_SEL`"]
pub struct INC_SEL_W<'a> {
    w: &'a mut W,
}
impl<'a> INC_SEL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: INC_SEL_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "pclk"]
    #[inline(always)]
    pub fn pclk(self) -> &'a mut W {
        self.variant(INC_SEL_A::PCLK)
    }
    #[doc = "Line start pulse"]
    #[inline(always)]
    pub fn line(self) -> &'a mut W {
        self.variant(INC_SEL_A::LINE)
    }
    #[doc = "Frame start pulse"]
    #[inline(always)]
    pub fn frame(self) -> &'a mut W {
        self.variant(INC_SEL_A::FRAME)
    }
    #[doc = "Use another signal as tick event"]
    #[inline(always)]
    pub fn sig_another(self) -> &'a mut W {
        self.variant(INC_SEL_A::SIG_ANOTHER)
    }
    #[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 & !(0x03 << 2)) | (((value as u32) & 0x03) << 2);
        self.w
    }
}
#[doc = "Reader of field `OFFSET`"]
pub type OFFSET_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `OFFSET`"]
pub struct OFFSET_W<'a> {
    w: &'a mut W,
}
impl<'a> OFFSET_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4);
        self.w
    }
}
#[doc = "select global counters as mask condition, use together with MASK_CNT\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum MASK_CNT_SEL_A {
    #[doc = "0: pclk counter within one hscan state"]
    HSTATE_CNT = 0,
    #[doc = "1: pclk cycle within one hscan state"]
    HSTATE_CYCLE = 1,
    #[doc = "2: line counter within one vscan state"]
    VSTATE_CNT = 2,
    #[doc = "3: line cycle within one vscan state"]
    VSTATE_CYCLE = 3,
    #[doc = "4: frame counter"]
    FRAME_CNT = 4,
    #[doc = "5: frame cycle"]
    FRAME_CYCLE = 5,
    #[doc = "6: horizontal counter (pclk counter within one line )"]
    HCNT = 6,
    #[doc = "7: vertical counter (line counter within one frame)"]
    VCNT = 7,
}
impl From<MASK_CNT_SEL_A> for u8 {
    #[inline(always)]
    fn from(variant: MASK_CNT_SEL_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `MASK_CNT_SEL`"]
pub type MASK_CNT_SEL_R = crate::R<u8, MASK_CNT_SEL_A>;
impl MASK_CNT_SEL_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, MASK_CNT_SEL_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(MASK_CNT_SEL_A::HSTATE_CNT),
            1 => Val(MASK_CNT_SEL_A::HSTATE_CYCLE),
            2 => Val(MASK_CNT_SEL_A::VSTATE_CNT),
            3 => Val(MASK_CNT_SEL_A::VSTATE_CYCLE),
            4 => Val(MASK_CNT_SEL_A::FRAME_CNT),
            5 => Val(MASK_CNT_SEL_A::FRAME_CYCLE),
            6 => Val(MASK_CNT_SEL_A::HCNT),
            7 => Val(MASK_CNT_SEL_A::VCNT),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `HSTATE_CNT`"]
    #[inline(always)]
    pub fn is_hstate_cnt(&self) -> bool {
        *self == MASK_CNT_SEL_A::HSTATE_CNT
    }
    #[doc = "Checks if the value of the field is `HSTATE_CYCLE`"]
    #[inline(always)]
    pub fn is_hstate_cycle(&self) -> bool {
        *self == MASK_CNT_SEL_A::HSTATE_CYCLE
    }
    #[doc = "Checks if the value of the field is `VSTATE_CNT`"]
    #[inline(always)]
    pub fn is_vstate_cnt(&self) -> bool {
        *self == MASK_CNT_SEL_A::VSTATE_CNT
    }
    #[doc = "Checks if the value of the field is `VSTATE_CYCLE`"]
    #[inline(always)]
    pub fn is_vstate_cycle(&self) -> bool {
        *self == MASK_CNT_SEL_A::VSTATE_CYCLE
    }
    #[doc = "Checks if the value of the field is `FRAME_CNT`"]
    #[inline(always)]
    pub fn is_frame_cnt(&self) -> bool {
        *self == MASK_CNT_SEL_A::FRAME_CNT
    }
    #[doc = "Checks if the value of the field is `FRAME_CYCLE`"]
    #[inline(always)]
    pub fn is_frame_cycle(&self) -> bool {
        *self == MASK_CNT_SEL_A::FRAME_CYCLE
    }
    #[doc = "Checks if the value of the field is `HCNT`"]
    #[inline(always)]
    pub fn is_hcnt(&self) -> bool {
        *self == MASK_CNT_SEL_A::HCNT
    }
    #[doc = "Checks if the value of the field is `VCNT`"]
    #[inline(always)]
    pub fn is_vcnt(&self) -> bool {
        *self == MASK_CNT_SEL_A::VCNT
    }
}
#[doc = "Write proxy for field `MASK_CNT_SEL`"]
pub struct MASK_CNT_SEL_W<'a> {
    w: &'a mut W,
}
impl<'a> MASK_CNT_SEL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: MASK_CNT_SEL_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "pclk counter within one hscan state"]
    #[inline(always)]
    pub fn hstate_cnt(self) -> &'a mut W {
        self.variant(MASK_CNT_SEL_A::HSTATE_CNT)
    }
    #[doc = "pclk cycle within one hscan state"]
    #[inline(always)]
    pub fn hstate_cycle(self) -> &'a mut W {
        self.variant(MASK_CNT_SEL_A::HSTATE_CYCLE)
    }
    #[doc = "line counter within one vscan state"]
    #[inline(always)]
    pub fn vstate_cnt(self) -> &'a mut W {
        self.variant(MASK_CNT_SEL_A::VSTATE_CNT)
    }
    #[doc = "line cycle within one vscan state"]
    #[inline(always)]
    pub fn vstate_cycle(self) -> &'a mut W {
        self.variant(MASK_CNT_SEL_A::VSTATE_CYCLE)
    }
    #[doc = "frame counter"]
    #[inline(always)]
    pub fn frame_cnt(self) -> &'a mut W {
        self.variant(MASK_CNT_SEL_A::FRAME_CNT)
    }
    #[doc = "frame cycle"]
    #[inline(always)]
    pub fn frame_cycle(self) -> &'a mut W {
        self.variant(MASK_CNT_SEL_A::FRAME_CYCLE)
    }
    #[doc = "horizontal counter (pclk counter within one line )"]
    #[inline(always)]
    pub fn hcnt(self) -> &'a mut W {
        self.variant(MASK_CNT_SEL_A::HCNT)
    }
    #[doc = "vertical counter (line counter within one frame)"]
    #[inline(always)]
    pub fn vcnt(self) -> &'a mut W {
        self.variant(MASK_CNT_SEL_A::VCNT)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8);
        self.w
    }
}
#[doc = "Reader of field `MASK_CNT`"]
pub type MASK_CNT_R = crate::R<u16, u16>;
#[doc = "Write proxy for field `MASK_CNT`"]
pub struct MASK_CNT_W<'a> {
    w: &'a mut W,
}
impl<'a> MASK_CNT_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u16) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x0fff << 12)) | (((value as u32) & 0x0fff) << 12);
        self.w
    }
}
#[doc = "state_mask = (FS|FB|FD|FE) and (LS|LB|LD|LE) , select any combination of scan states as reference point for local counter to start ticking\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum STATE_MASK_A {
    #[doc = "1: FRAME SYNC"]
    FS = 1,
    #[doc = "2: FRAME BEGIN"]
    FB = 2,
    #[doc = "4: FRAME DATA"]
    FD = 4,
    #[doc = "8: FRAME END"]
    FE = 8,
    #[doc = "16: LINE SYNC"]
    LS = 16,
    #[doc = "32: LINE BEGIN"]
    LB = 32,
    #[doc = "64: LINE DATA"]
    LD = 64,
    #[doc = "128: LINE END"]
    LE = 128,
}
impl From<STATE_MASK_A> for u8 {
    #[inline(always)]
    fn from(variant: STATE_MASK_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `STATE_MASK`"]
pub type STATE_MASK_R = crate::R<u8, STATE_MASK_A>;
impl STATE_MASK_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, STATE_MASK_A> {
        use crate::Variant::*;
        match self.bits {
            1 => Val(STATE_MASK_A::FS),
            2 => Val(STATE_MASK_A::FB),
            4 => Val(STATE_MASK_A::FD),
            8 => Val(STATE_MASK_A::FE),
            16 => Val(STATE_MASK_A::LS),
            32 => Val(STATE_MASK_A::LB),
            64 => Val(STATE_MASK_A::LD),
            128 => Val(STATE_MASK_A::LE),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `FS`"]
    #[inline(always)]
    pub fn is_fs(&self) -> bool {
        *self == STATE_MASK_A::FS
    }
    #[doc = "Checks if the value of the field is `FB`"]
    #[inline(always)]
    pub fn is_fb(&self) -> bool {
        *self == STATE_MASK_A::FB
    }
    #[doc = "Checks if the value of the field is `FD`"]
    #[inline(always)]
    pub fn is_fd(&self) -> bool {
        *self == STATE_MASK_A::FD
    }
    #[doc = "Checks if the value of the field is `FE`"]
    #[inline(always)]
    pub fn is_fe(&self) -> bool {
        *self == STATE_MASK_A::FE
    }
    #[doc = "Checks if the value of the field is `LS`"]
    #[inline(always)]
    pub fn is_ls(&self) -> bool {
        *self == STATE_MASK_A::LS
    }
    #[doc = "Checks if the value of the field is `LB`"]
    #[inline(always)]
    pub fn is_lb(&self) -> bool {
        *self == STATE_MASK_A::LB
    }
    #[doc = "Checks if the value of the field is `LD`"]
    #[inline(always)]
    pub fn is_ld(&self) -> bool {
        *self == STATE_MASK_A::LD
    }
    #[doc = "Checks if the value of the field is `LE`"]
    #[inline(always)]
    pub fn is_le(&self) -> bool {
        *self == STATE_MASK_A::LE
    }
}
#[doc = "Write proxy for field `STATE_MASK`"]
pub struct STATE_MASK_W<'a> {
    w: &'a mut W,
}
impl<'a> STATE_MASK_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: STATE_MASK_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "FRAME SYNC"]
    #[inline(always)]
    pub fn fs(self) -> &'a mut W {
        self.variant(STATE_MASK_A::FS)
    }
    #[doc = "FRAME BEGIN"]
    #[inline(always)]
    pub fn fb(self) -> &'a mut W {
        self.variant(STATE_MASK_A::FB)
    }
    #[doc = "FRAME DATA"]
    #[inline(always)]
    pub fn fd(self) -> &'a mut W {
        self.variant(STATE_MASK_A::FD)
    }
    #[doc = "FRAME END"]
    #[inline(always)]
    pub fn fe(self) -> &'a mut W {
        self.variant(STATE_MASK_A::FE)
    }
    #[doc = "LINE SYNC"]
    #[inline(always)]
    pub fn ls(self) -> &'a mut W {
        self.variant(STATE_MASK_A::LS)
    }
    #[doc = "LINE BEGIN"]
    #[inline(always)]
    pub fn lb(self) -> &'a mut W {
        self.variant(STATE_MASK_A::LB)
    }
    #[doc = "LINE DATA"]
    #[inline(always)]
    pub fn ld(self) -> &'a mut W {
        self.variant(STATE_MASK_A::LD)
    }
    #[doc = "LINE END"]
    #[inline(always)]
    pub fn le(self) -> &'a mut W {
        self.variant(STATE_MASK_A::LE)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24);
        self.w
    }
}
impl R {
    #[doc = "Bit 0 - Enable pigeon Mode on this signal"]
    #[inline(always)]
    pub fn en(&self) -> EN_R {
        EN_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bit 1 - Polarity of signal output"]
    #[inline(always)]
    pub fn pol(&self) -> POL_R {
        POL_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bits 2:3 - Event to incrment local counter"]
    #[inline(always)]
    pub fn inc_sel(&self) -> INC_SEL_R {
        INC_SEL_R::new(((self.bits >> 2) & 0x03) as u8)
    }
    #[doc = "Bits 4:7 - offset on pclk unit"]
    #[inline(always)]
    pub fn offset(&self) -> OFFSET_R {
        OFFSET_R::new(((self.bits >> 4) & 0x0f) as u8)
    }
    #[doc = "Bits 8:11 - select global counters as mask condition, use together with MASK_CNT"]
    #[inline(always)]
    pub fn mask_cnt_sel(&self) -> MASK_CNT_SEL_R {
        MASK_CNT_SEL_R::new(((self.bits >> 8) & 0x0f) as u8)
    }
    #[doc = "Bits 12:23 - When the global counter selected through MASK_CNT_SEL matches value in this reg, pigeon local counter start ticking"]
    #[inline(always)]
    pub fn mask_cnt(&self) -> MASK_CNT_R {
        MASK_CNT_R::new(((self.bits >> 12) & 0x0fff) as u16)
    }
    #[doc = "Bits 24:31 - state_mask = (FS|FB|FD|FE) and (LS|LB|LD|LE) , select any combination of scan states as reference point for local counter to start ticking"]
    #[inline(always)]
    pub fn state_mask(&self) -> STATE_MASK_R {
        STATE_MASK_R::new(((self.bits >> 24) & 0xff) as u8)
    }
}
impl W {
    #[doc = "Bit 0 - Enable pigeon Mode on this signal"]
    #[inline(always)]
    pub fn en(&mut self) -> EN_W {
        EN_W { w: self }
    }
    #[doc = "Bit 1 - Polarity of signal output"]
    #[inline(always)]
    pub fn pol(&mut self) -> POL_W {
        POL_W { w: self }
    }
    #[doc = "Bits 2:3 - Event to incrment local counter"]
    #[inline(always)]
    pub fn inc_sel(&mut self) -> INC_SEL_W {
        INC_SEL_W { w: self }
    }
    #[doc = "Bits 4:7 - offset on pclk unit"]
    #[inline(always)]
    pub fn offset(&mut self) -> OFFSET_W {
        OFFSET_W { w: self }
    }
    #[doc = "Bits 8:11 - select global counters as mask condition, use together with MASK_CNT"]
    #[inline(always)]
    pub fn mask_cnt_sel(&mut self) -> MASK_CNT_SEL_W {
        MASK_CNT_SEL_W { w: self }
    }
    #[doc = "Bits 12:23 - When the global counter selected through MASK_CNT_SEL matches value in this reg, pigeon local counter start ticking"]
    #[inline(always)]
    pub fn mask_cnt(&mut self) -> MASK_CNT_W {
        MASK_CNT_W { w: self }
    }
    #[doc = "Bits 24:31 - state_mask = (FS|FB|FD|FE) and (LS|LB|LD|LE) , select any combination of scan states as reference point for local counter to start ticking"]
    #[inline(always)]
    pub fn state_mask(&mut self) -> STATE_MASK_W {
        STATE_MASK_W { w: self }
    }
}