esp32p4/mipi_dsi_host/
vid_mode_cfg.rs

1#[doc = "Register `VID_MODE_CFG` reader"]
2pub type R = crate::R<VID_MODE_CFG_SPEC>;
3#[doc = "Register `VID_MODE_CFG` writer"]
4pub type W = crate::W<VID_MODE_CFG_SPEC>;
5#[doc = "Field `VID_MODE_TYPE` reader - NA"]
6pub type VID_MODE_TYPE_R = crate::FieldReader;
7#[doc = "Field `VID_MODE_TYPE` writer - NA"]
8pub type VID_MODE_TYPE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `LP_VSA_EN` reader - NA"]
10pub type LP_VSA_EN_R = crate::BitReader;
11#[doc = "Field `LP_VSA_EN` writer - NA"]
12pub type LP_VSA_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `LP_VBP_EN` reader - NA"]
14pub type LP_VBP_EN_R = crate::BitReader;
15#[doc = "Field `LP_VBP_EN` writer - NA"]
16pub type LP_VBP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `LP_VFP_EN` reader - NA"]
18pub type LP_VFP_EN_R = crate::BitReader;
19#[doc = "Field `LP_VFP_EN` writer - NA"]
20pub type LP_VFP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `LP_VACT_EN` reader - NA"]
22pub type LP_VACT_EN_R = crate::BitReader;
23#[doc = "Field `LP_VACT_EN` writer - NA"]
24pub type LP_VACT_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `LP_HBP_EN` reader - NA"]
26pub type LP_HBP_EN_R = crate::BitReader;
27#[doc = "Field `LP_HBP_EN` writer - NA"]
28pub type LP_HBP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `LP_HFP_EN` reader - NA"]
30pub type LP_HFP_EN_R = crate::BitReader;
31#[doc = "Field `LP_HFP_EN` writer - NA"]
32pub type LP_HFP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `FRAME_BTA_ACK_EN` reader - NA"]
34pub type FRAME_BTA_ACK_EN_R = crate::BitReader;
35#[doc = "Field `FRAME_BTA_ACK_EN` writer - NA"]
36pub type FRAME_BTA_ACK_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `LP_CMD_EN` reader - NA"]
38pub type LP_CMD_EN_R = crate::BitReader;
39#[doc = "Field `LP_CMD_EN` writer - NA"]
40pub type LP_CMD_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `VPG_EN` reader - NA"]
42pub type VPG_EN_R = crate::BitReader;
43#[doc = "Field `VPG_EN` writer - NA"]
44pub type VPG_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
45#[doc = "Field `VPG_MODE` reader - NA"]
46pub type VPG_MODE_R = crate::BitReader;
47#[doc = "Field `VPG_MODE` writer - NA"]
48pub type VPG_MODE_W<'a, REG> = crate::BitWriter<'a, REG>;
49#[doc = "Field `VPG_ORIENTATION` reader - NA"]
50pub type VPG_ORIENTATION_R = crate::BitReader;
51#[doc = "Field `VPG_ORIENTATION` writer - NA"]
52pub type VPG_ORIENTATION_W<'a, REG> = crate::BitWriter<'a, REG>;
53impl R {
54    #[doc = "Bits 0:1 - NA"]
55    #[inline(always)]
56    pub fn vid_mode_type(&self) -> VID_MODE_TYPE_R {
57        VID_MODE_TYPE_R::new((self.bits & 3) as u8)
58    }
59    #[doc = "Bit 8 - NA"]
60    #[inline(always)]
61    pub fn lp_vsa_en(&self) -> LP_VSA_EN_R {
62        LP_VSA_EN_R::new(((self.bits >> 8) & 1) != 0)
63    }
64    #[doc = "Bit 9 - NA"]
65    #[inline(always)]
66    pub fn lp_vbp_en(&self) -> LP_VBP_EN_R {
67        LP_VBP_EN_R::new(((self.bits >> 9) & 1) != 0)
68    }
69    #[doc = "Bit 10 - NA"]
70    #[inline(always)]
71    pub fn lp_vfp_en(&self) -> LP_VFP_EN_R {
72        LP_VFP_EN_R::new(((self.bits >> 10) & 1) != 0)
73    }
74    #[doc = "Bit 11 - NA"]
75    #[inline(always)]
76    pub fn lp_vact_en(&self) -> LP_VACT_EN_R {
77        LP_VACT_EN_R::new(((self.bits >> 11) & 1) != 0)
78    }
79    #[doc = "Bit 12 - NA"]
80    #[inline(always)]
81    pub fn lp_hbp_en(&self) -> LP_HBP_EN_R {
82        LP_HBP_EN_R::new(((self.bits >> 12) & 1) != 0)
83    }
84    #[doc = "Bit 13 - NA"]
85    #[inline(always)]
86    pub fn lp_hfp_en(&self) -> LP_HFP_EN_R {
87        LP_HFP_EN_R::new(((self.bits >> 13) & 1) != 0)
88    }
89    #[doc = "Bit 14 - NA"]
90    #[inline(always)]
91    pub fn frame_bta_ack_en(&self) -> FRAME_BTA_ACK_EN_R {
92        FRAME_BTA_ACK_EN_R::new(((self.bits >> 14) & 1) != 0)
93    }
94    #[doc = "Bit 15 - NA"]
95    #[inline(always)]
96    pub fn lp_cmd_en(&self) -> LP_CMD_EN_R {
97        LP_CMD_EN_R::new(((self.bits >> 15) & 1) != 0)
98    }
99    #[doc = "Bit 16 - NA"]
100    #[inline(always)]
101    pub fn vpg_en(&self) -> VPG_EN_R {
102        VPG_EN_R::new(((self.bits >> 16) & 1) != 0)
103    }
104    #[doc = "Bit 20 - NA"]
105    #[inline(always)]
106    pub fn vpg_mode(&self) -> VPG_MODE_R {
107        VPG_MODE_R::new(((self.bits >> 20) & 1) != 0)
108    }
109    #[doc = "Bit 24 - NA"]
110    #[inline(always)]
111    pub fn vpg_orientation(&self) -> VPG_ORIENTATION_R {
112        VPG_ORIENTATION_R::new(((self.bits >> 24) & 1) != 0)
113    }
114}
115#[cfg(feature = "impl-register-debug")]
116impl core::fmt::Debug for R {
117    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
118        f.debug_struct("VID_MODE_CFG")
119            .field(
120                "vid_mode_type",
121                &format_args!("{}", self.vid_mode_type().bits()),
122            )
123            .field("lp_vsa_en", &format_args!("{}", self.lp_vsa_en().bit()))
124            .field("lp_vbp_en", &format_args!("{}", self.lp_vbp_en().bit()))
125            .field("lp_vfp_en", &format_args!("{}", self.lp_vfp_en().bit()))
126            .field("lp_vact_en", &format_args!("{}", self.lp_vact_en().bit()))
127            .field("lp_hbp_en", &format_args!("{}", self.lp_hbp_en().bit()))
128            .field("lp_hfp_en", &format_args!("{}", self.lp_hfp_en().bit()))
129            .field(
130                "frame_bta_ack_en",
131                &format_args!("{}", self.frame_bta_ack_en().bit()),
132            )
133            .field("lp_cmd_en", &format_args!("{}", self.lp_cmd_en().bit()))
134            .field("vpg_en", &format_args!("{}", self.vpg_en().bit()))
135            .field("vpg_mode", &format_args!("{}", self.vpg_mode().bit()))
136            .field(
137                "vpg_orientation",
138                &format_args!("{}", self.vpg_orientation().bit()),
139            )
140            .finish()
141    }
142}
143#[cfg(feature = "impl-register-debug")]
144impl core::fmt::Debug for crate::generic::Reg<VID_MODE_CFG_SPEC> {
145    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
146        core::fmt::Debug::fmt(&self.read(), f)
147    }
148}
149impl W {
150    #[doc = "Bits 0:1 - NA"]
151    #[inline(always)]
152    #[must_use]
153    pub fn vid_mode_type(&mut self) -> VID_MODE_TYPE_W<VID_MODE_CFG_SPEC> {
154        VID_MODE_TYPE_W::new(self, 0)
155    }
156    #[doc = "Bit 8 - NA"]
157    #[inline(always)]
158    #[must_use]
159    pub fn lp_vsa_en(&mut self) -> LP_VSA_EN_W<VID_MODE_CFG_SPEC> {
160        LP_VSA_EN_W::new(self, 8)
161    }
162    #[doc = "Bit 9 - NA"]
163    #[inline(always)]
164    #[must_use]
165    pub fn lp_vbp_en(&mut self) -> LP_VBP_EN_W<VID_MODE_CFG_SPEC> {
166        LP_VBP_EN_W::new(self, 9)
167    }
168    #[doc = "Bit 10 - NA"]
169    #[inline(always)]
170    #[must_use]
171    pub fn lp_vfp_en(&mut self) -> LP_VFP_EN_W<VID_MODE_CFG_SPEC> {
172        LP_VFP_EN_W::new(self, 10)
173    }
174    #[doc = "Bit 11 - NA"]
175    #[inline(always)]
176    #[must_use]
177    pub fn lp_vact_en(&mut self) -> LP_VACT_EN_W<VID_MODE_CFG_SPEC> {
178        LP_VACT_EN_W::new(self, 11)
179    }
180    #[doc = "Bit 12 - NA"]
181    #[inline(always)]
182    #[must_use]
183    pub fn lp_hbp_en(&mut self) -> LP_HBP_EN_W<VID_MODE_CFG_SPEC> {
184        LP_HBP_EN_W::new(self, 12)
185    }
186    #[doc = "Bit 13 - NA"]
187    #[inline(always)]
188    #[must_use]
189    pub fn lp_hfp_en(&mut self) -> LP_HFP_EN_W<VID_MODE_CFG_SPEC> {
190        LP_HFP_EN_W::new(self, 13)
191    }
192    #[doc = "Bit 14 - NA"]
193    #[inline(always)]
194    #[must_use]
195    pub fn frame_bta_ack_en(&mut self) -> FRAME_BTA_ACK_EN_W<VID_MODE_CFG_SPEC> {
196        FRAME_BTA_ACK_EN_W::new(self, 14)
197    }
198    #[doc = "Bit 15 - NA"]
199    #[inline(always)]
200    #[must_use]
201    pub fn lp_cmd_en(&mut self) -> LP_CMD_EN_W<VID_MODE_CFG_SPEC> {
202        LP_CMD_EN_W::new(self, 15)
203    }
204    #[doc = "Bit 16 - NA"]
205    #[inline(always)]
206    #[must_use]
207    pub fn vpg_en(&mut self) -> VPG_EN_W<VID_MODE_CFG_SPEC> {
208        VPG_EN_W::new(self, 16)
209    }
210    #[doc = "Bit 20 - NA"]
211    #[inline(always)]
212    #[must_use]
213    pub fn vpg_mode(&mut self) -> VPG_MODE_W<VID_MODE_CFG_SPEC> {
214        VPG_MODE_W::new(self, 20)
215    }
216    #[doc = "Bit 24 - NA"]
217    #[inline(always)]
218    #[must_use]
219    pub fn vpg_orientation(&mut self) -> VPG_ORIENTATION_W<VID_MODE_CFG_SPEC> {
220        VPG_ORIENTATION_W::new(self, 24)
221    }
222}
223#[doc = "NA\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`vid_mode_cfg::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 [`vid_mode_cfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
224pub struct VID_MODE_CFG_SPEC;
225impl crate::RegisterSpec for VID_MODE_CFG_SPEC {
226    type Ux = u32;
227}
228#[doc = "`read()` method returns [`vid_mode_cfg::R`](R) reader structure"]
229impl crate::Readable for VID_MODE_CFG_SPEC {}
230#[doc = "`write(|w| ..)` method takes [`vid_mode_cfg::W`](W) writer structure"]
231impl crate::Writable for VID_MODE_CFG_SPEC {
232    type Safety = crate::Unsafe;
233    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
234    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
235}
236#[doc = "`reset()` method sets VID_MODE_CFG to value 0"]
237impl crate::Resettable for VID_MODE_CFG_SPEC {
238    const RESET_VALUE: u32 = 0;
239}