esp32p4/lcd_cam/
lcd_ctrl.rs

1#[doc = "Register `LCD_CTRL` reader"]
2pub type R = crate::R<LCD_CTRL_SPEC>;
3#[doc = "Register `LCD_CTRL` writer"]
4pub type W = crate::W<LCD_CTRL_SPEC>;
5#[doc = "Field `LCD_HB_FRONT` reader - It is the horizontal blank front porch of a frame."]
6pub type LCD_HB_FRONT_R = crate::FieldReader<u16>;
7#[doc = "Field `LCD_HB_FRONT` writer - It is the horizontal blank front porch of a frame."]
8pub type LCD_HB_FRONT_W<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>;
9#[doc = "Field `LCD_VA_HEIGHT` reader - It is the vertical active height of a frame."]
10pub type LCD_VA_HEIGHT_R = crate::FieldReader<u16>;
11#[doc = "Field `LCD_VA_HEIGHT` writer - It is the vertical active height of a frame."]
12pub type LCD_VA_HEIGHT_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
13#[doc = "Field `LCD_VT_HEIGHT` reader - It is the vertical total height of a frame."]
14pub type LCD_VT_HEIGHT_R = crate::FieldReader<u16>;
15#[doc = "Field `LCD_VT_HEIGHT` writer - It is the vertical total height of a frame."]
16pub type LCD_VT_HEIGHT_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
17#[doc = "Field `LCD_RGB_MODE_EN` reader - 1: Enable LCD RGB mode. 0: Disable LCD RGB mode."]
18pub type LCD_RGB_MODE_EN_R = crate::BitReader;
19#[doc = "Field `LCD_RGB_MODE_EN` writer - 1: Enable LCD RGB mode. 0: Disable LCD RGB mode."]
20pub type LCD_RGB_MODE_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bits 0:10 - It is the horizontal blank front porch of a frame."]
23    #[inline(always)]
24    pub fn lcd_hb_front(&self) -> LCD_HB_FRONT_R {
25        LCD_HB_FRONT_R::new((self.bits & 0x07ff) as u16)
26    }
27    #[doc = "Bits 11:20 - It is the vertical active height of a frame."]
28    #[inline(always)]
29    pub fn lcd_va_height(&self) -> LCD_VA_HEIGHT_R {
30        LCD_VA_HEIGHT_R::new(((self.bits >> 11) & 0x03ff) as u16)
31    }
32    #[doc = "Bits 21:30 - It is the vertical total height of a frame."]
33    #[inline(always)]
34    pub fn lcd_vt_height(&self) -> LCD_VT_HEIGHT_R {
35        LCD_VT_HEIGHT_R::new(((self.bits >> 21) & 0x03ff) as u16)
36    }
37    #[doc = "Bit 31 - 1: Enable LCD RGB mode. 0: Disable LCD RGB mode."]
38    #[inline(always)]
39    pub fn lcd_rgb_mode_en(&self) -> LCD_RGB_MODE_EN_R {
40        LCD_RGB_MODE_EN_R::new(((self.bits >> 31) & 1) != 0)
41    }
42}
43#[cfg(feature = "impl-register-debug")]
44impl core::fmt::Debug for R {
45    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46        f.debug_struct("LCD_CTRL")
47            .field(
48                "lcd_hb_front",
49                &format_args!("{}", self.lcd_hb_front().bits()),
50            )
51            .field(
52                "lcd_va_height",
53                &format_args!("{}", self.lcd_va_height().bits()),
54            )
55            .field(
56                "lcd_vt_height",
57                &format_args!("{}", self.lcd_vt_height().bits()),
58            )
59            .field(
60                "lcd_rgb_mode_en",
61                &format_args!("{}", self.lcd_rgb_mode_en().bit()),
62            )
63            .finish()
64    }
65}
66#[cfg(feature = "impl-register-debug")]
67impl core::fmt::Debug for crate::generic::Reg<LCD_CTRL_SPEC> {
68    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
69        core::fmt::Debug::fmt(&self.read(), f)
70    }
71}
72impl W {
73    #[doc = "Bits 0:10 - It is the horizontal blank front porch of a frame."]
74    #[inline(always)]
75    #[must_use]
76    pub fn lcd_hb_front(&mut self) -> LCD_HB_FRONT_W<LCD_CTRL_SPEC> {
77        LCD_HB_FRONT_W::new(self, 0)
78    }
79    #[doc = "Bits 11:20 - It is the vertical active height of a frame."]
80    #[inline(always)]
81    #[must_use]
82    pub fn lcd_va_height(&mut self) -> LCD_VA_HEIGHT_W<LCD_CTRL_SPEC> {
83        LCD_VA_HEIGHT_W::new(self, 11)
84    }
85    #[doc = "Bits 21:30 - It is the vertical total height of a frame."]
86    #[inline(always)]
87    #[must_use]
88    pub fn lcd_vt_height(&mut self) -> LCD_VT_HEIGHT_W<LCD_CTRL_SPEC> {
89        LCD_VT_HEIGHT_W::new(self, 21)
90    }
91    #[doc = "Bit 31 - 1: Enable LCD RGB mode. 0: Disable LCD RGB mode."]
92    #[inline(always)]
93    #[must_use]
94    pub fn lcd_rgb_mode_en(&mut self) -> LCD_RGB_MODE_EN_W<LCD_CTRL_SPEC> {
95        LCD_RGB_MODE_EN_W::new(self, 31)
96    }
97}
98#[doc = "LCD config register.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lcd_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 [`lcd_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
99pub struct LCD_CTRL_SPEC;
100impl crate::RegisterSpec for LCD_CTRL_SPEC {
101    type Ux = u32;
102}
103#[doc = "`read()` method returns [`lcd_ctrl::R`](R) reader structure"]
104impl crate::Readable for LCD_CTRL_SPEC {}
105#[doc = "`write(|w| ..)` method takes [`lcd_ctrl::W`](W) writer structure"]
106impl crate::Writable for LCD_CTRL_SPEC {
107    type Safety = crate::Unsafe;
108    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
109    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
110}
111#[doc = "`reset()` method sets LCD_CTRL to value 0"]
112impl crate::Resettable for LCD_CTRL_SPEC {
113    const RESET_VALUE: u32 = 0;
114}