stm32f7_staging/stm32f779/dsi/
wcfgr.rs

1///Register `WCFGR` reader
2pub type R = crate::R<WCFGRrs>;
3///Register `WCFGR` writer
4pub type W = crate::W<WCFGRrs>;
5///Field `DSIM` reader - DSI Mode
6pub type DSIM_R = crate::BitReader;
7///Field `DSIM` writer - DSI Mode
8pub type DSIM_W<'a, REG> = crate::BitWriter<'a, REG>;
9///Field `COLMUX` reader - Color Multiplexing
10pub type COLMUX_R = crate::FieldReader;
11///Field `COLMUX` writer - Color Multiplexing
12pub type COLMUX_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
13///Field `TESRC` reader - TE Source
14pub type TESRC_R = crate::BitReader;
15///Field `TESRC` writer - TE Source
16pub type TESRC_W<'a, REG> = crate::BitWriter<'a, REG>;
17///Field `TEPOL` reader - TE Polarity
18pub type TEPOL_R = crate::BitReader;
19///Field `TEPOL` writer - TE Polarity
20pub type TEPOL_W<'a, REG> = crate::BitWriter<'a, REG>;
21///Field `AR` reader - Automatic Refresh
22pub type AR_R = crate::BitReader;
23///Field `AR` writer - Automatic Refresh
24pub type AR_W<'a, REG> = crate::BitWriter<'a, REG>;
25///Field `VSPOL` reader - VSync Polarity
26pub type VSPOL_R = crate::BitReader;
27///Field `VSPOL` writer - VSync Polarity
28pub type VSPOL_W<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30    ///Bit 0 - DSI Mode
31    #[inline(always)]
32    pub fn dsim(&self) -> DSIM_R {
33        DSIM_R::new((self.bits & 1) != 0)
34    }
35    ///Bits 1:3 - Color Multiplexing
36    #[inline(always)]
37    pub fn colmux(&self) -> COLMUX_R {
38        COLMUX_R::new(((self.bits >> 1) & 7) as u8)
39    }
40    ///Bit 4 - TE Source
41    #[inline(always)]
42    pub fn tesrc(&self) -> TESRC_R {
43        TESRC_R::new(((self.bits >> 4) & 1) != 0)
44    }
45    ///Bit 5 - TE Polarity
46    #[inline(always)]
47    pub fn tepol(&self) -> TEPOL_R {
48        TEPOL_R::new(((self.bits >> 5) & 1) != 0)
49    }
50    ///Bit 6 - Automatic Refresh
51    #[inline(always)]
52    pub fn ar(&self) -> AR_R {
53        AR_R::new(((self.bits >> 6) & 1) != 0)
54    }
55    ///Bit 7 - VSync Polarity
56    #[inline(always)]
57    pub fn vspol(&self) -> VSPOL_R {
58        VSPOL_R::new(((self.bits >> 7) & 1) != 0)
59    }
60}
61impl core::fmt::Debug for R {
62    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
63        f.debug_struct("WCFGR")
64            .field("vspol", &self.vspol())
65            .field("ar", &self.ar())
66            .field("tepol", &self.tepol())
67            .field("tesrc", &self.tesrc())
68            .field("colmux", &self.colmux())
69            .field("dsim", &self.dsim())
70            .finish()
71    }
72}
73impl W {
74    ///Bit 0 - DSI Mode
75    #[inline(always)]
76    pub fn dsim(&mut self) -> DSIM_W<WCFGRrs> {
77        DSIM_W::new(self, 0)
78    }
79    ///Bits 1:3 - Color Multiplexing
80    #[inline(always)]
81    pub fn colmux(&mut self) -> COLMUX_W<WCFGRrs> {
82        COLMUX_W::new(self, 1)
83    }
84    ///Bit 4 - TE Source
85    #[inline(always)]
86    pub fn tesrc(&mut self) -> TESRC_W<WCFGRrs> {
87        TESRC_W::new(self, 4)
88    }
89    ///Bit 5 - TE Polarity
90    #[inline(always)]
91    pub fn tepol(&mut self) -> TEPOL_W<WCFGRrs> {
92        TEPOL_W::new(self, 5)
93    }
94    ///Bit 6 - Automatic Refresh
95    #[inline(always)]
96    pub fn ar(&mut self) -> AR_W<WCFGRrs> {
97        AR_W::new(self, 6)
98    }
99    ///Bit 7 - VSync Polarity
100    #[inline(always)]
101    pub fn vspol(&mut self) -> VSPOL_W<WCFGRrs> {
102        VSPOL_W::new(self, 7)
103    }
104}
105/**DSI Wrapper Configuration Register
106
107You can [`read`](crate::Reg::read) this register and get [`wcfgr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wcfgr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
108
109See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F779.html#DSI:WCFGR)*/
110pub struct WCFGRrs;
111impl crate::RegisterSpec for WCFGRrs {
112    type Ux = u32;
113}
114///`read()` method returns [`wcfgr::R`](R) reader structure
115impl crate::Readable for WCFGRrs {}
116///`write(|w| ..)` method takes [`wcfgr::W`](W) writer structure
117impl crate::Writable for WCFGRrs {
118    type Safety = crate::Unsafe;
119}
120///`reset()` method sets WCFGR to value 0
121impl crate::Resettable for WCFGRrs {}