stm32l4/stm32l4x1/can1/
rfr.rs1pub type R = crate::R<RFRrs>;
3pub type W = crate::W<RFRrs>;
5pub type FMP_R = crate::FieldReader;
7#[cfg_attr(feature = "defmt", derive(defmt::Format))]
11#[derive(Clone, Copy, Debug, PartialEq, Eq)]
12pub enum FULL0R {
13 NotFull = 0,
15 Full = 1,
17}
18impl From<FULL0R> for bool {
19 #[inline(always)]
20 fn from(variant: FULL0R) -> Self {
21 variant as u8 != 0
22 }
23}
24pub type FULL_R = crate::BitReader<FULL0R>;
26impl FULL_R {
27 #[inline(always)]
29 pub const fn variant(&self) -> FULL0R {
30 match self.bits {
31 false => FULL0R::NotFull,
32 true => FULL0R::Full,
33 }
34 }
35 #[inline(always)]
37 pub fn is_not_full(&self) -> bool {
38 *self == FULL0R::NotFull
39 }
40 #[inline(always)]
42 pub fn is_full(&self) -> bool {
43 *self == FULL0R::Full
44 }
45}
46#[cfg_attr(feature = "defmt", derive(defmt::Format))]
50#[derive(Clone, Copy, Debug, PartialEq, Eq)]
51pub enum FULL0W {
52 Clear = 1,
54}
55impl From<FULL0W> for bool {
56 #[inline(always)]
57 fn from(variant: FULL0W) -> Self {
58 variant as u8 != 0
59 }
60}
61pub type FULL_W<'a, REG> = crate::BitWriter<'a, REG, FULL0W>;
63impl<'a, REG> FULL_W<'a, REG>
64where
65 REG: crate::Writable + crate::RegisterSpec,
66{
67 #[inline(always)]
69 pub fn clear(self) -> &'a mut crate::W<REG> {
70 self.variant(FULL0W::Clear)
71 }
72}
73#[cfg_attr(feature = "defmt", derive(defmt::Format))]
77#[derive(Clone, Copy, Debug, PartialEq, Eq)]
78pub enum FOVR0R {
79 NoOverrun = 0,
81 Overrun = 1,
83}
84impl From<FOVR0R> for bool {
85 #[inline(always)]
86 fn from(variant: FOVR0R) -> Self {
87 variant as u8 != 0
88 }
89}
90pub type FOVR_R = crate::BitReader<FOVR0R>;
92impl FOVR_R {
93 #[inline(always)]
95 pub const fn variant(&self) -> FOVR0R {
96 match self.bits {
97 false => FOVR0R::NoOverrun,
98 true => FOVR0R::Overrun,
99 }
100 }
101 #[inline(always)]
103 pub fn is_no_overrun(&self) -> bool {
104 *self == FOVR0R::NoOverrun
105 }
106 #[inline(always)]
108 pub fn is_overrun(&self) -> bool {
109 *self == FOVR0R::Overrun
110 }
111}
112#[cfg_attr(feature = "defmt", derive(defmt::Format))]
116#[derive(Clone, Copy, Debug, PartialEq, Eq)]
117pub enum FOVR0W {
118 Clear = 1,
120}
121impl From<FOVR0W> for bool {
122 #[inline(always)]
123 fn from(variant: FOVR0W) -> Self {
124 variant as u8 != 0
125 }
126}
127pub type FOVR_W<'a, REG> = crate::BitWriter<'a, REG, FOVR0W>;
129impl<'a, REG> FOVR_W<'a, REG>
130where
131 REG: crate::Writable + crate::RegisterSpec,
132{
133 #[inline(always)]
135 pub fn clear(self) -> &'a mut crate::W<REG> {
136 self.variant(FOVR0W::Clear)
137 }
138}
139#[cfg_attr(feature = "defmt", derive(defmt::Format))]
143#[derive(Clone, Copy, Debug, PartialEq, Eq)]
144pub enum RFOM0W {
145 Release = 1,
147}
148impl From<RFOM0W> for bool {
149 #[inline(always)]
150 fn from(variant: RFOM0W) -> Self {
151 variant as u8 != 0
152 }
153}
154pub type RFOM_R = crate::BitReader<RFOM0W>;
156impl RFOM_R {
157 #[inline(always)]
159 pub const fn variant(&self) -> Option<RFOM0W> {
160 match self.bits {
161 true => Some(RFOM0W::Release),
162 _ => None,
163 }
164 }
165 #[inline(always)]
167 pub fn is_release(&self) -> bool {
168 *self == RFOM0W::Release
169 }
170}
171pub type RFOM_W<'a, REG> = crate::BitWriter<'a, REG, RFOM0W>;
173impl<'a, REG> RFOM_W<'a, REG>
174where
175 REG: crate::Writable + crate::RegisterSpec,
176{
177 #[inline(always)]
179 pub fn release(self) -> &'a mut crate::W<REG> {
180 self.variant(RFOM0W::Release)
181 }
182}
183impl R {
184 #[inline(always)]
186 pub fn fmp(&self) -> FMP_R {
187 FMP_R::new((self.bits & 3) as u8)
188 }
189 #[inline(always)]
191 pub fn full(&self) -> FULL_R {
192 FULL_R::new(((self.bits >> 3) & 1) != 0)
193 }
194 #[inline(always)]
196 pub fn fovr(&self) -> FOVR_R {
197 FOVR_R::new(((self.bits >> 4) & 1) != 0)
198 }
199 #[inline(always)]
201 pub fn rfom(&self) -> RFOM_R {
202 RFOM_R::new(((self.bits >> 5) & 1) != 0)
203 }
204}
205impl core::fmt::Debug for R {
206 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
207 f.debug_struct("RFR")
208 .field("rfom", &self.rfom())
209 .field("fovr", &self.fovr())
210 .field("full", &self.full())
211 .field("fmp", &self.fmp())
212 .finish()
213 }
214}
215impl W {
216 #[inline(always)]
218 pub fn full(&mut self) -> FULL_W<RFRrs> {
219 FULL_W::new(self, 3)
220 }
221 #[inline(always)]
223 pub fn fovr(&mut self) -> FOVR_W<RFRrs> {
224 FOVR_W::new(self, 4)
225 }
226 #[inline(always)]
228 pub fn rfom(&mut self) -> RFOM_W<RFRrs> {
229 RFOM_W::new(self, 5)
230 }
231}
232pub struct RFRrs;
238impl crate::RegisterSpec for RFRrs {
239 type Ux = u32;
240}
241impl crate::Readable for RFRrs {}
243impl crate::Writable for RFRrs {
245 type Safety = crate::Unsafe;
246}
247impl crate::Resettable for RFRrs {}