atsams70n21/pmc/
pmc_imr.rs1#[doc = "Register `PMC_IMR` reader"]
2pub struct R(crate::R<PMC_IMR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PMC_IMR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PMC_IMR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PMC_IMR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `MOSCXTS` reader - Main Crystal Oscillator Status Interrupt Mask"]
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 Interrupt Mask"]
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 Ready Interrupt Mask"]
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 Interrupt Mask"]
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 `PCKRDY0` reader - Programmable Clock Ready 0 Interrupt Mask"]
77pub struct PCKRDY0_R(crate::FieldReader<bool, bool>);
78impl PCKRDY0_R {
79 #[inline(always)]
80 pub(crate) fn new(bits: bool) -> Self {
81 PCKRDY0_R(crate::FieldReader::new(bits))
82 }
83}
84impl core::ops::Deref for PCKRDY0_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 `PCKRDY1` reader - Programmable Clock Ready 1 Interrupt Mask"]
92pub struct PCKRDY1_R(crate::FieldReader<bool, bool>);
93impl PCKRDY1_R {
94 #[inline(always)]
95 pub(crate) fn new(bits: bool) -> Self {
96 PCKRDY1_R(crate::FieldReader::new(bits))
97 }
98}
99impl core::ops::Deref for PCKRDY1_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 `PCKRDY2` reader - Programmable Clock Ready 2 Interrupt Mask"]
107pub struct PCKRDY2_R(crate::FieldReader<bool, bool>);
108impl PCKRDY2_R {
109 #[inline(always)]
110 pub(crate) fn new(bits: bool) -> Self {
111 PCKRDY2_R(crate::FieldReader::new(bits))
112 }
113}
114impl core::ops::Deref for PCKRDY2_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 `PCKRDY3` reader - Programmable Clock Ready 3 Interrupt Mask"]
122pub struct PCKRDY3_R(crate::FieldReader<bool, bool>);
123impl PCKRDY3_R {
124 #[inline(always)]
125 pub(crate) fn new(bits: bool) -> Self {
126 PCKRDY3_R(crate::FieldReader::new(bits))
127 }
128}
129impl core::ops::Deref for PCKRDY3_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 `PCKRDY4` reader - Programmable Clock Ready 4 Interrupt Mask"]
137pub struct PCKRDY4_R(crate::FieldReader<bool, bool>);
138impl PCKRDY4_R {
139 #[inline(always)]
140 pub(crate) fn new(bits: bool) -> Self {
141 PCKRDY4_R(crate::FieldReader::new(bits))
142 }
143}
144impl core::ops::Deref for PCKRDY4_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 `PCKRDY5` reader - Programmable Clock Ready 5 Interrupt Mask"]
152pub struct PCKRDY5_R(crate::FieldReader<bool, bool>);
153impl PCKRDY5_R {
154 #[inline(always)]
155 pub(crate) fn new(bits: bool) -> Self {
156 PCKRDY5_R(crate::FieldReader::new(bits))
157 }
158}
159impl core::ops::Deref for PCKRDY5_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 `PCKRDY6` reader - Programmable Clock Ready 6 Interrupt Mask"]
167pub struct PCKRDY6_R(crate::FieldReader<bool, bool>);
168impl PCKRDY6_R {
169 #[inline(always)]
170 pub(crate) fn new(bits: bool) -> Self {
171 PCKRDY6_R(crate::FieldReader::new(bits))
172 }
173}
174impl core::ops::Deref for PCKRDY6_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 `MOSCSELS` reader - Main Clock Source Oscillator Selection Status Interrupt Mask"]
182pub struct MOSCSELS_R(crate::FieldReader<bool, bool>);
183impl MOSCSELS_R {
184 #[inline(always)]
185 pub(crate) fn new(bits: bool) -> Self {
186 MOSCSELS_R(crate::FieldReader::new(bits))
187 }
188}
189impl core::ops::Deref for MOSCSELS_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 `MOSCRCS` reader - Main RC Status Interrupt Mask"]
197pub struct MOSCRCS_R(crate::FieldReader<bool, bool>);
198impl MOSCRCS_R {
199 #[inline(always)]
200 pub(crate) fn new(bits: bool) -> Self {
201 MOSCRCS_R(crate::FieldReader::new(bits))
202 }
203}
204impl core::ops::Deref for MOSCRCS_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 `CFDEV` reader - Clock Failure Detector Event Interrupt Mask"]
212pub struct CFDEV_R(crate::FieldReader<bool, bool>);
213impl CFDEV_R {
214 #[inline(always)]
215 pub(crate) fn new(bits: bool) -> Self {
216 CFDEV_R(crate::FieldReader::new(bits))
217 }
218}
219impl core::ops::Deref for CFDEV_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 `XT32KERR` reader - 32.768 kHz Crystal Oscillator Error Interrupt Mask"]
227pub struct XT32KERR_R(crate::FieldReader<bool, bool>);
228impl XT32KERR_R {
229 #[inline(always)]
230 pub(crate) fn new(bits: bool) -> Self {
231 XT32KERR_R(crate::FieldReader::new(bits))
232 }
233}
234impl core::ops::Deref for XT32KERR_R {
235 type Target = crate::FieldReader<bool, bool>;
236 #[inline(always)]
237 fn deref(&self) -> &Self::Target {
238 &self.0
239 }
240}
241impl R {
242 #[doc = "Bit 0 - Main Crystal Oscillator Status Interrupt Mask"]
243 #[inline(always)]
244 pub fn moscxts(&self) -> MOSCXTS_R {
245 MOSCXTS_R::new((self.bits & 0x01) != 0)
246 }
247 #[doc = "Bit 1 - PLLA Lock Interrupt Mask"]
248 #[inline(always)]
249 pub fn locka(&self) -> LOCKA_R {
250 LOCKA_R::new(((self.bits >> 1) & 0x01) != 0)
251 }
252 #[doc = "Bit 3 - Master Clock Ready Interrupt Mask"]
253 #[inline(always)]
254 pub fn mckrdy(&self) -> MCKRDY_R {
255 MCKRDY_R::new(((self.bits >> 3) & 0x01) != 0)
256 }
257 #[doc = "Bit 6 - UTMI PLL Lock Interrupt Mask"]
258 #[inline(always)]
259 pub fn locku(&self) -> LOCKU_R {
260 LOCKU_R::new(((self.bits >> 6) & 0x01) != 0)
261 }
262 #[doc = "Bit 8 - Programmable Clock Ready 0 Interrupt Mask"]
263 #[inline(always)]
264 pub fn pckrdy0(&self) -> PCKRDY0_R {
265 PCKRDY0_R::new(((self.bits >> 8) & 0x01) != 0)
266 }
267 #[doc = "Bit 9 - Programmable Clock Ready 1 Interrupt Mask"]
268 #[inline(always)]
269 pub fn pckrdy1(&self) -> PCKRDY1_R {
270 PCKRDY1_R::new(((self.bits >> 9) & 0x01) != 0)
271 }
272 #[doc = "Bit 10 - Programmable Clock Ready 2 Interrupt Mask"]
273 #[inline(always)]
274 pub fn pckrdy2(&self) -> PCKRDY2_R {
275 PCKRDY2_R::new(((self.bits >> 10) & 0x01) != 0)
276 }
277 #[doc = "Bit 11 - Programmable Clock Ready 3 Interrupt Mask"]
278 #[inline(always)]
279 pub fn pckrdy3(&self) -> PCKRDY3_R {
280 PCKRDY3_R::new(((self.bits >> 11) & 0x01) != 0)
281 }
282 #[doc = "Bit 12 - Programmable Clock Ready 4 Interrupt Mask"]
283 #[inline(always)]
284 pub fn pckrdy4(&self) -> PCKRDY4_R {
285 PCKRDY4_R::new(((self.bits >> 12) & 0x01) != 0)
286 }
287 #[doc = "Bit 13 - Programmable Clock Ready 5 Interrupt Mask"]
288 #[inline(always)]
289 pub fn pckrdy5(&self) -> PCKRDY5_R {
290 PCKRDY5_R::new(((self.bits >> 13) & 0x01) != 0)
291 }
292 #[doc = "Bit 14 - Programmable Clock Ready 6 Interrupt Mask"]
293 #[inline(always)]
294 pub fn pckrdy6(&self) -> PCKRDY6_R {
295 PCKRDY6_R::new(((self.bits >> 14) & 0x01) != 0)
296 }
297 #[doc = "Bit 16 - Main Clock Source Oscillator Selection Status Interrupt Mask"]
298 #[inline(always)]
299 pub fn moscsels(&self) -> MOSCSELS_R {
300 MOSCSELS_R::new(((self.bits >> 16) & 0x01) != 0)
301 }
302 #[doc = "Bit 17 - Main RC Status Interrupt Mask"]
303 #[inline(always)]
304 pub fn moscrcs(&self) -> MOSCRCS_R {
305 MOSCRCS_R::new(((self.bits >> 17) & 0x01) != 0)
306 }
307 #[doc = "Bit 18 - Clock Failure Detector Event Interrupt Mask"]
308 #[inline(always)]
309 pub fn cfdev(&self) -> CFDEV_R {
310 CFDEV_R::new(((self.bits >> 18) & 0x01) != 0)
311 }
312 #[doc = "Bit 21 - 32.768 kHz Crystal Oscillator Error Interrupt Mask"]
313 #[inline(always)]
314 pub fn xt32kerr(&self) -> XT32KERR_R {
315 XT32KERR_R::new(((self.bits >> 21) & 0x01) != 0)
316 }
317}
318#[doc = "Interrupt Mask 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_imr](index.html) module"]
319pub struct PMC_IMR_SPEC;
320impl crate::RegisterSpec for PMC_IMR_SPEC {
321 type Ux = u32;
322}
323#[doc = "`read()` method returns [pmc_imr::R](R) reader structure"]
324impl crate::Readable for PMC_IMR_SPEC {
325 type Reader = R;
326}
327#[doc = "`reset()` method sets PMC_IMR to value 0"]
328impl crate::Resettable for PMC_IMR_SPEC {
329 #[inline(always)]
330 fn reset_value() -> Self::Ux {
331 0
332 }
333}