stm32l4x2_pac/can1/rx/
rdhr.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5impl super::RDHR {
6    #[doc = r" Reads the contents of the register"]
7    #[inline]
8    pub fn read(&self) -> R {
9        R {
10            bits: self.register.get(),
11        }
12    }
13}
14#[doc = r" Value of the field"]
15pub struct DATA7R {
16    bits: u8,
17}
18impl DATA7R {
19    #[doc = r" Value of the field as raw bits"]
20    #[inline]
21    pub fn bits(&self) -> u8 {
22        self.bits
23    }
24}
25#[doc = r" Value of the field"]
26pub struct DATA6R {
27    bits: u8,
28}
29impl DATA6R {
30    #[doc = r" Value of the field as raw bits"]
31    #[inline]
32    pub fn bits(&self) -> u8 {
33        self.bits
34    }
35}
36#[doc = r" Value of the field"]
37pub struct DATA5R {
38    bits: u8,
39}
40impl DATA5R {
41    #[doc = r" Value of the field as raw bits"]
42    #[inline]
43    pub fn bits(&self) -> u8 {
44        self.bits
45    }
46}
47#[doc = r" Value of the field"]
48pub struct DATA4R {
49    bits: u8,
50}
51impl DATA4R {
52    #[doc = r" Value of the field as raw bits"]
53    #[inline]
54    pub fn bits(&self) -> u8 {
55        self.bits
56    }
57}
58impl R {
59    #[doc = r" Value of the register as raw bits"]
60    #[inline]
61    pub fn bits(&self) -> u32 {
62        self.bits
63    }
64    #[doc = "Bits 24:31 - DATA7"]
65    #[inline]
66    pub fn data7(&self) -> DATA7R {
67        let bits = {
68            const MASK: u8 = 255;
69            const OFFSET: u8 = 24;
70            ((self.bits >> OFFSET) & MASK as u32) as u8
71        };
72        DATA7R { bits }
73    }
74    #[doc = "Bits 16:23 - DATA6"]
75    #[inline]
76    pub fn data6(&self) -> DATA6R {
77        let bits = {
78            const MASK: u8 = 255;
79            const OFFSET: u8 = 16;
80            ((self.bits >> OFFSET) & MASK as u32) as u8
81        };
82        DATA6R { bits }
83    }
84    #[doc = "Bits 8:15 - DATA5"]
85    #[inline]
86    pub fn data5(&self) -> DATA5R {
87        let bits = {
88            const MASK: u8 = 255;
89            const OFFSET: u8 = 8;
90            ((self.bits >> OFFSET) & MASK as u32) as u8
91        };
92        DATA5R { bits }
93    }
94    #[doc = "Bits 0:7 - DATA4"]
95    #[inline]
96    pub fn data4(&self) -> DATA4R {
97        let bits = {
98            const MASK: u8 = 255;
99            const OFFSET: u8 = 0;
100            ((self.bits >> OFFSET) & MASK as u32) as u8
101        };
102        DATA4R { bits }
103    }
104}