1#[doc = "Register `CR1` reader"]
2pub struct R(crate::R<CR1_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CR1_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CR1_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CR1_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CR1` writer"]
17pub struct W(crate::W<CR1_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CR1_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<CR1_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CR1_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Analog watchdog enable on regular channels\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum AWDEN_A {
40 #[doc = "0: Analog watchdog disabled on regular channels"]
41 Disabled = 0,
42 #[doc = "1: Analog watchdog enabled on regular channels"]
43 Enabled = 1,
44}
45impl From<AWDEN_A> for bool {
46 #[inline(always)]
47 fn from(variant: AWDEN_A) -> Self {
48 variant as u8 != 0
49 }
50}
51#[doc = "Field `AWDEN` reader - Analog watchdog enable on regular channels"]
52pub type AWDEN_R = crate::BitReader<AWDEN_A>;
53impl AWDEN_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> AWDEN_A {
57 match self.bits {
58 false => AWDEN_A::Disabled,
59 true => AWDEN_A::Enabled,
60 }
61 }
62 #[doc = "Checks if the value of the field is `Disabled`"]
63 #[inline(always)]
64 pub fn is_disabled(&self) -> bool {
65 *self == AWDEN_A::Disabled
66 }
67 #[doc = "Checks if the value of the field is `Enabled`"]
68 #[inline(always)]
69 pub fn is_enabled(&self) -> bool {
70 *self == AWDEN_A::Enabled
71 }
72}
73#[doc = "Field `AWDEN` writer - Analog watchdog enable on regular channels"]
74pub type AWDEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, AWDEN_A, O>;
75impl<'a, const O: u8> AWDEN_W<'a, O> {
76 #[doc = "Analog watchdog disabled on regular channels"]
77 #[inline(always)]
78 pub fn disabled(self) -> &'a mut W {
79 self.variant(AWDEN_A::Disabled)
80 }
81 #[doc = "Analog watchdog enabled on regular channels"]
82 #[inline(always)]
83 pub fn enabled(self) -> &'a mut W {
84 self.variant(AWDEN_A::Enabled)
85 }
86}
87#[doc = "Analog watchdog enable on injected channels\n\nValue on reset: 0"]
88#[derive(Clone, Copy, Debug, PartialEq)]
89pub enum JAWDEN_A {
90 #[doc = "0: Analog watchdog disabled on injected channels"]
91 Disabled = 0,
92 #[doc = "1: Analog watchdog enabled on injected channels"]
93 Enabled = 1,
94}
95impl From<JAWDEN_A> for bool {
96 #[inline(always)]
97 fn from(variant: JAWDEN_A) -> Self {
98 variant as u8 != 0
99 }
100}
101#[doc = "Field `JAWDEN` reader - Analog watchdog enable on injected channels"]
102pub type JAWDEN_R = crate::BitReader<JAWDEN_A>;
103impl JAWDEN_R {
104 #[doc = "Get enumerated values variant"]
105 #[inline(always)]
106 pub fn variant(&self) -> JAWDEN_A {
107 match self.bits {
108 false => JAWDEN_A::Disabled,
109 true => JAWDEN_A::Enabled,
110 }
111 }
112 #[doc = "Checks if the value of the field is `Disabled`"]
113 #[inline(always)]
114 pub fn is_disabled(&self) -> bool {
115 *self == JAWDEN_A::Disabled
116 }
117 #[doc = "Checks if the value of the field is `Enabled`"]
118 #[inline(always)]
119 pub fn is_enabled(&self) -> bool {
120 *self == JAWDEN_A::Enabled
121 }
122}
123#[doc = "Field `JAWDEN` writer - Analog watchdog enable on injected channels"]
124pub type JAWDEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, JAWDEN_A, O>;
125impl<'a, const O: u8> JAWDEN_W<'a, O> {
126 #[doc = "Analog watchdog disabled on injected channels"]
127 #[inline(always)]
128 pub fn disabled(self) -> &'a mut W {
129 self.variant(JAWDEN_A::Disabled)
130 }
131 #[doc = "Analog watchdog enabled on injected channels"]
132 #[inline(always)]
133 pub fn enabled(self) -> &'a mut W {
134 self.variant(JAWDEN_A::Enabled)
135 }
136}
137#[doc = "Dual mode selection\n\nValue on reset: 0"]
138#[derive(Clone, Copy, Debug, PartialEq)]
139#[repr(u8)]
140pub enum DUALMOD_A {
141 #[doc = "0: Independent mode"]
142 Independent = 0,
143 #[doc = "1: Combined regular simultaneous + injected simultaneous mode"]
144 RegularInjected = 1,
145 #[doc = "2: Combined regular simultaneous + alternate trigger mode"]
146 RegularAlternateTrigger = 2,
147 #[doc = "3: Combined injected simultaneous + fast interleaved mode"]
148 InjectedFastInterleaved = 3,
149 #[doc = "4: Combined injected simultaneous + slow interleaved mode"]
150 InjectedSlowInterleaved = 4,
151 #[doc = "5: Injected simultaneous mode only"]
152 Injected = 5,
153 #[doc = "6: Regular simultaneous mode only"]
154 Regular = 6,
155 #[doc = "7: Fast interleaved mode only"]
156 FastInterleaved = 7,
157 #[doc = "8: Slow interleaved mode only"]
158 SlowInterleaved = 8,
159 #[doc = "9: Alternate trigger mode only"]
160 AlternateTrigger = 9,
161}
162impl From<DUALMOD_A> for u8 {
163 #[inline(always)]
164 fn from(variant: DUALMOD_A) -> Self {
165 variant as _
166 }
167}
168#[doc = "Field `DUALMOD` reader - Dual mode selection"]
169pub type DUALMOD_R = crate::FieldReader<u8, DUALMOD_A>;
170impl DUALMOD_R {
171 #[doc = "Get enumerated values variant"]
172 #[inline(always)]
173 pub fn variant(&self) -> Option<DUALMOD_A> {
174 match self.bits {
175 0 => Some(DUALMOD_A::Independent),
176 1 => Some(DUALMOD_A::RegularInjected),
177 2 => Some(DUALMOD_A::RegularAlternateTrigger),
178 3 => Some(DUALMOD_A::InjectedFastInterleaved),
179 4 => Some(DUALMOD_A::InjectedSlowInterleaved),
180 5 => Some(DUALMOD_A::Injected),
181 6 => Some(DUALMOD_A::Regular),
182 7 => Some(DUALMOD_A::FastInterleaved),
183 8 => Some(DUALMOD_A::SlowInterleaved),
184 9 => Some(DUALMOD_A::AlternateTrigger),
185 _ => None,
186 }
187 }
188 #[doc = "Checks if the value of the field is `Independent`"]
189 #[inline(always)]
190 pub fn is_independent(&self) -> bool {
191 *self == DUALMOD_A::Independent
192 }
193 #[doc = "Checks if the value of the field is `RegularInjected`"]
194 #[inline(always)]
195 pub fn is_regular_injected(&self) -> bool {
196 *self == DUALMOD_A::RegularInjected
197 }
198 #[doc = "Checks if the value of the field is `RegularAlternateTrigger`"]
199 #[inline(always)]
200 pub fn is_regular_alternate_trigger(&self) -> bool {
201 *self == DUALMOD_A::RegularAlternateTrigger
202 }
203 #[doc = "Checks if the value of the field is `InjectedFastInterleaved`"]
204 #[inline(always)]
205 pub fn is_injected_fast_interleaved(&self) -> bool {
206 *self == DUALMOD_A::InjectedFastInterleaved
207 }
208 #[doc = "Checks if the value of the field is `InjectedSlowInterleaved`"]
209 #[inline(always)]
210 pub fn is_injected_slow_interleaved(&self) -> bool {
211 *self == DUALMOD_A::InjectedSlowInterleaved
212 }
213 #[doc = "Checks if the value of the field is `Injected`"]
214 #[inline(always)]
215 pub fn is_injected(&self) -> bool {
216 *self == DUALMOD_A::Injected
217 }
218 #[doc = "Checks if the value of the field is `Regular`"]
219 #[inline(always)]
220 pub fn is_regular(&self) -> bool {
221 *self == DUALMOD_A::Regular
222 }
223 #[doc = "Checks if the value of the field is `FastInterleaved`"]
224 #[inline(always)]
225 pub fn is_fast_interleaved(&self) -> bool {
226 *self == DUALMOD_A::FastInterleaved
227 }
228 #[doc = "Checks if the value of the field is `SlowInterleaved`"]
229 #[inline(always)]
230 pub fn is_slow_interleaved(&self) -> bool {
231 *self == DUALMOD_A::SlowInterleaved
232 }
233 #[doc = "Checks if the value of the field is `AlternateTrigger`"]
234 #[inline(always)]
235 pub fn is_alternate_trigger(&self) -> bool {
236 *self == DUALMOD_A::AlternateTrigger
237 }
238}
239#[doc = "Field `DUALMOD` writer - Dual mode selection"]
240pub type DUALMOD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CR1_SPEC, u8, DUALMOD_A, 4, O>;
241impl<'a, const O: u8> DUALMOD_W<'a, O> {
242 #[doc = "Independent mode"]
243 #[inline(always)]
244 pub fn independent(self) -> &'a mut W {
245 self.variant(DUALMOD_A::Independent)
246 }
247 #[doc = "Combined regular simultaneous + injected simultaneous mode"]
248 #[inline(always)]
249 pub fn regular_injected(self) -> &'a mut W {
250 self.variant(DUALMOD_A::RegularInjected)
251 }
252 #[doc = "Combined regular simultaneous + alternate trigger mode"]
253 #[inline(always)]
254 pub fn regular_alternate_trigger(self) -> &'a mut W {
255 self.variant(DUALMOD_A::RegularAlternateTrigger)
256 }
257 #[doc = "Combined injected simultaneous + fast interleaved mode"]
258 #[inline(always)]
259 pub fn injected_fast_interleaved(self) -> &'a mut W {
260 self.variant(DUALMOD_A::InjectedFastInterleaved)
261 }
262 #[doc = "Combined injected simultaneous + slow interleaved mode"]
263 #[inline(always)]
264 pub fn injected_slow_interleaved(self) -> &'a mut W {
265 self.variant(DUALMOD_A::InjectedSlowInterleaved)
266 }
267 #[doc = "Injected simultaneous mode only"]
268 #[inline(always)]
269 pub fn injected(self) -> &'a mut W {
270 self.variant(DUALMOD_A::Injected)
271 }
272 #[doc = "Regular simultaneous mode only"]
273 #[inline(always)]
274 pub fn regular(self) -> &'a mut W {
275 self.variant(DUALMOD_A::Regular)
276 }
277 #[doc = "Fast interleaved mode only"]
278 #[inline(always)]
279 pub fn fast_interleaved(self) -> &'a mut W {
280 self.variant(DUALMOD_A::FastInterleaved)
281 }
282 #[doc = "Slow interleaved mode only"]
283 #[inline(always)]
284 pub fn slow_interleaved(self) -> &'a mut W {
285 self.variant(DUALMOD_A::SlowInterleaved)
286 }
287 #[doc = "Alternate trigger mode only"]
288 #[inline(always)]
289 pub fn alternate_trigger(self) -> &'a mut W {
290 self.variant(DUALMOD_A::AlternateTrigger)
291 }
292}
293#[doc = "Field `DISCNUM` reader - Discontinuous mode channel count"]
294pub type DISCNUM_R = crate::FieldReader<u8, u8>;
295#[doc = "Field `DISCNUM` writer - Discontinuous mode channel count"]
296pub type DISCNUM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CR1_SPEC, u8, u8, 3, O>;
297#[doc = "Discontinuous mode on injected channels\n\nValue on reset: 0"]
298#[derive(Clone, Copy, Debug, PartialEq)]
299pub enum JDISCEN_A {
300 #[doc = "0: Discontinuous mode on injected channels disabled"]
301 Disabled = 0,
302 #[doc = "1: Discontinuous mode on injected channels enabled"]
303 Enabled = 1,
304}
305impl From<JDISCEN_A> for bool {
306 #[inline(always)]
307 fn from(variant: JDISCEN_A) -> Self {
308 variant as u8 != 0
309 }
310}
311#[doc = "Field `JDISCEN` reader - Discontinuous mode on injected channels"]
312pub type JDISCEN_R = crate::BitReader<JDISCEN_A>;
313impl JDISCEN_R {
314 #[doc = "Get enumerated values variant"]
315 #[inline(always)]
316 pub fn variant(&self) -> JDISCEN_A {
317 match self.bits {
318 false => JDISCEN_A::Disabled,
319 true => JDISCEN_A::Enabled,
320 }
321 }
322 #[doc = "Checks if the value of the field is `Disabled`"]
323 #[inline(always)]
324 pub fn is_disabled(&self) -> bool {
325 *self == JDISCEN_A::Disabled
326 }
327 #[doc = "Checks if the value of the field is `Enabled`"]
328 #[inline(always)]
329 pub fn is_enabled(&self) -> bool {
330 *self == JDISCEN_A::Enabled
331 }
332}
333#[doc = "Field `JDISCEN` writer - Discontinuous mode on injected channels"]
334pub type JDISCEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, JDISCEN_A, O>;
335impl<'a, const O: u8> JDISCEN_W<'a, O> {
336 #[doc = "Discontinuous mode on injected channels disabled"]
337 #[inline(always)]
338 pub fn disabled(self) -> &'a mut W {
339 self.variant(JDISCEN_A::Disabled)
340 }
341 #[doc = "Discontinuous mode on injected channels enabled"]
342 #[inline(always)]
343 pub fn enabled(self) -> &'a mut W {
344 self.variant(JDISCEN_A::Enabled)
345 }
346}
347#[doc = "Discontinuous mode on regular channels\n\nValue on reset: 0"]
348#[derive(Clone, Copy, Debug, PartialEq)]
349pub enum DISCEN_A {
350 #[doc = "0: Discontinuous mode on regular channels disabled"]
351 Disabled = 0,
352 #[doc = "1: Discontinuous mode on regular channels enabled"]
353 Enabled = 1,
354}
355impl From<DISCEN_A> for bool {
356 #[inline(always)]
357 fn from(variant: DISCEN_A) -> Self {
358 variant as u8 != 0
359 }
360}
361#[doc = "Field `DISCEN` reader - Discontinuous mode on regular channels"]
362pub type DISCEN_R = crate::BitReader<DISCEN_A>;
363impl DISCEN_R {
364 #[doc = "Get enumerated values variant"]
365 #[inline(always)]
366 pub fn variant(&self) -> DISCEN_A {
367 match self.bits {
368 false => DISCEN_A::Disabled,
369 true => DISCEN_A::Enabled,
370 }
371 }
372 #[doc = "Checks if the value of the field is `Disabled`"]
373 #[inline(always)]
374 pub fn is_disabled(&self) -> bool {
375 *self == DISCEN_A::Disabled
376 }
377 #[doc = "Checks if the value of the field is `Enabled`"]
378 #[inline(always)]
379 pub fn is_enabled(&self) -> bool {
380 *self == DISCEN_A::Enabled
381 }
382}
383#[doc = "Field `DISCEN` writer - Discontinuous mode on regular channels"]
384pub type DISCEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, DISCEN_A, O>;
385impl<'a, const O: u8> DISCEN_W<'a, O> {
386 #[doc = "Discontinuous mode on regular channels disabled"]
387 #[inline(always)]
388 pub fn disabled(self) -> &'a mut W {
389 self.variant(DISCEN_A::Disabled)
390 }
391 #[doc = "Discontinuous mode on regular channels enabled"]
392 #[inline(always)]
393 pub fn enabled(self) -> &'a mut W {
394 self.variant(DISCEN_A::Enabled)
395 }
396}
397#[doc = "Automatic injected group conversion\n\nValue on reset: 0"]
398#[derive(Clone, Copy, Debug, PartialEq)]
399pub enum JAUTO_A {
400 #[doc = "0: Automatic injected group conversion disabled"]
401 Disabled = 0,
402 #[doc = "1: Automatic injected group conversion enabled"]
403 Enabled = 1,
404}
405impl From<JAUTO_A> for bool {
406 #[inline(always)]
407 fn from(variant: JAUTO_A) -> Self {
408 variant as u8 != 0
409 }
410}
411#[doc = "Field `JAUTO` reader - Automatic injected group conversion"]
412pub type JAUTO_R = crate::BitReader<JAUTO_A>;
413impl JAUTO_R {
414 #[doc = "Get enumerated values variant"]
415 #[inline(always)]
416 pub fn variant(&self) -> JAUTO_A {
417 match self.bits {
418 false => JAUTO_A::Disabled,
419 true => JAUTO_A::Enabled,
420 }
421 }
422 #[doc = "Checks if the value of the field is `Disabled`"]
423 #[inline(always)]
424 pub fn is_disabled(&self) -> bool {
425 *self == JAUTO_A::Disabled
426 }
427 #[doc = "Checks if the value of the field is `Enabled`"]
428 #[inline(always)]
429 pub fn is_enabled(&self) -> bool {
430 *self == JAUTO_A::Enabled
431 }
432}
433#[doc = "Field `JAUTO` writer - Automatic injected group conversion"]
434pub type JAUTO_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, JAUTO_A, O>;
435impl<'a, const O: u8> JAUTO_W<'a, O> {
436 #[doc = "Automatic injected group conversion disabled"]
437 #[inline(always)]
438 pub fn disabled(self) -> &'a mut W {
439 self.variant(JAUTO_A::Disabled)
440 }
441 #[doc = "Automatic injected group conversion enabled"]
442 #[inline(always)]
443 pub fn enabled(self) -> &'a mut W {
444 self.variant(JAUTO_A::Enabled)
445 }
446}
447#[doc = "Enable the watchdog on a single channel in scan mode\n\nValue on reset: 0"]
448#[derive(Clone, Copy, Debug, PartialEq)]
449pub enum AWDSGL_A {
450 #[doc = "0: Analog watchdog enabled on all channels"]
451 All = 0,
452 #[doc = "1: Analog watchdog enabled on a single channel"]
453 Single = 1,
454}
455impl From<AWDSGL_A> for bool {
456 #[inline(always)]
457 fn from(variant: AWDSGL_A) -> Self {
458 variant as u8 != 0
459 }
460}
461#[doc = "Field `AWDSGL` reader - Enable the watchdog on a single channel in scan mode"]
462pub type AWDSGL_R = crate::BitReader<AWDSGL_A>;
463impl AWDSGL_R {
464 #[doc = "Get enumerated values variant"]
465 #[inline(always)]
466 pub fn variant(&self) -> AWDSGL_A {
467 match self.bits {
468 false => AWDSGL_A::All,
469 true => AWDSGL_A::Single,
470 }
471 }
472 #[doc = "Checks if the value of the field is `All`"]
473 #[inline(always)]
474 pub fn is_all(&self) -> bool {
475 *self == AWDSGL_A::All
476 }
477 #[doc = "Checks if the value of the field is `Single`"]
478 #[inline(always)]
479 pub fn is_single(&self) -> bool {
480 *self == AWDSGL_A::Single
481 }
482}
483#[doc = "Field `AWDSGL` writer - Enable the watchdog on a single channel in scan mode"]
484pub type AWDSGL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, AWDSGL_A, O>;
485impl<'a, const O: u8> AWDSGL_W<'a, O> {
486 #[doc = "Analog watchdog enabled on all channels"]
487 #[inline(always)]
488 pub fn all(self) -> &'a mut W {
489 self.variant(AWDSGL_A::All)
490 }
491 #[doc = "Analog watchdog enabled on a single channel"]
492 #[inline(always)]
493 pub fn single(self) -> &'a mut W {
494 self.variant(AWDSGL_A::Single)
495 }
496}
497#[doc = "Scan mode\n\nValue on reset: 0"]
498#[derive(Clone, Copy, Debug, PartialEq)]
499pub enum SCAN_A {
500 #[doc = "0: Scan mode disabled"]
501 Disabled = 0,
502 #[doc = "1: Scan mode enabled"]
503 Enabled = 1,
504}
505impl From<SCAN_A> for bool {
506 #[inline(always)]
507 fn from(variant: SCAN_A) -> Self {
508 variant as u8 != 0
509 }
510}
511#[doc = "Field `SCAN` reader - Scan mode"]
512pub type SCAN_R = crate::BitReader<SCAN_A>;
513impl SCAN_R {
514 #[doc = "Get enumerated values variant"]
515 #[inline(always)]
516 pub fn variant(&self) -> SCAN_A {
517 match self.bits {
518 false => SCAN_A::Disabled,
519 true => SCAN_A::Enabled,
520 }
521 }
522 #[doc = "Checks if the value of the field is `Disabled`"]
523 #[inline(always)]
524 pub fn is_disabled(&self) -> bool {
525 *self == SCAN_A::Disabled
526 }
527 #[doc = "Checks if the value of the field is `Enabled`"]
528 #[inline(always)]
529 pub fn is_enabled(&self) -> bool {
530 *self == SCAN_A::Enabled
531 }
532}
533#[doc = "Field `SCAN` writer - Scan mode"]
534pub type SCAN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, SCAN_A, O>;
535impl<'a, const O: u8> SCAN_W<'a, O> {
536 #[doc = "Scan mode disabled"]
537 #[inline(always)]
538 pub fn disabled(self) -> &'a mut W {
539 self.variant(SCAN_A::Disabled)
540 }
541 #[doc = "Scan mode enabled"]
542 #[inline(always)]
543 pub fn enabled(self) -> &'a mut W {
544 self.variant(SCAN_A::Enabled)
545 }
546}
547#[doc = "Interrupt enable for injected channels\n\nValue on reset: 0"]
548#[derive(Clone, Copy, Debug, PartialEq)]
549pub enum JEOCIE_A {
550 #[doc = "0: JEOC interrupt disabled"]
551 Disabled = 0,
552 #[doc = "1: JEOC interrupt enabled. An interrupt is generated when the JEOC bit is set"]
553 Enabled = 1,
554}
555impl From<JEOCIE_A> for bool {
556 #[inline(always)]
557 fn from(variant: JEOCIE_A) -> Self {
558 variant as u8 != 0
559 }
560}
561#[doc = "Field `JEOCIE` reader - Interrupt enable for injected channels"]
562pub type JEOCIE_R = crate::BitReader<JEOCIE_A>;
563impl JEOCIE_R {
564 #[doc = "Get enumerated values variant"]
565 #[inline(always)]
566 pub fn variant(&self) -> JEOCIE_A {
567 match self.bits {
568 false => JEOCIE_A::Disabled,
569 true => JEOCIE_A::Enabled,
570 }
571 }
572 #[doc = "Checks if the value of the field is `Disabled`"]
573 #[inline(always)]
574 pub fn is_disabled(&self) -> bool {
575 *self == JEOCIE_A::Disabled
576 }
577 #[doc = "Checks if the value of the field is `Enabled`"]
578 #[inline(always)]
579 pub fn is_enabled(&self) -> bool {
580 *self == JEOCIE_A::Enabled
581 }
582}
583#[doc = "Field `JEOCIE` writer - Interrupt enable for injected channels"]
584pub type JEOCIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, JEOCIE_A, O>;
585impl<'a, const O: u8> JEOCIE_W<'a, O> {
586 #[doc = "JEOC interrupt disabled"]
587 #[inline(always)]
588 pub fn disabled(self) -> &'a mut W {
589 self.variant(JEOCIE_A::Disabled)
590 }
591 #[doc = "JEOC interrupt enabled. An interrupt is generated when the JEOC bit is set"]
592 #[inline(always)]
593 pub fn enabled(self) -> &'a mut W {
594 self.variant(JEOCIE_A::Enabled)
595 }
596}
597#[doc = "Analog watchdog interrupt enable\n\nValue on reset: 0"]
598#[derive(Clone, Copy, Debug, PartialEq)]
599pub enum AWDIE_A {
600 #[doc = "0: Analog watchdog interrupt disabled"]
601 Disabled = 0,
602 #[doc = "1: Analog watchdog interrupt enabled"]
603 Enabled = 1,
604}
605impl From<AWDIE_A> for bool {
606 #[inline(always)]
607 fn from(variant: AWDIE_A) -> Self {
608 variant as u8 != 0
609 }
610}
611#[doc = "Field `AWDIE` reader - Analog watchdog interrupt enable"]
612pub type AWDIE_R = crate::BitReader<AWDIE_A>;
613impl AWDIE_R {
614 #[doc = "Get enumerated values variant"]
615 #[inline(always)]
616 pub fn variant(&self) -> AWDIE_A {
617 match self.bits {
618 false => AWDIE_A::Disabled,
619 true => AWDIE_A::Enabled,
620 }
621 }
622 #[doc = "Checks if the value of the field is `Disabled`"]
623 #[inline(always)]
624 pub fn is_disabled(&self) -> bool {
625 *self == AWDIE_A::Disabled
626 }
627 #[doc = "Checks if the value of the field is `Enabled`"]
628 #[inline(always)]
629 pub fn is_enabled(&self) -> bool {
630 *self == AWDIE_A::Enabled
631 }
632}
633#[doc = "Field `AWDIE` writer - Analog watchdog interrupt enable"]
634pub type AWDIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, AWDIE_A, O>;
635impl<'a, const O: u8> AWDIE_W<'a, O> {
636 #[doc = "Analog watchdog interrupt disabled"]
637 #[inline(always)]
638 pub fn disabled(self) -> &'a mut W {
639 self.variant(AWDIE_A::Disabled)
640 }
641 #[doc = "Analog watchdog interrupt enabled"]
642 #[inline(always)]
643 pub fn enabled(self) -> &'a mut W {
644 self.variant(AWDIE_A::Enabled)
645 }
646}
647#[doc = "Interrupt enable for EOC\n\nValue on reset: 0"]
648#[derive(Clone, Copy, Debug, PartialEq)]
649pub enum EOCIE_A {
650 #[doc = "0: EOC interrupt disabled"]
651 Disabled = 0,
652 #[doc = "1: EOC interrupt enabled. An interrupt is generated when the EOC bit is set"]
653 Enabled = 1,
654}
655impl From<EOCIE_A> for bool {
656 #[inline(always)]
657 fn from(variant: EOCIE_A) -> Self {
658 variant as u8 != 0
659 }
660}
661#[doc = "Field `EOCIE` reader - Interrupt enable for EOC"]
662pub type EOCIE_R = crate::BitReader<EOCIE_A>;
663impl EOCIE_R {
664 #[doc = "Get enumerated values variant"]
665 #[inline(always)]
666 pub fn variant(&self) -> EOCIE_A {
667 match self.bits {
668 false => EOCIE_A::Disabled,
669 true => EOCIE_A::Enabled,
670 }
671 }
672 #[doc = "Checks if the value of the field is `Disabled`"]
673 #[inline(always)]
674 pub fn is_disabled(&self) -> bool {
675 *self == EOCIE_A::Disabled
676 }
677 #[doc = "Checks if the value of the field is `Enabled`"]
678 #[inline(always)]
679 pub fn is_enabled(&self) -> bool {
680 *self == EOCIE_A::Enabled
681 }
682}
683#[doc = "Field `EOCIE` writer - Interrupt enable for EOC"]
684pub type EOCIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, EOCIE_A, O>;
685impl<'a, const O: u8> EOCIE_W<'a, O> {
686 #[doc = "EOC interrupt disabled"]
687 #[inline(always)]
688 pub fn disabled(self) -> &'a mut W {
689 self.variant(EOCIE_A::Disabled)
690 }
691 #[doc = "EOC interrupt enabled. An interrupt is generated when the EOC bit is set"]
692 #[inline(always)]
693 pub fn enabled(self) -> &'a mut W {
694 self.variant(EOCIE_A::Enabled)
695 }
696}
697#[doc = "Field `AWDCH` reader - Analog watchdog channel select bits"]
698pub type AWDCH_R = crate::FieldReader<u8, u8>;
699#[doc = "Field `AWDCH` writer - Analog watchdog channel select bits"]
700pub type AWDCH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CR1_SPEC, u8, u8, 5, O>;
701impl R {
702 #[doc = "Bit 23 - Analog watchdog enable on regular channels"]
703 #[inline(always)]
704 pub fn awden(&self) -> AWDEN_R {
705 AWDEN_R::new(((self.bits >> 23) & 1) != 0)
706 }
707 #[doc = "Bit 22 - Analog watchdog enable on injected channels"]
708 #[inline(always)]
709 pub fn jawden(&self) -> JAWDEN_R {
710 JAWDEN_R::new(((self.bits >> 22) & 1) != 0)
711 }
712 #[doc = "Bits 16:19 - Dual mode selection"]
713 #[inline(always)]
714 pub fn dualmod(&self) -> DUALMOD_R {
715 DUALMOD_R::new(((self.bits >> 16) & 0x0f) as u8)
716 }
717 #[doc = "Bits 13:15 - Discontinuous mode channel count"]
718 #[inline(always)]
719 pub fn discnum(&self) -> DISCNUM_R {
720 DISCNUM_R::new(((self.bits >> 13) & 7) as u8)
721 }
722 #[doc = "Bit 12 - Discontinuous mode on injected channels"]
723 #[inline(always)]
724 pub fn jdiscen(&self) -> JDISCEN_R {
725 JDISCEN_R::new(((self.bits >> 12) & 1) != 0)
726 }
727 #[doc = "Bit 11 - Discontinuous mode on regular channels"]
728 #[inline(always)]
729 pub fn discen(&self) -> DISCEN_R {
730 DISCEN_R::new(((self.bits >> 11) & 1) != 0)
731 }
732 #[doc = "Bit 10 - Automatic injected group conversion"]
733 #[inline(always)]
734 pub fn jauto(&self) -> JAUTO_R {
735 JAUTO_R::new(((self.bits >> 10) & 1) != 0)
736 }
737 #[doc = "Bit 9 - Enable the watchdog on a single channel in scan mode"]
738 #[inline(always)]
739 pub fn awdsgl(&self) -> AWDSGL_R {
740 AWDSGL_R::new(((self.bits >> 9) & 1) != 0)
741 }
742 #[doc = "Bit 8 - Scan mode"]
743 #[inline(always)]
744 pub fn scan(&self) -> SCAN_R {
745 SCAN_R::new(((self.bits >> 8) & 1) != 0)
746 }
747 #[doc = "Bit 7 - Interrupt enable for injected channels"]
748 #[inline(always)]
749 pub fn jeocie(&self) -> JEOCIE_R {
750 JEOCIE_R::new(((self.bits >> 7) & 1) != 0)
751 }
752 #[doc = "Bit 6 - Analog watchdog interrupt enable"]
753 #[inline(always)]
754 pub fn awdie(&self) -> AWDIE_R {
755 AWDIE_R::new(((self.bits >> 6) & 1) != 0)
756 }
757 #[doc = "Bit 5 - Interrupt enable for EOC"]
758 #[inline(always)]
759 pub fn eocie(&self) -> EOCIE_R {
760 EOCIE_R::new(((self.bits >> 5) & 1) != 0)
761 }
762 #[doc = "Bits 0:4 - Analog watchdog channel select bits"]
763 #[inline(always)]
764 pub fn awdch(&self) -> AWDCH_R {
765 AWDCH_R::new((self.bits & 0x1f) as u8)
766 }
767}
768impl W {
769 #[doc = "Bit 23 - Analog watchdog enable on regular channels"]
770 #[inline(always)]
771 pub fn awden(&mut self) -> AWDEN_W<23> {
772 AWDEN_W::new(self)
773 }
774 #[doc = "Bit 22 - Analog watchdog enable on injected channels"]
775 #[inline(always)]
776 pub fn jawden(&mut self) -> JAWDEN_W<22> {
777 JAWDEN_W::new(self)
778 }
779 #[doc = "Bits 16:19 - Dual mode selection"]
780 #[inline(always)]
781 pub fn dualmod(&mut self) -> DUALMOD_W<16> {
782 DUALMOD_W::new(self)
783 }
784 #[doc = "Bits 13:15 - Discontinuous mode channel count"]
785 #[inline(always)]
786 pub fn discnum(&mut self) -> DISCNUM_W<13> {
787 DISCNUM_W::new(self)
788 }
789 #[doc = "Bit 12 - Discontinuous mode on injected channels"]
790 #[inline(always)]
791 pub fn jdiscen(&mut self) -> JDISCEN_W<12> {
792 JDISCEN_W::new(self)
793 }
794 #[doc = "Bit 11 - Discontinuous mode on regular channels"]
795 #[inline(always)]
796 pub fn discen(&mut self) -> DISCEN_W<11> {
797 DISCEN_W::new(self)
798 }
799 #[doc = "Bit 10 - Automatic injected group conversion"]
800 #[inline(always)]
801 pub fn jauto(&mut self) -> JAUTO_W<10> {
802 JAUTO_W::new(self)
803 }
804 #[doc = "Bit 9 - Enable the watchdog on a single channel in scan mode"]
805 #[inline(always)]
806 pub fn awdsgl(&mut self) -> AWDSGL_W<9> {
807 AWDSGL_W::new(self)
808 }
809 #[doc = "Bit 8 - Scan mode"]
810 #[inline(always)]
811 pub fn scan(&mut self) -> SCAN_W<8> {
812 SCAN_W::new(self)
813 }
814 #[doc = "Bit 7 - Interrupt enable for injected channels"]
815 #[inline(always)]
816 pub fn jeocie(&mut self) -> JEOCIE_W<7> {
817 JEOCIE_W::new(self)
818 }
819 #[doc = "Bit 6 - Analog watchdog interrupt enable"]
820 #[inline(always)]
821 pub fn awdie(&mut self) -> AWDIE_W<6> {
822 AWDIE_W::new(self)
823 }
824 #[doc = "Bit 5 - Interrupt enable for EOC"]
825 #[inline(always)]
826 pub fn eocie(&mut self) -> EOCIE_W<5> {
827 EOCIE_W::new(self)
828 }
829 #[doc = "Bits 0:4 - Analog watchdog channel select bits"]
830 #[inline(always)]
831 pub fn awdch(&mut self) -> AWDCH_W<0> {
832 AWDCH_W::new(self)
833 }
834 #[doc = "Writes raw bits to the register."]
835 #[inline(always)]
836 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
837 self.0.bits(bits);
838 self
839 }
840}
841#[doc = "control register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr1](index.html) module"]
842pub struct CR1_SPEC;
843impl crate::RegisterSpec for CR1_SPEC {
844 type Ux = u32;
845}
846#[doc = "`read()` method returns [cr1::R](R) reader structure"]
847impl crate::Readable for CR1_SPEC {
848 type Reader = R;
849}
850#[doc = "`write(|w| ..)` method takes [cr1::W](W) writer structure"]
851impl crate::Writable for CR1_SPEC {
852 type Writer = W;
853}
854#[doc = "`reset()` method sets CR1 to value 0"]
855impl crate::Resettable for CR1_SPEC {
856 #[inline(always)]
857 fn reset_value() -> Self::Ux {
858 0
859 }
860}