1#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"12-bit D/A converter"]
28unsafe impl ::core::marker::Send for super::Dac12 {}
29unsafe impl ::core::marker::Sync for super::Dac12 {}
30impl super::Dac12 {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36
37 #[doc = "D/A Data Register %s"]
38 #[inline(always)]
39 pub const fn dadr(
40 &self,
41 ) -> &'static crate::common::ClusterRegisterArray<
42 crate::common::Reg<self::Dadr_SPEC, crate::common::RW>,
43 2,
44 0x2,
45 > {
46 unsafe {
47 crate::common::ClusterRegisterArray::from_ptr(self._svd2pac_as_ptr().add(0x0usize))
48 }
49 }
50 #[inline(always)]
51 pub const fn dadr0(&self) -> &'static crate::common::Reg<self::Dadr_SPEC, crate::common::RW> {
52 unsafe {
53 crate::common::Reg::<self::Dadr_SPEC, crate::common::RW>::from_ptr(
54 self._svd2pac_as_ptr().add(0x0usize),
55 )
56 }
57 }
58 #[inline(always)]
59 pub const fn dadr1(&self) -> &'static crate::common::Reg<self::Dadr_SPEC, crate::common::RW> {
60 unsafe {
61 crate::common::Reg::<self::Dadr_SPEC, crate::common::RW>::from_ptr(
62 self._svd2pac_as_ptr().add(0x2usize),
63 )
64 }
65 }
66
67 #[doc = "D/A Control Register"]
68 #[inline(always)]
69 pub const fn dacr(&self) -> &'static crate::common::Reg<self::Dacr_SPEC, crate::common::RW> {
70 unsafe {
71 crate::common::Reg::<self::Dacr_SPEC, crate::common::RW>::from_ptr(
72 self._svd2pac_as_ptr().add(4usize),
73 )
74 }
75 }
76
77 #[doc = "DADRn Format Select Register"]
78 #[inline(always)]
79 pub const fn dadpr(&self) -> &'static crate::common::Reg<self::Dadpr_SPEC, crate::common::RW> {
80 unsafe {
81 crate::common::Reg::<self::Dadpr_SPEC, crate::common::RW>::from_ptr(
82 self._svd2pac_as_ptr().add(5usize),
83 )
84 }
85 }
86
87 #[doc = "D/A A/D Synchronous Start Control Register"]
88 #[inline(always)]
89 pub const fn daadscr(
90 &self,
91 ) -> &'static crate::common::Reg<self::Daadscr_SPEC, crate::common::RW> {
92 unsafe {
93 crate::common::Reg::<self::Daadscr_SPEC, crate::common::RW>::from_ptr(
94 self._svd2pac_as_ptr().add(6usize),
95 )
96 }
97 }
98
99 #[doc = "D/A Output Amplifier Control Register"]
100 #[inline(always)]
101 pub const fn daampcr(
102 &self,
103 ) -> &'static crate::common::Reg<self::Daampcr_SPEC, crate::common::RW> {
104 unsafe {
105 crate::common::Reg::<self::Daampcr_SPEC, crate::common::RW>::from_ptr(
106 self._svd2pac_as_ptr().add(8usize),
107 )
108 }
109 }
110
111 #[doc = "D/A Amplifier Stabilization Wait Control Register"]
112 #[inline(always)]
113 pub const fn daaswcr(
114 &self,
115 ) -> &'static crate::common::Reg<self::Daaswcr_SPEC, crate::common::RW> {
116 unsafe {
117 crate::common::Reg::<self::Daaswcr_SPEC, crate::common::RW>::from_ptr(
118 self._svd2pac_as_ptr().add(28usize),
119 )
120 }
121 }
122
123 #[doc = "D/A A/D Synchronous Unit Select Register"]
124 #[inline(always)]
125 pub const fn daadusr(
126 &self,
127 ) -> &'static crate::common::Reg<self::Daadusr_SPEC, crate::common::RW> {
128 unsafe {
129 crate::common::Reg::<self::Daadusr_SPEC, crate::common::RW>::from_ptr(
130 self._svd2pac_as_ptr().add(4288usize),
131 )
132 }
133 }
134}
135#[doc(hidden)]
136#[derive(Copy, Clone, Eq, PartialEq)]
137pub struct Dadr_SPEC;
138impl crate::sealed::RegSpec for Dadr_SPEC {
139 type DataType = u16;
140}
141
142#[doc = "D/A Data Register %s"]
143pub type Dadr = crate::RegValueT<Dadr_SPEC>;
144
145impl NoBitfieldReg<Dadr_SPEC> for Dadr {}
146impl ::core::default::Default for Dadr {
147 #[inline(always)]
148 fn default() -> Dadr {
149 <crate::RegValueT<Dadr_SPEC> as RegisterValue<_>>::new(0)
150 }
151}
152
153#[doc(hidden)]
154#[derive(Copy, Clone, Eq, PartialEq)]
155pub struct Dacr_SPEC;
156impl crate::sealed::RegSpec for Dacr_SPEC {
157 type DataType = u8;
158}
159
160#[doc = "D/A Control Register"]
161pub type Dacr = crate::RegValueT<Dacr_SPEC>;
162
163impl Dacr {
164 #[doc = "D/A Enable"]
165 #[inline(always)]
166 pub fn dae(
167 self,
168 ) -> crate::common::RegisterField<
169 5,
170 0x1,
171 1,
172 0,
173 dacr::Dae,
174 dacr::Dae,
175 Dacr_SPEC,
176 crate::common::RW,
177 > {
178 crate::common::RegisterField::<
179 5,
180 0x1,
181 1,
182 0,
183 dacr::Dae,
184 dacr::Dae,
185 Dacr_SPEC,
186 crate::common::RW,
187 >::from_register(self, 0)
188 }
189
190 #[doc = "D/A Output Enable 0"]
191 #[inline(always)]
192 pub fn daoe0(
193 self,
194 ) -> crate::common::RegisterField<
195 6,
196 0x1,
197 1,
198 0,
199 dacr::Daoe0,
200 dacr::Daoe0,
201 Dacr_SPEC,
202 crate::common::RW,
203 > {
204 crate::common::RegisterField::<
205 6,
206 0x1,
207 1,
208 0,
209 dacr::Daoe0,
210 dacr::Daoe0,
211 Dacr_SPEC,
212 crate::common::RW,
213 >::from_register(self, 0)
214 }
215
216 #[doc = "D/A Output Enable 1"]
217 #[inline(always)]
218 pub fn daoe1(
219 self,
220 ) -> crate::common::RegisterField<
221 7,
222 0x1,
223 1,
224 0,
225 dacr::Daoe1,
226 dacr::Daoe1,
227 Dacr_SPEC,
228 crate::common::RW,
229 > {
230 crate::common::RegisterField::<
231 7,
232 0x1,
233 1,
234 0,
235 dacr::Daoe1,
236 dacr::Daoe1,
237 Dacr_SPEC,
238 crate::common::RW,
239 >::from_register(self, 0)
240 }
241}
242impl ::core::default::Default for Dacr {
243 #[inline(always)]
244 fn default() -> Dacr {
245 <crate::RegValueT<Dacr_SPEC> as RegisterValue<_>>::new(31)
246 }
247}
248pub mod dacr {
249
250 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
251 pub struct Dae_SPEC;
252 pub type Dae = crate::EnumBitfieldStruct<u8, Dae_SPEC>;
253 impl Dae {
254 #[doc = "Control D/A conversion of channels 0 and 1 individually"]
255 pub const _0: Self = Self::new(0);
256
257 #[doc = "Control D/A conversion of channels 0 and 1 collectively"]
258 pub const _1: Self = Self::new(1);
259 }
260 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
261 pub struct Daoe0_SPEC;
262 pub type Daoe0 = crate::EnumBitfieldStruct<u8, Daoe0_SPEC>;
263 impl Daoe0 {
264 #[doc = "Disable D/A conversion and analog output of channel 0 (DA0)"]
265 pub const _0: Self = Self::new(0);
266
267 #[doc = "Enable D/A conversion and analog output of channel 0 (DA0)"]
268 pub const _1: Self = Self::new(1);
269 }
270 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
271 pub struct Daoe1_SPEC;
272 pub type Daoe1 = crate::EnumBitfieldStruct<u8, Daoe1_SPEC>;
273 impl Daoe1 {
274 #[doc = "Disable D/A conversion and analog output of channel 1 (DA1)"]
275 pub const _0: Self = Self::new(0);
276
277 #[doc = "Enable D/A conversion and analog output of channel 1 (DA1)"]
278 pub const _1: Self = Self::new(1);
279 }
280}
281#[doc(hidden)]
282#[derive(Copy, Clone, Eq, PartialEq)]
283pub struct Dadpr_SPEC;
284impl crate::sealed::RegSpec for Dadpr_SPEC {
285 type DataType = u8;
286}
287
288#[doc = "DADRn Format Select Register"]
289pub type Dadpr = crate::RegValueT<Dadpr_SPEC>;
290
291impl Dadpr {
292 #[doc = "DADRn Format Select"]
293 #[inline(always)]
294 pub fn dpsel(
295 self,
296 ) -> crate::common::RegisterField<
297 7,
298 0x1,
299 1,
300 0,
301 dadpr::Dpsel,
302 dadpr::Dpsel,
303 Dadpr_SPEC,
304 crate::common::RW,
305 > {
306 crate::common::RegisterField::<
307 7,
308 0x1,
309 1,
310 0,
311 dadpr::Dpsel,
312 dadpr::Dpsel,
313 Dadpr_SPEC,
314 crate::common::RW,
315 >::from_register(self, 0)
316 }
317}
318impl ::core::default::Default for Dadpr {
319 #[inline(always)]
320 fn default() -> Dadpr {
321 <crate::RegValueT<Dadpr_SPEC> as RegisterValue<_>>::new(0)
322 }
323}
324pub mod dadpr {
325
326 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
327 pub struct Dpsel_SPEC;
328 pub type Dpsel = crate::EnumBitfieldStruct<u8, Dpsel_SPEC>;
329 impl Dpsel {
330 #[doc = "Right-justified format"]
331 pub const _0: Self = Self::new(0);
332
333 #[doc = "Left-justified format"]
334 pub const _1: Self = Self::new(1);
335 }
336}
337#[doc(hidden)]
338#[derive(Copy, Clone, Eq, PartialEq)]
339pub struct Daadscr_SPEC;
340impl crate::sealed::RegSpec for Daadscr_SPEC {
341 type DataType = u8;
342}
343
344#[doc = "D/A A/D Synchronous Start Control Register"]
345pub type Daadscr = crate::RegValueT<Daadscr_SPEC>;
346
347impl Daadscr {
348 #[doc = "D/A A/D Synchronous Conversion"]
349 #[inline(always)]
350 pub fn daadst(
351 self,
352 ) -> crate::common::RegisterField<
353 7,
354 0x1,
355 1,
356 0,
357 daadscr::Daadst,
358 daadscr::Daadst,
359 Daadscr_SPEC,
360 crate::common::RW,
361 > {
362 crate::common::RegisterField::<
363 7,
364 0x1,
365 1,
366 0,
367 daadscr::Daadst,
368 daadscr::Daadst,
369 Daadscr_SPEC,
370 crate::common::RW,
371 >::from_register(self, 0)
372 }
373}
374impl ::core::default::Default for Daadscr {
375 #[inline(always)]
376 fn default() -> Daadscr {
377 <crate::RegValueT<Daadscr_SPEC> as RegisterValue<_>>::new(0)
378 }
379}
380pub mod daadscr {
381
382 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
383 pub struct Daadst_SPEC;
384 pub type Daadst = crate::EnumBitfieldStruct<u8, Daadst_SPEC>;
385 impl Daadst {
386 #[doc = "Do not synchronize DAC12 with ADC12 operation (disable interference reduction between D/A and A/D conversion)."]
387 pub const _0: Self = Self::new(0);
388
389 #[doc = "Synchronize DAC12 with ADC12 operation (enable interference reduction between D/A and A/D conversion)."]
390 pub const _1: Self = Self::new(1);
391 }
392}
393#[doc(hidden)]
394#[derive(Copy, Clone, Eq, PartialEq)]
395pub struct Daampcr_SPEC;
396impl crate::sealed::RegSpec for Daampcr_SPEC {
397 type DataType = u8;
398}
399
400#[doc = "D/A Output Amplifier Control Register"]
401pub type Daampcr = crate::RegValueT<Daampcr_SPEC>;
402
403impl Daampcr {
404 #[doc = "Amplifier Control 0"]
405 #[inline(always)]
406 pub fn daamp0(
407 self,
408 ) -> crate::common::RegisterField<
409 6,
410 0x1,
411 1,
412 0,
413 daampcr::Daamp0,
414 daampcr::Daamp0,
415 Daampcr_SPEC,
416 crate::common::RW,
417 > {
418 crate::common::RegisterField::<
419 6,
420 0x1,
421 1,
422 0,
423 daampcr::Daamp0,
424 daampcr::Daamp0,
425 Daampcr_SPEC,
426 crate::common::RW,
427 >::from_register(self, 0)
428 }
429
430 #[doc = "Amplifier Control 1"]
431 #[inline(always)]
432 pub fn daamp1(
433 self,
434 ) -> crate::common::RegisterField<
435 7,
436 0x1,
437 1,
438 0,
439 daampcr::Daamp1,
440 daampcr::Daamp1,
441 Daampcr_SPEC,
442 crate::common::RW,
443 > {
444 crate::common::RegisterField::<
445 7,
446 0x1,
447 1,
448 0,
449 daampcr::Daamp1,
450 daampcr::Daamp1,
451 Daampcr_SPEC,
452 crate::common::RW,
453 >::from_register(self, 0)
454 }
455}
456impl ::core::default::Default for Daampcr {
457 #[inline(always)]
458 fn default() -> Daampcr {
459 <crate::RegValueT<Daampcr_SPEC> as RegisterValue<_>>::new(0)
460 }
461}
462pub mod daampcr {
463
464 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
465 pub struct Daamp0_SPEC;
466 pub type Daamp0 = crate::EnumBitfieldStruct<u8, Daamp0_SPEC>;
467 impl Daamp0 {
468 #[doc = "Do not use channel 0 output amplifier"]
469 pub const _0: Self = Self::new(0);
470
471 #[doc = "Use channel 0 output amplifier"]
472 pub const _1: Self = Self::new(1);
473 }
474 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
475 pub struct Daamp1_SPEC;
476 pub type Daamp1 = crate::EnumBitfieldStruct<u8, Daamp1_SPEC>;
477 impl Daamp1 {
478 #[doc = "Do not use channel 1 output amplifier"]
479 pub const _0: Self = Self::new(0);
480
481 #[doc = "Use channel 1 output amplifier"]
482 pub const _1: Self = Self::new(1);
483 }
484}
485#[doc(hidden)]
486#[derive(Copy, Clone, Eq, PartialEq)]
487pub struct Daaswcr_SPEC;
488impl crate::sealed::RegSpec for Daaswcr_SPEC {
489 type DataType = u8;
490}
491
492#[doc = "D/A Amplifier Stabilization Wait Control Register"]
493pub type Daaswcr = crate::RegValueT<Daaswcr_SPEC>;
494
495impl Daaswcr {
496 #[doc = "D/A Amplifier Stabilization Wait 0"]
497 #[inline(always)]
498 pub fn daasw0(
499 self,
500 ) -> crate::common::RegisterField<
501 6,
502 0x1,
503 1,
504 0,
505 daaswcr::Daasw0,
506 daaswcr::Daasw0,
507 Daaswcr_SPEC,
508 crate::common::RW,
509 > {
510 crate::common::RegisterField::<
511 6,
512 0x1,
513 1,
514 0,
515 daaswcr::Daasw0,
516 daaswcr::Daasw0,
517 Daaswcr_SPEC,
518 crate::common::RW,
519 >::from_register(self, 0)
520 }
521
522 #[doc = "D/A Amplifier Stabilization Wait 1"]
523 #[inline(always)]
524 pub fn daasw1(
525 self,
526 ) -> crate::common::RegisterField<
527 7,
528 0x1,
529 1,
530 0,
531 daaswcr::Daasw1,
532 daaswcr::Daasw1,
533 Daaswcr_SPEC,
534 crate::common::RW,
535 > {
536 crate::common::RegisterField::<
537 7,
538 0x1,
539 1,
540 0,
541 daaswcr::Daasw1,
542 daaswcr::Daasw1,
543 Daaswcr_SPEC,
544 crate::common::RW,
545 >::from_register(self, 0)
546 }
547}
548impl ::core::default::Default for Daaswcr {
549 #[inline(always)]
550 fn default() -> Daaswcr {
551 <crate::RegValueT<Daaswcr_SPEC> as RegisterValue<_>>::new(0)
552 }
553}
554pub mod daaswcr {
555
556 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
557 pub struct Daasw0_SPEC;
558 pub type Daasw0 = crate::EnumBitfieldStruct<u8, Daasw0_SPEC>;
559 impl Daasw0 {
560 #[doc = "Amplifier stabilization wait off (output) for channel 0"]
561 pub const _0: Self = Self::new(0);
562
563 #[doc = "Amplifier stabilization wait on (high-Z) for channel 0"]
564 pub const _1: Self = Self::new(1);
565 }
566 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
567 pub struct Daasw1_SPEC;
568 pub type Daasw1 = crate::EnumBitfieldStruct<u8, Daasw1_SPEC>;
569 impl Daasw1 {
570 #[doc = "Amplifier stabilization wait off (output) for channel 1"]
571 pub const _0: Self = Self::new(0);
572
573 #[doc = "Amplifier stabilization wait on (high-Z) for channel 1"]
574 pub const _1: Self = Self::new(1);
575 }
576}
577#[doc(hidden)]
578#[derive(Copy, Clone, Eq, PartialEq)]
579pub struct Daadusr_SPEC;
580impl crate::sealed::RegSpec for Daadusr_SPEC {
581 type DataType = u8;
582}
583
584#[doc = "D/A A/D Synchronous Unit Select Register"]
585pub type Daadusr = crate::RegValueT<Daadusr_SPEC>;
586
587impl Daadusr {
588 #[doc = "A/D Unit 0 Select"]
589 #[inline(always)]
590 pub fn amadsel0(
591 self,
592 ) -> crate::common::RegisterField<
593 0,
594 0x1,
595 1,
596 0,
597 daadusr::Amadsel0,
598 daadusr::Amadsel0,
599 Daadusr_SPEC,
600 crate::common::RW,
601 > {
602 crate::common::RegisterField::<
603 0,
604 0x1,
605 1,
606 0,
607 daadusr::Amadsel0,
608 daadusr::Amadsel0,
609 Daadusr_SPEC,
610 crate::common::RW,
611 >::from_register(self, 0)
612 }
613}
614impl ::core::default::Default for Daadusr {
615 #[inline(always)]
616 fn default() -> Daadusr {
617 <crate::RegValueT<Daadusr_SPEC> as RegisterValue<_>>::new(0)
618 }
619}
620pub mod daadusr {
621
622 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
623 pub struct Amadsel0_SPEC;
624 pub type Amadsel0 = crate::EnumBitfieldStruct<u8, Amadsel0_SPEC>;
625 impl Amadsel0 {
626 #[doc = "Do not select unit 0"]
627 pub const _0: Self = Self::new(0);
628
629 #[doc = "Select unit 0"]
630 pub const _1: Self = Self::new(1);
631 }
632}