esp32p4/h264/
b_rc_conf0.rs1#[doc = "Register `B_RC_CONF0` reader"]
2pub type R = crate::R<B_RC_CONF0_SPEC>;
3#[doc = "Register `B_RC_CONF0` writer"]
4pub type W = crate::W<B_RC_CONF0_SPEC>;
5#[doc = "Field `B_QP` reader - Configures video B frame level initial luma QP value."]
6pub type B_QP_R = crate::FieldReader;
7#[doc = "Field `B_QP` writer - Configures video B frame level initial luma QP value."]
8pub type B_QP_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
9#[doc = "Field `B_RATE_CTRL_U` reader - Configures video B parameter U value. U = int((float) u << 8)."]
10pub type B_RATE_CTRL_U_R = crate::FieldReader<u16>;
11#[doc = "Field `B_RATE_CTRL_U` writer - Configures video B parameter U value. U = int((float) u << 8)."]
12pub type B_RATE_CTRL_U_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
13#[doc = "Field `B_MB_RATE_CTRL_EN` reader - Configures video A whether or not to open macro block rate ctrl.\\\\1:Open the macro block rate ctrl\\\\1:Close the macro block rate ctrl."]
14pub type B_MB_RATE_CTRL_EN_R = crate::BitReader;
15#[doc = "Field `B_MB_RATE_CTRL_EN` writer - Configures video A whether or not to open macro block rate ctrl.\\\\1:Open the macro block rate ctrl\\\\1:Close the macro block rate ctrl."]
16pub type B_MB_RATE_CTRL_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18 #[doc = "Bits 0:5 - Configures video B frame level initial luma QP value."]
19 #[inline(always)]
20 pub fn b_qp(&self) -> B_QP_R {
21 B_QP_R::new((self.bits & 0x3f) as u8)
22 }
23 #[doc = "Bits 6:21 - Configures video B parameter U value. U = int((float) u << 8)."]
24 #[inline(always)]
25 pub fn b_rate_ctrl_u(&self) -> B_RATE_CTRL_U_R {
26 B_RATE_CTRL_U_R::new(((self.bits >> 6) & 0xffff) as u16)
27 }
28 #[doc = "Bit 22 - Configures video A whether or not to open macro block rate ctrl.\\\\1:Open the macro block rate ctrl\\\\1:Close the macro block rate ctrl."]
29 #[inline(always)]
30 pub fn b_mb_rate_ctrl_en(&self) -> B_MB_RATE_CTRL_EN_R {
31 B_MB_RATE_CTRL_EN_R::new(((self.bits >> 22) & 1) != 0)
32 }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37 f.debug_struct("B_RC_CONF0")
38 .field("b_qp", &format_args!("{}", self.b_qp().bits()))
39 .field(
40 "b_rate_ctrl_u",
41 &format_args!("{}", self.b_rate_ctrl_u().bits()),
42 )
43 .field(
44 "b_mb_rate_ctrl_en",
45 &format_args!("{}", self.b_mb_rate_ctrl_en().bit()),
46 )
47 .finish()
48 }
49}
50#[cfg(feature = "impl-register-debug")]
51impl core::fmt::Debug for crate::generic::Reg<B_RC_CONF0_SPEC> {
52 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
53 core::fmt::Debug::fmt(&self.read(), f)
54 }
55}
56impl W {
57 #[doc = "Bits 0:5 - Configures video B frame level initial luma QP value."]
58 #[inline(always)]
59 #[must_use]
60 pub fn b_qp(&mut self) -> B_QP_W<B_RC_CONF0_SPEC> {
61 B_QP_W::new(self, 0)
62 }
63 #[doc = "Bits 6:21 - Configures video B parameter U value. U = int((float) u << 8)."]
64 #[inline(always)]
65 #[must_use]
66 pub fn b_rate_ctrl_u(&mut self) -> B_RATE_CTRL_U_W<B_RC_CONF0_SPEC> {
67 B_RATE_CTRL_U_W::new(self, 6)
68 }
69 #[doc = "Bit 22 - Configures video A whether or not to open macro block rate ctrl.\\\\1:Open the macro block rate ctrl\\\\1:Close the macro block rate ctrl."]
70 #[inline(always)]
71 #[must_use]
72 pub fn b_mb_rate_ctrl_en(&mut self) -> B_MB_RATE_CTRL_EN_W<B_RC_CONF0_SPEC> {
73 B_MB_RATE_CTRL_EN_W::new(self, 22)
74 }
75}
76#[doc = "Video B rate control configuration register0.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`b_rc_conf0::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_rc_conf0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct B_RC_CONF0_SPEC;
78impl crate::RegisterSpec for B_RC_CONF0_SPEC {
79 type Ux = u32;
80}
81#[doc = "`read()` method returns [`b_rc_conf0::R`](R) reader structure"]
82impl crate::Readable for B_RC_CONF0_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`b_rc_conf0::W`](W) writer structure"]
84impl crate::Writable for B_RC_CONF0_SPEC {
85 type Safety = crate::Unsafe;
86 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
87 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
88}
89#[doc = "`reset()` method sets B_RC_CONF0 to value 0"]
90impl crate::Resettable for B_RC_CONF0_SPEC {
91 const RESET_VALUE: u32 = 0;
92}