max32660_pac/sir/
fstat.rs1#[doc = "Register `FSTAT` reader"]
2pub struct R(crate::R<FSTAT_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<FSTAT_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<FSTAT_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<FSTAT_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "FPU Function.\n\nValue on reset: 0"]
17#[derive(Clone, Copy, Debug, PartialEq)]
18pub enum FPU_A {
19 #[doc = "0: `0`"]
20 NO = 0,
21 #[doc = "1: `1`"]
22 YES = 1,
23}
24impl From<FPU_A> for bool {
25 #[inline(always)]
26 fn from(variant: FPU_A) -> Self {
27 variant as u8 != 0
28 }
29}
30#[doc = "Field `FPU` reader - FPU Function."]
31pub struct FPU_R(crate::FieldReader<bool, FPU_A>);
32impl FPU_R {
33 #[inline(always)]
34 pub(crate) fn new(bits: bool) -> Self {
35 FPU_R(crate::FieldReader::new(bits))
36 }
37 #[doc = r"Get enumerated values variant"]
38 #[inline(always)]
39 pub fn variant(&self) -> FPU_A {
40 match self.bits {
41 false => FPU_A::NO,
42 true => FPU_A::YES,
43 }
44 }
45 #[doc = "Checks if the value of the field is `NO`"]
46 #[inline(always)]
47 pub fn is_no(&self) -> bool {
48 **self == FPU_A::NO
49 }
50 #[doc = "Checks if the value of the field is `YES`"]
51 #[inline(always)]
52 pub fn is_yes(&self) -> bool {
53 **self == FPU_A::YES
54 }
55}
56impl core::ops::Deref for FPU_R {
57 type Target = crate::FieldReader<bool, FPU_A>;
58 #[inline(always)]
59 fn deref(&self) -> &Self::Target {
60 &self.0
61 }
62}
63#[doc = "USB Device.\n\nValue on reset: 0"]
64#[derive(Clone, Copy, Debug, PartialEq)]
65pub enum USB_A {
66 #[doc = "0: `0`"]
67 NO = 0,
68 #[doc = "1: `1`"]
69 YES = 1,
70}
71impl From<USB_A> for bool {
72 #[inline(always)]
73 fn from(variant: USB_A) -> Self {
74 variant as u8 != 0
75 }
76}
77#[doc = "Field `USB` reader - USB Device."]
78pub struct USB_R(crate::FieldReader<bool, USB_A>);
79impl USB_R {
80 #[inline(always)]
81 pub(crate) fn new(bits: bool) -> Self {
82 USB_R(crate::FieldReader::new(bits))
83 }
84 #[doc = r"Get enumerated values variant"]
85 #[inline(always)]
86 pub fn variant(&self) -> USB_A {
87 match self.bits {
88 false => USB_A::NO,
89 true => USB_A::YES,
90 }
91 }
92 #[doc = "Checks if the value of the field is `NO`"]
93 #[inline(always)]
94 pub fn is_no(&self) -> bool {
95 **self == USB_A::NO
96 }
97 #[doc = "Checks if the value of the field is `YES`"]
98 #[inline(always)]
99 pub fn is_yes(&self) -> bool {
100 **self == USB_A::YES
101 }
102}
103impl core::ops::Deref for USB_R {
104 type Target = crate::FieldReader<bool, USB_A>;
105 #[inline(always)]
106 fn deref(&self) -> &Self::Target {
107 &self.0
108 }
109}
110#[doc = "10-bit Sigma Delta ADC.\n\nValue on reset: 0"]
111#[derive(Clone, Copy, Debug, PartialEq)]
112pub enum ADC_A {
113 #[doc = "0: `0`"]
114 NO = 0,
115 #[doc = "1: `1`"]
116 YES = 1,
117}
118impl From<ADC_A> for bool {
119 #[inline(always)]
120 fn from(variant: ADC_A) -> Self {
121 variant as u8 != 0
122 }
123}
124#[doc = "Field `ADC` reader - 10-bit Sigma Delta ADC."]
125pub struct ADC_R(crate::FieldReader<bool, ADC_A>);
126impl ADC_R {
127 #[inline(always)]
128 pub(crate) fn new(bits: bool) -> Self {
129 ADC_R(crate::FieldReader::new(bits))
130 }
131 #[doc = r"Get enumerated values variant"]
132 #[inline(always)]
133 pub fn variant(&self) -> ADC_A {
134 match self.bits {
135 false => ADC_A::NO,
136 true => ADC_A::YES,
137 }
138 }
139 #[doc = "Checks if the value of the field is `NO`"]
140 #[inline(always)]
141 pub fn is_no(&self) -> bool {
142 **self == ADC_A::NO
143 }
144 #[doc = "Checks if the value of the field is `YES`"]
145 #[inline(always)]
146 pub fn is_yes(&self) -> bool {
147 **self == ADC_A::YES
148 }
149}
150impl core::ops::Deref for ADC_R {
151 type Target = crate::FieldReader<bool, ADC_A>;
152 #[inline(always)]
153 fn deref(&self) -> &Self::Target {
154 &self.0
155 }
156}
157#[doc = "XiP function.\n\nValue on reset: 0"]
158#[derive(Clone, Copy, Debug, PartialEq)]
159pub enum XIP_A {
160 #[doc = "0: `0`"]
161 NO = 0,
162 #[doc = "1: `1`"]
163 YES = 1,
164}
165impl From<XIP_A> for bool {
166 #[inline(always)]
167 fn from(variant: XIP_A) -> Self {
168 variant as u8 != 0
169 }
170}
171#[doc = "Field `XIP` reader - XiP function."]
172pub struct XIP_R(crate::FieldReader<bool, XIP_A>);
173impl XIP_R {
174 #[inline(always)]
175 pub(crate) fn new(bits: bool) -> Self {
176 XIP_R(crate::FieldReader::new(bits))
177 }
178 #[doc = r"Get enumerated values variant"]
179 #[inline(always)]
180 pub fn variant(&self) -> XIP_A {
181 match self.bits {
182 false => XIP_A::NO,
183 true => XIP_A::YES,
184 }
185 }
186 #[doc = "Checks if the value of the field is `NO`"]
187 #[inline(always)]
188 pub fn is_no(&self) -> bool {
189 **self == XIP_A::NO
190 }
191 #[doc = "Checks if the value of the field is `YES`"]
192 #[inline(always)]
193 pub fn is_yes(&self) -> bool {
194 **self == XIP_A::YES
195 }
196}
197impl core::ops::Deref for XIP_R {
198 type Target = crate::FieldReader<bool, XIP_A>;
199 #[inline(always)]
200 fn deref(&self) -> &Self::Target {
201 &self.0
202 }
203}
204#[doc = "PBM function.\n\nValue on reset: 0"]
205#[derive(Clone, Copy, Debug, PartialEq)]
206pub enum PBM_A {
207 #[doc = "0: `0`"]
208 NO = 0,
209 #[doc = "1: `1`"]
210 YES = 1,
211}
212impl From<PBM_A> for bool {
213 #[inline(always)]
214 fn from(variant: PBM_A) -> Self {
215 variant as u8 != 0
216 }
217}
218#[doc = "Field `PBM` reader - PBM function."]
219pub struct PBM_R(crate::FieldReader<bool, PBM_A>);
220impl PBM_R {
221 #[inline(always)]
222 pub(crate) fn new(bits: bool) -> Self {
223 PBM_R(crate::FieldReader::new(bits))
224 }
225 #[doc = r"Get enumerated values variant"]
226 #[inline(always)]
227 pub fn variant(&self) -> PBM_A {
228 match self.bits {
229 false => PBM_A::NO,
230 true => PBM_A::YES,
231 }
232 }
233 #[doc = "Checks if the value of the field is `NO`"]
234 #[inline(always)]
235 pub fn is_no(&self) -> bool {
236 **self == PBM_A::NO
237 }
238 #[doc = "Checks if the value of the field is `YES`"]
239 #[inline(always)]
240 pub fn is_yes(&self) -> bool {
241 **self == PBM_A::YES
242 }
243}
244impl core::ops::Deref for PBM_R {
245 type Target = crate::FieldReader<bool, PBM_A>;
246 #[inline(always)]
247 fn deref(&self) -> &Self::Target {
248 &self.0
249 }
250}
251#[doc = "HBC function.\n\nValue on reset: 0"]
252#[derive(Clone, Copy, Debug, PartialEq)]
253pub enum HBC_A {
254 #[doc = "0: `0`"]
255 NO = 0,
256 #[doc = "1: `1`"]
257 YES = 1,
258}
259impl From<HBC_A> for bool {
260 #[inline(always)]
261 fn from(variant: HBC_A) -> Self {
262 variant as u8 != 0
263 }
264}
265#[doc = "Field `HBC` reader - HBC function."]
266pub struct HBC_R(crate::FieldReader<bool, HBC_A>);
267impl HBC_R {
268 #[inline(always)]
269 pub(crate) fn new(bits: bool) -> Self {
270 HBC_R(crate::FieldReader::new(bits))
271 }
272 #[doc = r"Get enumerated values variant"]
273 #[inline(always)]
274 pub fn variant(&self) -> HBC_A {
275 match self.bits {
276 false => HBC_A::NO,
277 true => HBC_A::YES,
278 }
279 }
280 #[doc = "Checks if the value of the field is `NO`"]
281 #[inline(always)]
282 pub fn is_no(&self) -> bool {
283 **self == HBC_A::NO
284 }
285 #[doc = "Checks if the value of the field is `YES`"]
286 #[inline(always)]
287 pub fn is_yes(&self) -> bool {
288 **self == HBC_A::YES
289 }
290}
291impl core::ops::Deref for HBC_R {
292 type Target = crate::FieldReader<bool, HBC_A>;
293 #[inline(always)]
294 fn deref(&self) -> &Self::Target {
295 &self.0
296 }
297}
298#[doc = "SDHC function.\n\nValue on reset: 0"]
299#[derive(Clone, Copy, Debug, PartialEq)]
300pub enum SDHC_A {
301 #[doc = "0: `0`"]
302 NO = 0,
303 #[doc = "1: `1`"]
304 YES = 1,
305}
306impl From<SDHC_A> for bool {
307 #[inline(always)]
308 fn from(variant: SDHC_A) -> Self {
309 variant as u8 != 0
310 }
311}
312#[doc = "Field `SDHC` reader - SDHC function."]
313pub struct SDHC_R(crate::FieldReader<bool, SDHC_A>);
314impl SDHC_R {
315 #[inline(always)]
316 pub(crate) fn new(bits: bool) -> Self {
317 SDHC_R(crate::FieldReader::new(bits))
318 }
319 #[doc = r"Get enumerated values variant"]
320 #[inline(always)]
321 pub fn variant(&self) -> SDHC_A {
322 match self.bits {
323 false => SDHC_A::NO,
324 true => SDHC_A::YES,
325 }
326 }
327 #[doc = "Checks if the value of the field is `NO`"]
328 #[inline(always)]
329 pub fn is_no(&self) -> bool {
330 **self == SDHC_A::NO
331 }
332 #[doc = "Checks if the value of the field is `YES`"]
333 #[inline(always)]
334 pub fn is_yes(&self) -> bool {
335 **self == SDHC_A::YES
336 }
337}
338impl core::ops::Deref for SDHC_R {
339 type Target = crate::FieldReader<bool, SDHC_A>;
340 #[inline(always)]
341 fn deref(&self) -> &Self::Target {
342 &self.0
343 }
344}
345#[doc = "SMPHR function.\n\nValue on reset: 0"]
346#[derive(Clone, Copy, Debug, PartialEq)]
347pub enum SMPHR_A {
348 #[doc = "0: `0`"]
349 NO = 0,
350 #[doc = "1: `1`"]
351 YES = 1,
352}
353impl From<SMPHR_A> for bool {
354 #[inline(always)]
355 fn from(variant: SMPHR_A) -> Self {
356 variant as u8 != 0
357 }
358}
359#[doc = "Field `SMPHR` reader - SMPHR function."]
360pub struct SMPHR_R(crate::FieldReader<bool, SMPHR_A>);
361impl SMPHR_R {
362 #[inline(always)]
363 pub(crate) fn new(bits: bool) -> Self {
364 SMPHR_R(crate::FieldReader::new(bits))
365 }
366 #[doc = r"Get enumerated values variant"]
367 #[inline(always)]
368 pub fn variant(&self) -> SMPHR_A {
369 match self.bits {
370 false => SMPHR_A::NO,
371 true => SMPHR_A::YES,
372 }
373 }
374 #[doc = "Checks if the value of the field is `NO`"]
375 #[inline(always)]
376 pub fn is_no(&self) -> bool {
377 **self == SMPHR_A::NO
378 }
379 #[doc = "Checks if the value of the field is `YES`"]
380 #[inline(always)]
381 pub fn is_yes(&self) -> bool {
382 **self == SMPHR_A::YES
383 }
384}
385impl core::ops::Deref for SMPHR_R {
386 type Target = crate::FieldReader<bool, SMPHR_A>;
387 #[inline(always)]
388 fn deref(&self) -> &Self::Target {
389 &self.0
390 }
391}
392#[doc = "System Cache function.\n\nValue on reset: 0"]
393#[derive(Clone, Copy, Debug, PartialEq)]
394pub enum SCACHE_A {
395 #[doc = "0: `0`"]
396 NO = 0,
397 #[doc = "1: `1`"]
398 YES = 1,
399}
400impl From<SCACHE_A> for bool {
401 #[inline(always)]
402 fn from(variant: SCACHE_A) -> Self {
403 variant as u8 != 0
404 }
405}
406#[doc = "Field `SCACHE` reader - System Cache function."]
407pub struct SCACHE_R(crate::FieldReader<bool, SCACHE_A>);
408impl SCACHE_R {
409 #[inline(always)]
410 pub(crate) fn new(bits: bool) -> Self {
411 SCACHE_R(crate::FieldReader::new(bits))
412 }
413 #[doc = r"Get enumerated values variant"]
414 #[inline(always)]
415 pub fn variant(&self) -> SCACHE_A {
416 match self.bits {
417 false => SCACHE_A::NO,
418 true => SCACHE_A::YES,
419 }
420 }
421 #[doc = "Checks if the value of the field is `NO`"]
422 #[inline(always)]
423 pub fn is_no(&self) -> bool {
424 **self == SCACHE_A::NO
425 }
426 #[doc = "Checks if the value of the field is `YES`"]
427 #[inline(always)]
428 pub fn is_yes(&self) -> bool {
429 **self == SCACHE_A::YES
430 }
431}
432impl core::ops::Deref for SCACHE_R {
433 type Target = crate::FieldReader<bool, SCACHE_A>;
434 #[inline(always)]
435 fn deref(&self) -> &Self::Target {
436 &self.0
437 }
438}
439impl R {
440 #[doc = "Bit 0 - FPU Function."]
441 #[inline(always)]
442 pub fn fpu(&self) -> FPU_R {
443 FPU_R::new((self.bits & 0x01) != 0)
444 }
445 #[doc = "Bit 1 - USB Device."]
446 #[inline(always)]
447 pub fn usb(&self) -> USB_R {
448 USB_R::new(((self.bits >> 1) & 0x01) != 0)
449 }
450 #[doc = "Bit 2 - 10-bit Sigma Delta ADC."]
451 #[inline(always)]
452 pub fn adc(&self) -> ADC_R {
453 ADC_R::new(((self.bits >> 2) & 0x01) != 0)
454 }
455 #[doc = "Bit 3 - XiP function."]
456 #[inline(always)]
457 pub fn xip(&self) -> XIP_R {
458 XIP_R::new(((self.bits >> 3) & 0x01) != 0)
459 }
460 #[doc = "Bit 4 - PBM function."]
461 #[inline(always)]
462 pub fn pbm(&self) -> PBM_R {
463 PBM_R::new(((self.bits >> 4) & 0x01) != 0)
464 }
465 #[doc = "Bit 5 - HBC function."]
466 #[inline(always)]
467 pub fn hbc(&self) -> HBC_R {
468 HBC_R::new(((self.bits >> 5) & 0x01) != 0)
469 }
470 #[doc = "Bit 6 - SDHC function."]
471 #[inline(always)]
472 pub fn sdhc(&self) -> SDHC_R {
473 SDHC_R::new(((self.bits >> 6) & 0x01) != 0)
474 }
475 #[doc = "Bit 7 - SMPHR function."]
476 #[inline(always)]
477 pub fn smphr(&self) -> SMPHR_R {
478 SMPHR_R::new(((self.bits >> 7) & 0x01) != 0)
479 }
480 #[doc = "Bit 8 - System Cache function."]
481 #[inline(always)]
482 pub fn scache(&self) -> SCACHE_R {
483 SCACHE_R::new(((self.bits >> 8) & 0x01) != 0)
484 }
485}
486#[doc = "funcstat 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 [fstat](index.html) module"]
487pub struct FSTAT_SPEC;
488impl crate::RegisterSpec for FSTAT_SPEC {
489 type Ux = u32;
490}
491#[doc = "`read()` method returns [fstat::R](R) reader structure"]
492impl crate::Readable for FSTAT_SPEC {
493 type Reader = R;
494}
495#[doc = "`reset()` method sets FSTAT to value 0"]
496impl crate::Resettable for FSTAT_SPEC {
497 #[inline(always)]
498 fn reset_value() -> Self::Ux {
499 0
500 }
501}