stm32l4/stm32l4x5/adc_common/
csr.rs1pub type R = crate::R<CSRrs>;
3#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum ADRDY_MST {
9 NotReady = 0,
11 Ready = 1,
13}
14impl From<ADRDY_MST> for bool {
15 #[inline(always)]
16 fn from(variant: ADRDY_MST) -> Self {
17 variant as u8 != 0
18 }
19}
20pub type ADRDY_MST_R = crate::BitReader<ADRDY_MST>;
22impl ADRDY_MST_R {
23 #[inline(always)]
25 pub const fn variant(&self) -> ADRDY_MST {
26 match self.bits {
27 false => ADRDY_MST::NotReady,
28 true => ADRDY_MST::Ready,
29 }
30 }
31 #[inline(always)]
33 pub fn is_not_ready(&self) -> bool {
34 *self == ADRDY_MST::NotReady
35 }
36 #[inline(always)]
38 pub fn is_ready(&self) -> bool {
39 *self == ADRDY_MST::Ready
40 }
41}
42#[cfg_attr(feature = "defmt", derive(defmt::Format))]
46#[derive(Clone, Copy, Debug, PartialEq, Eq)]
47pub enum EOSMP_MST {
48 NotEnded = 0,
50 Ended = 1,
52}
53impl From<EOSMP_MST> for bool {
54 #[inline(always)]
55 fn from(variant: EOSMP_MST) -> Self {
56 variant as u8 != 0
57 }
58}
59pub type EOSMP_MST_R = crate::BitReader<EOSMP_MST>;
61impl EOSMP_MST_R {
62 #[inline(always)]
64 pub const fn variant(&self) -> EOSMP_MST {
65 match self.bits {
66 false => EOSMP_MST::NotEnded,
67 true => EOSMP_MST::Ended,
68 }
69 }
70 #[inline(always)]
72 pub fn is_not_ended(&self) -> bool {
73 *self == EOSMP_MST::NotEnded
74 }
75 #[inline(always)]
77 pub fn is_ended(&self) -> bool {
78 *self == EOSMP_MST::Ended
79 }
80}
81#[cfg_attr(feature = "defmt", derive(defmt::Format))]
85#[derive(Clone, Copy, Debug, PartialEq, Eq)]
86pub enum EOC_MST {
87 NotComplete = 0,
89 Complete = 1,
91}
92impl From<EOC_MST> for bool {
93 #[inline(always)]
94 fn from(variant: EOC_MST) -> Self {
95 variant as u8 != 0
96 }
97}
98pub type EOC_MST_R = crate::BitReader<EOC_MST>;
100impl EOC_MST_R {
101 #[inline(always)]
103 pub const fn variant(&self) -> EOC_MST {
104 match self.bits {
105 false => EOC_MST::NotComplete,
106 true => EOC_MST::Complete,
107 }
108 }
109 #[inline(always)]
111 pub fn is_not_complete(&self) -> bool {
112 *self == EOC_MST::NotComplete
113 }
114 #[inline(always)]
116 pub fn is_complete(&self) -> bool {
117 *self == EOC_MST::Complete
118 }
119}
120#[cfg_attr(feature = "defmt", derive(defmt::Format))]
124#[derive(Clone, Copy, Debug, PartialEq, Eq)]
125pub enum EOS_MST {
126 NotComplete = 0,
128 Complete = 1,
130}
131impl From<EOS_MST> for bool {
132 #[inline(always)]
133 fn from(variant: EOS_MST) -> Self {
134 variant as u8 != 0
135 }
136}
137pub type EOS_MST_R = crate::BitReader<EOS_MST>;
139impl EOS_MST_R {
140 #[inline(always)]
142 pub const fn variant(&self) -> EOS_MST {
143 match self.bits {
144 false => EOS_MST::NotComplete,
145 true => EOS_MST::Complete,
146 }
147 }
148 #[inline(always)]
150 pub fn is_not_complete(&self) -> bool {
151 *self == EOS_MST::NotComplete
152 }
153 #[inline(always)]
155 pub fn is_complete(&self) -> bool {
156 *self == EOS_MST::Complete
157 }
158}
159#[cfg_attr(feature = "defmt", derive(defmt::Format))]
163#[derive(Clone, Copy, Debug, PartialEq, Eq)]
164pub enum OVR_MST {
165 NoOverrun = 0,
167 Overrun = 1,
169}
170impl From<OVR_MST> for bool {
171 #[inline(always)]
172 fn from(variant: OVR_MST) -> Self {
173 variant as u8 != 0
174 }
175}
176pub type OVR_MST_R = crate::BitReader<OVR_MST>;
178impl OVR_MST_R {
179 #[inline(always)]
181 pub const fn variant(&self) -> OVR_MST {
182 match self.bits {
183 false => OVR_MST::NoOverrun,
184 true => OVR_MST::Overrun,
185 }
186 }
187 #[inline(always)]
189 pub fn is_no_overrun(&self) -> bool {
190 *self == OVR_MST::NoOverrun
191 }
192 #[inline(always)]
194 pub fn is_overrun(&self) -> bool {
195 *self == OVR_MST::Overrun
196 }
197}
198#[cfg_attr(feature = "defmt", derive(defmt::Format))]
202#[derive(Clone, Copy, Debug, PartialEq, Eq)]
203pub enum JEOC_MST {
204 NotComplete = 0,
206 Complete = 1,
208}
209impl From<JEOC_MST> for bool {
210 #[inline(always)]
211 fn from(variant: JEOC_MST) -> Self {
212 variant as u8 != 0
213 }
214}
215pub type JEOC_MST_R = crate::BitReader<JEOC_MST>;
217impl JEOC_MST_R {
218 #[inline(always)]
220 pub const fn variant(&self) -> JEOC_MST {
221 match self.bits {
222 false => JEOC_MST::NotComplete,
223 true => JEOC_MST::Complete,
224 }
225 }
226 #[inline(always)]
228 pub fn is_not_complete(&self) -> bool {
229 *self == JEOC_MST::NotComplete
230 }
231 #[inline(always)]
233 pub fn is_complete(&self) -> bool {
234 *self == JEOC_MST::Complete
235 }
236}
237#[cfg_attr(feature = "defmt", derive(defmt::Format))]
241#[derive(Clone, Copy, Debug, PartialEq, Eq)]
242pub enum JEOS_MST {
243 NotComplete = 0,
245 Complete = 1,
247}
248impl From<JEOS_MST> for bool {
249 #[inline(always)]
250 fn from(variant: JEOS_MST) -> Self {
251 variant as u8 != 0
252 }
253}
254pub type JEOS_MST_R = crate::BitReader<JEOS_MST>;
256impl JEOS_MST_R {
257 #[inline(always)]
259 pub const fn variant(&self) -> JEOS_MST {
260 match self.bits {
261 false => JEOS_MST::NotComplete,
262 true => JEOS_MST::Complete,
263 }
264 }
265 #[inline(always)]
267 pub fn is_not_complete(&self) -> bool {
268 *self == JEOS_MST::NotComplete
269 }
270 #[inline(always)]
272 pub fn is_complete(&self) -> bool {
273 *self == JEOS_MST::Complete
274 }
275}
276#[cfg_attr(feature = "defmt", derive(defmt::Format))]
280#[derive(Clone, Copy, Debug, PartialEq, Eq)]
281pub enum AWD1_MST {
282 NoEvent = 0,
284 Event = 1,
286}
287impl From<AWD1_MST> for bool {
288 #[inline(always)]
289 fn from(variant: AWD1_MST) -> Self {
290 variant as u8 != 0
291 }
292}
293pub type AWD1_MST_R = crate::BitReader<AWD1_MST>;
295impl AWD1_MST_R {
296 #[inline(always)]
298 pub const fn variant(&self) -> AWD1_MST {
299 match self.bits {
300 false => AWD1_MST::NoEvent,
301 true => AWD1_MST::Event,
302 }
303 }
304 #[inline(always)]
306 pub fn is_no_event(&self) -> bool {
307 *self == AWD1_MST::NoEvent
308 }
309 #[inline(always)]
311 pub fn is_event(&self) -> bool {
312 *self == AWD1_MST::Event
313 }
314}
315pub use AWD1_MST_R as AWD2_MST_R;
317pub use AWD1_MST_R as AWD3_MST_R;
319#[cfg_attr(feature = "defmt", derive(defmt::Format))]
323#[derive(Clone, Copy, Debug, PartialEq, Eq)]
324pub enum JQOVF_MST {
325 NoOverflow = 0,
327 Overflow = 1,
329}
330impl From<JQOVF_MST> for bool {
331 #[inline(always)]
332 fn from(variant: JQOVF_MST) -> Self {
333 variant as u8 != 0
334 }
335}
336pub type JQOVF_MST_R = crate::BitReader<JQOVF_MST>;
338impl JQOVF_MST_R {
339 #[inline(always)]
341 pub const fn variant(&self) -> JQOVF_MST {
342 match self.bits {
343 false => JQOVF_MST::NoOverflow,
344 true => JQOVF_MST::Overflow,
345 }
346 }
347 #[inline(always)]
349 pub fn is_no_overflow(&self) -> bool {
350 *self == JQOVF_MST::NoOverflow
351 }
352 #[inline(always)]
354 pub fn is_overflow(&self) -> bool {
355 *self == JQOVF_MST::Overflow
356 }
357}
358pub use ADRDY_MST_R as ADRDY_SLV_R;
360pub use AWD1_MST_R as AWD1_SLV_R;
362pub use AWD1_MST_R as AWD2_SLV_R;
364pub use AWD1_MST_R as AWD3_SLV_R;
366pub use EOC_MST_R as EOC_SLV_R;
368pub use EOSMP_MST_R as EOSMP_SLV_R;
370pub use EOS_MST_R as EOS_SLV_R;
372pub use JEOC_MST_R as JEOC_SLV_R;
374pub use JEOS_MST_R as JEOS_SLV_R;
376pub use JQOVF_MST_R as JQOVF_SLV_R;
378pub use OVR_MST_R as OVR_SLV_R;
380impl R {
381 #[inline(always)]
383 pub fn adrdy_mst(&self) -> ADRDY_MST_R {
384 ADRDY_MST_R::new((self.bits & 1) != 0)
385 }
386 #[inline(always)]
388 pub fn eosmp_mst(&self) -> EOSMP_MST_R {
389 EOSMP_MST_R::new(((self.bits >> 1) & 1) != 0)
390 }
391 #[inline(always)]
393 pub fn eoc_mst(&self) -> EOC_MST_R {
394 EOC_MST_R::new(((self.bits >> 2) & 1) != 0)
395 }
396 #[inline(always)]
398 pub fn eos_mst(&self) -> EOS_MST_R {
399 EOS_MST_R::new(((self.bits >> 3) & 1) != 0)
400 }
401 #[inline(always)]
403 pub fn ovr_mst(&self) -> OVR_MST_R {
404 OVR_MST_R::new(((self.bits >> 4) & 1) != 0)
405 }
406 #[inline(always)]
408 pub fn jeoc_mst(&self) -> JEOC_MST_R {
409 JEOC_MST_R::new(((self.bits >> 5) & 1) != 0)
410 }
411 #[inline(always)]
413 pub fn jeos_mst(&self) -> JEOS_MST_R {
414 JEOS_MST_R::new(((self.bits >> 6) & 1) != 0)
415 }
416 #[inline(always)]
418 pub fn awd1_mst(&self) -> AWD1_MST_R {
419 AWD1_MST_R::new(((self.bits >> 7) & 1) != 0)
420 }
421 #[inline(always)]
423 pub fn awd2_mst(&self) -> AWD2_MST_R {
424 AWD2_MST_R::new(((self.bits >> 8) & 1) != 0)
425 }
426 #[inline(always)]
428 pub fn awd3_mst(&self) -> AWD3_MST_R {
429 AWD3_MST_R::new(((self.bits >> 9) & 1) != 0)
430 }
431 #[inline(always)]
433 pub fn jqovf_mst(&self) -> JQOVF_MST_R {
434 JQOVF_MST_R::new(((self.bits >> 10) & 1) != 0)
435 }
436 #[inline(always)]
438 pub fn adrdy_slv(&self) -> ADRDY_SLV_R {
439 ADRDY_SLV_R::new(((self.bits >> 16) & 1) != 0)
440 }
441 #[inline(always)]
443 pub fn eosmp_slv(&self) -> EOSMP_SLV_R {
444 EOSMP_SLV_R::new(((self.bits >> 17) & 1) != 0)
445 }
446 #[inline(always)]
448 pub fn eoc_slv(&self) -> EOC_SLV_R {
449 EOC_SLV_R::new(((self.bits >> 18) & 1) != 0)
450 }
451 #[inline(always)]
453 pub fn eos_slv(&self) -> EOS_SLV_R {
454 EOS_SLV_R::new(((self.bits >> 19) & 1) != 0)
455 }
456 #[inline(always)]
458 pub fn ovr_slv(&self) -> OVR_SLV_R {
459 OVR_SLV_R::new(((self.bits >> 20) & 1) != 0)
460 }
461 #[inline(always)]
463 pub fn jeoc_slv(&self) -> JEOC_SLV_R {
464 JEOC_SLV_R::new(((self.bits >> 21) & 1) != 0)
465 }
466 #[inline(always)]
468 pub fn jeos_slv(&self) -> JEOS_SLV_R {
469 JEOS_SLV_R::new(((self.bits >> 22) & 1) != 0)
470 }
471 #[inline(always)]
473 pub fn awd1_slv(&self) -> AWD1_SLV_R {
474 AWD1_SLV_R::new(((self.bits >> 23) & 1) != 0)
475 }
476 #[inline(always)]
478 pub fn awd2_slv(&self) -> AWD2_SLV_R {
479 AWD2_SLV_R::new(((self.bits >> 24) & 1) != 0)
480 }
481 #[inline(always)]
483 pub fn awd3_slv(&self) -> AWD3_SLV_R {
484 AWD3_SLV_R::new(((self.bits >> 25) & 1) != 0)
485 }
486 #[inline(always)]
488 pub fn jqovf_slv(&self) -> JQOVF_SLV_R {
489 JQOVF_SLV_R::new(((self.bits >> 26) & 1) != 0)
490 }
491}
492impl core::fmt::Debug for R {
493 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
494 f.debug_struct("CSR")
495 .field("adrdy_mst", &self.adrdy_mst())
496 .field("eosmp_mst", &self.eosmp_mst())
497 .field("eoc_mst", &self.eoc_mst())
498 .field("eos_mst", &self.eos_mst())
499 .field("ovr_mst", &self.ovr_mst())
500 .field("jeoc_mst", &self.jeoc_mst())
501 .field("jeos_mst", &self.jeos_mst())
502 .field("awd1_mst", &self.awd1_mst())
503 .field("awd2_mst", &self.awd2_mst())
504 .field("awd3_mst", &self.awd3_mst())
505 .field("jqovf_mst", &self.jqovf_mst())
506 .field("adrdy_slv", &self.adrdy_slv())
507 .field("eosmp_slv", &self.eosmp_slv())
508 .field("eoc_slv", &self.eoc_slv())
509 .field("eos_slv", &self.eos_slv())
510 .field("ovr_slv", &self.ovr_slv())
511 .field("jeoc_slv", &self.jeoc_slv())
512 .field("jeos_slv", &self.jeos_slv())
513 .field("awd1_slv", &self.awd1_slv())
514 .field("awd2_slv", &self.awd2_slv())
515 .field("awd3_slv", &self.awd3_slv())
516 .field("jqovf_slv", &self.jqovf_slv())
517 .finish()
518 }
519}
520pub struct CSRrs;
526impl crate::RegisterSpec for CSRrs {
527 type Ux = u32;
528}
529impl crate::Readable for CSRrs {}
531impl crate::Resettable for CSRrs {}