atsame70q21/pmc/
pmc_sr.rs

1#[doc = "Register `PMC_SR` reader"]
2pub struct R(crate::R<PMC_SR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PMC_SR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PMC_SR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PMC_SR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `MOSCXTS` reader - Main Crystal Oscillator Status"]
17pub struct MOSCXTS_R(crate::FieldReader<bool, bool>);
18impl MOSCXTS_R {
19    #[inline(always)]
20    pub(crate) fn new(bits: bool) -> Self {
21        MOSCXTS_R(crate::FieldReader::new(bits))
22    }
23}
24impl core::ops::Deref for MOSCXTS_R {
25    type Target = crate::FieldReader<bool, bool>;
26    #[inline(always)]
27    fn deref(&self) -> &Self::Target {
28        &self.0
29    }
30}
31#[doc = "Field `LOCKA` reader - PLLA Lock Status"]
32pub struct LOCKA_R(crate::FieldReader<bool, bool>);
33impl LOCKA_R {
34    #[inline(always)]
35    pub(crate) fn new(bits: bool) -> Self {
36        LOCKA_R(crate::FieldReader::new(bits))
37    }
38}
39impl core::ops::Deref for LOCKA_R {
40    type Target = crate::FieldReader<bool, bool>;
41    #[inline(always)]
42    fn deref(&self) -> &Self::Target {
43        &self.0
44    }
45}
46#[doc = "Field `MCKRDY` reader - Master Clock Status"]
47pub struct MCKRDY_R(crate::FieldReader<bool, bool>);
48impl MCKRDY_R {
49    #[inline(always)]
50    pub(crate) fn new(bits: bool) -> Self {
51        MCKRDY_R(crate::FieldReader::new(bits))
52    }
53}
54impl core::ops::Deref for MCKRDY_R {
55    type Target = crate::FieldReader<bool, bool>;
56    #[inline(always)]
57    fn deref(&self) -> &Self::Target {
58        &self.0
59    }
60}
61#[doc = "Field `LOCKU` reader - UTMI PLL Lock Status"]
62pub struct LOCKU_R(crate::FieldReader<bool, bool>);
63impl LOCKU_R {
64    #[inline(always)]
65    pub(crate) fn new(bits: bool) -> Self {
66        LOCKU_R(crate::FieldReader::new(bits))
67    }
68}
69impl core::ops::Deref for LOCKU_R {
70    type Target = crate::FieldReader<bool, bool>;
71    #[inline(always)]
72    fn deref(&self) -> &Self::Target {
73        &self.0
74    }
75}
76#[doc = "Field `OSCSELS` reader - Slow Clock Source Oscillator Selection"]
77pub struct OSCSELS_R(crate::FieldReader<bool, bool>);
78impl OSCSELS_R {
79    #[inline(always)]
80    pub(crate) fn new(bits: bool) -> Self {
81        OSCSELS_R(crate::FieldReader::new(bits))
82    }
83}
84impl core::ops::Deref for OSCSELS_R {
85    type Target = crate::FieldReader<bool, bool>;
86    #[inline(always)]
87    fn deref(&self) -> &Self::Target {
88        &self.0
89    }
90}
91#[doc = "Field `PCKRDY0` reader - Programmable Clock Ready 0 Status"]
92pub struct PCKRDY0_R(crate::FieldReader<bool, bool>);
93impl PCKRDY0_R {
94    #[inline(always)]
95    pub(crate) fn new(bits: bool) -> Self {
96        PCKRDY0_R(crate::FieldReader::new(bits))
97    }
98}
99impl core::ops::Deref for PCKRDY0_R {
100    type Target = crate::FieldReader<bool, bool>;
101    #[inline(always)]
102    fn deref(&self) -> &Self::Target {
103        &self.0
104    }
105}
106#[doc = "Field `PCKRDY1` reader - Programmable Clock Ready 1 Status"]
107pub struct PCKRDY1_R(crate::FieldReader<bool, bool>);
108impl PCKRDY1_R {
109    #[inline(always)]
110    pub(crate) fn new(bits: bool) -> Self {
111        PCKRDY1_R(crate::FieldReader::new(bits))
112    }
113}
114impl core::ops::Deref for PCKRDY1_R {
115    type Target = crate::FieldReader<bool, bool>;
116    #[inline(always)]
117    fn deref(&self) -> &Self::Target {
118        &self.0
119    }
120}
121#[doc = "Field `PCKRDY2` reader - Programmable Clock Ready 2 Status"]
122pub struct PCKRDY2_R(crate::FieldReader<bool, bool>);
123impl PCKRDY2_R {
124    #[inline(always)]
125    pub(crate) fn new(bits: bool) -> Self {
126        PCKRDY2_R(crate::FieldReader::new(bits))
127    }
128}
129impl core::ops::Deref for PCKRDY2_R {
130    type Target = crate::FieldReader<bool, bool>;
131    #[inline(always)]
132    fn deref(&self) -> &Self::Target {
133        &self.0
134    }
135}
136#[doc = "Field `PCKRDY3` reader - Programmable Clock Ready 3 Status"]
137pub struct PCKRDY3_R(crate::FieldReader<bool, bool>);
138impl PCKRDY3_R {
139    #[inline(always)]
140    pub(crate) fn new(bits: bool) -> Self {
141        PCKRDY3_R(crate::FieldReader::new(bits))
142    }
143}
144impl core::ops::Deref for PCKRDY3_R {
145    type Target = crate::FieldReader<bool, bool>;
146    #[inline(always)]
147    fn deref(&self) -> &Self::Target {
148        &self.0
149    }
150}
151#[doc = "Field `PCKRDY4` reader - Programmable Clock Ready 4 Status"]
152pub struct PCKRDY4_R(crate::FieldReader<bool, bool>);
153impl PCKRDY4_R {
154    #[inline(always)]
155    pub(crate) fn new(bits: bool) -> Self {
156        PCKRDY4_R(crate::FieldReader::new(bits))
157    }
158}
159impl core::ops::Deref for PCKRDY4_R {
160    type Target = crate::FieldReader<bool, bool>;
161    #[inline(always)]
162    fn deref(&self) -> &Self::Target {
163        &self.0
164    }
165}
166#[doc = "Field `PCKRDY5` reader - Programmable Clock Ready 5 Status"]
167pub struct PCKRDY5_R(crate::FieldReader<bool, bool>);
168impl PCKRDY5_R {
169    #[inline(always)]
170    pub(crate) fn new(bits: bool) -> Self {
171        PCKRDY5_R(crate::FieldReader::new(bits))
172    }
173}
174impl core::ops::Deref for PCKRDY5_R {
175    type Target = crate::FieldReader<bool, bool>;
176    #[inline(always)]
177    fn deref(&self) -> &Self::Target {
178        &self.0
179    }
180}
181#[doc = "Field `PCKRDY6` reader - Programmable Clock Ready 6 Status"]
182pub struct PCKRDY6_R(crate::FieldReader<bool, bool>);
183impl PCKRDY6_R {
184    #[inline(always)]
185    pub(crate) fn new(bits: bool) -> Self {
186        PCKRDY6_R(crate::FieldReader::new(bits))
187    }
188}
189impl core::ops::Deref for PCKRDY6_R {
190    type Target = crate::FieldReader<bool, bool>;
191    #[inline(always)]
192    fn deref(&self) -> &Self::Target {
193        &self.0
194    }
195}
196#[doc = "Field `MOSCSELS` reader - Main Clock Source Oscillator Selection Status"]
197pub struct MOSCSELS_R(crate::FieldReader<bool, bool>);
198impl MOSCSELS_R {
199    #[inline(always)]
200    pub(crate) fn new(bits: bool) -> Self {
201        MOSCSELS_R(crate::FieldReader::new(bits))
202    }
203}
204impl core::ops::Deref for MOSCSELS_R {
205    type Target = crate::FieldReader<bool, bool>;
206    #[inline(always)]
207    fn deref(&self) -> &Self::Target {
208        &self.0
209    }
210}
211#[doc = "Field `MOSCRCS` reader - Main RC Oscillator Status"]
212pub struct MOSCRCS_R(crate::FieldReader<bool, bool>);
213impl MOSCRCS_R {
214    #[inline(always)]
215    pub(crate) fn new(bits: bool) -> Self {
216        MOSCRCS_R(crate::FieldReader::new(bits))
217    }
218}
219impl core::ops::Deref for MOSCRCS_R {
220    type Target = crate::FieldReader<bool, bool>;
221    #[inline(always)]
222    fn deref(&self) -> &Self::Target {
223        &self.0
224    }
225}
226#[doc = "Field `CFDEV` reader - Clock Failure Detector Event"]
227pub struct CFDEV_R(crate::FieldReader<bool, bool>);
228impl CFDEV_R {
229    #[inline(always)]
230    pub(crate) fn new(bits: bool) -> Self {
231        CFDEV_R(crate::FieldReader::new(bits))
232    }
233}
234impl core::ops::Deref for CFDEV_R {
235    type Target = crate::FieldReader<bool, bool>;
236    #[inline(always)]
237    fn deref(&self) -> &Self::Target {
238        &self.0
239    }
240}
241#[doc = "Field `CFDS` reader - Clock Failure Detector Status"]
242pub struct CFDS_R(crate::FieldReader<bool, bool>);
243impl CFDS_R {
244    #[inline(always)]
245    pub(crate) fn new(bits: bool) -> Self {
246        CFDS_R(crate::FieldReader::new(bits))
247    }
248}
249impl core::ops::Deref for CFDS_R {
250    type Target = crate::FieldReader<bool, bool>;
251    #[inline(always)]
252    fn deref(&self) -> &Self::Target {
253        &self.0
254    }
255}
256#[doc = "Field `FOS` reader - Clock Failure Detector Fault Output Status"]
257pub struct FOS_R(crate::FieldReader<bool, bool>);
258impl FOS_R {
259    #[inline(always)]
260    pub(crate) fn new(bits: bool) -> Self {
261        FOS_R(crate::FieldReader::new(bits))
262    }
263}
264impl core::ops::Deref for FOS_R {
265    type Target = crate::FieldReader<bool, bool>;
266    #[inline(always)]
267    fn deref(&self) -> &Self::Target {
268        &self.0
269    }
270}
271#[doc = "Field `XT32KERR` reader - Slow Crystal Oscillator Error"]
272pub struct XT32KERR_R(crate::FieldReader<bool, bool>);
273impl XT32KERR_R {
274    #[inline(always)]
275    pub(crate) fn new(bits: bool) -> Self {
276        XT32KERR_R(crate::FieldReader::new(bits))
277    }
278}
279impl core::ops::Deref for XT32KERR_R {
280    type Target = crate::FieldReader<bool, bool>;
281    #[inline(always)]
282    fn deref(&self) -> &Self::Target {
283        &self.0
284    }
285}
286impl R {
287    #[doc = "Bit 0 - Main Crystal Oscillator Status"]
288    #[inline(always)]
289    pub fn moscxts(&self) -> MOSCXTS_R {
290        MOSCXTS_R::new((self.bits & 0x01) != 0)
291    }
292    #[doc = "Bit 1 - PLLA Lock Status"]
293    #[inline(always)]
294    pub fn locka(&self) -> LOCKA_R {
295        LOCKA_R::new(((self.bits >> 1) & 0x01) != 0)
296    }
297    #[doc = "Bit 3 - Master Clock Status"]
298    #[inline(always)]
299    pub fn mckrdy(&self) -> MCKRDY_R {
300        MCKRDY_R::new(((self.bits >> 3) & 0x01) != 0)
301    }
302    #[doc = "Bit 6 - UTMI PLL Lock Status"]
303    #[inline(always)]
304    pub fn locku(&self) -> LOCKU_R {
305        LOCKU_R::new(((self.bits >> 6) & 0x01) != 0)
306    }
307    #[doc = "Bit 7 - Slow Clock Source Oscillator Selection"]
308    #[inline(always)]
309    pub fn oscsels(&self) -> OSCSELS_R {
310        OSCSELS_R::new(((self.bits >> 7) & 0x01) != 0)
311    }
312    #[doc = "Bit 8 - Programmable Clock Ready 0 Status"]
313    #[inline(always)]
314    pub fn pckrdy0(&self) -> PCKRDY0_R {
315        PCKRDY0_R::new(((self.bits >> 8) & 0x01) != 0)
316    }
317    #[doc = "Bit 9 - Programmable Clock Ready 1 Status"]
318    #[inline(always)]
319    pub fn pckrdy1(&self) -> PCKRDY1_R {
320        PCKRDY1_R::new(((self.bits >> 9) & 0x01) != 0)
321    }
322    #[doc = "Bit 10 - Programmable Clock Ready 2 Status"]
323    #[inline(always)]
324    pub fn pckrdy2(&self) -> PCKRDY2_R {
325        PCKRDY2_R::new(((self.bits >> 10) & 0x01) != 0)
326    }
327    #[doc = "Bit 11 - Programmable Clock Ready 3 Status"]
328    #[inline(always)]
329    pub fn pckrdy3(&self) -> PCKRDY3_R {
330        PCKRDY3_R::new(((self.bits >> 11) & 0x01) != 0)
331    }
332    #[doc = "Bit 12 - Programmable Clock Ready 4 Status"]
333    #[inline(always)]
334    pub fn pckrdy4(&self) -> PCKRDY4_R {
335        PCKRDY4_R::new(((self.bits >> 12) & 0x01) != 0)
336    }
337    #[doc = "Bit 13 - Programmable Clock Ready 5 Status"]
338    #[inline(always)]
339    pub fn pckrdy5(&self) -> PCKRDY5_R {
340        PCKRDY5_R::new(((self.bits >> 13) & 0x01) != 0)
341    }
342    #[doc = "Bit 14 - Programmable Clock Ready 6 Status"]
343    #[inline(always)]
344    pub fn pckrdy6(&self) -> PCKRDY6_R {
345        PCKRDY6_R::new(((self.bits >> 14) & 0x01) != 0)
346    }
347    #[doc = "Bit 16 - Main Clock Source Oscillator Selection Status"]
348    #[inline(always)]
349    pub fn moscsels(&self) -> MOSCSELS_R {
350        MOSCSELS_R::new(((self.bits >> 16) & 0x01) != 0)
351    }
352    #[doc = "Bit 17 - Main RC Oscillator Status"]
353    #[inline(always)]
354    pub fn moscrcs(&self) -> MOSCRCS_R {
355        MOSCRCS_R::new(((self.bits >> 17) & 0x01) != 0)
356    }
357    #[doc = "Bit 18 - Clock Failure Detector Event"]
358    #[inline(always)]
359    pub fn cfdev(&self) -> CFDEV_R {
360        CFDEV_R::new(((self.bits >> 18) & 0x01) != 0)
361    }
362    #[doc = "Bit 19 - Clock Failure Detector Status"]
363    #[inline(always)]
364    pub fn cfds(&self) -> CFDS_R {
365        CFDS_R::new(((self.bits >> 19) & 0x01) != 0)
366    }
367    #[doc = "Bit 20 - Clock Failure Detector Fault Output Status"]
368    #[inline(always)]
369    pub fn fos(&self) -> FOS_R {
370        FOS_R::new(((self.bits >> 20) & 0x01) != 0)
371    }
372    #[doc = "Bit 21 - Slow Crystal Oscillator Error"]
373    #[inline(always)]
374    pub fn xt32kerr(&self) -> XT32KERR_R {
375        XT32KERR_R::new(((self.bits >> 21) & 0x01) != 0)
376    }
377}
378#[doc = "Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pmc_sr](index.html) module"]
379pub struct PMC_SR_SPEC;
380impl crate::RegisterSpec for PMC_SR_SPEC {
381    type Ux = u32;
382}
383#[doc = "`read()` method returns [pmc_sr::R](R) reader structure"]
384impl crate::Readable for PMC_SR_SPEC {
385    type Reader = R;
386}
387#[doc = "`reset()` method sets PMC_SR to value 0"]
388impl crate::Resettable for PMC_SR_SPEC {
389    #[inline(always)]
390    fn reset_value() -> Self::Ux {
391        0
392    }
393}