stm32l4x2_pac/can1/rx/
rir.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5impl super::RIR {
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 STIDR {
16    bits: u16,
17}
18impl STIDR {
19    #[doc = r" Value of the field as raw bits"]
20    #[inline]
21    pub fn bits(&self) -> u16 {
22        self.bits
23    }
24}
25#[doc = r" Value of the field"]
26pub struct EXIDR {
27    bits: u32,
28}
29impl EXIDR {
30    #[doc = r" Value of the field as raw bits"]
31    #[inline]
32    pub fn bits(&self) -> u32 {
33        self.bits
34    }
35}
36#[doc = r" Value of the field"]
37pub struct IDER {
38    bits: bool,
39}
40impl IDER {
41    #[doc = r" Value of the field as raw bits"]
42    #[inline]
43    pub fn bit(&self) -> bool {
44        self.bits
45    }
46    #[doc = r" Returns `true` if the bit is clear (0)"]
47    #[inline]
48    pub fn bit_is_clear(&self) -> bool {
49        !self.bit()
50    }
51    #[doc = r" Returns `true` if the bit is set (1)"]
52    #[inline]
53    pub fn bit_is_set(&self) -> bool {
54        self.bit()
55    }
56}
57#[doc = r" Value of the field"]
58pub struct RTRR {
59    bits: bool,
60}
61impl RTRR {
62    #[doc = r" Value of the field as raw bits"]
63    #[inline]
64    pub fn bit(&self) -> bool {
65        self.bits
66    }
67    #[doc = r" Returns `true` if the bit is clear (0)"]
68    #[inline]
69    pub fn bit_is_clear(&self) -> bool {
70        !self.bit()
71    }
72    #[doc = r" Returns `true` if the bit is set (1)"]
73    #[inline]
74    pub fn bit_is_set(&self) -> bool {
75        self.bit()
76    }
77}
78impl R {
79    #[doc = r" Value of the register as raw bits"]
80    #[inline]
81    pub fn bits(&self) -> u32 {
82        self.bits
83    }
84    #[doc = "Bits 21:31 - STID"]
85    #[inline]
86    pub fn stid(&self) -> STIDR {
87        let bits = {
88            const MASK: u16 = 2047;
89            const OFFSET: u8 = 21;
90            ((self.bits >> OFFSET) & MASK as u32) as u16
91        };
92        STIDR { bits }
93    }
94    #[doc = "Bits 3:20 - EXID"]
95    #[inline]
96    pub fn exid(&self) -> EXIDR {
97        let bits = {
98            const MASK: u32 = 262143;
99            const OFFSET: u8 = 3;
100            ((self.bits >> OFFSET) & MASK as u32) as u32
101        };
102        EXIDR { bits }
103    }
104    #[doc = "Bit 2 - IDE"]
105    #[inline]
106    pub fn ide(&self) -> IDER {
107        let bits = {
108            const MASK: bool = true;
109            const OFFSET: u8 = 2;
110            ((self.bits >> OFFSET) & MASK as u32) != 0
111        };
112        IDER { bits }
113    }
114    #[doc = "Bit 1 - RTR"]
115    #[inline]
116    pub fn rtr(&self) -> RTRR {
117        let bits = {
118            const MASK: bool = true;
119            const OFFSET: u8 = 1;
120            ((self.bits >> OFFSET) & MASK as u32) != 0
121        };
122        RTRR { bits }
123    }
124}