esp32p4/h264/
b_roi_region4.rs1#[doc = "Register `B_ROI_REGION4` reader"]
2pub type R = crate::R<B_ROI_REGION4_SPEC>;
3#[doc = "Register `B_ROI_REGION4` writer"]
4pub type W = crate::W<B_ROI_REGION4_SPEC>;
5#[doc = "Field `X` reader - Configures the horizontal start macroblocks of region 4 in Video B."]
6pub type X_R = crate::FieldReader;
7#[doc = "Field `X` writer - Configures the horizontal start macroblocks of region 4 in Video B."]
8pub type X_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
9#[doc = "Field `Y` reader - Configures the vertical start macroblocks of region 4 in Video B."]
10pub type Y_R = crate::FieldReader;
11#[doc = "Field `Y` writer - Configures the vertical start macroblocks of region 4 in Video B."]
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 4 in video B."]
14pub type X_LEN_R = crate::FieldReader;
15#[doc = "Field `X_LEN` writer - Configures the number of macroblocks in horizontal direction of the region 4 in video B."]
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 4 in video B."]
18pub type Y_LEN_R = crate::FieldReader;
19#[doc = "Field `Y_LEN` writer - Configures the number of macroblocks in vertical direction of the region 4 in video B."]
20pub type Y_LEN_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
21#[doc = "Field `EN` reader - Configures whether or not to open Video B ROI of region 4 .\\\\0:Close ROI\\\\1:Open ROI."]
22pub type EN_R = crate::BitReader;
23#[doc = "Field `EN` writer - Configures whether or not to open Video B ROI of region 4 .\\\\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 4 in Video B."]
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 4 in Video B."]
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 4 in video B."]
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 4 in video B."]
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 B ROI of region 4 .\\\\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("B_ROI_REGION4")
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<B_ROI_REGION4_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 4 in Video B."]
72 #[inline(always)]
73 #[must_use]
74 pub fn x(&mut self) -> X_W<B_ROI_REGION4_SPEC> {
75 X_W::new(self, 0)
76 }
77 #[doc = "Bits 7:13 - Configures the vertical start macroblocks of region 4 in Video B."]
78 #[inline(always)]
79 #[must_use]
80 pub fn y(&mut self) -> Y_W<B_ROI_REGION4_SPEC> {
81 Y_W::new(self, 7)
82 }
83 #[doc = "Bits 14:20 - Configures the number of macroblocks in horizontal direction of the region 4 in video B."]
84 #[inline(always)]
85 #[must_use]
86 pub fn x_len(&mut self) -> X_LEN_W<B_ROI_REGION4_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 4 in video B."]
90 #[inline(always)]
91 #[must_use]
92 pub fn y_len(&mut self) -> Y_LEN_W<B_ROI_REGION4_SPEC> {
93 Y_LEN_W::new(self, 21)
94 }
95 #[doc = "Bit 28 - Configures whether or not to open Video B ROI of region 4 .\\\\0:Close ROI\\\\1:Open ROI."]
96 #[inline(always)]
97 #[must_use]
98 pub fn en(&mut self) -> EN_W<B_ROI_REGION4_SPEC> {
99 EN_W::new(self, 28)
100 }
101}
102#[doc = "Video B H264 ROI region4 range configure register.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`b_roi_region4::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 [`b_roi_region4::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
103pub struct B_ROI_REGION4_SPEC;
104impl crate::RegisterSpec for B_ROI_REGION4_SPEC {
105 type Ux = u32;
106}
107#[doc = "`read()` method returns [`b_roi_region4::R`](R) reader structure"]
108impl crate::Readable for B_ROI_REGION4_SPEC {}
109#[doc = "`write(|w| ..)` method takes [`b_roi_region4::W`](W) writer structure"]
110impl crate::Writable for B_ROI_REGION4_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 B_ROI_REGION4 to value 0"]
116impl crate::Resettable for B_ROI_REGION4_SPEC {
117 const RESET_VALUE: u32 = 0;
118}