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
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
#[doc = "Register `csic_dma_cfg` reader"]
pub struct R(crate::R<CSIC_DMA_CFG_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CSIC_DMA_CFG_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<CSIC_DMA_CFG_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<CSIC_DMA_CFG_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `csic_dma_cfg` writer"]
pub struct W(crate::W<CSIC_DMA_CFG_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CSIC_DMA_CFG_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<CSIC_DMA_CFG_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<CSIC_DMA_CFG_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `min_sdr_wr_size` reader - Minimum size of SDRAM block write"]
pub type MIN_SDR_WR_SIZE_R = crate::FieldReader<u8, MIN_SDR_WR_SIZE_A>;
#[doc = "Minimum size of SDRAM block write\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum MIN_SDR_WR_SIZE_A {
    #[doc = "0: 256 bytes (if hflip is enabled, always select 256 bytes)"]
    _256 = 0,
    #[doc = "1: 512 bytes"]
    _512 = 1,
    #[doc = "2: 1K bytes"]
    _1K = 2,
    #[doc = "3: 2K bytes"]
    _2K = 3,
}
impl From<MIN_SDR_WR_SIZE_A> for u8 {
    #[inline(always)]
    fn from(variant: MIN_SDR_WR_SIZE_A) -> Self {
        variant as _
    }
}
impl MIN_SDR_WR_SIZE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> MIN_SDR_WR_SIZE_A {
        match self.bits {
            0 => MIN_SDR_WR_SIZE_A::_256,
            1 => MIN_SDR_WR_SIZE_A::_512,
            2 => MIN_SDR_WR_SIZE_A::_1K,
            3 => MIN_SDR_WR_SIZE_A::_2K,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_256`"]
    #[inline(always)]
    pub fn is_256(&self) -> bool {
        *self == MIN_SDR_WR_SIZE_A::_256
    }
    #[doc = "Checks if the value of the field is `_512`"]
    #[inline(always)]
    pub fn is_512(&self) -> bool {
        *self == MIN_SDR_WR_SIZE_A::_512
    }
    #[doc = "Checks if the value of the field is `_1K`"]
    #[inline(always)]
    pub fn is_1k(&self) -> bool {
        *self == MIN_SDR_WR_SIZE_A::_1K
    }
    #[doc = "Checks if the value of the field is `_2K`"]
    #[inline(always)]
    pub fn is_2k(&self) -> bool {
        *self == MIN_SDR_WR_SIZE_A::_2K
    }
}
#[doc = "Field `min_sdr_wr_size` writer - Minimum size of SDRAM block write"]
pub type MIN_SDR_WR_SIZE_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, CSIC_DMA_CFG_SPEC, u8, MIN_SDR_WR_SIZE_A, 2, O>;
impl<'a, const O: u8> MIN_SDR_WR_SIZE_W<'a, O> {
    #[doc = "256 bytes (if hflip is enabled, always select 256 bytes)"]
    #[inline(always)]
    pub fn _256(self) -> &'a mut W {
        self.variant(MIN_SDR_WR_SIZE_A::_256)
    }
    #[doc = "512 bytes"]
    #[inline(always)]
    pub fn _512(self) -> &'a mut W {
        self.variant(MIN_SDR_WR_SIZE_A::_512)
    }
    #[doc = "1K bytes"]
    #[inline(always)]
    pub fn _1k(self) -> &'a mut W {
        self.variant(MIN_SDR_WR_SIZE_A::_1K)
    }
    #[doc = "2K bytes"]
    #[inline(always)]
    pub fn _2k(self) -> &'a mut W {
        self.variant(MIN_SDR_WR_SIZE_A::_2K)
    }
}
#[doc = "Field `fps_ds` reader - Fps down sample"]
pub type FPS_DS_R = crate::FieldReader<u8, FPS_DS_A>;
#[doc = "Fps down sample\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FPS_DS_A {
    #[doc = "0: no down sample"]
    NO_DOWN_SAMPLE = 0,
    #[doc = "2: 1/3 fps, only receives the first frame every 3 frames"]
    _1_3 = 2,
    #[doc = "3: 1/4 fps, only receives the first frame every 4 frames"]
    _1_4 = 3,
    #[doc = "4: 1/5 fps, only receives the first frame every 5 frames"]
    _1_5 = 4,
    #[doc = "5: 1/6 fps, only receives the first frame every 6 frames"]
    _1_6 = 5,
    #[doc = "6: 1/7 fps, only receives the first frame every 7 frames"]
    _1_7 = 6,
    #[doc = "7: 1/8 fps, only receives the first frame every 8 frames"]
    _1_8 = 7,
    #[doc = "8: 1/9 fps, only receives the first frame every 9 frames"]
    _1_9 = 8,
    #[doc = "9: 1/10 fps, only receives the first frame every 10 frames"]
    _1_10 = 9,
    #[doc = "10: 1/11 fps, only receives the first frame every 11 frames"]
    _1_11 = 10,
    #[doc = "11: 1/12 fps, only receives the first frame every 12 frames"]
    _1_12 = 11,
    #[doc = "12: 1/13 fps, only receives the first frame every 13 frames"]
    _1_13 = 12,
    #[doc = "13: 1/14 fps, only receives the first frame every 14 frames"]
    _1_14 = 13,
    #[doc = "14: 1/15 fps, only receives the first frame every 15 frames"]
    _1_15 = 14,
    #[doc = "15: 1/16 fps, only receives the first frame every 16 frames"]
    _1_16 = 15,
}
impl From<FPS_DS_A> for u8 {
    #[inline(always)]
    fn from(variant: FPS_DS_A) -> Self {
        variant as _
    }
}
impl FPS_DS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<FPS_DS_A> {
        match self.bits {
            0 => Some(FPS_DS_A::NO_DOWN_SAMPLE),
            2 => Some(FPS_DS_A::_1_3),
            3 => Some(FPS_DS_A::_1_4),
            4 => Some(FPS_DS_A::_1_5),
            5 => Some(FPS_DS_A::_1_6),
            6 => Some(FPS_DS_A::_1_7),
            7 => Some(FPS_DS_A::_1_8),
            8 => Some(FPS_DS_A::_1_9),
            9 => Some(FPS_DS_A::_1_10),
            10 => Some(FPS_DS_A::_1_11),
            11 => Some(FPS_DS_A::_1_12),
            12 => Some(FPS_DS_A::_1_13),
            13 => Some(FPS_DS_A::_1_14),
            14 => Some(FPS_DS_A::_1_15),
            15 => Some(FPS_DS_A::_1_16),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `NO_DOWN_SAMPLE`"]
    #[inline(always)]
    pub fn is_no_down_sample(&self) -> bool {
        *self == FPS_DS_A::NO_DOWN_SAMPLE
    }
    #[doc = "Checks if the value of the field is `_1_3`"]
    #[inline(always)]
    pub fn is_1_3(&self) -> bool {
        *self == FPS_DS_A::_1_3
    }
    #[doc = "Checks if the value of the field is `_1_4`"]
    #[inline(always)]
    pub fn is_1_4(&self) -> bool {
        *self == FPS_DS_A::_1_4
    }
    #[doc = "Checks if the value of the field is `_1_5`"]
    #[inline(always)]
    pub fn is_1_5(&self) -> bool {
        *self == FPS_DS_A::_1_5
    }
    #[doc = "Checks if the value of the field is `_1_6`"]
    #[inline(always)]
    pub fn is_1_6(&self) -> bool {
        *self == FPS_DS_A::_1_6
    }
    #[doc = "Checks if the value of the field is `_1_7`"]
    #[inline(always)]
    pub fn is_1_7(&self) -> bool {
        *self == FPS_DS_A::_1_7
    }
    #[doc = "Checks if the value of the field is `_1_8`"]
    #[inline(always)]
    pub fn is_1_8(&self) -> bool {
        *self == FPS_DS_A::_1_8
    }
    #[doc = "Checks if the value of the field is `_1_9`"]
    #[inline(always)]
    pub fn is_1_9(&self) -> bool {
        *self == FPS_DS_A::_1_9
    }
    #[doc = "Checks if the value of the field is `_1_10`"]
    #[inline(always)]
    pub fn is_1_10(&self) -> bool {
        *self == FPS_DS_A::_1_10
    }
    #[doc = "Checks if the value of the field is `_1_11`"]
    #[inline(always)]
    pub fn is_1_11(&self) -> bool {
        *self == FPS_DS_A::_1_11
    }
    #[doc = "Checks if the value of the field is `_1_12`"]
    #[inline(always)]
    pub fn is_1_12(&self) -> bool {
        *self == FPS_DS_A::_1_12
    }
    #[doc = "Checks if the value of the field is `_1_13`"]
    #[inline(always)]
    pub fn is_1_13(&self) -> bool {
        *self == FPS_DS_A::_1_13
    }
    #[doc = "Checks if the value of the field is `_1_14`"]
    #[inline(always)]
    pub fn is_1_14(&self) -> bool {
        *self == FPS_DS_A::_1_14
    }
    #[doc = "Checks if the value of the field is `_1_15`"]
    #[inline(always)]
    pub fn is_1_15(&self) -> bool {
        *self == FPS_DS_A::_1_15
    }
    #[doc = "Checks if the value of the field is `_1_16`"]
    #[inline(always)]
    pub fn is_1_16(&self) -> bool {
        *self == FPS_DS_A::_1_16
    }
}
#[doc = "Field `fps_ds` writer - Fps down sample"]
pub type FPS_DS_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, CSIC_DMA_CFG_SPEC, u8, FPS_DS_A, 4, O>;
impl<'a, const O: u8> FPS_DS_W<'a, O> {
    #[doc = "no down sample"]
    #[inline(always)]
    pub fn no_down_sample(self) -> &'a mut W {
        self.variant(FPS_DS_A::NO_DOWN_SAMPLE)
    }
    #[doc = "1/3 fps, only receives the first frame every 3 frames"]
    #[inline(always)]
    pub fn _1_3(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_3)
    }
    #[doc = "1/4 fps, only receives the first frame every 4 frames"]
    #[inline(always)]
    pub fn _1_4(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_4)
    }
    #[doc = "1/5 fps, only receives the first frame every 5 frames"]
    #[inline(always)]
    pub fn _1_5(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_5)
    }
    #[doc = "1/6 fps, only receives the first frame every 6 frames"]
    #[inline(always)]
    pub fn _1_6(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_6)
    }
    #[doc = "1/7 fps, only receives the first frame every 7 frames"]
    #[inline(always)]
    pub fn _1_7(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_7)
    }
    #[doc = "1/8 fps, only receives the first frame every 8 frames"]
    #[inline(always)]
    pub fn _1_8(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_8)
    }
    #[doc = "1/9 fps, only receives the first frame every 9 frames"]
    #[inline(always)]
    pub fn _1_9(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_9)
    }
    #[doc = "1/10 fps, only receives the first frame every 10 frames"]
    #[inline(always)]
    pub fn _1_10(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_10)
    }
    #[doc = "1/11 fps, only receives the first frame every 11 frames"]
    #[inline(always)]
    pub fn _1_11(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_11)
    }
    #[doc = "1/12 fps, only receives the first frame every 12 frames"]
    #[inline(always)]
    pub fn _1_12(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_12)
    }
    #[doc = "1/13 fps, only receives the first frame every 13 frames"]
    #[inline(always)]
    pub fn _1_13(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_13)
    }
    #[doc = "1/14 fps, only receives the first frame every 14 frames"]
    #[inline(always)]
    pub fn _1_14(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_14)
    }
    #[doc = "1/15 fps, only receives the first frame every 15 frames"]
    #[inline(always)]
    pub fn _1_15(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_15)
    }
    #[doc = "1/16 fps, only receives the first frame every 16 frames"]
    #[inline(always)]
    pub fn _1_16(self) -> &'a mut W {
        self.variant(FPS_DS_A::_1_16)
    }
}
#[doc = "Field `field_sel` reader - Field selection"]
pub type FIELD_SEL_R = crate::FieldReader<u8, FIELD_SEL_A>;
#[doc = "Field selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FIELD_SEL_A {
    #[doc = "0: Capturing with field 0"]
    FIELD_0 = 0,
    #[doc = "1: Capturing with field 1"]
    FIELD_1 = 1,
    #[doc = "2: Capturing with either field"]
    EITHER_FIELD = 2,
}
impl From<FIELD_SEL_A> for u8 {
    #[inline(always)]
    fn from(variant: FIELD_SEL_A) -> Self {
        variant as _
    }
}
impl FIELD_SEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<FIELD_SEL_A> {
        match self.bits {
            0 => Some(FIELD_SEL_A::FIELD_0),
            1 => Some(FIELD_SEL_A::FIELD_1),
            2 => Some(FIELD_SEL_A::EITHER_FIELD),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `FIELD_0`"]
    #[inline(always)]
    pub fn is_field_0(&self) -> bool {
        *self == FIELD_SEL_A::FIELD_0
    }
    #[doc = "Checks if the value of the field is `FIELD_1`"]
    #[inline(always)]
    pub fn is_field_1(&self) -> bool {
        *self == FIELD_SEL_A::FIELD_1
    }
    #[doc = "Checks if the value of the field is `EITHER_FIELD`"]
    #[inline(always)]
    pub fn is_either_field(&self) -> bool {
        *self == FIELD_SEL_A::EITHER_FIELD
    }
}
#[doc = "Field `field_sel` writer - Field selection"]
pub type FIELD_SEL_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, CSIC_DMA_CFG_SPEC, u8, FIELD_SEL_A, 2, O>;
impl<'a, const O: u8> FIELD_SEL_W<'a, O> {
    #[doc = "Capturing with field 0"]
    #[inline(always)]
    pub fn field_0(self) -> &'a mut W {
        self.variant(FIELD_SEL_A::FIELD_0)
    }
    #[doc = "Capturing with field 1"]
    #[inline(always)]
    pub fn field_1(self) -> &'a mut W {
        self.variant(FIELD_SEL_A::FIELD_1)
    }
    #[doc = "Capturing with either field"]
    #[inline(always)]
    pub fn either_field(self) -> &'a mut W {
        self.variant(FIELD_SEL_A::EITHER_FIELD)
    }
}
#[doc = "Field `hflip_en` reader - Horizontal flip enable\n\nWhen enabled, the received data will be arranged in horizontal flip."]
pub type HFLIP_EN_R = crate::BitReader<HFLIP_EN_A>;
#[doc = "Horizontal flip enable\n\nWhen enabled, the received data will be arranged in horizontal flip.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HFLIP_EN_A {
    #[doc = "0: Disable"]
    DISABLE = 0,
    #[doc = "1: Enable"]
    ENABLE = 1,
}
impl From<HFLIP_EN_A> for bool {
    #[inline(always)]
    fn from(variant: HFLIP_EN_A) -> Self {
        variant as u8 != 0
    }
}
impl HFLIP_EN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HFLIP_EN_A {
        match self.bits {
            false => HFLIP_EN_A::DISABLE,
            true => HFLIP_EN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == HFLIP_EN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == HFLIP_EN_A::ENABLE
    }
}
#[doc = "Field `hflip_en` writer - Horizontal flip enable\n\nWhen enabled, the received data will be arranged in horizontal flip."]
pub type HFLIP_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSIC_DMA_CFG_SPEC, HFLIP_EN_A, O>;
impl<'a, const O: u8> HFLIP_EN_W<'a, O> {
    #[doc = "Disable"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(HFLIP_EN_A::DISABLE)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(HFLIP_EN_A::ENABLE)
    }
}
#[doc = "Field `vflip_en` reader - Vertical flip enable\n\nWhen enabled, the received data will be arranged in vertical flip."]
pub type VFLIP_EN_R = crate::BitReader<VFLIP_EN_A>;
#[doc = "Vertical flip enable\n\nWhen enabled, the received data will be arranged in vertical flip.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VFLIP_EN_A {
    #[doc = "0: Disable"]
    DISABLE = 0,
    #[doc = "1: Enable"]
    ENABLE = 1,
}
impl From<VFLIP_EN_A> for bool {
    #[inline(always)]
    fn from(variant: VFLIP_EN_A) -> Self {
        variant as u8 != 0
    }
}
impl VFLIP_EN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> VFLIP_EN_A {
        match self.bits {
            false => VFLIP_EN_A::DISABLE,
            true => VFLIP_EN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == VFLIP_EN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == VFLIP_EN_A::ENABLE
    }
}
#[doc = "Field `vflip_en` writer - Vertical flip enable\n\nWhen enabled, the received data will be arranged in vertical flip."]
pub type VFLIP_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSIC_DMA_CFG_SPEC, VFLIP_EN_A, O>;
impl<'a, const O: u8> VFLIP_EN_W<'a, O> {
    #[doc = "Disable"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(VFLIP_EN_A::DISABLE)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(VFLIP_EN_A::ENABLE)
    }
}
#[doc = "Field `output_fmt` reader - Output data format\n\nWhen the input format is set to RAW stream\n\n0000: field-raw-8\n\n0001: field-raw-10\n\n0010: field-raw-12\n\n0011: reserved\n\n0100: field-rgb565\n\n0101: field-rgb888\n\n0110: field-prgb888\n\n0111: reserved\n\n1000: frame-raw-8\n\n1001: frame-raw-10\n\n1010: frame-raw-12\n\n1011: reserved\n\n1100: frame-rgb565\n\n1101: frame-rgb888\n\n1110: frame-prgb888\n\n1111: reserved\n\nWhen the input format is set to YUV422\n\n0000: field planar YCbCr 422\n\n0001: field planar YCbCr 420\n\n0010: frame planar YCbCr 420\n\n0011: frame planar YCbCr 422\n\n0100: field planar YCbCr 422 UV combined (UV sequence)\n\n0101: field planar YCbCr 420 UV combined (UV sequence)\n\n0110: frame planar YCbCr 420 UV combined (UV sequence)\n\n0111: frame planar YCbCr 422 UV combined (UV sequence)\n\n1000: filed planar YCbCr 422 UV combined (VU sequence)\n\n1001: field planar YCbCr 420 UV combined (VU sequence)\n\n1010: frame planar YCbCr 420 UV combined (VU sequence)\n\n1011: frame planar YCbCr 422 UV combined (VU sequence)\n\n1100: reserved\n\n1101: field YCbCr 400\n\n1110: reserved\n\n1111: frame YCbCr 400\n\nWhen the input format is set to YUV420\n\n0000: reserved\n\n0001: field planar YCbCr 420\n\n0010: frame planar YCbCr 420\n\n0011: reserved\n\n0100: reserved\n\n0101: field planar YCbCr 420 UV combined (UV sequence)\n\n0110: frame planar YCbCr 420 UV combined (UV sequence) 0111~1000: reserved\n\n1001: field planar YCbCr 420 UV combined (VU sequence)\n\n1010: frame planar YCbCr 420 UV combined (VU sequence) 1011~1100: reserved\n\n1101: field YCbCr 400\n\n1110: reserved\n\n1111: frame YCbCr 400"]
pub type OUTPUT_FMT_R = crate::FieldReader<u8, u8>;
#[doc = "Field `output_fmt` writer - Output data format\n\nWhen the input format is set to RAW stream\n\n0000: field-raw-8\n\n0001: field-raw-10\n\n0010: field-raw-12\n\n0011: reserved\n\n0100: field-rgb565\n\n0101: field-rgb888\n\n0110: field-prgb888\n\n0111: reserved\n\n1000: frame-raw-8\n\n1001: frame-raw-10\n\n1010: frame-raw-12\n\n1011: reserved\n\n1100: frame-rgb565\n\n1101: frame-rgb888\n\n1110: frame-prgb888\n\n1111: reserved\n\nWhen the input format is set to YUV422\n\n0000: field planar YCbCr 422\n\n0001: field planar YCbCr 420\n\n0010: frame planar YCbCr 420\n\n0011: frame planar YCbCr 422\n\n0100: field planar YCbCr 422 UV combined (UV sequence)\n\n0101: field planar YCbCr 420 UV combined (UV sequence)\n\n0110: frame planar YCbCr 420 UV combined (UV sequence)\n\n0111: frame planar YCbCr 422 UV combined (UV sequence)\n\n1000: filed planar YCbCr 422 UV combined (VU sequence)\n\n1001: field planar YCbCr 420 UV combined (VU sequence)\n\n1010: frame planar YCbCr 420 UV combined (VU sequence)\n\n1011: frame planar YCbCr 422 UV combined (VU sequence)\n\n1100: reserved\n\n1101: field YCbCr 400\n\n1110: reserved\n\n1111: frame YCbCr 400\n\nWhen the input format is set to YUV420\n\n0000: reserved\n\n0001: field planar YCbCr 420\n\n0010: frame planar YCbCr 420\n\n0011: reserved\n\n0100: reserved\n\n0101: field planar YCbCr 420 UV combined (UV sequence)\n\n0110: frame planar YCbCr 420 UV combined (UV sequence) 0111~1000: reserved\n\n1001: field planar YCbCr 420 UV combined (VU sequence)\n\n1010: frame planar YCbCr 420 UV combined (VU sequence) 1011~1100: reserved\n\n1101: field YCbCr 400\n\n1110: reserved\n\n1111: frame YCbCr 400"]
pub type OUTPUT_FMT_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, CSIC_DMA_CFG_SPEC, u8, u8, 4, O>;
#[doc = "Field `yuv_10bit_store_configuration` reader - 10-bit store configuration"]
pub type YUV_10BIT_STORE_CONFIGURATION_R = crate::BitReader<YUV_10BIT_STORE_CONFIGURATION_A>;
#[doc = "10-bit store configuration\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum YUV_10BIT_STORE_CONFIGURATION_A {
    #[doc = "0: YUV 10-bit stored in low 10-bit of a 16-bit word"]
    LOW = 0,
    #[doc = "1: YUV 10-bit stored in high 10-bit of a 16-bit word"]
    HIGH = 1,
}
impl From<YUV_10BIT_STORE_CONFIGURATION_A> for bool {
    #[inline(always)]
    fn from(variant: YUV_10BIT_STORE_CONFIGURATION_A) -> Self {
        variant as u8 != 0
    }
}
impl YUV_10BIT_STORE_CONFIGURATION_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> YUV_10BIT_STORE_CONFIGURATION_A {
        match self.bits {
            false => YUV_10BIT_STORE_CONFIGURATION_A::LOW,
            true => YUV_10BIT_STORE_CONFIGURATION_A::HIGH,
        }
    }
    #[doc = "Checks if the value of the field is `LOW`"]
    #[inline(always)]
    pub fn is_low(&self) -> bool {
        *self == YUV_10BIT_STORE_CONFIGURATION_A::LOW
    }
    #[doc = "Checks if the value of the field is `HIGH`"]
    #[inline(always)]
    pub fn is_high(&self) -> bool {
        *self == YUV_10BIT_STORE_CONFIGURATION_A::HIGH
    }
}
#[doc = "Field `yuv_10bit_store_configuration` writer - 10-bit store configuration"]
pub type YUV_10BIT_STORE_CONFIGURATION_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, CSIC_DMA_CFG_SPEC, YUV_10BIT_STORE_CONFIGURATION_A, O>;
impl<'a, const O: u8> YUV_10BIT_STORE_CONFIGURATION_W<'a, O> {
    #[doc = "YUV 10-bit stored in low 10-bit of a 16-bit word"]
    #[inline(always)]
    pub fn low(self) -> &'a mut W {
        self.variant(YUV_10BIT_STORE_CONFIGURATION_A::LOW)
    }
    #[doc = "YUV 10-bit stored in high 10-bit of a 16-bit word"]
    #[inline(always)]
    pub fn high(self) -> &'a mut W {
        self.variant(YUV_10BIT_STORE_CONFIGURATION_A::HIGH)
    }
}
#[doc = "Field `yuv_10bit_cut_8bit` reader - 10-bit input cut to 8-bit"]
pub type YUV_10BIT_CUT_8BIT_R = crate::BitReader<YUV_10BIT_CUT_8BIT_A>;
#[doc = "10-bit input cut to 8-bit\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum YUV_10BIT_CUT_8BIT_A {
    #[doc = "0: Disable"]
    DISABLE = 0,
    #[doc = "1: Enable"]
    ENABLE = 1,
}
impl From<YUV_10BIT_CUT_8BIT_A> for bool {
    #[inline(always)]
    fn from(variant: YUV_10BIT_CUT_8BIT_A) -> Self {
        variant as u8 != 0
    }
}
impl YUV_10BIT_CUT_8BIT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> YUV_10BIT_CUT_8BIT_A {
        match self.bits {
            false => YUV_10BIT_CUT_8BIT_A::DISABLE,
            true => YUV_10BIT_CUT_8BIT_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == YUV_10BIT_CUT_8BIT_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == YUV_10BIT_CUT_8BIT_A::ENABLE
    }
}
#[doc = "Field `yuv_10bit_cut_8bit` writer - 10-bit input cut to 8-bit"]
pub type YUV_10BIT_CUT_8BIT_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, CSIC_DMA_CFG_SPEC, YUV_10BIT_CUT_8BIT_A, O>;
impl<'a, const O: u8> YUV_10BIT_CUT_8BIT_W<'a, O> {
    #[doc = "Disable"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(YUV_10BIT_CUT_8BIT_A::DISABLE)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(YUV_10BIT_CUT_8BIT_A::ENABLE)
    }
}
#[doc = "Field `pad_val` reader - Padding value when OUTPUT_FMT is prgb888\n\n0x00-0xff"]
pub type PAD_VAL_R = crate::FieldReader<u8, u8>;
#[doc = "Field `pad_val` writer - Padding value when OUTPUT_FMT is prgb888\n\n0x00-0xff"]
pub type PAD_VAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CSIC_DMA_CFG_SPEC, u8, u8, 8, O>;
impl R {
    #[doc = "Bits 0:1 - Minimum size of SDRAM block write"]
    #[inline(always)]
    pub fn min_sdr_wr_size(&self) -> MIN_SDR_WR_SIZE_R {
        MIN_SDR_WR_SIZE_R::new((self.bits & 3) as u8)
    }
    #[doc = "Bits 6:9 - Fps down sample"]
    #[inline(always)]
    pub fn fps_ds(&self) -> FPS_DS_R {
        FPS_DS_R::new(((self.bits >> 6) & 0x0f) as u8)
    }
    #[doc = "Bits 10:11 - Field selection"]
    #[inline(always)]
    pub fn field_sel(&self) -> FIELD_SEL_R {
        FIELD_SEL_R::new(((self.bits >> 10) & 3) as u8)
    }
    #[doc = "Bit 12 - Horizontal flip enable\n\nWhen enabled, the received data will be arranged in horizontal flip."]
    #[inline(always)]
    pub fn hflip_en(&self) -> HFLIP_EN_R {
        HFLIP_EN_R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - Vertical flip enable\n\nWhen enabled, the received data will be arranged in vertical flip."]
    #[inline(always)]
    pub fn vflip_en(&self) -> VFLIP_EN_R {
        VFLIP_EN_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bits 16:19 - Output data format\n\nWhen the input format is set to RAW stream\n\n0000: field-raw-8\n\n0001: field-raw-10\n\n0010: field-raw-12\n\n0011: reserved\n\n0100: field-rgb565\n\n0101: field-rgb888\n\n0110: field-prgb888\n\n0111: reserved\n\n1000: frame-raw-8\n\n1001: frame-raw-10\n\n1010: frame-raw-12\n\n1011: reserved\n\n1100: frame-rgb565\n\n1101: frame-rgb888\n\n1110: frame-prgb888\n\n1111: reserved\n\nWhen the input format is set to YUV422\n\n0000: field planar YCbCr 422\n\n0001: field planar YCbCr 420\n\n0010: frame planar YCbCr 420\n\n0011: frame planar YCbCr 422\n\n0100: field planar YCbCr 422 UV combined (UV sequence)\n\n0101: field planar YCbCr 420 UV combined (UV sequence)\n\n0110: frame planar YCbCr 420 UV combined (UV sequence)\n\n0111: frame planar YCbCr 422 UV combined (UV sequence)\n\n1000: filed planar YCbCr 422 UV combined (VU sequence)\n\n1001: field planar YCbCr 420 UV combined (VU sequence)\n\n1010: frame planar YCbCr 420 UV combined (VU sequence)\n\n1011: frame planar YCbCr 422 UV combined (VU sequence)\n\n1100: reserved\n\n1101: field YCbCr 400\n\n1110: reserved\n\n1111: frame YCbCr 400\n\nWhen the input format is set to YUV420\n\n0000: reserved\n\n0001: field planar YCbCr 420\n\n0010: frame planar YCbCr 420\n\n0011: reserved\n\n0100: reserved\n\n0101: field planar YCbCr 420 UV combined (UV sequence)\n\n0110: frame planar YCbCr 420 UV combined (UV sequence) 0111~1000: reserved\n\n1001: field planar YCbCr 420 UV combined (VU sequence)\n\n1010: frame planar YCbCr 420 UV combined (VU sequence) 1011~1100: reserved\n\n1101: field YCbCr 400\n\n1110: reserved\n\n1111: frame YCbCr 400"]
    #[inline(always)]
    pub fn output_fmt(&self) -> OUTPUT_FMT_R {
        OUTPUT_FMT_R::new(((self.bits >> 16) & 0x0f) as u8)
    }
    #[doc = "Bit 20 - 10-bit store configuration"]
    #[inline(always)]
    pub fn yuv_10bit_store_configuration(&self) -> YUV_10BIT_STORE_CONFIGURATION_R {
        YUV_10BIT_STORE_CONFIGURATION_R::new(((self.bits >> 20) & 1) != 0)
    }
    #[doc = "Bit 21 - 10-bit input cut to 8-bit"]
    #[inline(always)]
    pub fn yuv_10bit_cut_8bit(&self) -> YUV_10BIT_CUT_8BIT_R {
        YUV_10BIT_CUT_8BIT_R::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bits 24:31 - Padding value when OUTPUT_FMT is prgb888\n\n0x00-0xff"]
    #[inline(always)]
    pub fn pad_val(&self) -> PAD_VAL_R {
        PAD_VAL_R::new(((self.bits >> 24) & 0xff) as u8)
    }
}
impl W {
    #[doc = "Bits 0:1 - Minimum size of SDRAM block write"]
    #[inline(always)]
    #[must_use]
    pub fn min_sdr_wr_size(&mut self) -> MIN_SDR_WR_SIZE_W<0> {
        MIN_SDR_WR_SIZE_W::new(self)
    }
    #[doc = "Bits 6:9 - Fps down sample"]
    #[inline(always)]
    #[must_use]
    pub fn fps_ds(&mut self) -> FPS_DS_W<6> {
        FPS_DS_W::new(self)
    }
    #[doc = "Bits 10:11 - Field selection"]
    #[inline(always)]
    #[must_use]
    pub fn field_sel(&mut self) -> FIELD_SEL_W<10> {
        FIELD_SEL_W::new(self)
    }
    #[doc = "Bit 12 - Horizontal flip enable\n\nWhen enabled, the received data will be arranged in horizontal flip."]
    #[inline(always)]
    #[must_use]
    pub fn hflip_en(&mut self) -> HFLIP_EN_W<12> {
        HFLIP_EN_W::new(self)
    }
    #[doc = "Bit 13 - Vertical flip enable\n\nWhen enabled, the received data will be arranged in vertical flip."]
    #[inline(always)]
    #[must_use]
    pub fn vflip_en(&mut self) -> VFLIP_EN_W<13> {
        VFLIP_EN_W::new(self)
    }
    #[doc = "Bits 16:19 - Output data format\n\nWhen the input format is set to RAW stream\n\n0000: field-raw-8\n\n0001: field-raw-10\n\n0010: field-raw-12\n\n0011: reserved\n\n0100: field-rgb565\n\n0101: field-rgb888\n\n0110: field-prgb888\n\n0111: reserved\n\n1000: frame-raw-8\n\n1001: frame-raw-10\n\n1010: frame-raw-12\n\n1011: reserved\n\n1100: frame-rgb565\n\n1101: frame-rgb888\n\n1110: frame-prgb888\n\n1111: reserved\n\nWhen the input format is set to YUV422\n\n0000: field planar YCbCr 422\n\n0001: field planar YCbCr 420\n\n0010: frame planar YCbCr 420\n\n0011: frame planar YCbCr 422\n\n0100: field planar YCbCr 422 UV combined (UV sequence)\n\n0101: field planar YCbCr 420 UV combined (UV sequence)\n\n0110: frame planar YCbCr 420 UV combined (UV sequence)\n\n0111: frame planar YCbCr 422 UV combined (UV sequence)\n\n1000: filed planar YCbCr 422 UV combined (VU sequence)\n\n1001: field planar YCbCr 420 UV combined (VU sequence)\n\n1010: frame planar YCbCr 420 UV combined (VU sequence)\n\n1011: frame planar YCbCr 422 UV combined (VU sequence)\n\n1100: reserved\n\n1101: field YCbCr 400\n\n1110: reserved\n\n1111: frame YCbCr 400\n\nWhen the input format is set to YUV420\n\n0000: reserved\n\n0001: field planar YCbCr 420\n\n0010: frame planar YCbCr 420\n\n0011: reserved\n\n0100: reserved\n\n0101: field planar YCbCr 420 UV combined (UV sequence)\n\n0110: frame planar YCbCr 420 UV combined (UV sequence) 0111~1000: reserved\n\n1001: field planar YCbCr 420 UV combined (VU sequence)\n\n1010: frame planar YCbCr 420 UV combined (VU sequence) 1011~1100: reserved\n\n1101: field YCbCr 400\n\n1110: reserved\n\n1111: frame YCbCr 400"]
    #[inline(always)]
    #[must_use]
    pub fn output_fmt(&mut self) -> OUTPUT_FMT_W<16> {
        OUTPUT_FMT_W::new(self)
    }
    #[doc = "Bit 20 - 10-bit store configuration"]
    #[inline(always)]
    #[must_use]
    pub fn yuv_10bit_store_configuration(&mut self) -> YUV_10BIT_STORE_CONFIGURATION_W<20> {
        YUV_10BIT_STORE_CONFIGURATION_W::new(self)
    }
    #[doc = "Bit 21 - 10-bit input cut to 8-bit"]
    #[inline(always)]
    #[must_use]
    pub fn yuv_10bit_cut_8bit(&mut self) -> YUV_10BIT_CUT_8BIT_W<21> {
        YUV_10BIT_CUT_8BIT_W::new(self)
    }
    #[doc = "Bits 24:31 - Padding value when OUTPUT_FMT is prgb888\n\n0x00-0xff"]
    #[inline(always)]
    #[must_use]
    pub fn pad_val(&mut self) -> PAD_VAL_W<24> {
        PAD_VAL_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "CSIC DMA Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csic_dma_cfg](index.html) module"]
pub struct CSIC_DMA_CFG_SPEC;
impl crate::RegisterSpec for CSIC_DMA_CFG_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [csic_dma_cfg::R](R) reader structure"]
impl crate::Readable for CSIC_DMA_CFG_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [csic_dma_cfg::W](W) writer structure"]
impl crate::Writable for CSIC_DMA_CFG_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets csic_dma_cfg to value 0"]
impl crate::Resettable for CSIC_DMA_CFG_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}