atsaml21j17bu/oscctrl/
dfllctrl.rs

1#[doc = "Register `DFLLCTRL` reader"]
2pub struct R(crate::R<DFLLCTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<DFLLCTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<DFLLCTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<DFLLCTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `DFLLCTRL` writer"]
17pub struct W(crate::W<DFLLCTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<DFLLCTRL_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<DFLLCTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<DFLLCTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `ENABLE` reader - DFLL Enable"]
38pub type ENABLE_R = crate::BitReader<bool>;
39#[doc = "Field `ENABLE` writer - DFLL Enable"]
40pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u16, DFLLCTRL_SPEC, bool, O>;
41#[doc = "Field `MODE` reader - Operating Mode Selection"]
42pub type MODE_R = crate::BitReader<bool>;
43#[doc = "Field `MODE` writer - Operating Mode Selection"]
44pub type MODE_W<'a, const O: u8> = crate::BitWriter<'a, u16, DFLLCTRL_SPEC, bool, O>;
45#[doc = "Field `STABLE` reader - Stable DFLL Frequency"]
46pub type STABLE_R = crate::BitReader<bool>;
47#[doc = "Field `STABLE` writer - Stable DFLL Frequency"]
48pub type STABLE_W<'a, const O: u8> = crate::BitWriter<'a, u16, DFLLCTRL_SPEC, bool, O>;
49#[doc = "Field `LLAW` reader - Lose Lock After Wake"]
50pub type LLAW_R = crate::BitReader<bool>;
51#[doc = "Field `LLAW` writer - Lose Lock After Wake"]
52pub type LLAW_W<'a, const O: u8> = crate::BitWriter<'a, u16, DFLLCTRL_SPEC, bool, O>;
53#[doc = "Field `USBCRM` reader - USB Clock Recovery Mode"]
54pub type USBCRM_R = crate::BitReader<bool>;
55#[doc = "Field `USBCRM` writer - USB Clock Recovery Mode"]
56pub type USBCRM_W<'a, const O: u8> = crate::BitWriter<'a, u16, DFLLCTRL_SPEC, bool, O>;
57#[doc = "Field `RUNSTDBY` reader - Run in Standby"]
58pub type RUNSTDBY_R = crate::BitReader<bool>;
59#[doc = "Field `RUNSTDBY` writer - Run in Standby"]
60pub type RUNSTDBY_W<'a, const O: u8> = crate::BitWriter<'a, u16, DFLLCTRL_SPEC, bool, O>;
61#[doc = "Field `ONDEMAND` reader - On Demand Control"]
62pub type ONDEMAND_R = crate::BitReader<bool>;
63#[doc = "Field `ONDEMAND` writer - On Demand Control"]
64pub type ONDEMAND_W<'a, const O: u8> = crate::BitWriter<'a, u16, DFLLCTRL_SPEC, bool, O>;
65#[doc = "Field `CCDIS` reader - Chill Cycle Disable"]
66pub type CCDIS_R = crate::BitReader<bool>;
67#[doc = "Field `CCDIS` writer - Chill Cycle Disable"]
68pub type CCDIS_W<'a, const O: u8> = crate::BitWriter<'a, u16, DFLLCTRL_SPEC, bool, O>;
69#[doc = "Field `QLDIS` reader - Quick Lock Disable"]
70pub type QLDIS_R = crate::BitReader<bool>;
71#[doc = "Field `QLDIS` writer - Quick Lock Disable"]
72pub type QLDIS_W<'a, const O: u8> = crate::BitWriter<'a, u16, DFLLCTRL_SPEC, bool, O>;
73#[doc = "Field `BPLCKC` reader - Bypass Coarse Lock"]
74pub type BPLCKC_R = crate::BitReader<bool>;
75#[doc = "Field `BPLCKC` writer - Bypass Coarse Lock"]
76pub type BPLCKC_W<'a, const O: u8> = crate::BitWriter<'a, u16, DFLLCTRL_SPEC, bool, O>;
77#[doc = "Field `WAITLOCK` reader - Wait Lock"]
78pub type WAITLOCK_R = crate::BitReader<bool>;
79#[doc = "Field `WAITLOCK` writer - Wait Lock"]
80pub type WAITLOCK_W<'a, const O: u8> = crate::BitWriter<'a, u16, DFLLCTRL_SPEC, bool, O>;
81impl R {
82    #[doc = "Bit 1 - DFLL Enable"]
83    #[inline(always)]
84    pub fn enable(&self) -> ENABLE_R {
85        ENABLE_R::new(((self.bits >> 1) & 1) != 0)
86    }
87    #[doc = "Bit 2 - Operating Mode Selection"]
88    #[inline(always)]
89    pub fn mode(&self) -> MODE_R {
90        MODE_R::new(((self.bits >> 2) & 1) != 0)
91    }
92    #[doc = "Bit 3 - Stable DFLL Frequency"]
93    #[inline(always)]
94    pub fn stable(&self) -> STABLE_R {
95        STABLE_R::new(((self.bits >> 3) & 1) != 0)
96    }
97    #[doc = "Bit 4 - Lose Lock After Wake"]
98    #[inline(always)]
99    pub fn llaw(&self) -> LLAW_R {
100        LLAW_R::new(((self.bits >> 4) & 1) != 0)
101    }
102    #[doc = "Bit 5 - USB Clock Recovery Mode"]
103    #[inline(always)]
104    pub fn usbcrm(&self) -> USBCRM_R {
105        USBCRM_R::new(((self.bits >> 5) & 1) != 0)
106    }
107    #[doc = "Bit 6 - Run in Standby"]
108    #[inline(always)]
109    pub fn runstdby(&self) -> RUNSTDBY_R {
110        RUNSTDBY_R::new(((self.bits >> 6) & 1) != 0)
111    }
112    #[doc = "Bit 7 - On Demand Control"]
113    #[inline(always)]
114    pub fn ondemand(&self) -> ONDEMAND_R {
115        ONDEMAND_R::new(((self.bits >> 7) & 1) != 0)
116    }
117    #[doc = "Bit 8 - Chill Cycle Disable"]
118    #[inline(always)]
119    pub fn ccdis(&self) -> CCDIS_R {
120        CCDIS_R::new(((self.bits >> 8) & 1) != 0)
121    }
122    #[doc = "Bit 9 - Quick Lock Disable"]
123    #[inline(always)]
124    pub fn qldis(&self) -> QLDIS_R {
125        QLDIS_R::new(((self.bits >> 9) & 1) != 0)
126    }
127    #[doc = "Bit 10 - Bypass Coarse Lock"]
128    #[inline(always)]
129    pub fn bplckc(&self) -> BPLCKC_R {
130        BPLCKC_R::new(((self.bits >> 10) & 1) != 0)
131    }
132    #[doc = "Bit 11 - Wait Lock"]
133    #[inline(always)]
134    pub fn waitlock(&self) -> WAITLOCK_R {
135        WAITLOCK_R::new(((self.bits >> 11) & 1) != 0)
136    }
137}
138impl W {
139    #[doc = "Bit 1 - DFLL Enable"]
140    #[inline(always)]
141    #[must_use]
142    pub fn enable(&mut self) -> ENABLE_W<1> {
143        ENABLE_W::new(self)
144    }
145    #[doc = "Bit 2 - Operating Mode Selection"]
146    #[inline(always)]
147    #[must_use]
148    pub fn mode(&mut self) -> MODE_W<2> {
149        MODE_W::new(self)
150    }
151    #[doc = "Bit 3 - Stable DFLL Frequency"]
152    #[inline(always)]
153    #[must_use]
154    pub fn stable(&mut self) -> STABLE_W<3> {
155        STABLE_W::new(self)
156    }
157    #[doc = "Bit 4 - Lose Lock After Wake"]
158    #[inline(always)]
159    #[must_use]
160    pub fn llaw(&mut self) -> LLAW_W<4> {
161        LLAW_W::new(self)
162    }
163    #[doc = "Bit 5 - USB Clock Recovery Mode"]
164    #[inline(always)]
165    #[must_use]
166    pub fn usbcrm(&mut self) -> USBCRM_W<5> {
167        USBCRM_W::new(self)
168    }
169    #[doc = "Bit 6 - Run in Standby"]
170    #[inline(always)]
171    #[must_use]
172    pub fn runstdby(&mut self) -> RUNSTDBY_W<6> {
173        RUNSTDBY_W::new(self)
174    }
175    #[doc = "Bit 7 - On Demand Control"]
176    #[inline(always)]
177    #[must_use]
178    pub fn ondemand(&mut self) -> ONDEMAND_W<7> {
179        ONDEMAND_W::new(self)
180    }
181    #[doc = "Bit 8 - Chill Cycle Disable"]
182    #[inline(always)]
183    #[must_use]
184    pub fn ccdis(&mut self) -> CCDIS_W<8> {
185        CCDIS_W::new(self)
186    }
187    #[doc = "Bit 9 - Quick Lock Disable"]
188    #[inline(always)]
189    #[must_use]
190    pub fn qldis(&mut self) -> QLDIS_W<9> {
191        QLDIS_W::new(self)
192    }
193    #[doc = "Bit 10 - Bypass Coarse Lock"]
194    #[inline(always)]
195    #[must_use]
196    pub fn bplckc(&mut self) -> BPLCKC_W<10> {
197        BPLCKC_W::new(self)
198    }
199    #[doc = "Bit 11 - Wait Lock"]
200    #[inline(always)]
201    #[must_use]
202    pub fn waitlock(&mut self) -> WAITLOCK_W<11> {
203        WAITLOCK_W::new(self)
204    }
205    #[doc = "Writes raw bits to the register."]
206    #[inline(always)]
207    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
208        self.0.bits(bits);
209        self
210    }
211}
212#[doc = "DFLL48M Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dfllctrl](index.html) module"]
213pub struct DFLLCTRL_SPEC;
214impl crate::RegisterSpec for DFLLCTRL_SPEC {
215    type Ux = u16;
216}
217#[doc = "`read()` method returns [dfllctrl::R](R) reader structure"]
218impl crate::Readable for DFLLCTRL_SPEC {
219    type Reader = R;
220}
221#[doc = "`write(|w| ..)` method takes [dfllctrl::W](W) writer structure"]
222impl crate::Writable for DFLLCTRL_SPEC {
223    type Writer = W;
224    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
225    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
226}
227#[doc = "`reset()` method sets DFLLCTRL to value 0x80"]
228impl crate::Resettable for DFLLCTRL_SPEC {
229    const RESET_VALUE: Self::Ux = 0x80;
230}