stm32f4_staging/stm32f469/dsi/
ghcr.rs

1///Register `GHCR` reader
2pub type R = crate::R<GHCRrs>;
3///Register `GHCR` writer
4pub type W = crate::W<GHCRrs>;
5///Field `DT` reader - Type This field configures the packet data type of the header packet.
6pub type DT_R = crate::FieldReader;
7///Field `DT` writer - Type This field configures the packet data type of the header packet.
8pub type DT_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
9///Field `VCID` reader - Channel This field configures the virtual channel ID of the header packet.
10pub type VCID_R = crate::FieldReader;
11///Field `VCID` writer - Channel This field configures the virtual channel ID of the header packet.
12pub type VCID_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13///Field `WCLSB` reader - WordCount LSB This field configures the less significant byte of the header packet word count for long packets, or data 0 for short packets.
14pub type WCLSB_R = crate::FieldReader;
15///Field `WCLSB` writer - WordCount LSB This field configures the less significant byte of the header packet word count for long packets, or data 0 for short packets.
16pub type WCLSB_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17///Field `WCMSB` reader - WordCount MSB This field configures the most significant byte of the header packet word count for long packets, or data 1 for short packets.
18pub type WCMSB_R = crate::FieldReader;
19///Field `WCMSB` writer - WordCount MSB This field configures the most significant byte of the header packet word count for long packets, or data 1 for short packets.
20pub type WCMSB_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
21impl R {
22    ///Bits 0:5 - Type This field configures the packet data type of the header packet.
23    #[inline(always)]
24    pub fn dt(&self) -> DT_R {
25        DT_R::new((self.bits & 0x3f) as u8)
26    }
27    ///Bits 6:7 - Channel This field configures the virtual channel ID of the header packet.
28    #[inline(always)]
29    pub fn vcid(&self) -> VCID_R {
30        VCID_R::new(((self.bits >> 6) & 3) as u8)
31    }
32    ///Bits 8:15 - WordCount LSB This field configures the less significant byte of the header packet word count for long packets, or data 0 for short packets.
33    #[inline(always)]
34    pub fn wclsb(&self) -> WCLSB_R {
35        WCLSB_R::new(((self.bits >> 8) & 0xff) as u8)
36    }
37    ///Bits 16:23 - WordCount MSB This field configures the most significant byte of the header packet word count for long packets, or data 1 for short packets.
38    #[inline(always)]
39    pub fn wcmsb(&self) -> WCMSB_R {
40        WCMSB_R::new(((self.bits >> 16) & 0xff) as u8)
41    }
42}
43impl core::fmt::Debug for R {
44    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
45        f.debug_struct("GHCR")
46            .field("dt", &self.dt())
47            .field("vcid", &self.vcid())
48            .field("wclsb", &self.wclsb())
49            .field("wcmsb", &self.wcmsb())
50            .finish()
51    }
52}
53impl W {
54    ///Bits 0:5 - Type This field configures the packet data type of the header packet.
55    #[inline(always)]
56    pub fn dt(&mut self) -> DT_W<GHCRrs> {
57        DT_W::new(self, 0)
58    }
59    ///Bits 6:7 - Channel This field configures the virtual channel ID of the header packet.
60    #[inline(always)]
61    pub fn vcid(&mut self) -> VCID_W<GHCRrs> {
62        VCID_W::new(self, 6)
63    }
64    ///Bits 8:15 - WordCount LSB This field configures the less significant byte of the header packet word count for long packets, or data 0 for short packets.
65    #[inline(always)]
66    pub fn wclsb(&mut self) -> WCLSB_W<GHCRrs> {
67        WCLSB_W::new(self, 8)
68    }
69    ///Bits 16:23 - WordCount MSB This field configures the most significant byte of the header packet word count for long packets, or data 1 for short packets.
70    #[inline(always)]
71    pub fn wcmsb(&mut self) -> WCMSB_W<GHCRrs> {
72        WCMSB_W::new(self, 16)
73    }
74}
75/**DSI Host generic header configuration register
76
77You can [`read`](crate::Reg::read) this register and get [`ghcr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ghcr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
78
79See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F469.html#DSI:GHCR)*/
80pub struct GHCRrs;
81impl crate::RegisterSpec for GHCRrs {
82    type Ux = u32;
83}
84///`read()` method returns [`ghcr::R`](R) reader structure
85impl crate::Readable for GHCRrs {}
86///`write(|w| ..)` method takes [`ghcr::W`](W) writer structure
87impl crate::Writable for GHCRrs {
88    type Safety = crate::Unsafe;
89}
90///`reset()` method sets GHCR to value 0
91impl crate::Resettable for GHCRrs {}