Skip to main content

rk3399_pac/isp/
dpcc_methods_set_2.rs

1#[doc = "Register `DPCC_METHODS_SET_2` reader"]
2pub type R = crate::R<DpccMethodsSet2Spec>;
3#[doc = "Register `DPCC_METHODS_SET_2` writer"]
4pub type W = crate::W<DpccMethodsSet2Spec>;
5#[doc = "\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum PgGreen2Enable {
9    #[doc = "1: enable Peak Gradient check for green *Default*"]
10    B1 = 1,
11    #[doc = "0: bypass Peak Gradient check for green"]
12    B0 = 0,
13}
14impl From<PgGreen2Enable> for bool {
15    #[inline(always)]
16    fn from(variant: PgGreen2Enable) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `PG_GREEN2_ENABLE` reader - "]
21pub type PgGreen2EnableR = crate::BitReader<PgGreen2Enable>;
22impl PgGreen2EnableR {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> PgGreen2Enable {
26        match self.bits {
27            true => PgGreen2Enable::B1,
28            false => PgGreen2Enable::B0,
29        }
30    }
31    #[doc = "enable Peak Gradient check for green *Default*"]
32    #[inline(always)]
33    pub fn is_b1(&self) -> bool {
34        *self == PgGreen2Enable::B1
35    }
36    #[doc = "bypass Peak Gradient check for green"]
37    #[inline(always)]
38    pub fn is_b0(&self) -> bool {
39        *self == PgGreen2Enable::B0
40    }
41}
42#[doc = "Field `PG_GREEN2_ENABLE` writer - "]
43pub type PgGreen2EnableW<'a, REG> = crate::BitWriter<'a, REG, PgGreen2Enable>;
44impl<'a, REG> PgGreen2EnableW<'a, REG>
45where
46    REG: crate::Writable + crate::RegisterSpec,
47{
48    #[doc = "enable Peak Gradient check for green *Default*"]
49    #[inline(always)]
50    pub fn b1(self) -> &'a mut crate::W<REG> {
51        self.variant(PgGreen2Enable::B1)
52    }
53    #[doc = "bypass Peak Gradient check for green"]
54    #[inline(always)]
55    pub fn b0(self) -> &'a mut crate::W<REG> {
56        self.variant(PgGreen2Enable::B0)
57    }
58}
59#[doc = "\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum LcGreen2Enable {
63    #[doc = "1: enable Line check for green"]
64    B1 = 1,
65    #[doc = "0: bypass Line check for green *Default*"]
66    B0 = 0,
67}
68impl From<LcGreen2Enable> for bool {
69    #[inline(always)]
70    fn from(variant: LcGreen2Enable) -> Self {
71        variant as u8 != 0
72    }
73}
74#[doc = "Field `LC_GREEN2_ENABLE` reader - "]
75pub type LcGreen2EnableR = crate::BitReader<LcGreen2Enable>;
76impl LcGreen2EnableR {
77    #[doc = "Get enumerated values variant"]
78    #[inline(always)]
79    pub const fn variant(&self) -> LcGreen2Enable {
80        match self.bits {
81            true => LcGreen2Enable::B1,
82            false => LcGreen2Enable::B0,
83        }
84    }
85    #[doc = "enable Line check for green"]
86    #[inline(always)]
87    pub fn is_b1(&self) -> bool {
88        *self == LcGreen2Enable::B1
89    }
90    #[doc = "bypass Line check for green *Default*"]
91    #[inline(always)]
92    pub fn is_b0(&self) -> bool {
93        *self == LcGreen2Enable::B0
94    }
95}
96#[doc = "Field `LC_GREEN2_ENABLE` writer - "]
97pub type LcGreen2EnableW<'a, REG> = crate::BitWriter<'a, REG, LcGreen2Enable>;
98impl<'a, REG> LcGreen2EnableW<'a, REG>
99where
100    REG: crate::Writable + crate::RegisterSpec,
101{
102    #[doc = "enable Line check for green"]
103    #[inline(always)]
104    pub fn b1(self) -> &'a mut crate::W<REG> {
105        self.variant(LcGreen2Enable::B1)
106    }
107    #[doc = "bypass Line check for green *Default*"]
108    #[inline(always)]
109    pub fn b0(self) -> &'a mut crate::W<REG> {
110        self.variant(LcGreen2Enable::B0)
111    }
112}
113#[doc = "\n\nValue on reset: 0"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum RoGreen2Enable {
117    #[doc = "1: enable Rank Order check for green *Default*"]
118    B1 = 1,
119    #[doc = "0: bypass Rank Order check for green"]
120    B0 = 0,
121}
122impl From<RoGreen2Enable> for bool {
123    #[inline(always)]
124    fn from(variant: RoGreen2Enable) -> Self {
125        variant as u8 != 0
126    }
127}
128#[doc = "Field `RO_GREEN2_ENABLE` reader - "]
129pub type RoGreen2EnableR = crate::BitReader<RoGreen2Enable>;
130impl RoGreen2EnableR {
131    #[doc = "Get enumerated values variant"]
132    #[inline(always)]
133    pub const fn variant(&self) -> RoGreen2Enable {
134        match self.bits {
135            true => RoGreen2Enable::B1,
136            false => RoGreen2Enable::B0,
137        }
138    }
139    #[doc = "enable Rank Order check for green *Default*"]
140    #[inline(always)]
141    pub fn is_b1(&self) -> bool {
142        *self == RoGreen2Enable::B1
143    }
144    #[doc = "bypass Rank Order check for green"]
145    #[inline(always)]
146    pub fn is_b0(&self) -> bool {
147        *self == RoGreen2Enable::B0
148    }
149}
150#[doc = "Field `RO_GREEN2_ENABLE` writer - "]
151pub type RoGreen2EnableW<'a, REG> = crate::BitWriter<'a, REG, RoGreen2Enable>;
152impl<'a, REG> RoGreen2EnableW<'a, REG>
153where
154    REG: crate::Writable + crate::RegisterSpec,
155{
156    #[doc = "enable Rank Order check for green *Default*"]
157    #[inline(always)]
158    pub fn b1(self) -> &'a mut crate::W<REG> {
159        self.variant(RoGreen2Enable::B1)
160    }
161    #[doc = "bypass Rank Order check for green"]
162    #[inline(always)]
163    pub fn b0(self) -> &'a mut crate::W<REG> {
164        self.variant(RoGreen2Enable::B0)
165    }
166}
167#[doc = "Field `RND_GREEN2_ENABLE` reader - 1: enable Rank Neighbor Difference check for green\n\n*Default* 0: bypass Rank Neighbor Difference check for\n\ngreen"]
168pub type RndGreen2EnableR = crate::BitReader;
169#[doc = "Field `RND_GREEN2_ENABLE` writer - 1: enable Rank Neighbor Difference check for green\n\n*Default* 0: bypass Rank Neighbor Difference check for\n\ngreen"]
170pub type RndGreen2EnableW<'a, REG> = crate::BitWriter<'a, REG>;
171#[doc = "\n\nValue on reset: 0"]
172#[cfg_attr(feature = "defmt", derive(defmt::Format))]
173#[derive(Clone, Copy, Debug, PartialEq, Eq)]
174pub enum RgGreen2Enable {
175    #[doc = "1: enable Rank Gradient check for green *Default*"]
176    B1 = 1,
177    #[doc = "0: bypass Rank Gradient check for green"]
178    B0 = 0,
179}
180impl From<RgGreen2Enable> for bool {
181    #[inline(always)]
182    fn from(variant: RgGreen2Enable) -> Self {
183        variant as u8 != 0
184    }
185}
186#[doc = "Field `RG_GREEN2_ENABLE` reader - "]
187pub type RgGreen2EnableR = crate::BitReader<RgGreen2Enable>;
188impl RgGreen2EnableR {
189    #[doc = "Get enumerated values variant"]
190    #[inline(always)]
191    pub const fn variant(&self) -> RgGreen2Enable {
192        match self.bits {
193            true => RgGreen2Enable::B1,
194            false => RgGreen2Enable::B0,
195        }
196    }
197    #[doc = "enable Rank Gradient check for green *Default*"]
198    #[inline(always)]
199    pub fn is_b1(&self) -> bool {
200        *self == RgGreen2Enable::B1
201    }
202    #[doc = "bypass Rank Gradient check for green"]
203    #[inline(always)]
204    pub fn is_b0(&self) -> bool {
205        *self == RgGreen2Enable::B0
206    }
207}
208#[doc = "Field `RG_GREEN2_ENABLE` writer - "]
209pub type RgGreen2EnableW<'a, REG> = crate::BitWriter<'a, REG, RgGreen2Enable>;
210impl<'a, REG> RgGreen2EnableW<'a, REG>
211where
212    REG: crate::Writable + crate::RegisterSpec,
213{
214    #[doc = "enable Rank Gradient check for green *Default*"]
215    #[inline(always)]
216    pub fn b1(self) -> &'a mut crate::W<REG> {
217        self.variant(RgGreen2Enable::B1)
218    }
219    #[doc = "bypass Rank Gradient check for green"]
220    #[inline(always)]
221    pub fn b0(self) -> &'a mut crate::W<REG> {
222        self.variant(RgGreen2Enable::B0)
223    }
224}
225impl R {
226    #[doc = "Bit 0"]
227    #[inline(always)]
228    pub fn pg_green2_enable(&self) -> PgGreen2EnableR {
229        PgGreen2EnableR::new((self.bits & 1) != 0)
230    }
231    #[doc = "Bit 1"]
232    #[inline(always)]
233    pub fn lc_green2_enable(&self) -> LcGreen2EnableR {
234        LcGreen2EnableR::new(((self.bits >> 1) & 1) != 0)
235    }
236    #[doc = "Bit 2"]
237    #[inline(always)]
238    pub fn ro_green2_enable(&self) -> RoGreen2EnableR {
239        RoGreen2EnableR::new(((self.bits >> 2) & 1) != 0)
240    }
241    #[doc = "Bit 3 - 1: enable Rank Neighbor Difference check for green\n\n*Default* 0: bypass Rank Neighbor Difference check for\n\ngreen"]
242    #[inline(always)]
243    pub fn rnd_green2_enable(&self) -> RndGreen2EnableR {
244        RndGreen2EnableR::new(((self.bits >> 3) & 1) != 0)
245    }
246    #[doc = "Bit 4"]
247    #[inline(always)]
248    pub fn rg_green2_enable(&self) -> RgGreen2EnableR {
249        RgGreen2EnableR::new(((self.bits >> 4) & 1) != 0)
250    }
251}
252impl W {
253    #[doc = "Bit 0"]
254    #[inline(always)]
255    #[must_use]
256    pub fn pg_green2_enable(&mut self) -> PgGreen2EnableW<DpccMethodsSet2Spec> {
257        PgGreen2EnableW::new(self, 0)
258    }
259    #[doc = "Bit 1"]
260    #[inline(always)]
261    #[must_use]
262    pub fn lc_green2_enable(&mut self) -> LcGreen2EnableW<DpccMethodsSet2Spec> {
263        LcGreen2EnableW::new(self, 1)
264    }
265    #[doc = "Bit 2"]
266    #[inline(always)]
267    #[must_use]
268    pub fn ro_green2_enable(&mut self) -> RoGreen2EnableW<DpccMethodsSet2Spec> {
269        RoGreen2EnableW::new(self, 2)
270    }
271    #[doc = "Bit 3 - 1: enable Rank Neighbor Difference check for green\n\n*Default* 0: bypass Rank Neighbor Difference check for\n\ngreen"]
272    #[inline(always)]
273    #[must_use]
274    pub fn rnd_green2_enable(&mut self) -> RndGreen2EnableW<DpccMethodsSet2Spec> {
275        RndGreen2EnableW::new(self, 3)
276    }
277    #[doc = "Bit 4"]
278    #[inline(always)]
279    #[must_use]
280    pub fn rg_green2_enable(&mut self) -> RgGreen2EnableW<DpccMethodsSet2Spec> {
281        RgGreen2EnableW::new(self, 4)
282    }
283}
284#[doc = "Methods enable bits for SET_2\n\nNote: different methods can be used in parallel, the result is the logical AND of all selected \n\n\n\nmethods \n\n \n\n\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dpcc_methods_set_2::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 [`dpcc_methods_set_2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
285pub struct DpccMethodsSet2Spec;
286impl crate::RegisterSpec for DpccMethodsSet2Spec {
287    type Ux = u32;
288}
289#[doc = "`read()` method returns [`dpcc_methods_set_2::R`](R) reader structure"]
290impl crate::Readable for DpccMethodsSet2Spec {}
291#[doc = "`write(|w| ..)` method takes [`dpcc_methods_set_2::W`](W) writer structure"]
292impl crate::Writable for DpccMethodsSet2Spec {
293    type Safety = crate::Unsafe;
294    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
295    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
296}
297#[doc = "`reset()` method sets DPCC_METHODS_SET_2 to value 0"]
298impl crate::Resettable for DpccMethodsSet2Spec {
299    const RESET_VALUE: u32 = 0;
300}