esp32p4/h264/
a_roi_region3.rs

1#[doc = "Register `A_ROI_REGION3` reader"]
2pub type R = crate::R<A_ROI_REGION3_SPEC>;
3#[doc = "Register `A_ROI_REGION3` writer"]
4pub type W = crate::W<A_ROI_REGION3_SPEC>;
5#[doc = "Field `X` reader - Configures the horizontal start macroblocks of region 3 in Video A."]
6pub type X_R = crate::FieldReader;
7#[doc = "Field `X` writer - Configures the horizontal start macroblocks of region 3 in Video A."]
8pub type X_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
9#[doc = "Field `Y` reader - Configures the vertical start macroblocks of region 3 in Video A."]
10pub type Y_R = crate::FieldReader;
11#[doc = "Field `Y` writer - Configures the vertical start macroblocks of region 3 in Video A."]
12pub type Y_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
13#[doc = "Field `X_LEN` reader - Configures the number of macroblocks in horizontal direction of the region 3 in video A."]
14pub type X_LEN_R = crate::FieldReader;
15#[doc = "Field `X_LEN` writer - Configures the number of macroblocks in horizontal direction of the region 3 in video A."]
16pub type X_LEN_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
17#[doc = "Field `Y_LEN` reader - Configures the number of macroblocks in vertical direction of the region 3 in video A."]
18pub type Y_LEN_R = crate::FieldReader;
19#[doc = "Field `Y_LEN` writer - Configures the number of macroblocks in vertical direction of the region 3 in video A."]
20pub type Y_LEN_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
21#[doc = "Field `EN` reader - Configures whether or not to open Video A ROI of region 3 .\\\\0:Close ROI\\\\1:Open ROI."]
22pub type EN_R = crate::BitReader;
23#[doc = "Field `EN` writer - Configures whether or not to open Video A ROI of region 3 .\\\\0:Close ROI\\\\1:Open ROI."]
24pub type EN_W<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26    #[doc = "Bits 0:6 - Configures the horizontal start macroblocks of region 3 in Video A."]
27    #[inline(always)]
28    pub fn x(&self) -> X_R {
29        X_R::new((self.bits & 0x7f) as u8)
30    }
31    #[doc = "Bits 7:13 - Configures the vertical start macroblocks of region 3 in Video A."]
32    #[inline(always)]
33    pub fn y(&self) -> Y_R {
34        Y_R::new(((self.bits >> 7) & 0x7f) as u8)
35    }
36    #[doc = "Bits 14:20 - Configures the number of macroblocks in horizontal direction of the region 3 in video A."]
37    #[inline(always)]
38    pub fn x_len(&self) -> X_LEN_R {
39        X_LEN_R::new(((self.bits >> 14) & 0x7f) as u8)
40    }
41    #[doc = "Bits 21:27 - Configures the number of macroblocks in vertical direction of the region 3 in video A."]
42    #[inline(always)]
43    pub fn y_len(&self) -> Y_LEN_R {
44        Y_LEN_R::new(((self.bits >> 21) & 0x7f) as u8)
45    }
46    #[doc = "Bit 28 - Configures whether or not to open Video A ROI of region 3 .\\\\0:Close ROI\\\\1:Open ROI."]
47    #[inline(always)]
48    pub fn en(&self) -> EN_R {
49        EN_R::new(((self.bits >> 28) & 1) != 0)
50    }
51}
52#[cfg(feature = "impl-register-debug")]
53impl core::fmt::Debug for R {
54    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
55        f.debug_struct("A_ROI_REGION3")
56            .field("x", &format_args!("{}", self.x().bits()))
57            .field("y", &format_args!("{}", self.y().bits()))
58            .field("x_len", &format_args!("{}", self.x_len().bits()))
59            .field("y_len", &format_args!("{}", self.y_len().bits()))
60            .field("en", &format_args!("{}", self.en().bit()))
61            .finish()
62    }
63}
64#[cfg(feature = "impl-register-debug")]
65impl core::fmt::Debug for crate::generic::Reg<A_ROI_REGION3_SPEC> {
66    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
67        core::fmt::Debug::fmt(&self.read(), f)
68    }
69}
70impl W {
71    #[doc = "Bits 0:6 - Configures the horizontal start macroblocks of region 3 in Video A."]
72    #[inline(always)]
73    #[must_use]
74    pub fn x(&mut self) -> X_W<A_ROI_REGION3_SPEC> {
75        X_W::new(self, 0)
76    }
77    #[doc = "Bits 7:13 - Configures the vertical start macroblocks of region 3 in Video A."]
78    #[inline(always)]
79    #[must_use]
80    pub fn y(&mut self) -> Y_W<A_ROI_REGION3_SPEC> {
81        Y_W::new(self, 7)
82    }
83    #[doc = "Bits 14:20 - Configures the number of macroblocks in horizontal direction of the region 3 in video A."]
84    #[inline(always)]
85    #[must_use]
86    pub fn x_len(&mut self) -> X_LEN_W<A_ROI_REGION3_SPEC> {
87        X_LEN_W::new(self, 14)
88    }
89    #[doc = "Bits 21:27 - Configures the number of macroblocks in vertical direction of the region 3 in video A."]
90    #[inline(always)]
91    #[must_use]
92    pub fn y_len(&mut self) -> Y_LEN_W<A_ROI_REGION3_SPEC> {
93        Y_LEN_W::new(self, 21)
94    }
95    #[doc = "Bit 28 - Configures whether or not to open Video A ROI of region 3 .\\\\0:Close ROI\\\\1:Open ROI."]
96    #[inline(always)]
97    #[must_use]
98    pub fn en(&mut self) -> EN_W<A_ROI_REGION3_SPEC> {
99        EN_W::new(self, 28)
100    }
101}
102#[doc = "Video A H264 ROI region3 range configure register.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`a_roi_region3::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 [`a_roi_region3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
103pub struct A_ROI_REGION3_SPEC;
104impl crate::RegisterSpec for A_ROI_REGION3_SPEC {
105    type Ux = u32;
106}
107#[doc = "`read()` method returns [`a_roi_region3::R`](R) reader structure"]
108impl crate::Readable for A_ROI_REGION3_SPEC {}
109#[doc = "`write(|w| ..)` method takes [`a_roi_region3::W`](W) writer structure"]
110impl crate::Writable for A_ROI_REGION3_SPEC {
111    type Safety = crate::Unsafe;
112    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
113    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
114}
115#[doc = "`reset()` method sets A_ROI_REGION3 to value 0"]
116impl crate::Resettable for A_ROI_REGION3_SPEC {
117    const RESET_VALUE: u32 = 0;
118}