efm32pg22_pac/efm32pg22c200/cmu_ns/
status.rs1#[doc = "Register `STATUS` reader"]
2pub struct R(crate::R<STATUS_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<STATUS_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<STATUS_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<STATUS_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `CALRDY` reader - Calibration Ready"]
17pub type CALRDY_R = crate::BitReader<bool>;
18#[doc = "Field `WDOGLOCK` reader - Configuration Lock Status for WDOG"]
19pub type WDOGLOCK_R = crate::BitReader<WDOGLOCK_A>;
20#[doc = "Configuration Lock Status for WDOG\n\nValue on reset: 0"]
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22pub enum WDOGLOCK_A {
23 #[doc = "0: WDOG configuration lock is unlocked"]
24 UNLOCKED = 0,
25 #[doc = "1: WDOG configuration lock is locked"]
26 LOCKED = 1,
27}
28impl From<WDOGLOCK_A> for bool {
29 #[inline(always)]
30 fn from(variant: WDOGLOCK_A) -> Self {
31 variant as u8 != 0
32 }
33}
34impl WDOGLOCK_R {
35 #[doc = "Get enumerated values variant"]
36 #[inline(always)]
37 pub fn variant(&self) -> WDOGLOCK_A {
38 match self.bits {
39 false => WDOGLOCK_A::UNLOCKED,
40 true => WDOGLOCK_A::LOCKED,
41 }
42 }
43 #[doc = "Checks if the value of the field is `UNLOCKED`"]
44 #[inline(always)]
45 pub fn is_unlocked(&self) -> bool {
46 *self == WDOGLOCK_A::UNLOCKED
47 }
48 #[doc = "Checks if the value of the field is `LOCKED`"]
49 #[inline(always)]
50 pub fn is_locked(&self) -> bool {
51 *self == WDOGLOCK_A::LOCKED
52 }
53}
54#[doc = "Field `LOCK` reader - Configuration Lock Status"]
55pub type LOCK_R = crate::BitReader<LOCK_A>;
56#[doc = "Configuration Lock Status\n\nValue on reset: 0"]
57#[derive(Clone, Copy, Debug, PartialEq, Eq)]
58pub enum LOCK_A {
59 #[doc = "0: Configuration lock is unlocked"]
60 UNLOCKED = 0,
61 #[doc = "1: Configuration lock is locked"]
62 LOCKED = 1,
63}
64impl From<LOCK_A> for bool {
65 #[inline(always)]
66 fn from(variant: LOCK_A) -> Self {
67 variant as u8 != 0
68 }
69}
70impl LOCK_R {
71 #[doc = "Get enumerated values variant"]
72 #[inline(always)]
73 pub fn variant(&self) -> LOCK_A {
74 match self.bits {
75 false => LOCK_A::UNLOCKED,
76 true => LOCK_A::LOCKED,
77 }
78 }
79 #[doc = "Checks if the value of the field is `UNLOCKED`"]
80 #[inline(always)]
81 pub fn is_unlocked(&self) -> bool {
82 *self == LOCK_A::UNLOCKED
83 }
84 #[doc = "Checks if the value of the field is `LOCKED`"]
85 #[inline(always)]
86 pub fn is_locked(&self) -> bool {
87 *self == LOCK_A::LOCKED
88 }
89}
90impl R {
91 #[doc = "Bit 0 - Calibration Ready"]
92 #[inline(always)]
93 pub fn calrdy(&self) -> CALRDY_R {
94 CALRDY_R::new((self.bits & 1) != 0)
95 }
96 #[doc = "Bit 30 - Configuration Lock Status for WDOG"]
97 #[inline(always)]
98 pub fn wdoglock(&self) -> WDOGLOCK_R {
99 WDOGLOCK_R::new(((self.bits >> 30) & 1) != 0)
100 }
101 #[doc = "Bit 31 - Configuration Lock Status"]
102 #[inline(always)]
103 pub fn lock(&self) -> LOCK_R {
104 LOCK_R::new(((self.bits >> 31) & 1) != 0)
105 }
106}
107#[doc = "No Description\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 [status](index.html) module"]
108pub struct STATUS_SPEC;
109impl crate::RegisterSpec for STATUS_SPEC {
110 type Ux = u32;
111}
112#[doc = "`read()` method returns [status::R](R) reader structure"]
113impl crate::Readable for STATUS_SPEC {
114 type Reader = R;
115}
116#[doc = "`reset()` method sets STATUS to value 0"]
117impl crate::Resettable for STATUS_SPEC {
118 const RESET_VALUE: Self::Ux = 0;
119}