1pub type R = crate::R<CRrs>;
3pub type W = crate::W<CRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum CAPTURE {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<CAPTURE> for bool {
17 #[inline(always)]
18 fn from(variant: CAPTURE) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type CAPTURE_R = crate::BitReader<CAPTURE>;
24impl CAPTURE_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> CAPTURE {
28 match self.bits {
29 false => CAPTURE::Disabled,
30 true => CAPTURE::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == CAPTURE::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == CAPTURE::Enabled
42 }
43}
44pub type CAPTURE_W<'a, REG> = crate::BitWriter<'a, REG, CAPTURE>;
46impl<'a, REG> CAPTURE_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn disabled(self) -> &'a mut crate::W<REG> {
53 self.variant(CAPTURE::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(CAPTURE::Enabled)
59 }
60}
61#[cfg_attr(feature = "defmt", derive(defmt::Format))]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum CM {
67 Continuous = 0,
69 Snapshot = 1,
71}
72impl From<CM> for bool {
73 #[inline(always)]
74 fn from(variant: CM) -> Self {
75 variant as u8 != 0
76 }
77}
78pub type CM_R = crate::BitReader<CM>;
80impl CM_R {
81 #[inline(always)]
83 pub const fn variant(&self) -> CM {
84 match self.bits {
85 false => CM::Continuous,
86 true => CM::Snapshot,
87 }
88 }
89 #[inline(always)]
91 pub fn is_continuous(&self) -> bool {
92 *self == CM::Continuous
93 }
94 #[inline(always)]
96 pub fn is_snapshot(&self) -> bool {
97 *self == CM::Snapshot
98 }
99}
100pub type CM_W<'a, REG> = crate::BitWriter<'a, REG, CM>;
102impl<'a, REG> CM_W<'a, REG>
103where
104 REG: crate::Writable + crate::RegisterSpec,
105{
106 #[inline(always)]
108 pub fn continuous(self) -> &'a mut crate::W<REG> {
109 self.variant(CM::Continuous)
110 }
111 #[inline(always)]
113 pub fn snapshot(self) -> &'a mut crate::W<REG> {
114 self.variant(CM::Snapshot)
115 }
116}
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
122pub enum CROP {
123 Full = 0,
125 Cropped = 1,
127}
128impl From<CROP> for bool {
129 #[inline(always)]
130 fn from(variant: CROP) -> Self {
131 variant as u8 != 0
132 }
133}
134pub type CROP_R = crate::BitReader<CROP>;
136impl CROP_R {
137 #[inline(always)]
139 pub const fn variant(&self) -> CROP {
140 match self.bits {
141 false => CROP::Full,
142 true => CROP::Cropped,
143 }
144 }
145 #[inline(always)]
147 pub fn is_full(&self) -> bool {
148 *self == CROP::Full
149 }
150 #[inline(always)]
152 pub fn is_cropped(&self) -> bool {
153 *self == CROP::Cropped
154 }
155}
156pub type CROP_W<'a, REG> = crate::BitWriter<'a, REG, CROP>;
158impl<'a, REG> CROP_W<'a, REG>
159where
160 REG: crate::Writable + crate::RegisterSpec,
161{
162 #[inline(always)]
164 pub fn full(self) -> &'a mut crate::W<REG> {
165 self.variant(CROP::Full)
166 }
167 #[inline(always)]
169 pub fn cropped(self) -> &'a mut crate::W<REG> {
170 self.variant(CROP::Cropped)
171 }
172}
173#[cfg_attr(feature = "defmt", derive(defmt::Format))]
177#[derive(Clone, Copy, Debug, PartialEq, Eq)]
178pub enum JPEG {
179 Uncompressed = 0,
181 Jpeg = 1,
183}
184impl From<JPEG> for bool {
185 #[inline(always)]
186 fn from(variant: JPEG) -> Self {
187 variant as u8 != 0
188 }
189}
190pub type JPEG_R = crate::BitReader<JPEG>;
192impl JPEG_R {
193 #[inline(always)]
195 pub const fn variant(&self) -> JPEG {
196 match self.bits {
197 false => JPEG::Uncompressed,
198 true => JPEG::Jpeg,
199 }
200 }
201 #[inline(always)]
203 pub fn is_uncompressed(&self) -> bool {
204 *self == JPEG::Uncompressed
205 }
206 #[inline(always)]
208 pub fn is_jpeg(&self) -> bool {
209 *self == JPEG::Jpeg
210 }
211}
212pub type JPEG_W<'a, REG> = crate::BitWriter<'a, REG, JPEG>;
214impl<'a, REG> JPEG_W<'a, REG>
215where
216 REG: crate::Writable + crate::RegisterSpec,
217{
218 #[inline(always)]
220 pub fn uncompressed(self) -> &'a mut crate::W<REG> {
221 self.variant(JPEG::Uncompressed)
222 }
223 #[inline(always)]
225 pub fn jpeg(self) -> &'a mut crate::W<REG> {
226 self.variant(JPEG::Jpeg)
227 }
228}
229#[cfg_attr(feature = "defmt", derive(defmt::Format))]
233#[derive(Clone, Copy, Debug, PartialEq, Eq)]
234pub enum ESS {
235 Hardware = 0,
237 Embedded = 1,
239}
240impl From<ESS> for bool {
241 #[inline(always)]
242 fn from(variant: ESS) -> Self {
243 variant as u8 != 0
244 }
245}
246pub type ESS_R = crate::BitReader<ESS>;
248impl ESS_R {
249 #[inline(always)]
251 pub const fn variant(&self) -> ESS {
252 match self.bits {
253 false => ESS::Hardware,
254 true => ESS::Embedded,
255 }
256 }
257 #[inline(always)]
259 pub fn is_hardware(&self) -> bool {
260 *self == ESS::Hardware
261 }
262 #[inline(always)]
264 pub fn is_embedded(&self) -> bool {
265 *self == ESS::Embedded
266 }
267}
268pub type ESS_W<'a, REG> = crate::BitWriter<'a, REG, ESS>;
270impl<'a, REG> ESS_W<'a, REG>
271where
272 REG: crate::Writable + crate::RegisterSpec,
273{
274 #[inline(always)]
276 pub fn hardware(self) -> &'a mut crate::W<REG> {
277 self.variant(ESS::Hardware)
278 }
279 #[inline(always)]
281 pub fn embedded(self) -> &'a mut crate::W<REG> {
282 self.variant(ESS::Embedded)
283 }
284}
285#[cfg_attr(feature = "defmt", derive(defmt::Format))]
289#[derive(Clone, Copy, Debug, PartialEq, Eq)]
290pub enum PCKPOL {
291 FallingEdge = 0,
293 RisingEdge = 1,
295}
296impl From<PCKPOL> for bool {
297 #[inline(always)]
298 fn from(variant: PCKPOL) -> Self {
299 variant as u8 != 0
300 }
301}
302pub type PCKPOL_R = crate::BitReader<PCKPOL>;
304impl PCKPOL_R {
305 #[inline(always)]
307 pub const fn variant(&self) -> PCKPOL {
308 match self.bits {
309 false => PCKPOL::FallingEdge,
310 true => PCKPOL::RisingEdge,
311 }
312 }
313 #[inline(always)]
315 pub fn is_falling_edge(&self) -> bool {
316 *self == PCKPOL::FallingEdge
317 }
318 #[inline(always)]
320 pub fn is_rising_edge(&self) -> bool {
321 *self == PCKPOL::RisingEdge
322 }
323}
324pub type PCKPOL_W<'a, REG> = crate::BitWriter<'a, REG, PCKPOL>;
326impl<'a, REG> PCKPOL_W<'a, REG>
327where
328 REG: crate::Writable + crate::RegisterSpec,
329{
330 #[inline(always)]
332 pub fn falling_edge(self) -> &'a mut crate::W<REG> {
333 self.variant(PCKPOL::FallingEdge)
334 }
335 #[inline(always)]
337 pub fn rising_edge(self) -> &'a mut crate::W<REG> {
338 self.variant(PCKPOL::RisingEdge)
339 }
340}
341#[cfg_attr(feature = "defmt", derive(defmt::Format))]
345#[derive(Clone, Copy, Debug, PartialEq, Eq)]
346pub enum HSPOL {
347 ActiveLow = 0,
349 ActiveHigh = 1,
351}
352impl From<HSPOL> for bool {
353 #[inline(always)]
354 fn from(variant: HSPOL) -> Self {
355 variant as u8 != 0
356 }
357}
358pub type HSPOL_R = crate::BitReader<HSPOL>;
360impl HSPOL_R {
361 #[inline(always)]
363 pub const fn variant(&self) -> HSPOL {
364 match self.bits {
365 false => HSPOL::ActiveLow,
366 true => HSPOL::ActiveHigh,
367 }
368 }
369 #[inline(always)]
371 pub fn is_active_low(&self) -> bool {
372 *self == HSPOL::ActiveLow
373 }
374 #[inline(always)]
376 pub fn is_active_high(&self) -> bool {
377 *self == HSPOL::ActiveHigh
378 }
379}
380pub type HSPOL_W<'a, REG> = crate::BitWriter<'a, REG, HSPOL>;
382impl<'a, REG> HSPOL_W<'a, REG>
383where
384 REG: crate::Writable + crate::RegisterSpec,
385{
386 #[inline(always)]
388 pub fn active_low(self) -> &'a mut crate::W<REG> {
389 self.variant(HSPOL::ActiveLow)
390 }
391 #[inline(always)]
393 pub fn active_high(self) -> &'a mut crate::W<REG> {
394 self.variant(HSPOL::ActiveHigh)
395 }
396}
397#[cfg_attr(feature = "defmt", derive(defmt::Format))]
401#[derive(Clone, Copy, Debug, PartialEq, Eq)]
402pub enum VSPOL {
403 ActiveLow = 0,
405 ActiveHigh = 1,
407}
408impl From<VSPOL> for bool {
409 #[inline(always)]
410 fn from(variant: VSPOL) -> Self {
411 variant as u8 != 0
412 }
413}
414pub type VSPOL_R = crate::BitReader<VSPOL>;
416impl VSPOL_R {
417 #[inline(always)]
419 pub const fn variant(&self) -> VSPOL {
420 match self.bits {
421 false => VSPOL::ActiveLow,
422 true => VSPOL::ActiveHigh,
423 }
424 }
425 #[inline(always)]
427 pub fn is_active_low(&self) -> bool {
428 *self == VSPOL::ActiveLow
429 }
430 #[inline(always)]
432 pub fn is_active_high(&self) -> bool {
433 *self == VSPOL::ActiveHigh
434 }
435}
436pub type VSPOL_W<'a, REG> = crate::BitWriter<'a, REG, VSPOL>;
438impl<'a, REG> VSPOL_W<'a, REG>
439where
440 REG: crate::Writable + crate::RegisterSpec,
441{
442 #[inline(always)]
444 pub fn active_low(self) -> &'a mut crate::W<REG> {
445 self.variant(VSPOL::ActiveLow)
446 }
447 #[inline(always)]
449 pub fn active_high(self) -> &'a mut crate::W<REG> {
450 self.variant(VSPOL::ActiveHigh)
451 }
452}
453#[cfg_attr(feature = "defmt", derive(defmt::Format))]
457#[derive(Clone, Copy, Debug, PartialEq, Eq)]
458#[repr(u8)]
459pub enum FCRC {
460 All = 0,
462 Alternate = 1,
464 OneOfFour = 2,
466}
467impl From<FCRC> for u8 {
468 #[inline(always)]
469 fn from(variant: FCRC) -> Self {
470 variant as _
471 }
472}
473impl crate::FieldSpec for FCRC {
474 type Ux = u8;
475}
476impl crate::IsEnum for FCRC {}
477pub type FCRC_R = crate::FieldReader<FCRC>;
479impl FCRC_R {
480 #[inline(always)]
482 pub const fn variant(&self) -> Option<FCRC> {
483 match self.bits {
484 0 => Some(FCRC::All),
485 1 => Some(FCRC::Alternate),
486 2 => Some(FCRC::OneOfFour),
487 _ => None,
488 }
489 }
490 #[inline(always)]
492 pub fn is_all(&self) -> bool {
493 *self == FCRC::All
494 }
495 #[inline(always)]
497 pub fn is_alternate(&self) -> bool {
498 *self == FCRC::Alternate
499 }
500 #[inline(always)]
502 pub fn is_one_of_four(&self) -> bool {
503 *self == FCRC::OneOfFour
504 }
505}
506pub type FCRC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, FCRC>;
508impl<'a, REG> FCRC_W<'a, REG>
509where
510 REG: crate::Writable + crate::RegisterSpec,
511 REG::Ux: From<u8>,
512{
513 #[inline(always)]
515 pub fn all(self) -> &'a mut crate::W<REG> {
516 self.variant(FCRC::All)
517 }
518 #[inline(always)]
520 pub fn alternate(self) -> &'a mut crate::W<REG> {
521 self.variant(FCRC::Alternate)
522 }
523 #[inline(always)]
525 pub fn one_of_four(self) -> &'a mut crate::W<REG> {
526 self.variant(FCRC::OneOfFour)
527 }
528}
529#[cfg_attr(feature = "defmt", derive(defmt::Format))]
533#[derive(Clone, Copy, Debug, PartialEq, Eq)]
534#[repr(u8)]
535pub enum EDM {
536 BitWidth8 = 0,
538 BitWidth10 = 1,
540 BitWidth12 = 2,
542 BitWidth14 = 3,
544}
545impl From<EDM> for u8 {
546 #[inline(always)]
547 fn from(variant: EDM) -> Self {
548 variant as _
549 }
550}
551impl crate::FieldSpec for EDM {
552 type Ux = u8;
553}
554impl crate::IsEnum for EDM {}
555pub type EDM_R = crate::FieldReader<EDM>;
557impl EDM_R {
558 #[inline(always)]
560 pub const fn variant(&self) -> EDM {
561 match self.bits {
562 0 => EDM::BitWidth8,
563 1 => EDM::BitWidth10,
564 2 => EDM::BitWidth12,
565 3 => EDM::BitWidth14,
566 _ => unreachable!(),
567 }
568 }
569 #[inline(always)]
571 pub fn is_bit_width8(&self) -> bool {
572 *self == EDM::BitWidth8
573 }
574 #[inline(always)]
576 pub fn is_bit_width10(&self) -> bool {
577 *self == EDM::BitWidth10
578 }
579 #[inline(always)]
581 pub fn is_bit_width12(&self) -> bool {
582 *self == EDM::BitWidth12
583 }
584 #[inline(always)]
586 pub fn is_bit_width14(&self) -> bool {
587 *self == EDM::BitWidth14
588 }
589}
590pub type EDM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, EDM, crate::Safe>;
592impl<'a, REG> EDM_W<'a, REG>
593where
594 REG: crate::Writable + crate::RegisterSpec,
595 REG::Ux: From<u8>,
596{
597 #[inline(always)]
599 pub fn bit_width8(self) -> &'a mut crate::W<REG> {
600 self.variant(EDM::BitWidth8)
601 }
602 #[inline(always)]
604 pub fn bit_width10(self) -> &'a mut crate::W<REG> {
605 self.variant(EDM::BitWidth10)
606 }
607 #[inline(always)]
609 pub fn bit_width12(self) -> &'a mut crate::W<REG> {
610 self.variant(EDM::BitWidth12)
611 }
612 #[inline(always)]
614 pub fn bit_width14(self) -> &'a mut crate::W<REG> {
615 self.variant(EDM::BitWidth14)
616 }
617}
618#[cfg_attr(feature = "defmt", derive(defmt::Format))]
622#[derive(Clone, Copy, Debug, PartialEq, Eq)]
623pub enum ENABLE {
624 Disabled = 0,
626 Enabled = 1,
628}
629impl From<ENABLE> for bool {
630 #[inline(always)]
631 fn from(variant: ENABLE) -> Self {
632 variant as u8 != 0
633 }
634}
635pub type ENABLE_R = crate::BitReader<ENABLE>;
637impl ENABLE_R {
638 #[inline(always)]
640 pub const fn variant(&self) -> ENABLE {
641 match self.bits {
642 false => ENABLE::Disabled,
643 true => ENABLE::Enabled,
644 }
645 }
646 #[inline(always)]
648 pub fn is_disabled(&self) -> bool {
649 *self == ENABLE::Disabled
650 }
651 #[inline(always)]
653 pub fn is_enabled(&self) -> bool {
654 *self == ENABLE::Enabled
655 }
656}
657pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG, ENABLE>;
659impl<'a, REG> ENABLE_W<'a, REG>
660where
661 REG: crate::Writable + crate::RegisterSpec,
662{
663 #[inline(always)]
665 pub fn disabled(self) -> &'a mut crate::W<REG> {
666 self.variant(ENABLE::Disabled)
667 }
668 #[inline(always)]
670 pub fn enabled(self) -> &'a mut crate::W<REG> {
671 self.variant(ENABLE::Enabled)
672 }
673}
674impl R {
675 #[inline(always)]
677 pub fn capture(&self) -> CAPTURE_R {
678 CAPTURE_R::new((self.bits & 1) != 0)
679 }
680 #[inline(always)]
682 pub fn cm(&self) -> CM_R {
683 CM_R::new(((self.bits >> 1) & 1) != 0)
684 }
685 #[inline(always)]
687 pub fn crop(&self) -> CROP_R {
688 CROP_R::new(((self.bits >> 2) & 1) != 0)
689 }
690 #[inline(always)]
692 pub fn jpeg(&self) -> JPEG_R {
693 JPEG_R::new(((self.bits >> 3) & 1) != 0)
694 }
695 #[inline(always)]
697 pub fn ess(&self) -> ESS_R {
698 ESS_R::new(((self.bits >> 4) & 1) != 0)
699 }
700 #[inline(always)]
702 pub fn pckpol(&self) -> PCKPOL_R {
703 PCKPOL_R::new(((self.bits >> 5) & 1) != 0)
704 }
705 #[inline(always)]
707 pub fn hspol(&self) -> HSPOL_R {
708 HSPOL_R::new(((self.bits >> 6) & 1) != 0)
709 }
710 #[inline(always)]
712 pub fn vspol(&self) -> VSPOL_R {
713 VSPOL_R::new(((self.bits >> 7) & 1) != 0)
714 }
715 #[inline(always)]
717 pub fn fcrc(&self) -> FCRC_R {
718 FCRC_R::new(((self.bits >> 8) & 3) as u8)
719 }
720 #[inline(always)]
722 pub fn edm(&self) -> EDM_R {
723 EDM_R::new(((self.bits >> 10) & 3) as u8)
724 }
725 #[inline(always)]
727 pub fn enable(&self) -> ENABLE_R {
728 ENABLE_R::new(((self.bits >> 14) & 1) != 0)
729 }
730}
731impl core::fmt::Debug for R {
732 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
733 f.debug_struct("CR")
734 .field("enable", &self.enable())
735 .field("edm", &self.edm())
736 .field("fcrc", &self.fcrc())
737 .field("vspol", &self.vspol())
738 .field("hspol", &self.hspol())
739 .field("pckpol", &self.pckpol())
740 .field("ess", &self.ess())
741 .field("jpeg", &self.jpeg())
742 .field("crop", &self.crop())
743 .field("cm", &self.cm())
744 .field("capture", &self.capture())
745 .finish()
746 }
747}
748impl W {
749 #[inline(always)]
751 pub fn capture(&mut self) -> CAPTURE_W<CRrs> {
752 CAPTURE_W::new(self, 0)
753 }
754 #[inline(always)]
756 pub fn cm(&mut self) -> CM_W<CRrs> {
757 CM_W::new(self, 1)
758 }
759 #[inline(always)]
761 pub fn crop(&mut self) -> CROP_W<CRrs> {
762 CROP_W::new(self, 2)
763 }
764 #[inline(always)]
766 pub fn jpeg(&mut self) -> JPEG_W<CRrs> {
767 JPEG_W::new(self, 3)
768 }
769 #[inline(always)]
771 pub fn ess(&mut self) -> ESS_W<CRrs> {
772 ESS_W::new(self, 4)
773 }
774 #[inline(always)]
776 pub fn pckpol(&mut self) -> PCKPOL_W<CRrs> {
777 PCKPOL_W::new(self, 5)
778 }
779 #[inline(always)]
781 pub fn hspol(&mut self) -> HSPOL_W<CRrs> {
782 HSPOL_W::new(self, 6)
783 }
784 #[inline(always)]
786 pub fn vspol(&mut self) -> VSPOL_W<CRrs> {
787 VSPOL_W::new(self, 7)
788 }
789 #[inline(always)]
791 pub fn fcrc(&mut self) -> FCRC_W<CRrs> {
792 FCRC_W::new(self, 8)
793 }
794 #[inline(always)]
796 pub fn edm(&mut self) -> EDM_W<CRrs> {
797 EDM_W::new(self, 10)
798 }
799 #[inline(always)]
801 pub fn enable(&mut self) -> ENABLE_W<CRrs> {
802 ENABLE_W::new(self, 14)
803 }
804}
805pub struct CRrs;
811impl crate::RegisterSpec for CRrs {
812 type Ux = u32;
813}
814impl crate::Readable for CRrs {}
816impl crate::Writable for CRrs {
818 type Safety = crate::Unsafe;
819}
820impl crate::Resettable for CRrs {}