atsam3s4b/dacc/
mr.rs

1#[doc = "Register `MR` reader"]
2pub type R = crate::R<MrSpec>;
3#[doc = "Register `MR` writer"]
4pub type W = crate::W<MrSpec>;
5#[doc = "Trigger Enable\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum Trgen {
8    #[doc = "0: External trigger mode disabled. DACC in free running mode."]
9    Dis = 0,
10    #[doc = "1: External trigger mode enabled."]
11    En = 1,
12}
13impl From<Trgen> for bool {
14    #[inline(always)]
15    fn from(variant: Trgen) -> Self {
16        variant as u8 != 0
17    }
18}
19#[doc = "Field `TRGEN` reader - Trigger Enable"]
20pub type TrgenR = crate::BitReader<Trgen>;
21impl TrgenR {
22    #[doc = "Get enumerated values variant"]
23    #[inline(always)]
24    pub const fn variant(&self) -> Trgen {
25        match self.bits {
26            false => Trgen::Dis,
27            true => Trgen::En,
28        }
29    }
30    #[doc = "External trigger mode disabled. DACC in free running mode."]
31    #[inline(always)]
32    pub fn is_dis(&self) -> bool {
33        *self == Trgen::Dis
34    }
35    #[doc = "External trigger mode enabled."]
36    #[inline(always)]
37    pub fn is_en(&self) -> bool {
38        *self == Trgen::En
39    }
40}
41#[doc = "Field `TRGEN` writer - Trigger Enable"]
42pub type TrgenW<'a, REG> = crate::BitWriter<'a, REG, Trgen>;
43impl<'a, REG> TrgenW<'a, REG>
44where
45    REG: crate::Writable + crate::RegisterSpec,
46{
47    #[doc = "External trigger mode disabled. DACC in free running mode."]
48    #[inline(always)]
49    pub fn dis(self) -> &'a mut crate::W<REG> {
50        self.variant(Trgen::Dis)
51    }
52    #[doc = "External trigger mode enabled."]
53    #[inline(always)]
54    pub fn en(self) -> &'a mut crate::W<REG> {
55        self.variant(Trgen::En)
56    }
57}
58#[doc = "Trigger Selection\n\nValue on reset: 0"]
59#[derive(Clone, Copy, Debug, PartialEq, Eq)]
60#[repr(u8)]
61pub enum Trgsel {
62    #[doc = "0: External trigger"]
63    Trgsel0 = 0,
64    #[doc = "1: TIO Output of the Timer Counter Channel 0"]
65    Trgsel1 = 1,
66    #[doc = "2: TIO Output of the Timer Counter Channel 1"]
67    Trgsel2 = 2,
68    #[doc = "3: TIO Output of the Timer Counter Channel 2"]
69    Trgsel3 = 3,
70    #[doc = "4: PWM Event Line 0"]
71    Trgsel4 = 4,
72    #[doc = "5: PWM Event Line 1"]
73    Trgsel5 = 5,
74}
75impl From<Trgsel> for u8 {
76    #[inline(always)]
77    fn from(variant: Trgsel) -> Self {
78        variant as _
79    }
80}
81impl crate::FieldSpec for Trgsel {
82    type Ux = u8;
83}
84impl crate::IsEnum for Trgsel {}
85#[doc = "Field `TRGSEL` reader - Trigger Selection"]
86pub type TrgselR = crate::FieldReader<Trgsel>;
87impl TrgselR {
88    #[doc = "Get enumerated values variant"]
89    #[inline(always)]
90    pub const fn variant(&self) -> Option<Trgsel> {
91        match self.bits {
92            0 => Some(Trgsel::Trgsel0),
93            1 => Some(Trgsel::Trgsel1),
94            2 => Some(Trgsel::Trgsel2),
95            3 => Some(Trgsel::Trgsel3),
96            4 => Some(Trgsel::Trgsel4),
97            5 => Some(Trgsel::Trgsel5),
98            _ => None,
99        }
100    }
101    #[doc = "External trigger"]
102    #[inline(always)]
103    pub fn is_trgsel0(&self) -> bool {
104        *self == Trgsel::Trgsel0
105    }
106    #[doc = "TIO Output of the Timer Counter Channel 0"]
107    #[inline(always)]
108    pub fn is_trgsel1(&self) -> bool {
109        *self == Trgsel::Trgsel1
110    }
111    #[doc = "TIO Output of the Timer Counter Channel 1"]
112    #[inline(always)]
113    pub fn is_trgsel2(&self) -> bool {
114        *self == Trgsel::Trgsel2
115    }
116    #[doc = "TIO Output of the Timer Counter Channel 2"]
117    #[inline(always)]
118    pub fn is_trgsel3(&self) -> bool {
119        *self == Trgsel::Trgsel3
120    }
121    #[doc = "PWM Event Line 0"]
122    #[inline(always)]
123    pub fn is_trgsel4(&self) -> bool {
124        *self == Trgsel::Trgsel4
125    }
126    #[doc = "PWM Event Line 1"]
127    #[inline(always)]
128    pub fn is_trgsel5(&self) -> bool {
129        *self == Trgsel::Trgsel5
130    }
131}
132#[doc = "Field `TRGSEL` writer - Trigger Selection"]
133pub type TrgselW<'a, REG> = crate::FieldWriter<'a, REG, 3, Trgsel>;
134impl<'a, REG> TrgselW<'a, REG>
135where
136    REG: crate::Writable + crate::RegisterSpec,
137    REG::Ux: From<u8>,
138{
139    #[doc = "External trigger"]
140    #[inline(always)]
141    pub fn trgsel0(self) -> &'a mut crate::W<REG> {
142        self.variant(Trgsel::Trgsel0)
143    }
144    #[doc = "TIO Output of the Timer Counter Channel 0"]
145    #[inline(always)]
146    pub fn trgsel1(self) -> &'a mut crate::W<REG> {
147        self.variant(Trgsel::Trgsel1)
148    }
149    #[doc = "TIO Output of the Timer Counter Channel 1"]
150    #[inline(always)]
151    pub fn trgsel2(self) -> &'a mut crate::W<REG> {
152        self.variant(Trgsel::Trgsel2)
153    }
154    #[doc = "TIO Output of the Timer Counter Channel 2"]
155    #[inline(always)]
156    pub fn trgsel3(self) -> &'a mut crate::W<REG> {
157        self.variant(Trgsel::Trgsel3)
158    }
159    #[doc = "PWM Event Line 0"]
160    #[inline(always)]
161    pub fn trgsel4(self) -> &'a mut crate::W<REG> {
162        self.variant(Trgsel::Trgsel4)
163    }
164    #[doc = "PWM Event Line 1"]
165    #[inline(always)]
166    pub fn trgsel5(self) -> &'a mut crate::W<REG> {
167        self.variant(Trgsel::Trgsel5)
168    }
169}
170#[doc = "Word Transfer\n\nValue on reset: 0"]
171#[derive(Clone, Copy, Debug, PartialEq, Eq)]
172pub enum Word {
173    #[doc = "0: Half-Word transfer"]
174    Half = 0,
175    #[doc = "1: Word Transfer"]
176    Word = 1,
177}
178impl From<Word> for bool {
179    #[inline(always)]
180    fn from(variant: Word) -> Self {
181        variant as u8 != 0
182    }
183}
184#[doc = "Field `WORD` reader - Word Transfer"]
185pub type WordR = crate::BitReader<Word>;
186impl WordR {
187    #[doc = "Get enumerated values variant"]
188    #[inline(always)]
189    pub const fn variant(&self) -> Word {
190        match self.bits {
191            false => Word::Half,
192            true => Word::Word,
193        }
194    }
195    #[doc = "Half-Word transfer"]
196    #[inline(always)]
197    pub fn is_half(&self) -> bool {
198        *self == Word::Half
199    }
200    #[doc = "Word Transfer"]
201    #[inline(always)]
202    pub fn is_word(&self) -> bool {
203        *self == Word::Word
204    }
205}
206#[doc = "Field `WORD` writer - Word Transfer"]
207pub type WordW<'a, REG> = crate::BitWriter<'a, REG, Word>;
208impl<'a, REG> WordW<'a, REG>
209where
210    REG: crate::Writable + crate::RegisterSpec,
211{
212    #[doc = "Half-Word transfer"]
213    #[inline(always)]
214    pub fn half(self) -> &'a mut crate::W<REG> {
215        self.variant(Word::Half)
216    }
217    #[doc = "Word Transfer"]
218    #[inline(always)]
219    pub fn word(self) -> &'a mut crate::W<REG> {
220        self.variant(Word::Word)
221    }
222}
223#[doc = "Sleep Mode\n\nValue on reset: 0"]
224#[derive(Clone, Copy, Debug, PartialEq, Eq)]
225pub enum Sleep {
226    #[doc = "0: Normal Mode: The DAC Core and reference voltage circuitry are kept ON between conversions."]
227    Disabled = 0,
228    #[doc = "1: Sleep Mode: The DAC Core and/or reference voltage circuitry are OFF between conversions."]
229    Enabled = 1,
230}
231impl From<Sleep> for bool {
232    #[inline(always)]
233    fn from(variant: Sleep) -> Self {
234        variant as u8 != 0
235    }
236}
237#[doc = "Field `SLEEP` reader - Sleep Mode"]
238pub type SleepR = crate::BitReader<Sleep>;
239impl SleepR {
240    #[doc = "Get enumerated values variant"]
241    #[inline(always)]
242    pub const fn variant(&self) -> Sleep {
243        match self.bits {
244            false => Sleep::Disabled,
245            true => Sleep::Enabled,
246        }
247    }
248    #[doc = "Normal Mode: The DAC Core and reference voltage circuitry are kept ON between conversions."]
249    #[inline(always)]
250    pub fn is_disabled(&self) -> bool {
251        *self == Sleep::Disabled
252    }
253    #[doc = "Sleep Mode: The DAC Core and/or reference voltage circuitry are OFF between conversions."]
254    #[inline(always)]
255    pub fn is_enabled(&self) -> bool {
256        *self == Sleep::Enabled
257    }
258}
259#[doc = "Field `SLEEP` writer - Sleep Mode"]
260pub type SleepW<'a, REG> = crate::BitWriter<'a, REG, Sleep>;
261impl<'a, REG> SleepW<'a, REG>
262where
263    REG: crate::Writable + crate::RegisterSpec,
264{
265    #[doc = "Normal Mode: The DAC Core and reference voltage circuitry are kept ON between conversions."]
266    #[inline(always)]
267    pub fn disabled(self) -> &'a mut crate::W<REG> {
268        self.variant(Sleep::Disabled)
269    }
270    #[doc = "Sleep Mode: The DAC Core and/or reference voltage circuitry are OFF between conversions."]
271    #[inline(always)]
272    pub fn enabled(self) -> &'a mut crate::W<REG> {
273        self.variant(Sleep::Enabled)
274    }
275}
276#[doc = "Fast Wake up Mode\n\nValue on reset: 0"]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278pub enum Fastwkup {
279    #[doc = "0: Normal Sleep Mode: The sleep mode is defined by the SLEEP bit. Voltage reference is OFF between conversions."]
280    Stamode = 0,
281    #[doc = "1: Fast Wake up after Sleep Mode: the voltage reference is kept ON between conversions but DAC Core is OFF"]
282    Fastwakeup = 1,
283}
284impl From<Fastwkup> for bool {
285    #[inline(always)]
286    fn from(variant: Fastwkup) -> Self {
287        variant as u8 != 0
288    }
289}
290#[doc = "Field `FASTWKUP` reader - Fast Wake up Mode"]
291pub type FastwkupR = crate::BitReader<Fastwkup>;
292impl FastwkupR {
293    #[doc = "Get enumerated values variant"]
294    #[inline(always)]
295    pub const fn variant(&self) -> Fastwkup {
296        match self.bits {
297            false => Fastwkup::Stamode,
298            true => Fastwkup::Fastwakeup,
299        }
300    }
301    #[doc = "Normal Sleep Mode: The sleep mode is defined by the SLEEP bit. Voltage reference is OFF between conversions."]
302    #[inline(always)]
303    pub fn is_stamode(&self) -> bool {
304        *self == Fastwkup::Stamode
305    }
306    #[doc = "Fast Wake up after Sleep Mode: the voltage reference is kept ON between conversions but DAC Core is OFF"]
307    #[inline(always)]
308    pub fn is_fastwakeup(&self) -> bool {
309        *self == Fastwkup::Fastwakeup
310    }
311}
312#[doc = "Field `FASTWKUP` writer - Fast Wake up Mode"]
313pub type FastwkupW<'a, REG> = crate::BitWriter<'a, REG, Fastwkup>;
314impl<'a, REG> FastwkupW<'a, REG>
315where
316    REG: crate::Writable + crate::RegisterSpec,
317{
318    #[doc = "Normal Sleep Mode: The sleep mode is defined by the SLEEP bit. Voltage reference is OFF between conversions."]
319    #[inline(always)]
320    pub fn stamode(self) -> &'a mut crate::W<REG> {
321        self.variant(Fastwkup::Stamode)
322    }
323    #[doc = "Fast Wake up after Sleep Mode: the voltage reference is kept ON between conversions but DAC Core is OFF"]
324    #[inline(always)]
325    pub fn fastwakeup(self) -> &'a mut crate::W<REG> {
326        self.variant(Fastwkup::Fastwakeup)
327    }
328}
329#[doc = "Field `REFRESH` reader - Refresh Period"]
330pub type RefreshR = crate::FieldReader;
331#[doc = "Field `REFRESH` writer - Refresh Period"]
332pub type RefreshW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
333#[doc = "User Channel Selection\n\nValue on reset: 0"]
334#[derive(Clone, Copy, Debug, PartialEq, Eq)]
335#[repr(u8)]
336pub enum UserSel {
337    #[doc = "0: Channel 0"]
338    Channel0 = 0,
339    #[doc = "1: Channel 1"]
340    Channel1 = 1,
341}
342impl From<UserSel> for u8 {
343    #[inline(always)]
344    fn from(variant: UserSel) -> Self {
345        variant as _
346    }
347}
348impl crate::FieldSpec for UserSel {
349    type Ux = u8;
350}
351impl crate::IsEnum for UserSel {}
352#[doc = "Field `USER_SEL` reader - User Channel Selection"]
353pub type UserSelR = crate::FieldReader<UserSel>;
354impl UserSelR {
355    #[doc = "Get enumerated values variant"]
356    #[inline(always)]
357    pub const fn variant(&self) -> Option<UserSel> {
358        match self.bits {
359            0 => Some(UserSel::Channel0),
360            1 => Some(UserSel::Channel1),
361            _ => None,
362        }
363    }
364    #[doc = "Channel 0"]
365    #[inline(always)]
366    pub fn is_channel0(&self) -> bool {
367        *self == UserSel::Channel0
368    }
369    #[doc = "Channel 1"]
370    #[inline(always)]
371    pub fn is_channel1(&self) -> bool {
372        *self == UserSel::Channel1
373    }
374}
375#[doc = "Field `USER_SEL` writer - User Channel Selection"]
376pub type UserSelW<'a, REG> = crate::FieldWriter<'a, REG, 2, UserSel>;
377impl<'a, REG> UserSelW<'a, REG>
378where
379    REG: crate::Writable + crate::RegisterSpec,
380    REG::Ux: From<u8>,
381{
382    #[doc = "Channel 0"]
383    #[inline(always)]
384    pub fn channel0(self) -> &'a mut crate::W<REG> {
385        self.variant(UserSel::Channel0)
386    }
387    #[doc = "Channel 1"]
388    #[inline(always)]
389    pub fn channel1(self) -> &'a mut crate::W<REG> {
390        self.variant(UserSel::Channel1)
391    }
392}
393#[doc = "Tag Selection Mode\n\nValue on reset: 0"]
394#[derive(Clone, Copy, Debug, PartialEq, Eq)]
395pub enum Tag {
396    #[doc = "0: Tag selection mode disabled. Using USER_SEL to select the channel for the conversion."]
397    Dis = 0,
398    #[doc = "1: Tag selection mode enabled"]
399    En = 1,
400}
401impl From<Tag> for bool {
402    #[inline(always)]
403    fn from(variant: Tag) -> Self {
404        variant as u8 != 0
405    }
406}
407#[doc = "Field `TAG` reader - Tag Selection Mode"]
408pub type TagR = crate::BitReader<Tag>;
409impl TagR {
410    #[doc = "Get enumerated values variant"]
411    #[inline(always)]
412    pub const fn variant(&self) -> Tag {
413        match self.bits {
414            false => Tag::Dis,
415            true => Tag::En,
416        }
417    }
418    #[doc = "Tag selection mode disabled. Using USER_SEL to select the channel for the conversion."]
419    #[inline(always)]
420    pub fn is_dis(&self) -> bool {
421        *self == Tag::Dis
422    }
423    #[doc = "Tag selection mode enabled"]
424    #[inline(always)]
425    pub fn is_en(&self) -> bool {
426        *self == Tag::En
427    }
428}
429#[doc = "Field `TAG` writer - Tag Selection Mode"]
430pub type TagW<'a, REG> = crate::BitWriter<'a, REG, Tag>;
431impl<'a, REG> TagW<'a, REG>
432where
433    REG: crate::Writable + crate::RegisterSpec,
434{
435    #[doc = "Tag selection mode disabled. Using USER_SEL to select the channel for the conversion."]
436    #[inline(always)]
437    pub fn dis(self) -> &'a mut crate::W<REG> {
438        self.variant(Tag::Dis)
439    }
440    #[doc = "Tag selection mode enabled"]
441    #[inline(always)]
442    pub fn en(self) -> &'a mut crate::W<REG> {
443        self.variant(Tag::En)
444    }
445}
446#[doc = "Max Speed Mode\n\nValue on reset: 0"]
447#[derive(Clone, Copy, Debug, PartialEq, Eq)]
448pub enum Maxs {
449    #[doc = "0: Normal Mode"]
450    Normal = 0,
451    #[doc = "1: Max Speed Mode enabled"]
452    Maximum = 1,
453}
454impl From<Maxs> for bool {
455    #[inline(always)]
456    fn from(variant: Maxs) -> Self {
457        variant as u8 != 0
458    }
459}
460#[doc = "Field `MAXS` reader - Max Speed Mode"]
461pub type MaxsR = crate::BitReader<Maxs>;
462impl MaxsR {
463    #[doc = "Get enumerated values variant"]
464    #[inline(always)]
465    pub const fn variant(&self) -> Maxs {
466        match self.bits {
467            false => Maxs::Normal,
468            true => Maxs::Maximum,
469        }
470    }
471    #[doc = "Normal Mode"]
472    #[inline(always)]
473    pub fn is_normal(&self) -> bool {
474        *self == Maxs::Normal
475    }
476    #[doc = "Max Speed Mode enabled"]
477    #[inline(always)]
478    pub fn is_maximum(&self) -> bool {
479        *self == Maxs::Maximum
480    }
481}
482#[doc = "Field `MAXS` writer - Max Speed Mode"]
483pub type MaxsW<'a, REG> = crate::BitWriter<'a, REG, Maxs>;
484impl<'a, REG> MaxsW<'a, REG>
485where
486    REG: crate::Writable + crate::RegisterSpec,
487{
488    #[doc = "Normal Mode"]
489    #[inline(always)]
490    pub fn normal(self) -> &'a mut crate::W<REG> {
491        self.variant(Maxs::Normal)
492    }
493    #[doc = "Max Speed Mode enabled"]
494    #[inline(always)]
495    pub fn maximum(self) -> &'a mut crate::W<REG> {
496        self.variant(Maxs::Maximum)
497    }
498}
499#[doc = "Startup Time Selection\n\nValue on reset: 0"]
500#[derive(Clone, Copy, Debug, PartialEq, Eq)]
501#[repr(u8)]
502pub enum Startup {
503    #[doc = "0: 0 periods of DACClock"]
504    _0 = 0,
505    #[doc = "1: 8 periods of DACClock"]
506    _8 = 1,
507    #[doc = "2: 16 periods of DACClock"]
508    _16 = 2,
509    #[doc = "3: 24 periods of DACClock"]
510    _24 = 3,
511    #[doc = "4: 64 periods of DACClock"]
512    _64 = 4,
513    #[doc = "5: 80 periods of DACClock"]
514    _80 = 5,
515    #[doc = "6: 96 periods of DACClock"]
516    _96 = 6,
517    #[doc = "7: 112 periods of DACClock"]
518    _112 = 7,
519    #[doc = "8: 512 periods of DACClock"]
520    _512 = 8,
521    #[doc = "9: 576 periods of DACClock"]
522    _576 = 9,
523    #[doc = "10: 640 periods of DACClock"]
524    _640 = 10,
525    #[doc = "11: 704 periods of DACClock"]
526    _704 = 11,
527    #[doc = "12: 768 periods of DACClock"]
528    _768 = 12,
529    #[doc = "13: 832 periods of DACClock"]
530    _832 = 13,
531    #[doc = "14: 896 periods of DACClock"]
532    _896 = 14,
533    #[doc = "15: 960 periods of DACClock"]
534    _960 = 15,
535    #[doc = "16: 1024 periods of DACClock"]
536    _1024 = 16,
537    #[doc = "17: 1088 periods of DACClock"]
538    _1088 = 17,
539    #[doc = "18: 1152 periods of DACClock"]
540    _1152 = 18,
541    #[doc = "19: 1216 periods of DACClock"]
542    _1216 = 19,
543    #[doc = "20: 1280 periods of DACClock"]
544    _1280 = 20,
545    #[doc = "21: 1344 periods of DACClock"]
546    _1344 = 21,
547    #[doc = "22: 1408 periods of DACClock"]
548    _1408 = 22,
549    #[doc = "23: 1472 periods of DACClock"]
550    _1472 = 23,
551    #[doc = "24: 1536 periods of DACClock"]
552    _1536 = 24,
553    #[doc = "25: 1600 periods of DACClock"]
554    _1600 = 25,
555    #[doc = "26: 1664 periods of DACClock"]
556    _1664 = 26,
557    #[doc = "27: 1728 periods of DACClock"]
558    _1728 = 27,
559    #[doc = "28: 1792 periods of DACClock"]
560    _1792 = 28,
561    #[doc = "29: 1856 periods of DACClock"]
562    _1856 = 29,
563    #[doc = "30: 1920 periods of DACClock"]
564    _1920 = 30,
565    #[doc = "31: 1984 periods of DACClock"]
566    _1984 = 31,
567}
568impl From<Startup> for u8 {
569    #[inline(always)]
570    fn from(variant: Startup) -> Self {
571        variant as _
572    }
573}
574impl crate::FieldSpec for Startup {
575    type Ux = u8;
576}
577impl crate::IsEnum for Startup {}
578#[doc = "Field `STARTUP` reader - Startup Time Selection"]
579pub type StartupR = crate::FieldReader<Startup>;
580impl StartupR {
581    #[doc = "Get enumerated values variant"]
582    #[inline(always)]
583    pub const fn variant(&self) -> Option<Startup> {
584        match self.bits {
585            0 => Some(Startup::_0),
586            1 => Some(Startup::_8),
587            2 => Some(Startup::_16),
588            3 => Some(Startup::_24),
589            4 => Some(Startup::_64),
590            5 => Some(Startup::_80),
591            6 => Some(Startup::_96),
592            7 => Some(Startup::_112),
593            8 => Some(Startup::_512),
594            9 => Some(Startup::_576),
595            10 => Some(Startup::_640),
596            11 => Some(Startup::_704),
597            12 => Some(Startup::_768),
598            13 => Some(Startup::_832),
599            14 => Some(Startup::_896),
600            15 => Some(Startup::_960),
601            16 => Some(Startup::_1024),
602            17 => Some(Startup::_1088),
603            18 => Some(Startup::_1152),
604            19 => Some(Startup::_1216),
605            20 => Some(Startup::_1280),
606            21 => Some(Startup::_1344),
607            22 => Some(Startup::_1408),
608            23 => Some(Startup::_1472),
609            24 => Some(Startup::_1536),
610            25 => Some(Startup::_1600),
611            26 => Some(Startup::_1664),
612            27 => Some(Startup::_1728),
613            28 => Some(Startup::_1792),
614            29 => Some(Startup::_1856),
615            30 => Some(Startup::_1920),
616            31 => Some(Startup::_1984),
617            _ => None,
618        }
619    }
620    #[doc = "0 periods of DACClock"]
621    #[inline(always)]
622    pub fn is_0(&self) -> bool {
623        *self == Startup::_0
624    }
625    #[doc = "8 periods of DACClock"]
626    #[inline(always)]
627    pub fn is_8(&self) -> bool {
628        *self == Startup::_8
629    }
630    #[doc = "16 periods of DACClock"]
631    #[inline(always)]
632    pub fn is_16(&self) -> bool {
633        *self == Startup::_16
634    }
635    #[doc = "24 periods of DACClock"]
636    #[inline(always)]
637    pub fn is_24(&self) -> bool {
638        *self == Startup::_24
639    }
640    #[doc = "64 periods of DACClock"]
641    #[inline(always)]
642    pub fn is_64(&self) -> bool {
643        *self == Startup::_64
644    }
645    #[doc = "80 periods of DACClock"]
646    #[inline(always)]
647    pub fn is_80(&self) -> bool {
648        *self == Startup::_80
649    }
650    #[doc = "96 periods of DACClock"]
651    #[inline(always)]
652    pub fn is_96(&self) -> bool {
653        *self == Startup::_96
654    }
655    #[doc = "112 periods of DACClock"]
656    #[inline(always)]
657    pub fn is_112(&self) -> bool {
658        *self == Startup::_112
659    }
660    #[doc = "512 periods of DACClock"]
661    #[inline(always)]
662    pub fn is_512(&self) -> bool {
663        *self == Startup::_512
664    }
665    #[doc = "576 periods of DACClock"]
666    #[inline(always)]
667    pub fn is_576(&self) -> bool {
668        *self == Startup::_576
669    }
670    #[doc = "640 periods of DACClock"]
671    #[inline(always)]
672    pub fn is_640(&self) -> bool {
673        *self == Startup::_640
674    }
675    #[doc = "704 periods of DACClock"]
676    #[inline(always)]
677    pub fn is_704(&self) -> bool {
678        *self == Startup::_704
679    }
680    #[doc = "768 periods of DACClock"]
681    #[inline(always)]
682    pub fn is_768(&self) -> bool {
683        *self == Startup::_768
684    }
685    #[doc = "832 periods of DACClock"]
686    #[inline(always)]
687    pub fn is_832(&self) -> bool {
688        *self == Startup::_832
689    }
690    #[doc = "896 periods of DACClock"]
691    #[inline(always)]
692    pub fn is_896(&self) -> bool {
693        *self == Startup::_896
694    }
695    #[doc = "960 periods of DACClock"]
696    #[inline(always)]
697    pub fn is_960(&self) -> bool {
698        *self == Startup::_960
699    }
700    #[doc = "1024 periods of DACClock"]
701    #[inline(always)]
702    pub fn is_1024(&self) -> bool {
703        *self == Startup::_1024
704    }
705    #[doc = "1088 periods of DACClock"]
706    #[inline(always)]
707    pub fn is_1088(&self) -> bool {
708        *self == Startup::_1088
709    }
710    #[doc = "1152 periods of DACClock"]
711    #[inline(always)]
712    pub fn is_1152(&self) -> bool {
713        *self == Startup::_1152
714    }
715    #[doc = "1216 periods of DACClock"]
716    #[inline(always)]
717    pub fn is_1216(&self) -> bool {
718        *self == Startup::_1216
719    }
720    #[doc = "1280 periods of DACClock"]
721    #[inline(always)]
722    pub fn is_1280(&self) -> bool {
723        *self == Startup::_1280
724    }
725    #[doc = "1344 periods of DACClock"]
726    #[inline(always)]
727    pub fn is_1344(&self) -> bool {
728        *self == Startup::_1344
729    }
730    #[doc = "1408 periods of DACClock"]
731    #[inline(always)]
732    pub fn is_1408(&self) -> bool {
733        *self == Startup::_1408
734    }
735    #[doc = "1472 periods of DACClock"]
736    #[inline(always)]
737    pub fn is_1472(&self) -> bool {
738        *self == Startup::_1472
739    }
740    #[doc = "1536 periods of DACClock"]
741    #[inline(always)]
742    pub fn is_1536(&self) -> bool {
743        *self == Startup::_1536
744    }
745    #[doc = "1600 periods of DACClock"]
746    #[inline(always)]
747    pub fn is_1600(&self) -> bool {
748        *self == Startup::_1600
749    }
750    #[doc = "1664 periods of DACClock"]
751    #[inline(always)]
752    pub fn is_1664(&self) -> bool {
753        *self == Startup::_1664
754    }
755    #[doc = "1728 periods of DACClock"]
756    #[inline(always)]
757    pub fn is_1728(&self) -> bool {
758        *self == Startup::_1728
759    }
760    #[doc = "1792 periods of DACClock"]
761    #[inline(always)]
762    pub fn is_1792(&self) -> bool {
763        *self == Startup::_1792
764    }
765    #[doc = "1856 periods of DACClock"]
766    #[inline(always)]
767    pub fn is_1856(&self) -> bool {
768        *self == Startup::_1856
769    }
770    #[doc = "1920 periods of DACClock"]
771    #[inline(always)]
772    pub fn is_1920(&self) -> bool {
773        *self == Startup::_1920
774    }
775    #[doc = "1984 periods of DACClock"]
776    #[inline(always)]
777    pub fn is_1984(&self) -> bool {
778        *self == Startup::_1984
779    }
780}
781#[doc = "Field `STARTUP` writer - Startup Time Selection"]
782pub type StartupW<'a, REG> = crate::FieldWriter<'a, REG, 6, Startup>;
783impl<'a, REG> StartupW<'a, REG>
784where
785    REG: crate::Writable + crate::RegisterSpec,
786    REG::Ux: From<u8>,
787{
788    #[doc = "0 periods of DACClock"]
789    #[inline(always)]
790    pub fn _0(self) -> &'a mut crate::W<REG> {
791        self.variant(Startup::_0)
792    }
793    #[doc = "8 periods of DACClock"]
794    #[inline(always)]
795    pub fn _8(self) -> &'a mut crate::W<REG> {
796        self.variant(Startup::_8)
797    }
798    #[doc = "16 periods of DACClock"]
799    #[inline(always)]
800    pub fn _16(self) -> &'a mut crate::W<REG> {
801        self.variant(Startup::_16)
802    }
803    #[doc = "24 periods of DACClock"]
804    #[inline(always)]
805    pub fn _24(self) -> &'a mut crate::W<REG> {
806        self.variant(Startup::_24)
807    }
808    #[doc = "64 periods of DACClock"]
809    #[inline(always)]
810    pub fn _64(self) -> &'a mut crate::W<REG> {
811        self.variant(Startup::_64)
812    }
813    #[doc = "80 periods of DACClock"]
814    #[inline(always)]
815    pub fn _80(self) -> &'a mut crate::W<REG> {
816        self.variant(Startup::_80)
817    }
818    #[doc = "96 periods of DACClock"]
819    #[inline(always)]
820    pub fn _96(self) -> &'a mut crate::W<REG> {
821        self.variant(Startup::_96)
822    }
823    #[doc = "112 periods of DACClock"]
824    #[inline(always)]
825    pub fn _112(self) -> &'a mut crate::W<REG> {
826        self.variant(Startup::_112)
827    }
828    #[doc = "512 periods of DACClock"]
829    #[inline(always)]
830    pub fn _512(self) -> &'a mut crate::W<REG> {
831        self.variant(Startup::_512)
832    }
833    #[doc = "576 periods of DACClock"]
834    #[inline(always)]
835    pub fn _576(self) -> &'a mut crate::W<REG> {
836        self.variant(Startup::_576)
837    }
838    #[doc = "640 periods of DACClock"]
839    #[inline(always)]
840    pub fn _640(self) -> &'a mut crate::W<REG> {
841        self.variant(Startup::_640)
842    }
843    #[doc = "704 periods of DACClock"]
844    #[inline(always)]
845    pub fn _704(self) -> &'a mut crate::W<REG> {
846        self.variant(Startup::_704)
847    }
848    #[doc = "768 periods of DACClock"]
849    #[inline(always)]
850    pub fn _768(self) -> &'a mut crate::W<REG> {
851        self.variant(Startup::_768)
852    }
853    #[doc = "832 periods of DACClock"]
854    #[inline(always)]
855    pub fn _832(self) -> &'a mut crate::W<REG> {
856        self.variant(Startup::_832)
857    }
858    #[doc = "896 periods of DACClock"]
859    #[inline(always)]
860    pub fn _896(self) -> &'a mut crate::W<REG> {
861        self.variant(Startup::_896)
862    }
863    #[doc = "960 periods of DACClock"]
864    #[inline(always)]
865    pub fn _960(self) -> &'a mut crate::W<REG> {
866        self.variant(Startup::_960)
867    }
868    #[doc = "1024 periods of DACClock"]
869    #[inline(always)]
870    pub fn _1024(self) -> &'a mut crate::W<REG> {
871        self.variant(Startup::_1024)
872    }
873    #[doc = "1088 periods of DACClock"]
874    #[inline(always)]
875    pub fn _1088(self) -> &'a mut crate::W<REG> {
876        self.variant(Startup::_1088)
877    }
878    #[doc = "1152 periods of DACClock"]
879    #[inline(always)]
880    pub fn _1152(self) -> &'a mut crate::W<REG> {
881        self.variant(Startup::_1152)
882    }
883    #[doc = "1216 periods of DACClock"]
884    #[inline(always)]
885    pub fn _1216(self) -> &'a mut crate::W<REG> {
886        self.variant(Startup::_1216)
887    }
888    #[doc = "1280 periods of DACClock"]
889    #[inline(always)]
890    pub fn _1280(self) -> &'a mut crate::W<REG> {
891        self.variant(Startup::_1280)
892    }
893    #[doc = "1344 periods of DACClock"]
894    #[inline(always)]
895    pub fn _1344(self) -> &'a mut crate::W<REG> {
896        self.variant(Startup::_1344)
897    }
898    #[doc = "1408 periods of DACClock"]
899    #[inline(always)]
900    pub fn _1408(self) -> &'a mut crate::W<REG> {
901        self.variant(Startup::_1408)
902    }
903    #[doc = "1472 periods of DACClock"]
904    #[inline(always)]
905    pub fn _1472(self) -> &'a mut crate::W<REG> {
906        self.variant(Startup::_1472)
907    }
908    #[doc = "1536 periods of DACClock"]
909    #[inline(always)]
910    pub fn _1536(self) -> &'a mut crate::W<REG> {
911        self.variant(Startup::_1536)
912    }
913    #[doc = "1600 periods of DACClock"]
914    #[inline(always)]
915    pub fn _1600(self) -> &'a mut crate::W<REG> {
916        self.variant(Startup::_1600)
917    }
918    #[doc = "1664 periods of DACClock"]
919    #[inline(always)]
920    pub fn _1664(self) -> &'a mut crate::W<REG> {
921        self.variant(Startup::_1664)
922    }
923    #[doc = "1728 periods of DACClock"]
924    #[inline(always)]
925    pub fn _1728(self) -> &'a mut crate::W<REG> {
926        self.variant(Startup::_1728)
927    }
928    #[doc = "1792 periods of DACClock"]
929    #[inline(always)]
930    pub fn _1792(self) -> &'a mut crate::W<REG> {
931        self.variant(Startup::_1792)
932    }
933    #[doc = "1856 periods of DACClock"]
934    #[inline(always)]
935    pub fn _1856(self) -> &'a mut crate::W<REG> {
936        self.variant(Startup::_1856)
937    }
938    #[doc = "1920 periods of DACClock"]
939    #[inline(always)]
940    pub fn _1920(self) -> &'a mut crate::W<REG> {
941        self.variant(Startup::_1920)
942    }
943    #[doc = "1984 periods of DACClock"]
944    #[inline(always)]
945    pub fn _1984(self) -> &'a mut crate::W<REG> {
946        self.variant(Startup::_1984)
947    }
948}
949impl R {
950    #[doc = "Bit 0 - Trigger Enable"]
951    #[inline(always)]
952    pub fn trgen(&self) -> TrgenR {
953        TrgenR::new((self.bits & 1) != 0)
954    }
955    #[doc = "Bits 1:3 - Trigger Selection"]
956    #[inline(always)]
957    pub fn trgsel(&self) -> TrgselR {
958        TrgselR::new(((self.bits >> 1) & 7) as u8)
959    }
960    #[doc = "Bit 4 - Word Transfer"]
961    #[inline(always)]
962    pub fn word(&self) -> WordR {
963        WordR::new(((self.bits >> 4) & 1) != 0)
964    }
965    #[doc = "Bit 5 - Sleep Mode"]
966    #[inline(always)]
967    pub fn sleep(&self) -> SleepR {
968        SleepR::new(((self.bits >> 5) & 1) != 0)
969    }
970    #[doc = "Bit 6 - Fast Wake up Mode"]
971    #[inline(always)]
972    pub fn fastwkup(&self) -> FastwkupR {
973        FastwkupR::new(((self.bits >> 6) & 1) != 0)
974    }
975    #[doc = "Bits 8:15 - Refresh Period"]
976    #[inline(always)]
977    pub fn refresh(&self) -> RefreshR {
978        RefreshR::new(((self.bits >> 8) & 0xff) as u8)
979    }
980    #[doc = "Bits 16:17 - User Channel Selection"]
981    #[inline(always)]
982    pub fn user_sel(&self) -> UserSelR {
983        UserSelR::new(((self.bits >> 16) & 3) as u8)
984    }
985    #[doc = "Bit 20 - Tag Selection Mode"]
986    #[inline(always)]
987    pub fn tag(&self) -> TagR {
988        TagR::new(((self.bits >> 20) & 1) != 0)
989    }
990    #[doc = "Bit 21 - Max Speed Mode"]
991    #[inline(always)]
992    pub fn maxs(&self) -> MaxsR {
993        MaxsR::new(((self.bits >> 21) & 1) != 0)
994    }
995    #[doc = "Bits 24:29 - Startup Time Selection"]
996    #[inline(always)]
997    pub fn startup(&self) -> StartupR {
998        StartupR::new(((self.bits >> 24) & 0x3f) as u8)
999    }
1000}
1001impl W {
1002    #[doc = "Bit 0 - Trigger Enable"]
1003    #[inline(always)]
1004    #[must_use]
1005    pub fn trgen(&mut self) -> TrgenW<MrSpec> {
1006        TrgenW::new(self, 0)
1007    }
1008    #[doc = "Bits 1:3 - Trigger Selection"]
1009    #[inline(always)]
1010    #[must_use]
1011    pub fn trgsel(&mut self) -> TrgselW<MrSpec> {
1012        TrgselW::new(self, 1)
1013    }
1014    #[doc = "Bit 4 - Word Transfer"]
1015    #[inline(always)]
1016    #[must_use]
1017    pub fn word(&mut self) -> WordW<MrSpec> {
1018        WordW::new(self, 4)
1019    }
1020    #[doc = "Bit 5 - Sleep Mode"]
1021    #[inline(always)]
1022    #[must_use]
1023    pub fn sleep(&mut self) -> SleepW<MrSpec> {
1024        SleepW::new(self, 5)
1025    }
1026    #[doc = "Bit 6 - Fast Wake up Mode"]
1027    #[inline(always)]
1028    #[must_use]
1029    pub fn fastwkup(&mut self) -> FastwkupW<MrSpec> {
1030        FastwkupW::new(self, 6)
1031    }
1032    #[doc = "Bits 8:15 - Refresh Period"]
1033    #[inline(always)]
1034    #[must_use]
1035    pub fn refresh(&mut self) -> RefreshW<MrSpec> {
1036        RefreshW::new(self, 8)
1037    }
1038    #[doc = "Bits 16:17 - User Channel Selection"]
1039    #[inline(always)]
1040    #[must_use]
1041    pub fn user_sel(&mut self) -> UserSelW<MrSpec> {
1042        UserSelW::new(self, 16)
1043    }
1044    #[doc = "Bit 20 - Tag Selection Mode"]
1045    #[inline(always)]
1046    #[must_use]
1047    pub fn tag(&mut self) -> TagW<MrSpec> {
1048        TagW::new(self, 20)
1049    }
1050    #[doc = "Bit 21 - Max Speed Mode"]
1051    #[inline(always)]
1052    #[must_use]
1053    pub fn maxs(&mut self) -> MaxsW<MrSpec> {
1054        MaxsW::new(self, 21)
1055    }
1056    #[doc = "Bits 24:29 - Startup Time Selection"]
1057    #[inline(always)]
1058    #[must_use]
1059    pub fn startup(&mut self) -> StartupW<MrSpec> {
1060        StartupW::new(self, 24)
1061    }
1062}
1063#[doc = "Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mr::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
1064pub struct MrSpec;
1065impl crate::RegisterSpec for MrSpec {
1066    type Ux = u32;
1067}
1068#[doc = "`read()` method returns [`mr::R`](R) reader structure"]
1069impl crate::Readable for MrSpec {}
1070#[doc = "`write(|w| ..)` method takes [`mr::W`](W) writer structure"]
1071impl crate::Writable for MrSpec {
1072    type Safety = crate::Unsafe;
1073    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
1074    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
1075}
1076#[doc = "`reset()` method sets MR to value 0"]
1077impl crate::Resettable for MrSpec {
1078    const RESET_VALUE: u32 = 0;
1079}