1pub type R = crate::R<CRrs>;
3pub type W = crate::W<CRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum ADENR {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<ADENR> for bool {
17 #[inline(always)]
18 fn from(variant: ADENR) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type ADEN_R = crate::BitReader<ADENR>;
24impl ADEN_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> ADENR {
28 match self.bits {
29 false => ADENR::Disabled,
30 true => ADENR::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == ADENR::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == ADENR::Enabled
42 }
43}
44#[cfg_attr(feature = "defmt", derive(defmt::Format))]
48#[derive(Clone, Copy, Debug, PartialEq, Eq)]
49pub enum ADENW {
50 Enabled = 1,
52}
53impl From<ADENW> for bool {
54 #[inline(always)]
55 fn from(variant: ADENW) -> Self {
56 variant as u8 != 0
57 }
58}
59pub type ADEN_W<'a, REG> = crate::BitWriter1S<'a, REG, ADENW>;
61impl<'a, REG> ADEN_W<'a, REG>
62where
63 REG: crate::Writable + crate::RegisterSpec,
64{
65 #[inline(always)]
67 pub fn enabled(self) -> &'a mut crate::W<REG> {
68 self.variant(ADENW::Enabled)
69 }
70}
71#[cfg_attr(feature = "defmt", derive(defmt::Format))]
75#[derive(Clone, Copy, Debug, PartialEq, Eq)]
76pub enum ADDISR {
77 NotDisabling = 0,
79 Disabling = 1,
81}
82impl From<ADDISR> for bool {
83 #[inline(always)]
84 fn from(variant: ADDISR) -> Self {
85 variant as u8 != 0
86 }
87}
88pub type ADDIS_R = crate::BitReader<ADDISR>;
90impl ADDIS_R {
91 #[inline(always)]
93 pub const fn variant(&self) -> ADDISR {
94 match self.bits {
95 false => ADDISR::NotDisabling,
96 true => ADDISR::Disabling,
97 }
98 }
99 #[inline(always)]
101 pub fn is_not_disabling(&self) -> bool {
102 *self == ADDISR::NotDisabling
103 }
104 #[inline(always)]
106 pub fn is_disabling(&self) -> bool {
107 *self == ADDISR::Disabling
108 }
109}
110#[cfg_attr(feature = "defmt", derive(defmt::Format))]
114#[derive(Clone, Copy, Debug, PartialEq, Eq)]
115pub enum ADDISW {
116 Disable = 1,
118}
119impl From<ADDISW> for bool {
120 #[inline(always)]
121 fn from(variant: ADDISW) -> Self {
122 variant as u8 != 0
123 }
124}
125pub type ADDIS_W<'a, REG> = crate::BitWriter1S<'a, REG, ADDISW>;
127impl<'a, REG> ADDIS_W<'a, REG>
128where
129 REG: crate::Writable + crate::RegisterSpec,
130{
131 #[inline(always)]
133 pub fn disable(self) -> &'a mut crate::W<REG> {
134 self.variant(ADDISW::Disable)
135 }
136}
137#[cfg_attr(feature = "defmt", derive(defmt::Format))]
141#[derive(Clone, Copy, Debug, PartialEq, Eq)]
142pub enum ADSTARTR {
143 NotActive = 0,
145 Active = 1,
147}
148impl From<ADSTARTR> for bool {
149 #[inline(always)]
150 fn from(variant: ADSTARTR) -> Self {
151 variant as u8 != 0
152 }
153}
154pub type ADSTART_R = crate::BitReader<ADSTARTR>;
156impl ADSTART_R {
157 #[inline(always)]
159 pub const fn variant(&self) -> ADSTARTR {
160 match self.bits {
161 false => ADSTARTR::NotActive,
162 true => ADSTARTR::Active,
163 }
164 }
165 #[inline(always)]
167 pub fn is_not_active(&self) -> bool {
168 *self == ADSTARTR::NotActive
169 }
170 #[inline(always)]
172 pub fn is_active(&self) -> bool {
173 *self == ADSTARTR::Active
174 }
175}
176#[cfg_attr(feature = "defmt", derive(defmt::Format))]
180#[derive(Clone, Copy, Debug, PartialEq, Eq)]
181pub enum ADSTARTW {
182 StartConversion = 1,
184}
185impl From<ADSTARTW> for bool {
186 #[inline(always)]
187 fn from(variant: ADSTARTW) -> Self {
188 variant as u8 != 0
189 }
190}
191pub type ADSTART_W<'a, REG> = crate::BitWriter1S<'a, REG, ADSTARTW>;
193impl<'a, REG> ADSTART_W<'a, REG>
194where
195 REG: crate::Writable + crate::RegisterSpec,
196{
197 #[inline(always)]
199 pub fn start_conversion(self) -> &'a mut crate::W<REG> {
200 self.variant(ADSTARTW::StartConversion)
201 }
202}
203pub use ADSTART_R as JADSTART_R;
205pub use ADSTART_W as JADSTART_W;
207#[cfg_attr(feature = "defmt", derive(defmt::Format))]
211#[derive(Clone, Copy, Debug, PartialEq, Eq)]
212pub enum ADSTPR {
213 NotStopping = 0,
215 Stopping = 1,
217}
218impl From<ADSTPR> for bool {
219 #[inline(always)]
220 fn from(variant: ADSTPR) -> Self {
221 variant as u8 != 0
222 }
223}
224pub type ADSTP_R = crate::BitReader<ADSTPR>;
226impl ADSTP_R {
227 #[inline(always)]
229 pub const fn variant(&self) -> ADSTPR {
230 match self.bits {
231 false => ADSTPR::NotStopping,
232 true => ADSTPR::Stopping,
233 }
234 }
235 #[inline(always)]
237 pub fn is_not_stopping(&self) -> bool {
238 *self == ADSTPR::NotStopping
239 }
240 #[inline(always)]
242 pub fn is_stopping(&self) -> bool {
243 *self == ADSTPR::Stopping
244 }
245}
246#[cfg_attr(feature = "defmt", derive(defmt::Format))]
250#[derive(Clone, Copy, Debug, PartialEq, Eq)]
251pub enum ADSTPW {
252 StopConversion = 1,
254}
255impl From<ADSTPW> for bool {
256 #[inline(always)]
257 fn from(variant: ADSTPW) -> Self {
258 variant as u8 != 0
259 }
260}
261pub type ADSTP_W<'a, REG> = crate::BitWriter1S<'a, REG, ADSTPW>;
263impl<'a, REG> ADSTP_W<'a, REG>
264where
265 REG: crate::Writable + crate::RegisterSpec,
266{
267 #[inline(always)]
269 pub fn stop_conversion(self) -> &'a mut crate::W<REG> {
270 self.variant(ADSTPW::StopConversion)
271 }
272}
273pub use ADSTP_R as JADSTP_R;
275pub use ADSTP_W as JADSTP_W;
277#[cfg_attr(feature = "defmt", derive(defmt::Format))]
281#[derive(Clone, Copy, Debug, PartialEq, Eq)]
282pub enum ADVREGEN {
283 Disabled = 0,
285 Enabled = 1,
287}
288impl From<ADVREGEN> for bool {
289 #[inline(always)]
290 fn from(variant: ADVREGEN) -> Self {
291 variant as u8 != 0
292 }
293}
294pub type ADVREGEN_R = crate::BitReader<ADVREGEN>;
296impl ADVREGEN_R {
297 #[inline(always)]
299 pub const fn variant(&self) -> ADVREGEN {
300 match self.bits {
301 false => ADVREGEN::Disabled,
302 true => ADVREGEN::Enabled,
303 }
304 }
305 #[inline(always)]
307 pub fn is_disabled(&self) -> bool {
308 *self == ADVREGEN::Disabled
309 }
310 #[inline(always)]
312 pub fn is_enabled(&self) -> bool {
313 *self == ADVREGEN::Enabled
314 }
315}
316pub type ADVREGEN_W<'a, REG> = crate::BitWriter<'a, REG, ADVREGEN>;
318impl<'a, REG> ADVREGEN_W<'a, REG>
319where
320 REG: crate::Writable + crate::RegisterSpec,
321{
322 #[inline(always)]
324 pub fn disabled(self) -> &'a mut crate::W<REG> {
325 self.variant(ADVREGEN::Disabled)
326 }
327 #[inline(always)]
329 pub fn enabled(self) -> &'a mut crate::W<REG> {
330 self.variant(ADVREGEN::Enabled)
331 }
332}
333#[cfg_attr(feature = "defmt", derive(defmt::Format))]
337#[derive(Clone, Copy, Debug, PartialEq, Eq)]
338pub enum DEEPPWD {
339 NotDeepPowerDown = 0,
341 DeepPowerDown = 1,
343}
344impl From<DEEPPWD> for bool {
345 #[inline(always)]
346 fn from(variant: DEEPPWD) -> Self {
347 variant as u8 != 0
348 }
349}
350pub type DEEPPWD_R = crate::BitReader<DEEPPWD>;
352impl DEEPPWD_R {
353 #[inline(always)]
355 pub const fn variant(&self) -> DEEPPWD {
356 match self.bits {
357 false => DEEPPWD::NotDeepPowerDown,
358 true => DEEPPWD::DeepPowerDown,
359 }
360 }
361 #[inline(always)]
363 pub fn is_not_deep_power_down(&self) -> bool {
364 *self == DEEPPWD::NotDeepPowerDown
365 }
366 #[inline(always)]
368 pub fn is_deep_power_down(&self) -> bool {
369 *self == DEEPPWD::DeepPowerDown
370 }
371}
372pub type DEEPPWD_W<'a, REG> = crate::BitWriter<'a, REG, DEEPPWD>;
374impl<'a, REG> DEEPPWD_W<'a, REG>
375where
376 REG: crate::Writable + crate::RegisterSpec,
377{
378 #[inline(always)]
380 pub fn not_deep_power_down(self) -> &'a mut crate::W<REG> {
381 self.variant(DEEPPWD::NotDeepPowerDown)
382 }
383 #[inline(always)]
385 pub fn deep_power_down(self) -> &'a mut crate::W<REG> {
386 self.variant(DEEPPWD::DeepPowerDown)
387 }
388}
389#[cfg_attr(feature = "defmt", derive(defmt::Format))]
393#[derive(Clone, Copy, Debug, PartialEq, Eq)]
394pub enum ADCALDIF {
395 SingleEnded = 0,
397 Differential = 1,
399}
400impl From<ADCALDIF> for bool {
401 #[inline(always)]
402 fn from(variant: ADCALDIF) -> Self {
403 variant as u8 != 0
404 }
405}
406pub type ADCALDIF_R = crate::BitReader<ADCALDIF>;
408impl ADCALDIF_R {
409 #[inline(always)]
411 pub const fn variant(&self) -> ADCALDIF {
412 match self.bits {
413 false => ADCALDIF::SingleEnded,
414 true => ADCALDIF::Differential,
415 }
416 }
417 #[inline(always)]
419 pub fn is_single_ended(&self) -> bool {
420 *self == ADCALDIF::SingleEnded
421 }
422 #[inline(always)]
424 pub fn is_differential(&self) -> bool {
425 *self == ADCALDIF::Differential
426 }
427}
428pub type ADCALDIF_W<'a, REG> = crate::BitWriter<'a, REG, ADCALDIF>;
430impl<'a, REG> ADCALDIF_W<'a, REG>
431where
432 REG: crate::Writable + crate::RegisterSpec,
433{
434 #[inline(always)]
436 pub fn single_ended(self) -> &'a mut crate::W<REG> {
437 self.variant(ADCALDIF::SingleEnded)
438 }
439 #[inline(always)]
441 pub fn differential(self) -> &'a mut crate::W<REG> {
442 self.variant(ADCALDIF::Differential)
443 }
444}
445#[cfg_attr(feature = "defmt", derive(defmt::Format))]
449#[derive(Clone, Copy, Debug, PartialEq, Eq)]
450pub enum ADCALR {
451 NotCalibrating = 0,
453 Calibrating = 1,
455}
456impl From<ADCALR> for bool {
457 #[inline(always)]
458 fn from(variant: ADCALR) -> Self {
459 variant as u8 != 0
460 }
461}
462pub type ADCAL_R = crate::BitReader<ADCALR>;
464impl ADCAL_R {
465 #[inline(always)]
467 pub const fn variant(&self) -> ADCALR {
468 match self.bits {
469 false => ADCALR::NotCalibrating,
470 true => ADCALR::Calibrating,
471 }
472 }
473 #[inline(always)]
475 pub fn is_not_calibrating(&self) -> bool {
476 *self == ADCALR::NotCalibrating
477 }
478 #[inline(always)]
480 pub fn is_calibrating(&self) -> bool {
481 *self == ADCALR::Calibrating
482 }
483}
484#[cfg_attr(feature = "defmt", derive(defmt::Format))]
488#[derive(Clone, Copy, Debug, PartialEq, Eq)]
489pub enum ADCALW {
490 StartCalibration = 1,
492}
493impl From<ADCALW> for bool {
494 #[inline(always)]
495 fn from(variant: ADCALW) -> Self {
496 variant as u8 != 0
497 }
498}
499pub type ADCAL_W<'a, REG> = crate::BitWriter1S<'a, REG, ADCALW>;
501impl<'a, REG> ADCAL_W<'a, REG>
502where
503 REG: crate::Writable + crate::RegisterSpec,
504{
505 #[inline(always)]
507 pub fn start_calibration(self) -> &'a mut crate::W<REG> {
508 self.variant(ADCALW::StartCalibration)
509 }
510}
511impl R {
512 #[inline(always)]
514 pub fn aden(&self) -> ADEN_R {
515 ADEN_R::new((self.bits & 1) != 0)
516 }
517 #[inline(always)]
519 pub fn addis(&self) -> ADDIS_R {
520 ADDIS_R::new(((self.bits >> 1) & 1) != 0)
521 }
522 #[inline(always)]
524 pub fn adstart(&self) -> ADSTART_R {
525 ADSTART_R::new(((self.bits >> 2) & 1) != 0)
526 }
527 #[inline(always)]
529 pub fn jadstart(&self) -> JADSTART_R {
530 JADSTART_R::new(((self.bits >> 3) & 1) != 0)
531 }
532 #[inline(always)]
534 pub fn adstp(&self) -> ADSTP_R {
535 ADSTP_R::new(((self.bits >> 4) & 1) != 0)
536 }
537 #[inline(always)]
539 pub fn jadstp(&self) -> JADSTP_R {
540 JADSTP_R::new(((self.bits >> 5) & 1) != 0)
541 }
542 #[inline(always)]
544 pub fn advregen(&self) -> ADVREGEN_R {
545 ADVREGEN_R::new(((self.bits >> 28) & 1) != 0)
546 }
547 #[inline(always)]
549 pub fn deeppwd(&self) -> DEEPPWD_R {
550 DEEPPWD_R::new(((self.bits >> 29) & 1) != 0)
551 }
552 #[inline(always)]
554 pub fn adcaldif(&self) -> ADCALDIF_R {
555 ADCALDIF_R::new(((self.bits >> 30) & 1) != 0)
556 }
557 #[inline(always)]
559 pub fn adcal(&self) -> ADCAL_R {
560 ADCAL_R::new(((self.bits >> 31) & 1) != 0)
561 }
562}
563impl core::fmt::Debug for R {
564 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
565 f.debug_struct("CR")
566 .field("adcal", &self.adcal())
567 .field("adcaldif", &self.adcaldif())
568 .field("deeppwd", &self.deeppwd())
569 .field("advregen", &self.advregen())
570 .field("adstp", &self.adstp())
571 .field("jadstp", &self.jadstp())
572 .field("adstart", &self.adstart())
573 .field("jadstart", &self.jadstart())
574 .field("addis", &self.addis())
575 .field("aden", &self.aden())
576 .finish()
577 }
578}
579impl W {
580 #[inline(always)]
582 pub fn aden(&mut self) -> ADEN_W<CRrs> {
583 ADEN_W::new(self, 0)
584 }
585 #[inline(always)]
587 pub fn addis(&mut self) -> ADDIS_W<CRrs> {
588 ADDIS_W::new(self, 1)
589 }
590 #[inline(always)]
592 pub fn adstart(&mut self) -> ADSTART_W<CRrs> {
593 ADSTART_W::new(self, 2)
594 }
595 #[inline(always)]
597 pub fn jadstart(&mut self) -> JADSTART_W<CRrs> {
598 JADSTART_W::new(self, 3)
599 }
600 #[inline(always)]
602 pub fn adstp(&mut self) -> ADSTP_W<CRrs> {
603 ADSTP_W::new(self, 4)
604 }
605 #[inline(always)]
607 pub fn jadstp(&mut self) -> JADSTP_W<CRrs> {
608 JADSTP_W::new(self, 5)
609 }
610 #[inline(always)]
612 pub fn advregen(&mut self) -> ADVREGEN_W<CRrs> {
613 ADVREGEN_W::new(self, 28)
614 }
615 #[inline(always)]
617 pub fn deeppwd(&mut self) -> DEEPPWD_W<CRrs> {
618 DEEPPWD_W::new(self, 29)
619 }
620 #[inline(always)]
622 pub fn adcaldif(&mut self) -> ADCALDIF_W<CRrs> {
623 ADCALDIF_W::new(self, 30)
624 }
625 #[inline(always)]
627 pub fn adcal(&mut self) -> ADCAL_W<CRrs> {
628 ADCAL_W::new(self, 31)
629 }
630}
631pub struct CRrs;
637impl crate::RegisterSpec for CRrs {
638 type Ux = u32;
639}
640impl crate::Readable for CRrs {}
642impl crate::Writable for CRrs {
644 type Safety = crate::Unsafe;
645 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x8000_003f;
646}
647impl crate::Resettable for CRrs {}