1#[doc = "Register `DPC_CTRL` reader"]
2pub type R = crate::R<DPC_CTRL_SPEC>;
3#[doc = "Register `DPC_CTRL` writer"]
4pub type W = crate::W<DPC_CTRL_SPEC>;
5#[doc = "Field `DPC_CHECK_EN` reader - this bit configures the check mode enable. 0: disable, 1: enable"]
6pub type DPC_CHECK_EN_R = crate::BitReader;
7#[doc = "Field `DPC_CHECK_EN` writer - this bit configures the check mode enable. 0: disable, 1: enable"]
8pub type DPC_CHECK_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `STA_EN` reader - this bit configures the sta dpc enable. 0: disable, 1: enable"]
10pub type STA_EN_R = crate::BitReader;
11#[doc = "Field `STA_EN` writer - this bit configures the sta dpc enable. 0: disable, 1: enable"]
12pub type STA_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `DYN_EN` reader - this bit configures the dyn dpc enable. 0: disable, 1: enable"]
14pub type DYN_EN_R = crate::BitReader;
15#[doc = "Field `DYN_EN` writer - this bit configures the dyn dpc enable. 0: disable, 1: enable"]
16pub type DYN_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `DPC_BLACK_EN` reader - this bit configures input image type select when in check mode, 0: white img, 1: black img"]
18pub type DPC_BLACK_EN_R = crate::BitReader;
19#[doc = "Field `DPC_BLACK_EN` writer - this bit configures input image type select when in check mode, 0: white img, 1: black img"]
20pub type DPC_BLACK_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `DPC_METHOD_SEL` reader - this bit configures dyn dpc method select. 0: simple method, 1: hard method"]
22pub type DPC_METHOD_SEL_R = crate::BitReader;
23#[doc = "Field `DPC_METHOD_SEL` writer - this bit configures dyn dpc method select. 0: simple method, 1: hard method"]
24pub type DPC_METHOD_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `DPC_CHECK_OD_EN` reader - this bit configures output pixel data when in check mode or not. 0: no data output, 1: data output"]
26pub type DPC_CHECK_OD_EN_R = crate::BitReader;
27#[doc = "Field `DPC_CHECK_OD_EN` writer - this bit configures output pixel data when in check mode or not. 0: no data output, 1: data output"]
28pub type DPC_CHECK_OD_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30 #[doc = "Bit 0 - this bit configures the check mode enable. 0: disable, 1: enable"]
31 #[inline(always)]
32 pub fn dpc_check_en(&self) -> DPC_CHECK_EN_R {
33 DPC_CHECK_EN_R::new((self.bits & 1) != 0)
34 }
35 #[doc = "Bit 1 - this bit configures the sta dpc enable. 0: disable, 1: enable"]
36 #[inline(always)]
37 pub fn sta_en(&self) -> STA_EN_R {
38 STA_EN_R::new(((self.bits >> 1) & 1) != 0)
39 }
40 #[doc = "Bit 2 - this bit configures the dyn dpc enable. 0: disable, 1: enable"]
41 #[inline(always)]
42 pub fn dyn_en(&self) -> DYN_EN_R {
43 DYN_EN_R::new(((self.bits >> 2) & 1) != 0)
44 }
45 #[doc = "Bit 3 - this bit configures input image type select when in check mode, 0: white img, 1: black img"]
46 #[inline(always)]
47 pub fn dpc_black_en(&self) -> DPC_BLACK_EN_R {
48 DPC_BLACK_EN_R::new(((self.bits >> 3) & 1) != 0)
49 }
50 #[doc = "Bit 4 - this bit configures dyn dpc method select. 0: simple method, 1: hard method"]
51 #[inline(always)]
52 pub fn dpc_method_sel(&self) -> DPC_METHOD_SEL_R {
53 DPC_METHOD_SEL_R::new(((self.bits >> 4) & 1) != 0)
54 }
55 #[doc = "Bit 5 - this bit configures output pixel data when in check mode or not. 0: no data output, 1: data output"]
56 #[inline(always)]
57 pub fn dpc_check_od_en(&self) -> DPC_CHECK_OD_EN_R {
58 DPC_CHECK_OD_EN_R::new(((self.bits >> 5) & 1) != 0)
59 }
60}
61#[cfg(feature = "impl-register-debug")]
62impl core::fmt::Debug for R {
63 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64 f.debug_struct("DPC_CTRL")
65 .field(
66 "dpc_check_en",
67 &format_args!("{}", self.dpc_check_en().bit()),
68 )
69 .field("sta_en", &format_args!("{}", self.sta_en().bit()))
70 .field("dyn_en", &format_args!("{}", self.dyn_en().bit()))
71 .field(
72 "dpc_black_en",
73 &format_args!("{}", self.dpc_black_en().bit()),
74 )
75 .field(
76 "dpc_method_sel",
77 &format_args!("{}", self.dpc_method_sel().bit()),
78 )
79 .field(
80 "dpc_check_od_en",
81 &format_args!("{}", self.dpc_check_od_en().bit()),
82 )
83 .finish()
84 }
85}
86#[cfg(feature = "impl-register-debug")]
87impl core::fmt::Debug for crate::generic::Reg<DPC_CTRL_SPEC> {
88 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
89 core::fmt::Debug::fmt(&self.read(), f)
90 }
91}
92impl W {
93 #[doc = "Bit 0 - this bit configures the check mode enable. 0: disable, 1: enable"]
94 #[inline(always)]
95 #[must_use]
96 pub fn dpc_check_en(&mut self) -> DPC_CHECK_EN_W<DPC_CTRL_SPEC> {
97 DPC_CHECK_EN_W::new(self, 0)
98 }
99 #[doc = "Bit 1 - this bit configures the sta dpc enable. 0: disable, 1: enable"]
100 #[inline(always)]
101 #[must_use]
102 pub fn sta_en(&mut self) -> STA_EN_W<DPC_CTRL_SPEC> {
103 STA_EN_W::new(self, 1)
104 }
105 #[doc = "Bit 2 - this bit configures the dyn dpc enable. 0: disable, 1: enable"]
106 #[inline(always)]
107 #[must_use]
108 pub fn dyn_en(&mut self) -> DYN_EN_W<DPC_CTRL_SPEC> {
109 DYN_EN_W::new(self, 2)
110 }
111 #[doc = "Bit 3 - this bit configures input image type select when in check mode, 0: white img, 1: black img"]
112 #[inline(always)]
113 #[must_use]
114 pub fn dpc_black_en(&mut self) -> DPC_BLACK_EN_W<DPC_CTRL_SPEC> {
115 DPC_BLACK_EN_W::new(self, 3)
116 }
117 #[doc = "Bit 4 - this bit configures dyn dpc method select. 0: simple method, 1: hard method"]
118 #[inline(always)]
119 #[must_use]
120 pub fn dpc_method_sel(&mut self) -> DPC_METHOD_SEL_W<DPC_CTRL_SPEC> {
121 DPC_METHOD_SEL_W::new(self, 4)
122 }
123 #[doc = "Bit 5 - this bit configures output pixel data when in check mode or not. 0: no data output, 1: data output"]
124 #[inline(always)]
125 #[must_use]
126 pub fn dpc_check_od_en(&mut self) -> DPC_CHECK_OD_EN_W<DPC_CTRL_SPEC> {
127 DPC_CHECK_OD_EN_W::new(self, 5)
128 }
129}
130#[doc = "DPC mode control register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dpc_ctrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dpc_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
131pub struct DPC_CTRL_SPEC;
132impl crate::RegisterSpec for DPC_CTRL_SPEC {
133 type Ux = u32;
134}
135#[doc = "`read()` method returns [`dpc_ctrl::R`](R) reader structure"]
136impl crate::Readable for DPC_CTRL_SPEC {}
137#[doc = "`write(|w| ..)` method takes [`dpc_ctrl::W`](W) writer structure"]
138impl crate::Writable for DPC_CTRL_SPEC {
139 type Safety = crate::Unsafe;
140 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
141 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
142}
143#[doc = "`reset()` method sets DPC_CTRL to value 0x04"]
144impl crate::Resettable for DPC_CTRL_SPEC {
145 const RESET_VALUE: u32 = 0x04;
146}