atsamd51g/oscctrl/dpll/
dpllctrlb.rs

1#[doc = "Register `DPLLCTRLB` reader"]
2pub type R = crate::R<DpllctrlbSpec>;
3#[doc = "Register `DPLLCTRLB` writer"]
4pub type W = crate::W<DpllctrlbSpec>;
5#[doc = "Proportional Integral Filter Selection\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7#[repr(u8)]
8pub enum Filterselect {
9    #[doc = "0: Bandwidth = 92.7Khz and Damping Factor = 0.76"]
10    Filter1 = 0,
11    #[doc = "1: Bandwidth = 131Khz and Damping Factor = 1.08"]
12    Filter2 = 1,
13    #[doc = "2: Bandwidth = 46.4Khz and Damping Factor = 0.38"]
14    Filter3 = 2,
15    #[doc = "3: Bandwidth = 65.6Khz and Damping Factor = 0.54"]
16    Filter4 = 3,
17    #[doc = "4: Bandwidth = 131Khz and Damping Factor = 0.56"]
18    Filter5 = 4,
19    #[doc = "5: Bandwidth = 185Khz and Damping Factor = 0.79"]
20    Filter6 = 5,
21    #[doc = "6: Bandwidth = 65.6Khz and Damping Factor = 0.28"]
22    Filter7 = 6,
23    #[doc = "7: Bandwidth = 92.7Khz and Damping Factor = 0.39"]
24    Filter8 = 7,
25    #[doc = "8: Bandwidth = 46.4Khz and Damping Factor = 1.49"]
26    Filter9 = 8,
27    #[doc = "9: Bandwidth = 65.6Khz and Damping Factor = 2.11"]
28    Filter10 = 9,
29    #[doc = "10: Bandwidth = 23.2Khz and Damping Factor = 0.75"]
30    Filter11 = 10,
31    #[doc = "11: Bandwidth = 32.8Khz and Damping Factor = 1.06"]
32    Filter12 = 11,
33    #[doc = "12: Bandwidth = 65.6Khz and Damping Factor = 1.07"]
34    Filter13 = 12,
35    #[doc = "13: Bandwidth = 92.7Khz and Damping Factor = 1.51"]
36    Filter14 = 13,
37    #[doc = "14: Bandwidth = 32.8Khz and Damping Factor = 0.53"]
38    Filter15 = 14,
39    #[doc = "15: Bandwidth = 46.4Khz and Damping Factor = 0.75"]
40    Filter16 = 15,
41}
42impl From<Filterselect> for u8 {
43    #[inline(always)]
44    fn from(variant: Filterselect) -> Self {
45        variant as _
46    }
47}
48impl crate::FieldSpec for Filterselect {
49    type Ux = u8;
50}
51impl crate::IsEnum for Filterselect {}
52#[doc = "Field `FILTER` reader - Proportional Integral Filter Selection"]
53pub type FilterR = crate::FieldReader<Filterselect>;
54impl FilterR {
55    #[doc = "Get enumerated values variant"]
56    #[inline(always)]
57    pub const fn variant(&self) -> Filterselect {
58        match self.bits {
59            0 => Filterselect::Filter1,
60            1 => Filterselect::Filter2,
61            2 => Filterselect::Filter3,
62            3 => Filterselect::Filter4,
63            4 => Filterselect::Filter5,
64            5 => Filterselect::Filter6,
65            6 => Filterselect::Filter7,
66            7 => Filterselect::Filter8,
67            8 => Filterselect::Filter9,
68            9 => Filterselect::Filter10,
69            10 => Filterselect::Filter11,
70            11 => Filterselect::Filter12,
71            12 => Filterselect::Filter13,
72            13 => Filterselect::Filter14,
73            14 => Filterselect::Filter15,
74            15 => Filterselect::Filter16,
75            _ => unreachable!(),
76        }
77    }
78    #[doc = "Bandwidth = 92.7Khz and Damping Factor = 0.76"]
79    #[inline(always)]
80    pub fn is_filter1(&self) -> bool {
81        *self == Filterselect::Filter1
82    }
83    #[doc = "Bandwidth = 131Khz and Damping Factor = 1.08"]
84    #[inline(always)]
85    pub fn is_filter2(&self) -> bool {
86        *self == Filterselect::Filter2
87    }
88    #[doc = "Bandwidth = 46.4Khz and Damping Factor = 0.38"]
89    #[inline(always)]
90    pub fn is_filter3(&self) -> bool {
91        *self == Filterselect::Filter3
92    }
93    #[doc = "Bandwidth = 65.6Khz and Damping Factor = 0.54"]
94    #[inline(always)]
95    pub fn is_filter4(&self) -> bool {
96        *self == Filterselect::Filter4
97    }
98    #[doc = "Bandwidth = 131Khz and Damping Factor = 0.56"]
99    #[inline(always)]
100    pub fn is_filter5(&self) -> bool {
101        *self == Filterselect::Filter5
102    }
103    #[doc = "Bandwidth = 185Khz and Damping Factor = 0.79"]
104    #[inline(always)]
105    pub fn is_filter6(&self) -> bool {
106        *self == Filterselect::Filter6
107    }
108    #[doc = "Bandwidth = 65.6Khz and Damping Factor = 0.28"]
109    #[inline(always)]
110    pub fn is_filter7(&self) -> bool {
111        *self == Filterselect::Filter7
112    }
113    #[doc = "Bandwidth = 92.7Khz and Damping Factor = 0.39"]
114    #[inline(always)]
115    pub fn is_filter8(&self) -> bool {
116        *self == Filterselect::Filter8
117    }
118    #[doc = "Bandwidth = 46.4Khz and Damping Factor = 1.49"]
119    #[inline(always)]
120    pub fn is_filter9(&self) -> bool {
121        *self == Filterselect::Filter9
122    }
123    #[doc = "Bandwidth = 65.6Khz and Damping Factor = 2.11"]
124    #[inline(always)]
125    pub fn is_filter10(&self) -> bool {
126        *self == Filterselect::Filter10
127    }
128    #[doc = "Bandwidth = 23.2Khz and Damping Factor = 0.75"]
129    #[inline(always)]
130    pub fn is_filter11(&self) -> bool {
131        *self == Filterselect::Filter11
132    }
133    #[doc = "Bandwidth = 32.8Khz and Damping Factor = 1.06"]
134    #[inline(always)]
135    pub fn is_filter12(&self) -> bool {
136        *self == Filterselect::Filter12
137    }
138    #[doc = "Bandwidth = 65.6Khz and Damping Factor = 1.07"]
139    #[inline(always)]
140    pub fn is_filter13(&self) -> bool {
141        *self == Filterselect::Filter13
142    }
143    #[doc = "Bandwidth = 92.7Khz and Damping Factor = 1.51"]
144    #[inline(always)]
145    pub fn is_filter14(&self) -> bool {
146        *self == Filterselect::Filter14
147    }
148    #[doc = "Bandwidth = 32.8Khz and Damping Factor = 0.53"]
149    #[inline(always)]
150    pub fn is_filter15(&self) -> bool {
151        *self == Filterselect::Filter15
152    }
153    #[doc = "Bandwidth = 46.4Khz and Damping Factor = 0.75"]
154    #[inline(always)]
155    pub fn is_filter16(&self) -> bool {
156        *self == Filterselect::Filter16
157    }
158}
159#[doc = "Field `FILTER` writer - Proportional Integral Filter Selection"]
160pub type FilterW<'a, REG> = crate::FieldWriter<'a, REG, 4, Filterselect, crate::Safe>;
161impl<'a, REG> FilterW<'a, REG>
162where
163    REG: crate::Writable + crate::RegisterSpec,
164    REG::Ux: From<u8>,
165{
166    #[doc = "Bandwidth = 92.7Khz and Damping Factor = 0.76"]
167    #[inline(always)]
168    pub fn filter1(self) -> &'a mut crate::W<REG> {
169        self.variant(Filterselect::Filter1)
170    }
171    #[doc = "Bandwidth = 131Khz and Damping Factor = 1.08"]
172    #[inline(always)]
173    pub fn filter2(self) -> &'a mut crate::W<REG> {
174        self.variant(Filterselect::Filter2)
175    }
176    #[doc = "Bandwidth = 46.4Khz and Damping Factor = 0.38"]
177    #[inline(always)]
178    pub fn filter3(self) -> &'a mut crate::W<REG> {
179        self.variant(Filterselect::Filter3)
180    }
181    #[doc = "Bandwidth = 65.6Khz and Damping Factor = 0.54"]
182    #[inline(always)]
183    pub fn filter4(self) -> &'a mut crate::W<REG> {
184        self.variant(Filterselect::Filter4)
185    }
186    #[doc = "Bandwidth = 131Khz and Damping Factor = 0.56"]
187    #[inline(always)]
188    pub fn filter5(self) -> &'a mut crate::W<REG> {
189        self.variant(Filterselect::Filter5)
190    }
191    #[doc = "Bandwidth = 185Khz and Damping Factor = 0.79"]
192    #[inline(always)]
193    pub fn filter6(self) -> &'a mut crate::W<REG> {
194        self.variant(Filterselect::Filter6)
195    }
196    #[doc = "Bandwidth = 65.6Khz and Damping Factor = 0.28"]
197    #[inline(always)]
198    pub fn filter7(self) -> &'a mut crate::W<REG> {
199        self.variant(Filterselect::Filter7)
200    }
201    #[doc = "Bandwidth = 92.7Khz and Damping Factor = 0.39"]
202    #[inline(always)]
203    pub fn filter8(self) -> &'a mut crate::W<REG> {
204        self.variant(Filterselect::Filter8)
205    }
206    #[doc = "Bandwidth = 46.4Khz and Damping Factor = 1.49"]
207    #[inline(always)]
208    pub fn filter9(self) -> &'a mut crate::W<REG> {
209        self.variant(Filterselect::Filter9)
210    }
211    #[doc = "Bandwidth = 65.6Khz and Damping Factor = 2.11"]
212    #[inline(always)]
213    pub fn filter10(self) -> &'a mut crate::W<REG> {
214        self.variant(Filterselect::Filter10)
215    }
216    #[doc = "Bandwidth = 23.2Khz and Damping Factor = 0.75"]
217    #[inline(always)]
218    pub fn filter11(self) -> &'a mut crate::W<REG> {
219        self.variant(Filterselect::Filter11)
220    }
221    #[doc = "Bandwidth = 32.8Khz and Damping Factor = 1.06"]
222    #[inline(always)]
223    pub fn filter12(self) -> &'a mut crate::W<REG> {
224        self.variant(Filterselect::Filter12)
225    }
226    #[doc = "Bandwidth = 65.6Khz and Damping Factor = 1.07"]
227    #[inline(always)]
228    pub fn filter13(self) -> &'a mut crate::W<REG> {
229        self.variant(Filterselect::Filter13)
230    }
231    #[doc = "Bandwidth = 92.7Khz and Damping Factor = 1.51"]
232    #[inline(always)]
233    pub fn filter14(self) -> &'a mut crate::W<REG> {
234        self.variant(Filterselect::Filter14)
235    }
236    #[doc = "Bandwidth = 32.8Khz and Damping Factor = 0.53"]
237    #[inline(always)]
238    pub fn filter15(self) -> &'a mut crate::W<REG> {
239        self.variant(Filterselect::Filter15)
240    }
241    #[doc = "Bandwidth = 46.4Khz and Damping Factor = 0.75"]
242    #[inline(always)]
243    pub fn filter16(self) -> &'a mut crate::W<REG> {
244        self.variant(Filterselect::Filter16)
245    }
246}
247#[doc = "Field `WUF` reader - Wake Up Fast"]
248pub type WufR = crate::BitReader;
249#[doc = "Field `WUF` writer - Wake Up Fast"]
250pub type WufW<'a, REG> = crate::BitWriter<'a, REG>;
251#[doc = "Reference Clock Selection\n\nValue on reset: 1"]
252#[derive(Clone, Copy, Debug, PartialEq, Eq)]
253#[repr(u8)]
254pub enum Refclkselect {
255    #[doc = "0: Dedicated GCLK clock reference"]
256    Gclk = 0,
257    #[doc = "1: XOSC32K clock reference"]
258    Xosc32 = 1,
259    #[doc = "2: XOSC0 clock reference"]
260    Xosc0 = 2,
261    #[doc = "3: XOSC1 clock reference"]
262    Xosc1 = 3,
263}
264impl From<Refclkselect> for u8 {
265    #[inline(always)]
266    fn from(variant: Refclkselect) -> Self {
267        variant as _
268    }
269}
270impl crate::FieldSpec for Refclkselect {
271    type Ux = u8;
272}
273impl crate::IsEnum for Refclkselect {}
274#[doc = "Field `REFCLK` reader - Reference Clock Selection"]
275pub type RefclkR = crate::FieldReader<Refclkselect>;
276impl RefclkR {
277    #[doc = "Get enumerated values variant"]
278    #[inline(always)]
279    pub const fn variant(&self) -> Option<Refclkselect> {
280        match self.bits {
281            0 => Some(Refclkselect::Gclk),
282            1 => Some(Refclkselect::Xosc32),
283            2 => Some(Refclkselect::Xosc0),
284            3 => Some(Refclkselect::Xosc1),
285            _ => None,
286        }
287    }
288    #[doc = "Dedicated GCLK clock reference"]
289    #[inline(always)]
290    pub fn is_gclk(&self) -> bool {
291        *self == Refclkselect::Gclk
292    }
293    #[doc = "XOSC32K clock reference"]
294    #[inline(always)]
295    pub fn is_xosc32(&self) -> bool {
296        *self == Refclkselect::Xosc32
297    }
298    #[doc = "XOSC0 clock reference"]
299    #[inline(always)]
300    pub fn is_xosc0(&self) -> bool {
301        *self == Refclkselect::Xosc0
302    }
303    #[doc = "XOSC1 clock reference"]
304    #[inline(always)]
305    pub fn is_xosc1(&self) -> bool {
306        *self == Refclkselect::Xosc1
307    }
308}
309#[doc = "Field `REFCLK` writer - Reference Clock Selection"]
310pub type RefclkW<'a, REG> = crate::FieldWriter<'a, REG, 3, Refclkselect>;
311impl<'a, REG> RefclkW<'a, REG>
312where
313    REG: crate::Writable + crate::RegisterSpec,
314    REG::Ux: From<u8>,
315{
316    #[doc = "Dedicated GCLK clock reference"]
317    #[inline(always)]
318    pub fn gclk(self) -> &'a mut crate::W<REG> {
319        self.variant(Refclkselect::Gclk)
320    }
321    #[doc = "XOSC32K clock reference"]
322    #[inline(always)]
323    pub fn xosc32(self) -> &'a mut crate::W<REG> {
324        self.variant(Refclkselect::Xosc32)
325    }
326    #[doc = "XOSC0 clock reference"]
327    #[inline(always)]
328    pub fn xosc0(self) -> &'a mut crate::W<REG> {
329        self.variant(Refclkselect::Xosc0)
330    }
331    #[doc = "XOSC1 clock reference"]
332    #[inline(always)]
333    pub fn xosc1(self) -> &'a mut crate::W<REG> {
334        self.variant(Refclkselect::Xosc1)
335    }
336}
337#[doc = "Lock Time\n\nValue on reset: 0"]
338#[derive(Clone, Copy, Debug, PartialEq, Eq)]
339#[repr(u8)]
340pub enum Ltimeselect {
341    #[doc = "0: No time-out. Automatic lock"]
342    Default = 0,
343    #[doc = "4: Time-out if no lock within 800us"]
344    _800us = 4,
345    #[doc = "5: Time-out if no lock within 900us"]
346    _900us = 5,
347    #[doc = "6: Time-out if no lock within 1ms"]
348    _1ms = 6,
349    #[doc = "7: Time-out if no lock within 1.1ms"]
350    _1p1ms = 7,
351}
352impl From<Ltimeselect> for u8 {
353    #[inline(always)]
354    fn from(variant: Ltimeselect) -> Self {
355        variant as _
356    }
357}
358impl crate::FieldSpec for Ltimeselect {
359    type Ux = u8;
360}
361impl crate::IsEnum for Ltimeselect {}
362#[doc = "Field `LTIME` reader - Lock Time"]
363pub type LtimeR = crate::FieldReader<Ltimeselect>;
364impl LtimeR {
365    #[doc = "Get enumerated values variant"]
366    #[inline(always)]
367    pub const fn variant(&self) -> Option<Ltimeselect> {
368        match self.bits {
369            0 => Some(Ltimeselect::Default),
370            4 => Some(Ltimeselect::_800us),
371            5 => Some(Ltimeselect::_900us),
372            6 => Some(Ltimeselect::_1ms),
373            7 => Some(Ltimeselect::_1p1ms),
374            _ => None,
375        }
376    }
377    #[doc = "No time-out. Automatic lock"]
378    #[inline(always)]
379    pub fn is_default(&self) -> bool {
380        *self == Ltimeselect::Default
381    }
382    #[doc = "Time-out if no lock within 800us"]
383    #[inline(always)]
384    pub fn is_800us(&self) -> bool {
385        *self == Ltimeselect::_800us
386    }
387    #[doc = "Time-out if no lock within 900us"]
388    #[inline(always)]
389    pub fn is_900us(&self) -> bool {
390        *self == Ltimeselect::_900us
391    }
392    #[doc = "Time-out if no lock within 1ms"]
393    #[inline(always)]
394    pub fn is_1ms(&self) -> bool {
395        *self == Ltimeselect::_1ms
396    }
397    #[doc = "Time-out if no lock within 1.1ms"]
398    #[inline(always)]
399    pub fn is_1p1ms(&self) -> bool {
400        *self == Ltimeselect::_1p1ms
401    }
402}
403#[doc = "Field `LTIME` writer - Lock Time"]
404pub type LtimeW<'a, REG> = crate::FieldWriter<'a, REG, 3, Ltimeselect>;
405impl<'a, REG> LtimeW<'a, REG>
406where
407    REG: crate::Writable + crate::RegisterSpec,
408    REG::Ux: From<u8>,
409{
410    #[doc = "No time-out. Automatic lock"]
411    #[inline(always)]
412    pub fn default(self) -> &'a mut crate::W<REG> {
413        self.variant(Ltimeselect::Default)
414    }
415    #[doc = "Time-out if no lock within 800us"]
416    #[inline(always)]
417    pub fn _800us(self) -> &'a mut crate::W<REG> {
418        self.variant(Ltimeselect::_800us)
419    }
420    #[doc = "Time-out if no lock within 900us"]
421    #[inline(always)]
422    pub fn _900us(self) -> &'a mut crate::W<REG> {
423        self.variant(Ltimeselect::_900us)
424    }
425    #[doc = "Time-out if no lock within 1ms"]
426    #[inline(always)]
427    pub fn _1ms(self) -> &'a mut crate::W<REG> {
428        self.variant(Ltimeselect::_1ms)
429    }
430    #[doc = "Time-out if no lock within 1.1ms"]
431    #[inline(always)]
432    pub fn _1p1ms(self) -> &'a mut crate::W<REG> {
433        self.variant(Ltimeselect::_1p1ms)
434    }
435}
436#[doc = "Field `LBYPASS` reader - Lock Bypass"]
437pub type LbypassR = crate::BitReader;
438#[doc = "Field `LBYPASS` writer - Lock Bypass"]
439pub type LbypassW<'a, REG> = crate::BitWriter<'a, REG>;
440#[doc = "Sigma-Delta DCO Filter Selection\n\nValue on reset: 0"]
441#[derive(Clone, Copy, Debug, PartialEq, Eq)]
442#[repr(u8)]
443pub enum Dcofilterselect {
444    #[doc = "0: Capacitor(pF) = 0.5 and Bandwidth Fn (MHz) = 3.21"]
445    Filter1 = 0,
446    #[doc = "1: Capacitor(pF) = 1 and Bandwidth Fn (MHz) = 1.6"]
447    Filter2 = 1,
448    #[doc = "2: Capacitor(pF) = 1.5 and Bandwidth Fn (MHz) = 1.1"]
449    Filter3 = 2,
450    #[doc = "3: Capacitor(pF) = 2 and Bandwidth Fn (MHz) = 0.8"]
451    Filter4 = 3,
452    #[doc = "4: Capacitor(pF) = 2.5 and Bandwidth Fn (MHz) = 0.64"]
453    Filter5 = 4,
454    #[doc = "5: Capacitor(pF) = 3 and Bandwidth Fn (MHz) = 0.55"]
455    Filter6 = 5,
456    #[doc = "6: Capacitor(pF) = 3.5 and Bandwidth Fn (MHz) = 0.45"]
457    Filter7 = 6,
458    #[doc = "7: Capacitor(pF) = 4 and Bandwidth Fn (MHz) = 0.4"]
459    Filter8 = 7,
460}
461impl From<Dcofilterselect> for u8 {
462    #[inline(always)]
463    fn from(variant: Dcofilterselect) -> Self {
464        variant as _
465    }
466}
467impl crate::FieldSpec for Dcofilterselect {
468    type Ux = u8;
469}
470impl crate::IsEnum for Dcofilterselect {}
471#[doc = "Field `DCOFILTER` reader - Sigma-Delta DCO Filter Selection"]
472pub type DcofilterR = crate::FieldReader<Dcofilterselect>;
473impl DcofilterR {
474    #[doc = "Get enumerated values variant"]
475    #[inline(always)]
476    pub const fn variant(&self) -> Dcofilterselect {
477        match self.bits {
478            0 => Dcofilterselect::Filter1,
479            1 => Dcofilterselect::Filter2,
480            2 => Dcofilterselect::Filter3,
481            3 => Dcofilterselect::Filter4,
482            4 => Dcofilterselect::Filter5,
483            5 => Dcofilterselect::Filter6,
484            6 => Dcofilterselect::Filter7,
485            7 => Dcofilterselect::Filter8,
486            _ => unreachable!(),
487        }
488    }
489    #[doc = "Capacitor(pF) = 0.5 and Bandwidth Fn (MHz) = 3.21"]
490    #[inline(always)]
491    pub fn is_filter1(&self) -> bool {
492        *self == Dcofilterselect::Filter1
493    }
494    #[doc = "Capacitor(pF) = 1 and Bandwidth Fn (MHz) = 1.6"]
495    #[inline(always)]
496    pub fn is_filter2(&self) -> bool {
497        *self == Dcofilterselect::Filter2
498    }
499    #[doc = "Capacitor(pF) = 1.5 and Bandwidth Fn (MHz) = 1.1"]
500    #[inline(always)]
501    pub fn is_filter3(&self) -> bool {
502        *self == Dcofilterselect::Filter3
503    }
504    #[doc = "Capacitor(pF) = 2 and Bandwidth Fn (MHz) = 0.8"]
505    #[inline(always)]
506    pub fn is_filter4(&self) -> bool {
507        *self == Dcofilterselect::Filter4
508    }
509    #[doc = "Capacitor(pF) = 2.5 and Bandwidth Fn (MHz) = 0.64"]
510    #[inline(always)]
511    pub fn is_filter5(&self) -> bool {
512        *self == Dcofilterselect::Filter5
513    }
514    #[doc = "Capacitor(pF) = 3 and Bandwidth Fn (MHz) = 0.55"]
515    #[inline(always)]
516    pub fn is_filter6(&self) -> bool {
517        *self == Dcofilterselect::Filter6
518    }
519    #[doc = "Capacitor(pF) = 3.5 and Bandwidth Fn (MHz) = 0.45"]
520    #[inline(always)]
521    pub fn is_filter7(&self) -> bool {
522        *self == Dcofilterselect::Filter7
523    }
524    #[doc = "Capacitor(pF) = 4 and Bandwidth Fn (MHz) = 0.4"]
525    #[inline(always)]
526    pub fn is_filter8(&self) -> bool {
527        *self == Dcofilterselect::Filter8
528    }
529}
530#[doc = "Field `DCOFILTER` writer - Sigma-Delta DCO Filter Selection"]
531pub type DcofilterW<'a, REG> = crate::FieldWriter<'a, REG, 3, Dcofilterselect, crate::Safe>;
532impl<'a, REG> DcofilterW<'a, REG>
533where
534    REG: crate::Writable + crate::RegisterSpec,
535    REG::Ux: From<u8>,
536{
537    #[doc = "Capacitor(pF) = 0.5 and Bandwidth Fn (MHz) = 3.21"]
538    #[inline(always)]
539    pub fn filter1(self) -> &'a mut crate::W<REG> {
540        self.variant(Dcofilterselect::Filter1)
541    }
542    #[doc = "Capacitor(pF) = 1 and Bandwidth Fn (MHz) = 1.6"]
543    #[inline(always)]
544    pub fn filter2(self) -> &'a mut crate::W<REG> {
545        self.variant(Dcofilterselect::Filter2)
546    }
547    #[doc = "Capacitor(pF) = 1.5 and Bandwidth Fn (MHz) = 1.1"]
548    #[inline(always)]
549    pub fn filter3(self) -> &'a mut crate::W<REG> {
550        self.variant(Dcofilterselect::Filter3)
551    }
552    #[doc = "Capacitor(pF) = 2 and Bandwidth Fn (MHz) = 0.8"]
553    #[inline(always)]
554    pub fn filter4(self) -> &'a mut crate::W<REG> {
555        self.variant(Dcofilterselect::Filter4)
556    }
557    #[doc = "Capacitor(pF) = 2.5 and Bandwidth Fn (MHz) = 0.64"]
558    #[inline(always)]
559    pub fn filter5(self) -> &'a mut crate::W<REG> {
560        self.variant(Dcofilterselect::Filter5)
561    }
562    #[doc = "Capacitor(pF) = 3 and Bandwidth Fn (MHz) = 0.55"]
563    #[inline(always)]
564    pub fn filter6(self) -> &'a mut crate::W<REG> {
565        self.variant(Dcofilterselect::Filter6)
566    }
567    #[doc = "Capacitor(pF) = 3.5 and Bandwidth Fn (MHz) = 0.45"]
568    #[inline(always)]
569    pub fn filter7(self) -> &'a mut crate::W<REG> {
570        self.variant(Dcofilterselect::Filter7)
571    }
572    #[doc = "Capacitor(pF) = 4 and Bandwidth Fn (MHz) = 0.4"]
573    #[inline(always)]
574    pub fn filter8(self) -> &'a mut crate::W<REG> {
575        self.variant(Dcofilterselect::Filter8)
576    }
577}
578#[doc = "Field `DCOEN` reader - DCO Filter Enable"]
579pub type DcoenR = crate::BitReader;
580#[doc = "Field `DCOEN` writer - DCO Filter Enable"]
581pub type DcoenW<'a, REG> = crate::BitWriter<'a, REG>;
582#[doc = "Field `DIV` reader - Clock Divider"]
583pub type DivR = crate::FieldReader<u16>;
584#[doc = "Field `DIV` writer - Clock Divider"]
585pub type DivW<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>;
586impl R {
587    #[doc = "Bits 0:3 - Proportional Integral Filter Selection"]
588    #[inline(always)]
589    pub fn filter(&self) -> FilterR {
590        FilterR::new((self.bits & 0x0f) as u8)
591    }
592    #[doc = "Bit 4 - Wake Up Fast"]
593    #[inline(always)]
594    pub fn wuf(&self) -> WufR {
595        WufR::new(((self.bits >> 4) & 1) != 0)
596    }
597    #[doc = "Bits 5:7 - Reference Clock Selection"]
598    #[inline(always)]
599    pub fn refclk(&self) -> RefclkR {
600        RefclkR::new(((self.bits >> 5) & 7) as u8)
601    }
602    #[doc = "Bits 8:10 - Lock Time"]
603    #[inline(always)]
604    pub fn ltime(&self) -> LtimeR {
605        LtimeR::new(((self.bits >> 8) & 7) as u8)
606    }
607    #[doc = "Bit 11 - Lock Bypass"]
608    #[inline(always)]
609    pub fn lbypass(&self) -> LbypassR {
610        LbypassR::new(((self.bits >> 11) & 1) != 0)
611    }
612    #[doc = "Bits 12:14 - Sigma-Delta DCO Filter Selection"]
613    #[inline(always)]
614    pub fn dcofilter(&self) -> DcofilterR {
615        DcofilterR::new(((self.bits >> 12) & 7) as u8)
616    }
617    #[doc = "Bit 15 - DCO Filter Enable"]
618    #[inline(always)]
619    pub fn dcoen(&self) -> DcoenR {
620        DcoenR::new(((self.bits >> 15) & 1) != 0)
621    }
622    #[doc = "Bits 16:26 - Clock Divider"]
623    #[inline(always)]
624    pub fn div(&self) -> DivR {
625        DivR::new(((self.bits >> 16) & 0x07ff) as u16)
626    }
627}
628impl W {
629    #[doc = "Bits 0:3 - Proportional Integral Filter Selection"]
630    #[inline(always)]
631    #[must_use]
632    pub fn filter(&mut self) -> FilterW<DpllctrlbSpec> {
633        FilterW::new(self, 0)
634    }
635    #[doc = "Bit 4 - Wake Up Fast"]
636    #[inline(always)]
637    #[must_use]
638    pub fn wuf(&mut self) -> WufW<DpllctrlbSpec> {
639        WufW::new(self, 4)
640    }
641    #[doc = "Bits 5:7 - Reference Clock Selection"]
642    #[inline(always)]
643    #[must_use]
644    pub fn refclk(&mut self) -> RefclkW<DpllctrlbSpec> {
645        RefclkW::new(self, 5)
646    }
647    #[doc = "Bits 8:10 - Lock Time"]
648    #[inline(always)]
649    #[must_use]
650    pub fn ltime(&mut self) -> LtimeW<DpllctrlbSpec> {
651        LtimeW::new(self, 8)
652    }
653    #[doc = "Bit 11 - Lock Bypass"]
654    #[inline(always)]
655    #[must_use]
656    pub fn lbypass(&mut self) -> LbypassW<DpllctrlbSpec> {
657        LbypassW::new(self, 11)
658    }
659    #[doc = "Bits 12:14 - Sigma-Delta DCO Filter Selection"]
660    #[inline(always)]
661    #[must_use]
662    pub fn dcofilter(&mut self) -> DcofilterW<DpllctrlbSpec> {
663        DcofilterW::new(self, 12)
664    }
665    #[doc = "Bit 15 - DCO Filter Enable"]
666    #[inline(always)]
667    #[must_use]
668    pub fn dcoen(&mut self) -> DcoenW<DpllctrlbSpec> {
669        DcoenW::new(self, 15)
670    }
671    #[doc = "Bits 16:26 - Clock Divider"]
672    #[inline(always)]
673    #[must_use]
674    pub fn div(&mut self) -> DivW<DpllctrlbSpec> {
675        DivW::new(self, 16)
676    }
677}
678#[doc = "DPLL Control B\n\nYou can [`read`](crate::Reg::read) this register and get [`dpllctrlb::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dpllctrlb::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
679pub struct DpllctrlbSpec;
680impl crate::RegisterSpec for DpllctrlbSpec {
681    type Ux = u32;
682}
683#[doc = "`read()` method returns [`dpllctrlb::R`](R) reader structure"]
684impl crate::Readable for DpllctrlbSpec {}
685#[doc = "`write(|w| ..)` method takes [`dpllctrlb::W`](W) writer structure"]
686impl crate::Writable for DpllctrlbSpec {
687    type Safety = crate::Unsafe;
688    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
689    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
690}
691#[doc = "`reset()` method sets DPLLCTRLB to value 0x20"]
692impl crate::Resettable for DpllctrlbSpec {
693    const RESET_VALUE: u32 = 0x20;
694}