esp32p4/mipi_dsi_host/
dsc_parameter.rs

1#[doc = "Register `DSC_PARAMETER` reader"]
2pub type R = crate::R<DSC_PARAMETER_SPEC>;
3#[doc = "Register `DSC_PARAMETER` writer"]
4pub type W = crate::W<DSC_PARAMETER_SPEC>;
5#[doc = "Field `COMPRESSION_MODE` reader - NA"]
6pub type COMPRESSION_MODE_R = crate::BitReader;
7#[doc = "Field `COMPRESSION_MODE` writer - NA"]
8pub type COMPRESSION_MODE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `COMPRESS_ALGO` reader - NA"]
10pub type COMPRESS_ALGO_R = crate::FieldReader;
11#[doc = "Field `COMPRESS_ALGO` writer - NA"]
12pub type COMPRESS_ALGO_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13#[doc = "Field `PPS_SEL` reader - NA"]
14pub type PPS_SEL_R = crate::FieldReader;
15#[doc = "Field `PPS_SEL` writer - NA"]
16pub type PPS_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
17impl R {
18    #[doc = "Bit 0 - NA"]
19    #[inline(always)]
20    pub fn compression_mode(&self) -> COMPRESSION_MODE_R {
21        COMPRESSION_MODE_R::new((self.bits & 1) != 0)
22    }
23    #[doc = "Bits 8:9 - NA"]
24    #[inline(always)]
25    pub fn compress_algo(&self) -> COMPRESS_ALGO_R {
26        COMPRESS_ALGO_R::new(((self.bits >> 8) & 3) as u8)
27    }
28    #[doc = "Bits 16:17 - NA"]
29    #[inline(always)]
30    pub fn pps_sel(&self) -> PPS_SEL_R {
31        PPS_SEL_R::new(((self.bits >> 16) & 3) as u8)
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("DSC_PARAMETER")
38            .field(
39                "compression_mode",
40                &format_args!("{}", self.compression_mode().bit()),
41            )
42            .field(
43                "compress_algo",
44                &format_args!("{}", self.compress_algo().bits()),
45            )
46            .field("pps_sel", &format_args!("{}", self.pps_sel().bits()))
47            .finish()
48    }
49}
50#[cfg(feature = "impl-register-debug")]
51impl core::fmt::Debug for crate::generic::Reg<DSC_PARAMETER_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 = "Bit 0 - NA"]
58    #[inline(always)]
59    #[must_use]
60    pub fn compression_mode(&mut self) -> COMPRESSION_MODE_W<DSC_PARAMETER_SPEC> {
61        COMPRESSION_MODE_W::new(self, 0)
62    }
63    #[doc = "Bits 8:9 - NA"]
64    #[inline(always)]
65    #[must_use]
66    pub fn compress_algo(&mut self) -> COMPRESS_ALGO_W<DSC_PARAMETER_SPEC> {
67        COMPRESS_ALGO_W::new(self, 8)
68    }
69    #[doc = "Bits 16:17 - NA"]
70    #[inline(always)]
71    #[must_use]
72    pub fn pps_sel(&mut self) -> PPS_SEL_W<DSC_PARAMETER_SPEC> {
73        PPS_SEL_W::new(self, 16)
74    }
75}
76#[doc = "NA\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dsc_parameter::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 [`dsc_parameter::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct DSC_PARAMETER_SPEC;
78impl crate::RegisterSpec for DSC_PARAMETER_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`dsc_parameter::R`](R) reader structure"]
82impl crate::Readable for DSC_PARAMETER_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`dsc_parameter::W`](W) writer structure"]
84impl crate::Writable for DSC_PARAMETER_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 DSC_PARAMETER to value 0"]
90impl crate::Resettable for DSC_PARAMETER_SPEC {
91    const RESET_VALUE: u32 = 0;
92}