stm32l4x2_pac/dac1/
cr.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7    bits: u32,
8}
9impl super::CR {
10    #[doc = r" Modifies the contents of the register"]
11    #[inline]
12    pub fn modify<F>(&self, f: F)
13    where
14        for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15    {
16        let bits = self.register.get();
17        let r = R { bits: bits };
18        let mut w = W { bits: bits };
19        f(&r, &mut w);
20        self.register.set(w.bits);
21    }
22    #[doc = r" Reads the contents of the register"]
23    #[inline]
24    pub fn read(&self) -> R {
25        R {
26            bits: self.register.get(),
27        }
28    }
29    #[doc = r" Writes to the register"]
30    #[inline]
31    pub fn write<F>(&self, f: F)
32    where
33        F: FnOnce(&mut W) -> &mut W,
34    {
35        let mut w = W::reset_value();
36        f(&mut w);
37        self.register.set(w.bits);
38    }
39    #[doc = r" Writes the reset value to the register"]
40    #[inline]
41    pub fn reset(&self) {
42        self.write(|w| w)
43    }
44}
45#[doc = r" Value of the field"]
46pub struct EN1R {
47    bits: bool,
48}
49impl EN1R {
50    #[doc = r" Value of the field as raw bits"]
51    #[inline]
52    pub fn bit(&self) -> bool {
53        self.bits
54    }
55    #[doc = r" Returns `true` if the bit is clear (0)"]
56    #[inline]
57    pub fn bit_is_clear(&self) -> bool {
58        !self.bit()
59    }
60    #[doc = r" Returns `true` if the bit is set (1)"]
61    #[inline]
62    pub fn bit_is_set(&self) -> bool {
63        self.bit()
64    }
65}
66#[doc = r" Value of the field"]
67pub struct TEN1R {
68    bits: bool,
69}
70impl TEN1R {
71    #[doc = r" Value of the field as raw bits"]
72    #[inline]
73    pub fn bit(&self) -> bool {
74        self.bits
75    }
76    #[doc = r" Returns `true` if the bit is clear (0)"]
77    #[inline]
78    pub fn bit_is_clear(&self) -> bool {
79        !self.bit()
80    }
81    #[doc = r" Returns `true` if the bit is set (1)"]
82    #[inline]
83    pub fn bit_is_set(&self) -> bool {
84        self.bit()
85    }
86}
87#[doc = r" Value of the field"]
88pub struct TSEL1R {
89    bits: u8,
90}
91impl TSEL1R {
92    #[doc = r" Value of the field as raw bits"]
93    #[inline]
94    pub fn bits(&self) -> u8 {
95        self.bits
96    }
97}
98#[doc = r" Value of the field"]
99pub struct WAVE1R {
100    bits: u8,
101}
102impl WAVE1R {
103    #[doc = r" Value of the field as raw bits"]
104    #[inline]
105    pub fn bits(&self) -> u8 {
106        self.bits
107    }
108}
109#[doc = r" Value of the field"]
110pub struct MAMP1R {
111    bits: u8,
112}
113impl MAMP1R {
114    #[doc = r" Value of the field as raw bits"]
115    #[inline]
116    pub fn bits(&self) -> u8 {
117        self.bits
118    }
119}
120#[doc = r" Value of the field"]
121pub struct DMAEN1R {
122    bits: bool,
123}
124impl DMAEN1R {
125    #[doc = r" Value of the field as raw bits"]
126    #[inline]
127    pub fn bit(&self) -> bool {
128        self.bits
129    }
130    #[doc = r" Returns `true` if the bit is clear (0)"]
131    #[inline]
132    pub fn bit_is_clear(&self) -> bool {
133        !self.bit()
134    }
135    #[doc = r" Returns `true` if the bit is set (1)"]
136    #[inline]
137    pub fn bit_is_set(&self) -> bool {
138        self.bit()
139    }
140}
141#[doc = r" Value of the field"]
142pub struct DMAUDRIE1R {
143    bits: bool,
144}
145impl DMAUDRIE1R {
146    #[doc = r" Value of the field as raw bits"]
147    #[inline]
148    pub fn bit(&self) -> bool {
149        self.bits
150    }
151    #[doc = r" Returns `true` if the bit is clear (0)"]
152    #[inline]
153    pub fn bit_is_clear(&self) -> bool {
154        !self.bit()
155    }
156    #[doc = r" Returns `true` if the bit is set (1)"]
157    #[inline]
158    pub fn bit_is_set(&self) -> bool {
159        self.bit()
160    }
161}
162#[doc = r" Value of the field"]
163pub struct CEN1R {
164    bits: bool,
165}
166impl CEN1R {
167    #[doc = r" Value of the field as raw bits"]
168    #[inline]
169    pub fn bit(&self) -> bool {
170        self.bits
171    }
172    #[doc = r" Returns `true` if the bit is clear (0)"]
173    #[inline]
174    pub fn bit_is_clear(&self) -> bool {
175        !self.bit()
176    }
177    #[doc = r" Returns `true` if the bit is set (1)"]
178    #[inline]
179    pub fn bit_is_set(&self) -> bool {
180        self.bit()
181    }
182}
183#[doc = r" Value of the field"]
184pub struct EN2R {
185    bits: bool,
186}
187impl EN2R {
188    #[doc = r" Value of the field as raw bits"]
189    #[inline]
190    pub fn bit(&self) -> bool {
191        self.bits
192    }
193    #[doc = r" Returns `true` if the bit is clear (0)"]
194    #[inline]
195    pub fn bit_is_clear(&self) -> bool {
196        !self.bit()
197    }
198    #[doc = r" Returns `true` if the bit is set (1)"]
199    #[inline]
200    pub fn bit_is_set(&self) -> bool {
201        self.bit()
202    }
203}
204#[doc = r" Value of the field"]
205pub struct TEN2R {
206    bits: bool,
207}
208impl TEN2R {
209    #[doc = r" Value of the field as raw bits"]
210    #[inline]
211    pub fn bit(&self) -> bool {
212        self.bits
213    }
214    #[doc = r" Returns `true` if the bit is clear (0)"]
215    #[inline]
216    pub fn bit_is_clear(&self) -> bool {
217        !self.bit()
218    }
219    #[doc = r" Returns `true` if the bit is set (1)"]
220    #[inline]
221    pub fn bit_is_set(&self) -> bool {
222        self.bit()
223    }
224}
225#[doc = r" Value of the field"]
226pub struct TSEL2R {
227    bits: u8,
228}
229impl TSEL2R {
230    #[doc = r" Value of the field as raw bits"]
231    #[inline]
232    pub fn bits(&self) -> u8 {
233        self.bits
234    }
235}
236#[doc = r" Value of the field"]
237pub struct WAVE2R {
238    bits: u8,
239}
240impl WAVE2R {
241    #[doc = r" Value of the field as raw bits"]
242    #[inline]
243    pub fn bits(&self) -> u8 {
244        self.bits
245    }
246}
247#[doc = r" Value of the field"]
248pub struct MAMP2R {
249    bits: u8,
250}
251impl MAMP2R {
252    #[doc = r" Value of the field as raw bits"]
253    #[inline]
254    pub fn bits(&self) -> u8 {
255        self.bits
256    }
257}
258#[doc = r" Value of the field"]
259pub struct DMAEN2R {
260    bits: bool,
261}
262impl DMAEN2R {
263    #[doc = r" Value of the field as raw bits"]
264    #[inline]
265    pub fn bit(&self) -> bool {
266        self.bits
267    }
268    #[doc = r" Returns `true` if the bit is clear (0)"]
269    #[inline]
270    pub fn bit_is_clear(&self) -> bool {
271        !self.bit()
272    }
273    #[doc = r" Returns `true` if the bit is set (1)"]
274    #[inline]
275    pub fn bit_is_set(&self) -> bool {
276        self.bit()
277    }
278}
279#[doc = r" Value of the field"]
280pub struct DMAUDRIE2R {
281    bits: bool,
282}
283impl DMAUDRIE2R {
284    #[doc = r" Value of the field as raw bits"]
285    #[inline]
286    pub fn bit(&self) -> bool {
287        self.bits
288    }
289    #[doc = r" Returns `true` if the bit is clear (0)"]
290    #[inline]
291    pub fn bit_is_clear(&self) -> bool {
292        !self.bit()
293    }
294    #[doc = r" Returns `true` if the bit is set (1)"]
295    #[inline]
296    pub fn bit_is_set(&self) -> bool {
297        self.bit()
298    }
299}
300#[doc = r" Value of the field"]
301pub struct CEN2R {
302    bits: bool,
303}
304impl CEN2R {
305    #[doc = r" Value of the field as raw bits"]
306    #[inline]
307    pub fn bit(&self) -> bool {
308        self.bits
309    }
310    #[doc = r" Returns `true` if the bit is clear (0)"]
311    #[inline]
312    pub fn bit_is_clear(&self) -> bool {
313        !self.bit()
314    }
315    #[doc = r" Returns `true` if the bit is set (1)"]
316    #[inline]
317    pub fn bit_is_set(&self) -> bool {
318        self.bit()
319    }
320}
321#[doc = r" Proxy"]
322pub struct _EN1W<'a> {
323    w: &'a mut W,
324}
325impl<'a> _EN1W<'a> {
326    #[doc = r" Sets the field bit"]
327    pub fn set_bit(self) -> &'a mut W {
328        self.bit(true)
329    }
330    #[doc = r" Clears the field bit"]
331    pub fn clear_bit(self) -> &'a mut W {
332        self.bit(false)
333    }
334    #[doc = r" Writes raw bits to the field"]
335    #[inline]
336    pub fn bit(self, value: bool) -> &'a mut W {
337        const MASK: bool = true;
338        const OFFSET: u8 = 0;
339        self.w.bits &= !((MASK as u32) << OFFSET);
340        self.w.bits |= ((value & MASK) as u32) << OFFSET;
341        self.w
342    }
343}
344#[doc = r" Proxy"]
345pub struct _TEN1W<'a> {
346    w: &'a mut W,
347}
348impl<'a> _TEN1W<'a> {
349    #[doc = r" Sets the field bit"]
350    pub fn set_bit(self) -> &'a mut W {
351        self.bit(true)
352    }
353    #[doc = r" Clears the field bit"]
354    pub fn clear_bit(self) -> &'a mut W {
355        self.bit(false)
356    }
357    #[doc = r" Writes raw bits to the field"]
358    #[inline]
359    pub fn bit(self, value: bool) -> &'a mut W {
360        const MASK: bool = true;
361        const OFFSET: u8 = 2;
362        self.w.bits &= !((MASK as u32) << OFFSET);
363        self.w.bits |= ((value & MASK) as u32) << OFFSET;
364        self.w
365    }
366}
367#[doc = r" Proxy"]
368pub struct _TSEL1W<'a> {
369    w: &'a mut W,
370}
371impl<'a> _TSEL1W<'a> {
372    #[doc = r" Writes raw bits to the field"]
373    #[inline]
374    pub unsafe fn bits(self, value: u8) -> &'a mut W {
375        const MASK: u8 = 7;
376        const OFFSET: u8 = 3;
377        self.w.bits &= !((MASK as u32) << OFFSET);
378        self.w.bits |= ((value & MASK) as u32) << OFFSET;
379        self.w
380    }
381}
382#[doc = r" Proxy"]
383pub struct _WAVE1W<'a> {
384    w: &'a mut W,
385}
386impl<'a> _WAVE1W<'a> {
387    #[doc = r" Writes raw bits to the field"]
388    #[inline]
389    pub unsafe fn bits(self, value: u8) -> &'a mut W {
390        const MASK: u8 = 3;
391        const OFFSET: u8 = 6;
392        self.w.bits &= !((MASK as u32) << OFFSET);
393        self.w.bits |= ((value & MASK) as u32) << OFFSET;
394        self.w
395    }
396}
397#[doc = r" Proxy"]
398pub struct _MAMP1W<'a> {
399    w: &'a mut W,
400}
401impl<'a> _MAMP1W<'a> {
402    #[doc = r" Writes raw bits to the field"]
403    #[inline]
404    pub unsafe fn bits(self, value: u8) -> &'a mut W {
405        const MASK: u8 = 15;
406        const OFFSET: u8 = 8;
407        self.w.bits &= !((MASK as u32) << OFFSET);
408        self.w.bits |= ((value & MASK) as u32) << OFFSET;
409        self.w
410    }
411}
412#[doc = r" Proxy"]
413pub struct _DMAEN1W<'a> {
414    w: &'a mut W,
415}
416impl<'a> _DMAEN1W<'a> {
417    #[doc = r" Sets the field bit"]
418    pub fn set_bit(self) -> &'a mut W {
419        self.bit(true)
420    }
421    #[doc = r" Clears the field bit"]
422    pub fn clear_bit(self) -> &'a mut W {
423        self.bit(false)
424    }
425    #[doc = r" Writes raw bits to the field"]
426    #[inline]
427    pub fn bit(self, value: bool) -> &'a mut W {
428        const MASK: bool = true;
429        const OFFSET: u8 = 12;
430        self.w.bits &= !((MASK as u32) << OFFSET);
431        self.w.bits |= ((value & MASK) as u32) << OFFSET;
432        self.w
433    }
434}
435#[doc = r" Proxy"]
436pub struct _DMAUDRIE1W<'a> {
437    w: &'a mut W,
438}
439impl<'a> _DMAUDRIE1W<'a> {
440    #[doc = r" Sets the field bit"]
441    pub fn set_bit(self) -> &'a mut W {
442        self.bit(true)
443    }
444    #[doc = r" Clears the field bit"]
445    pub fn clear_bit(self) -> &'a mut W {
446        self.bit(false)
447    }
448    #[doc = r" Writes raw bits to the field"]
449    #[inline]
450    pub fn bit(self, value: bool) -> &'a mut W {
451        const MASK: bool = true;
452        const OFFSET: u8 = 13;
453        self.w.bits &= !((MASK as u32) << OFFSET);
454        self.w.bits |= ((value & MASK) as u32) << OFFSET;
455        self.w
456    }
457}
458#[doc = r" Proxy"]
459pub struct _CEN1W<'a> {
460    w: &'a mut W,
461}
462impl<'a> _CEN1W<'a> {
463    #[doc = r" Sets the field bit"]
464    pub fn set_bit(self) -> &'a mut W {
465        self.bit(true)
466    }
467    #[doc = r" Clears the field bit"]
468    pub fn clear_bit(self) -> &'a mut W {
469        self.bit(false)
470    }
471    #[doc = r" Writes raw bits to the field"]
472    #[inline]
473    pub fn bit(self, value: bool) -> &'a mut W {
474        const MASK: bool = true;
475        const OFFSET: u8 = 14;
476        self.w.bits &= !((MASK as u32) << OFFSET);
477        self.w.bits |= ((value & MASK) as u32) << OFFSET;
478        self.w
479    }
480}
481#[doc = r" Proxy"]
482pub struct _EN2W<'a> {
483    w: &'a mut W,
484}
485impl<'a> _EN2W<'a> {
486    #[doc = r" Sets the field bit"]
487    pub fn set_bit(self) -> &'a mut W {
488        self.bit(true)
489    }
490    #[doc = r" Clears the field bit"]
491    pub fn clear_bit(self) -> &'a mut W {
492        self.bit(false)
493    }
494    #[doc = r" Writes raw bits to the field"]
495    #[inline]
496    pub fn bit(self, value: bool) -> &'a mut W {
497        const MASK: bool = true;
498        const OFFSET: u8 = 16;
499        self.w.bits &= !((MASK as u32) << OFFSET);
500        self.w.bits |= ((value & MASK) as u32) << OFFSET;
501        self.w
502    }
503}
504#[doc = r" Proxy"]
505pub struct _TEN2W<'a> {
506    w: &'a mut W,
507}
508impl<'a> _TEN2W<'a> {
509    #[doc = r" Sets the field bit"]
510    pub fn set_bit(self) -> &'a mut W {
511        self.bit(true)
512    }
513    #[doc = r" Clears the field bit"]
514    pub fn clear_bit(self) -> &'a mut W {
515        self.bit(false)
516    }
517    #[doc = r" Writes raw bits to the field"]
518    #[inline]
519    pub fn bit(self, value: bool) -> &'a mut W {
520        const MASK: bool = true;
521        const OFFSET: u8 = 18;
522        self.w.bits &= !((MASK as u32) << OFFSET);
523        self.w.bits |= ((value & MASK) as u32) << OFFSET;
524        self.w
525    }
526}
527#[doc = r" Proxy"]
528pub struct _TSEL2W<'a> {
529    w: &'a mut W,
530}
531impl<'a> _TSEL2W<'a> {
532    #[doc = r" Writes raw bits to the field"]
533    #[inline]
534    pub unsafe fn bits(self, value: u8) -> &'a mut W {
535        const MASK: u8 = 7;
536        const OFFSET: u8 = 19;
537        self.w.bits &= !((MASK as u32) << OFFSET);
538        self.w.bits |= ((value & MASK) as u32) << OFFSET;
539        self.w
540    }
541}
542#[doc = r" Proxy"]
543pub struct _WAVE2W<'a> {
544    w: &'a mut W,
545}
546impl<'a> _WAVE2W<'a> {
547    #[doc = r" Writes raw bits to the field"]
548    #[inline]
549    pub unsafe fn bits(self, value: u8) -> &'a mut W {
550        const MASK: u8 = 3;
551        const OFFSET: u8 = 22;
552        self.w.bits &= !((MASK as u32) << OFFSET);
553        self.w.bits |= ((value & MASK) as u32) << OFFSET;
554        self.w
555    }
556}
557#[doc = r" Proxy"]
558pub struct _MAMP2W<'a> {
559    w: &'a mut W,
560}
561impl<'a> _MAMP2W<'a> {
562    #[doc = r" Writes raw bits to the field"]
563    #[inline]
564    pub unsafe fn bits(self, value: u8) -> &'a mut W {
565        const MASK: u8 = 15;
566        const OFFSET: u8 = 24;
567        self.w.bits &= !((MASK as u32) << OFFSET);
568        self.w.bits |= ((value & MASK) as u32) << OFFSET;
569        self.w
570    }
571}
572#[doc = r" Proxy"]
573pub struct _DMAEN2W<'a> {
574    w: &'a mut W,
575}
576impl<'a> _DMAEN2W<'a> {
577    #[doc = r" Sets the field bit"]
578    pub fn set_bit(self) -> &'a mut W {
579        self.bit(true)
580    }
581    #[doc = r" Clears the field bit"]
582    pub fn clear_bit(self) -> &'a mut W {
583        self.bit(false)
584    }
585    #[doc = r" Writes raw bits to the field"]
586    #[inline]
587    pub fn bit(self, value: bool) -> &'a mut W {
588        const MASK: bool = true;
589        const OFFSET: u8 = 28;
590        self.w.bits &= !((MASK as u32) << OFFSET);
591        self.w.bits |= ((value & MASK) as u32) << OFFSET;
592        self.w
593    }
594}
595#[doc = r" Proxy"]
596pub struct _DMAUDRIE2W<'a> {
597    w: &'a mut W,
598}
599impl<'a> _DMAUDRIE2W<'a> {
600    #[doc = r" Sets the field bit"]
601    pub fn set_bit(self) -> &'a mut W {
602        self.bit(true)
603    }
604    #[doc = r" Clears the field bit"]
605    pub fn clear_bit(self) -> &'a mut W {
606        self.bit(false)
607    }
608    #[doc = r" Writes raw bits to the field"]
609    #[inline]
610    pub fn bit(self, value: bool) -> &'a mut W {
611        const MASK: bool = true;
612        const OFFSET: u8 = 29;
613        self.w.bits &= !((MASK as u32) << OFFSET);
614        self.w.bits |= ((value & MASK) as u32) << OFFSET;
615        self.w
616    }
617}
618#[doc = r" Proxy"]
619pub struct _CEN2W<'a> {
620    w: &'a mut W,
621}
622impl<'a> _CEN2W<'a> {
623    #[doc = r" Sets the field bit"]
624    pub fn set_bit(self) -> &'a mut W {
625        self.bit(true)
626    }
627    #[doc = r" Clears the field bit"]
628    pub fn clear_bit(self) -> &'a mut W {
629        self.bit(false)
630    }
631    #[doc = r" Writes raw bits to the field"]
632    #[inline]
633    pub fn bit(self, value: bool) -> &'a mut W {
634        const MASK: bool = true;
635        const OFFSET: u8 = 30;
636        self.w.bits &= !((MASK as u32) << OFFSET);
637        self.w.bits |= ((value & MASK) as u32) << OFFSET;
638        self.w
639    }
640}
641impl R {
642    #[doc = r" Value of the register as raw bits"]
643    #[inline]
644    pub fn bits(&self) -> u32 {
645        self.bits
646    }
647    #[doc = "Bit 0 - DAC channel1 enable"]
648    #[inline]
649    pub fn en1(&self) -> EN1R {
650        let bits = {
651            const MASK: bool = true;
652            const OFFSET: u8 = 0;
653            ((self.bits >> OFFSET) & MASK as u32) != 0
654        };
655        EN1R { bits }
656    }
657    #[doc = "Bit 2 - DAC channel1 trigger enable"]
658    #[inline]
659    pub fn ten1(&self) -> TEN1R {
660        let bits = {
661            const MASK: bool = true;
662            const OFFSET: u8 = 2;
663            ((self.bits >> OFFSET) & MASK as u32) != 0
664        };
665        TEN1R { bits }
666    }
667    #[doc = "Bits 3:5 - DAC channel1 trigger selection"]
668    #[inline]
669    pub fn tsel1(&self) -> TSEL1R {
670        let bits = {
671            const MASK: u8 = 7;
672            const OFFSET: u8 = 3;
673            ((self.bits >> OFFSET) & MASK as u32) as u8
674        };
675        TSEL1R { bits }
676    }
677    #[doc = "Bits 6:7 - DAC channel1 noise/triangle wave generation enable"]
678    #[inline]
679    pub fn wave1(&self) -> WAVE1R {
680        let bits = {
681            const MASK: u8 = 3;
682            const OFFSET: u8 = 6;
683            ((self.bits >> OFFSET) & MASK as u32) as u8
684        };
685        WAVE1R { bits }
686    }
687    #[doc = "Bits 8:11 - DAC channel1 mask/amplitude selector"]
688    #[inline]
689    pub fn mamp1(&self) -> MAMP1R {
690        let bits = {
691            const MASK: u8 = 15;
692            const OFFSET: u8 = 8;
693            ((self.bits >> OFFSET) & MASK as u32) as u8
694        };
695        MAMP1R { bits }
696    }
697    #[doc = "Bit 12 - DAC channel1 DMA enable"]
698    #[inline]
699    pub fn dmaen1(&self) -> DMAEN1R {
700        let bits = {
701            const MASK: bool = true;
702            const OFFSET: u8 = 12;
703            ((self.bits >> OFFSET) & MASK as u32) != 0
704        };
705        DMAEN1R { bits }
706    }
707    #[doc = "Bit 13 - DAC channel1 DMA Underrun Interrupt enable"]
708    #[inline]
709    pub fn dmaudrie1(&self) -> DMAUDRIE1R {
710        let bits = {
711            const MASK: bool = true;
712            const OFFSET: u8 = 13;
713            ((self.bits >> OFFSET) & MASK as u32) != 0
714        };
715        DMAUDRIE1R { bits }
716    }
717    #[doc = "Bit 14 - DAC Channel 1 calibration enable"]
718    #[inline]
719    pub fn cen1(&self) -> CEN1R {
720        let bits = {
721            const MASK: bool = true;
722            const OFFSET: u8 = 14;
723            ((self.bits >> OFFSET) & MASK as u32) != 0
724        };
725        CEN1R { bits }
726    }
727    #[doc = "Bit 16 - DAC channel2 enable"]
728    #[inline]
729    pub fn en2(&self) -> EN2R {
730        let bits = {
731            const MASK: bool = true;
732            const OFFSET: u8 = 16;
733            ((self.bits >> OFFSET) & MASK as u32) != 0
734        };
735        EN2R { bits }
736    }
737    #[doc = "Bit 18 - DAC channel2 trigger enable"]
738    #[inline]
739    pub fn ten2(&self) -> TEN2R {
740        let bits = {
741            const MASK: bool = true;
742            const OFFSET: u8 = 18;
743            ((self.bits >> OFFSET) & MASK as u32) != 0
744        };
745        TEN2R { bits }
746    }
747    #[doc = "Bits 19:21 - DAC channel2 trigger selection"]
748    #[inline]
749    pub fn tsel2(&self) -> TSEL2R {
750        let bits = {
751            const MASK: u8 = 7;
752            const OFFSET: u8 = 19;
753            ((self.bits >> OFFSET) & MASK as u32) as u8
754        };
755        TSEL2R { bits }
756    }
757    #[doc = "Bits 22:23 - DAC channel2 noise/triangle wave generation enable"]
758    #[inline]
759    pub fn wave2(&self) -> WAVE2R {
760        let bits = {
761            const MASK: u8 = 3;
762            const OFFSET: u8 = 22;
763            ((self.bits >> OFFSET) & MASK as u32) as u8
764        };
765        WAVE2R { bits }
766    }
767    #[doc = "Bits 24:27 - DAC channel2 mask/amplitude selector"]
768    #[inline]
769    pub fn mamp2(&self) -> MAMP2R {
770        let bits = {
771            const MASK: u8 = 15;
772            const OFFSET: u8 = 24;
773            ((self.bits >> OFFSET) & MASK as u32) as u8
774        };
775        MAMP2R { bits }
776    }
777    #[doc = "Bit 28 - DAC channel2 DMA enable"]
778    #[inline]
779    pub fn dmaen2(&self) -> DMAEN2R {
780        let bits = {
781            const MASK: bool = true;
782            const OFFSET: u8 = 28;
783            ((self.bits >> OFFSET) & MASK as u32) != 0
784        };
785        DMAEN2R { bits }
786    }
787    #[doc = "Bit 29 - DAC channel2 DMA underrun interrupt enable"]
788    #[inline]
789    pub fn dmaudrie2(&self) -> DMAUDRIE2R {
790        let bits = {
791            const MASK: bool = true;
792            const OFFSET: u8 = 29;
793            ((self.bits >> OFFSET) & MASK as u32) != 0
794        };
795        DMAUDRIE2R { bits }
796    }
797    #[doc = "Bit 30 - DAC Channel 2 calibration enable"]
798    #[inline]
799    pub fn cen2(&self) -> CEN2R {
800        let bits = {
801            const MASK: bool = true;
802            const OFFSET: u8 = 30;
803            ((self.bits >> OFFSET) & MASK as u32) != 0
804        };
805        CEN2R { bits }
806    }
807}
808impl W {
809    #[doc = r" Reset value of the register"]
810    #[inline]
811    pub fn reset_value() -> W {
812        W { bits: 0 }
813    }
814    #[doc = r" Writes raw bits to the register"]
815    #[inline]
816    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
817        self.bits = bits;
818        self
819    }
820    #[doc = "Bit 0 - DAC channel1 enable"]
821    #[inline]
822    pub fn en1(&mut self) -> _EN1W {
823        _EN1W { w: self }
824    }
825    #[doc = "Bit 2 - DAC channel1 trigger enable"]
826    #[inline]
827    pub fn ten1(&mut self) -> _TEN1W {
828        _TEN1W { w: self }
829    }
830    #[doc = "Bits 3:5 - DAC channel1 trigger selection"]
831    #[inline]
832    pub fn tsel1(&mut self) -> _TSEL1W {
833        _TSEL1W { w: self }
834    }
835    #[doc = "Bits 6:7 - DAC channel1 noise/triangle wave generation enable"]
836    #[inline]
837    pub fn wave1(&mut self) -> _WAVE1W {
838        _WAVE1W { w: self }
839    }
840    #[doc = "Bits 8:11 - DAC channel1 mask/amplitude selector"]
841    #[inline]
842    pub fn mamp1(&mut self) -> _MAMP1W {
843        _MAMP1W { w: self }
844    }
845    #[doc = "Bit 12 - DAC channel1 DMA enable"]
846    #[inline]
847    pub fn dmaen1(&mut self) -> _DMAEN1W {
848        _DMAEN1W { w: self }
849    }
850    #[doc = "Bit 13 - DAC channel1 DMA Underrun Interrupt enable"]
851    #[inline]
852    pub fn dmaudrie1(&mut self) -> _DMAUDRIE1W {
853        _DMAUDRIE1W { w: self }
854    }
855    #[doc = "Bit 14 - DAC Channel 1 calibration enable"]
856    #[inline]
857    pub fn cen1(&mut self) -> _CEN1W {
858        _CEN1W { w: self }
859    }
860    #[doc = "Bit 16 - DAC channel2 enable"]
861    #[inline]
862    pub fn en2(&mut self) -> _EN2W {
863        _EN2W { w: self }
864    }
865    #[doc = "Bit 18 - DAC channel2 trigger enable"]
866    #[inline]
867    pub fn ten2(&mut self) -> _TEN2W {
868        _TEN2W { w: self }
869    }
870    #[doc = "Bits 19:21 - DAC channel2 trigger selection"]
871    #[inline]
872    pub fn tsel2(&mut self) -> _TSEL2W {
873        _TSEL2W { w: self }
874    }
875    #[doc = "Bits 22:23 - DAC channel2 noise/triangle wave generation enable"]
876    #[inline]
877    pub fn wave2(&mut self) -> _WAVE2W {
878        _WAVE2W { w: self }
879    }
880    #[doc = "Bits 24:27 - DAC channel2 mask/amplitude selector"]
881    #[inline]
882    pub fn mamp2(&mut self) -> _MAMP2W {
883        _MAMP2W { w: self }
884    }
885    #[doc = "Bit 28 - DAC channel2 DMA enable"]
886    #[inline]
887    pub fn dmaen2(&mut self) -> _DMAEN2W {
888        _DMAEN2W { w: self }
889    }
890    #[doc = "Bit 29 - DAC channel2 DMA underrun interrupt enable"]
891    #[inline]
892    pub fn dmaudrie2(&mut self) -> _DMAUDRIE2W {
893        _DMAUDRIE2W { w: self }
894    }
895    #[doc = "Bit 30 - DAC Channel 2 calibration enable"]
896    #[inline]
897    pub fn cen2(&mut self) -> _CEN2W {
898        _CEN2W { w: self }
899    }
900}