esp32p4/mipi_dsi_bridge/
dpi_misc_config.rs1#[doc = "Register `DPI_MISC_CONFIG` reader"]
2pub type R = crate::R<DPI_MISC_CONFIG_SPEC>;
3#[doc = "Register `DPI_MISC_CONFIG` writer"]
4pub type W = crate::W<DPI_MISC_CONFIG_SPEC>;
5#[doc = "Field `DPI_EN` reader - this bit configures enable of dpi output, 0: disable, 1: enable"]
6pub type DPI_EN_R = crate::BitReader;
7#[doc = "Field `DPI_EN` writer - this bit configures enable of dpi output, 0: disable, 1: enable"]
8pub type DPI_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `FIFO_UNDERRUN_DISCARD_VCNT` reader - this field configures the underrun interrupt musk, when underrun occurs and line cnt is less then this field"]
10pub type FIFO_UNDERRUN_DISCARD_VCNT_R = crate::FieldReader<u16>;
11#[doc = "Field `FIFO_UNDERRUN_DISCARD_VCNT` writer - this field configures the underrun interrupt musk, when underrun occurs and line cnt is less then this field"]
12pub type FIFO_UNDERRUN_DISCARD_VCNT_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>;
13impl R {
14 #[doc = "Bit 0 - this bit configures enable of dpi output, 0: disable, 1: enable"]
15 #[inline(always)]
16 pub fn dpi_en(&self) -> DPI_EN_R {
17 DPI_EN_R::new((self.bits & 1) != 0)
18 }
19 #[doc = "Bits 4:15 - this field configures the underrun interrupt musk, when underrun occurs and line cnt is less then this field"]
20 #[inline(always)]
21 pub fn fifo_underrun_discard_vcnt(&self) -> FIFO_UNDERRUN_DISCARD_VCNT_R {
22 FIFO_UNDERRUN_DISCARD_VCNT_R::new(((self.bits >> 4) & 0x0fff) as u16)
23 }
24}
25#[cfg(feature = "impl-register-debug")]
26impl core::fmt::Debug for R {
27 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28 f.debug_struct("DPI_MISC_CONFIG")
29 .field("dpi_en", &format_args!("{}", self.dpi_en().bit()))
30 .field(
31 "fifo_underrun_discard_vcnt",
32 &format_args!("{}", self.fifo_underrun_discard_vcnt().bits()),
33 )
34 .finish()
35 }
36}
37#[cfg(feature = "impl-register-debug")]
38impl core::fmt::Debug for crate::generic::Reg<DPI_MISC_CONFIG_SPEC> {
39 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
40 core::fmt::Debug::fmt(&self.read(), f)
41 }
42}
43impl W {
44 #[doc = "Bit 0 - this bit configures enable of dpi output, 0: disable, 1: enable"]
45 #[inline(always)]
46 #[must_use]
47 pub fn dpi_en(&mut self) -> DPI_EN_W<DPI_MISC_CONFIG_SPEC> {
48 DPI_EN_W::new(self, 0)
49 }
50 #[doc = "Bits 4:15 - this field configures the underrun interrupt musk, when underrun occurs and line cnt is less then this field"]
51 #[inline(always)]
52 #[must_use]
53 pub fn fifo_underrun_discard_vcnt(
54 &mut self,
55 ) -> FIFO_UNDERRUN_DISCARD_VCNT_W<DPI_MISC_CONFIG_SPEC> {
56 FIFO_UNDERRUN_DISCARD_VCNT_W::new(self, 4)
57 }
58}
59#[doc = "dsi_bridge dpi misc config register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dpi_misc_config::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 [`dpi_misc_config::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
60pub struct DPI_MISC_CONFIG_SPEC;
61impl crate::RegisterSpec for DPI_MISC_CONFIG_SPEC {
62 type Ux = u32;
63}
64#[doc = "`read()` method returns [`dpi_misc_config::R`](R) reader structure"]
65impl crate::Readable for DPI_MISC_CONFIG_SPEC {}
66#[doc = "`write(|w| ..)` method takes [`dpi_misc_config::W`](W) writer structure"]
67impl crate::Writable for DPI_MISC_CONFIG_SPEC {
68 type Safety = crate::Unsafe;
69 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
70 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
71}
72#[doc = "`reset()` method sets DPI_MISC_CONFIG to value 0x19d0"]
73impl crate::Resettable for DPI_MISC_CONFIG_SPEC {
74 const RESET_VALUE: u32 = 0x19d0;
75}