esp32p4/isp/
gamma_gx1.rs

1#[doc = "Register `GAMMA_GX1` reader"]
2pub type R = crate::R<GAMMA_GX1_SPEC>;
3#[doc = "Register `GAMMA_GX1` writer"]
4pub type W = crate::W<GAMMA_GX1_SPEC>;
5#[doc = "Field `GAMMA_G_X07` reader - this field configures the point 7 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
6pub type GAMMA_G_X07_R = crate::FieldReader;
7#[doc = "Field `GAMMA_G_X07` writer - this field configures the point 7 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
8pub type GAMMA_G_X07_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
9#[doc = "Field `GAMMA_G_X06` reader - this field configures the point 6 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
10pub type GAMMA_G_X06_R = crate::FieldReader;
11#[doc = "Field `GAMMA_G_X06` writer - this field configures the point 6 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
12pub type GAMMA_G_X06_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
13#[doc = "Field `GAMMA_G_X05` reader - this field configures the point 5 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
14pub type GAMMA_G_X05_R = crate::FieldReader;
15#[doc = "Field `GAMMA_G_X05` writer - this field configures the point 5 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
16pub type GAMMA_G_X05_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
17#[doc = "Field `GAMMA_G_X04` reader - this field configures the point 4 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
18pub type GAMMA_G_X04_R = crate::FieldReader;
19#[doc = "Field `GAMMA_G_X04` writer - this field configures the point 4 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
20pub type GAMMA_G_X04_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
21#[doc = "Field `GAMMA_G_X03` reader - this field configures the point 3 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
22pub type GAMMA_G_X03_R = crate::FieldReader;
23#[doc = "Field `GAMMA_G_X03` writer - this field configures the point 3 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
24pub type GAMMA_G_X03_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
25#[doc = "Field `GAMMA_G_X02` reader - this field configures the point 2 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
26pub type GAMMA_G_X02_R = crate::FieldReader;
27#[doc = "Field `GAMMA_G_X02` writer - this field configures the point 2 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
28pub type GAMMA_G_X02_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
29#[doc = "Field `GAMMA_G_X01` reader - this field configures the point 1 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
30pub type GAMMA_G_X01_R = crate::FieldReader;
31#[doc = "Field `GAMMA_G_X01` writer - this field configures the point 1 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
32pub type GAMMA_G_X01_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
33#[doc = "Field `GAMMA_G_X00` reader - this field configures the point 0 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
34pub type GAMMA_G_X00_R = crate::FieldReader;
35#[doc = "Field `GAMMA_G_X00` writer - this field configures the point 0 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
36pub type GAMMA_G_X00_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
37impl R {
38    #[doc = "Bits 0:2 - this field configures the point 7 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
39    #[inline(always)]
40    pub fn gamma_g_x07(&self) -> GAMMA_G_X07_R {
41        GAMMA_G_X07_R::new((self.bits & 7) as u8)
42    }
43    #[doc = "Bits 3:5 - this field configures the point 6 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
44    #[inline(always)]
45    pub fn gamma_g_x06(&self) -> GAMMA_G_X06_R {
46        GAMMA_G_X06_R::new(((self.bits >> 3) & 7) as u8)
47    }
48    #[doc = "Bits 6:8 - this field configures the point 5 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
49    #[inline(always)]
50    pub fn gamma_g_x05(&self) -> GAMMA_G_X05_R {
51        GAMMA_G_X05_R::new(((self.bits >> 6) & 7) as u8)
52    }
53    #[doc = "Bits 9:11 - this field configures the point 4 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
54    #[inline(always)]
55    pub fn gamma_g_x04(&self) -> GAMMA_G_X04_R {
56        GAMMA_G_X04_R::new(((self.bits >> 9) & 7) as u8)
57    }
58    #[doc = "Bits 12:14 - this field configures the point 3 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
59    #[inline(always)]
60    pub fn gamma_g_x03(&self) -> GAMMA_G_X03_R {
61        GAMMA_G_X03_R::new(((self.bits >> 12) & 7) as u8)
62    }
63    #[doc = "Bits 15:17 - this field configures the point 2 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
64    #[inline(always)]
65    pub fn gamma_g_x02(&self) -> GAMMA_G_X02_R {
66        GAMMA_G_X02_R::new(((self.bits >> 15) & 7) as u8)
67    }
68    #[doc = "Bits 18:20 - this field configures the point 1 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
69    #[inline(always)]
70    pub fn gamma_g_x01(&self) -> GAMMA_G_X01_R {
71        GAMMA_G_X01_R::new(((self.bits >> 18) & 7) as u8)
72    }
73    #[doc = "Bits 21:23 - this field configures the point 0 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
74    #[inline(always)]
75    pub fn gamma_g_x00(&self) -> GAMMA_G_X00_R {
76        GAMMA_G_X00_R::new(((self.bits >> 21) & 7) as u8)
77    }
78}
79#[cfg(feature = "impl-register-debug")]
80impl core::fmt::Debug for R {
81    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
82        f.debug_struct("GAMMA_GX1")
83            .field(
84                "gamma_g_x07",
85                &format_args!("{}", self.gamma_g_x07().bits()),
86            )
87            .field(
88                "gamma_g_x06",
89                &format_args!("{}", self.gamma_g_x06().bits()),
90            )
91            .field(
92                "gamma_g_x05",
93                &format_args!("{}", self.gamma_g_x05().bits()),
94            )
95            .field(
96                "gamma_g_x04",
97                &format_args!("{}", self.gamma_g_x04().bits()),
98            )
99            .field(
100                "gamma_g_x03",
101                &format_args!("{}", self.gamma_g_x03().bits()),
102            )
103            .field(
104                "gamma_g_x02",
105                &format_args!("{}", self.gamma_g_x02().bits()),
106            )
107            .field(
108                "gamma_g_x01",
109                &format_args!("{}", self.gamma_g_x01().bits()),
110            )
111            .field(
112                "gamma_g_x00",
113                &format_args!("{}", self.gamma_g_x00().bits()),
114            )
115            .finish()
116    }
117}
118#[cfg(feature = "impl-register-debug")]
119impl core::fmt::Debug for crate::generic::Reg<GAMMA_GX1_SPEC> {
120    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
121        core::fmt::Debug::fmt(&self.read(), f)
122    }
123}
124impl W {
125    #[doc = "Bits 0:2 - this field configures the point 7 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
126    #[inline(always)]
127    #[must_use]
128    pub fn gamma_g_x07(&mut self) -> GAMMA_G_X07_W<GAMMA_GX1_SPEC> {
129        GAMMA_G_X07_W::new(self, 0)
130    }
131    #[doc = "Bits 3:5 - this field configures the point 6 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
132    #[inline(always)]
133    #[must_use]
134    pub fn gamma_g_x06(&mut self) -> GAMMA_G_X06_W<GAMMA_GX1_SPEC> {
135        GAMMA_G_X06_W::new(self, 3)
136    }
137    #[doc = "Bits 6:8 - this field configures the point 5 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
138    #[inline(always)]
139    #[must_use]
140    pub fn gamma_g_x05(&mut self) -> GAMMA_G_X05_W<GAMMA_GX1_SPEC> {
141        GAMMA_G_X05_W::new(self, 6)
142    }
143    #[doc = "Bits 9:11 - this field configures the point 4 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
144    #[inline(always)]
145    #[must_use]
146    pub fn gamma_g_x04(&mut self) -> GAMMA_G_X04_W<GAMMA_GX1_SPEC> {
147        GAMMA_G_X04_W::new(self, 9)
148    }
149    #[doc = "Bits 12:14 - this field configures the point 3 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
150    #[inline(always)]
151    #[must_use]
152    pub fn gamma_g_x03(&mut self) -> GAMMA_G_X03_W<GAMMA_GX1_SPEC> {
153        GAMMA_G_X03_W::new(self, 12)
154    }
155    #[doc = "Bits 15:17 - this field configures the point 2 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
156    #[inline(always)]
157    #[must_use]
158    pub fn gamma_g_x02(&mut self) -> GAMMA_G_X02_W<GAMMA_GX1_SPEC> {
159        GAMMA_G_X02_W::new(self, 15)
160    }
161    #[doc = "Bits 18:20 - this field configures the point 1 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
162    #[inline(always)]
163    #[must_use]
164    pub fn gamma_g_x01(&mut self) -> GAMMA_G_X01_W<GAMMA_GX1_SPEC> {
165        GAMMA_G_X01_W::new(self, 18)
166    }
167    #[doc = "Bits 21:23 - this field configures the point 0 of X-axis of g channel gamma curve, it represents the power of the distance from the previous point"]
168    #[inline(always)]
169    #[must_use]
170    pub fn gamma_g_x00(&mut self) -> GAMMA_G_X00_W<GAMMA_GX1_SPEC> {
171        GAMMA_G_X00_W::new(self, 21)
172    }
173}
174#[doc = "point of X-axis of g channel gamma curve register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gamma_gx1::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 [`gamma_gx1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
175pub struct GAMMA_GX1_SPEC;
176impl crate::RegisterSpec for GAMMA_GX1_SPEC {
177    type Ux = u32;
178}
179#[doc = "`read()` method returns [`gamma_gx1::R`](R) reader structure"]
180impl crate::Readable for GAMMA_GX1_SPEC {}
181#[doc = "`write(|w| ..)` method takes [`gamma_gx1::W`](W) writer structure"]
182impl crate::Writable for GAMMA_GX1_SPEC {
183    type Safety = crate::Unsafe;
184    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
185    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
186}
187#[doc = "`reset()` method sets GAMMA_GX1 to value 0x0092_4924"]
188impl crate::Resettable for GAMMA_GX1_SPEC {
189    const RESET_VALUE: u32 = 0x0092_4924;
190}