efm32pg22_pac/efm32pg22c200/hfxo0_ns/
status.rs

1#[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 `RDY` reader - Ready Status"]
17pub type RDY_R = crate::BitReader<bool>;
18#[doc = "Field `COREBIASOPTRDY` reader - Core Bias Optimization Ready"]
19pub type COREBIASOPTRDY_R = crate::BitReader<bool>;
20#[doc = "Field `ENS` reader - Enabled Status"]
21pub type ENS_R = crate::BitReader<bool>;
22#[doc = "Field `HWREQ` reader - Oscillator Requested by Hardware"]
23pub type HWREQ_R = crate::BitReader<bool>;
24#[doc = "Field `ISWARM` reader - Oscillator Is Kept Warm"]
25pub type ISWARM_R = crate::BitReader<bool>;
26#[doc = "Field `FSMLOCK` reader - FSM Lock Status"]
27pub type FSMLOCK_R = crate::BitReader<FSMLOCK_A>;
28#[doc = "FSM Lock Status\n\nValue on reset: 0"]
29#[derive(Clone, Copy, Debug, PartialEq, Eq)]
30pub enum FSMLOCK_A {
31    #[doc = "0: FSM lock is unlocked"]
32    UNLOCKED = 0,
33    #[doc = "1: FSM lock is locked"]
34    LOCKED = 1,
35}
36impl From<FSMLOCK_A> for bool {
37    #[inline(always)]
38    fn from(variant: FSMLOCK_A) -> Self {
39        variant as u8 != 0
40    }
41}
42impl FSMLOCK_R {
43    #[doc = "Get enumerated values variant"]
44    #[inline(always)]
45    pub fn variant(&self) -> FSMLOCK_A {
46        match self.bits {
47            false => FSMLOCK_A::UNLOCKED,
48            true => FSMLOCK_A::LOCKED,
49        }
50    }
51    #[doc = "Checks if the value of the field is `UNLOCKED`"]
52    #[inline(always)]
53    pub fn is_unlocked(&self) -> bool {
54        *self == FSMLOCK_A::UNLOCKED
55    }
56    #[doc = "Checks if the value of the field is `LOCKED`"]
57    #[inline(always)]
58    pub fn is_locked(&self) -> bool {
59        *self == FSMLOCK_A::LOCKED
60    }
61}
62#[doc = "Field `LOCK` reader - Configuration Lock Status"]
63pub type LOCK_R = crate::BitReader<LOCK_A>;
64#[doc = "Configuration Lock Status\n\nValue on reset: 0"]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum LOCK_A {
67    #[doc = "0: Configuration lock is unlocked"]
68    UNLOCKED = 0,
69    #[doc = "1: Configuration lock is locked"]
70    LOCKED = 1,
71}
72impl From<LOCK_A> for bool {
73    #[inline(always)]
74    fn from(variant: LOCK_A) -> Self {
75        variant as u8 != 0
76    }
77}
78impl LOCK_R {
79    #[doc = "Get enumerated values variant"]
80    #[inline(always)]
81    pub fn variant(&self) -> LOCK_A {
82        match self.bits {
83            false => LOCK_A::UNLOCKED,
84            true => LOCK_A::LOCKED,
85        }
86    }
87    #[doc = "Checks if the value of the field is `UNLOCKED`"]
88    #[inline(always)]
89    pub fn is_unlocked(&self) -> bool {
90        *self == LOCK_A::UNLOCKED
91    }
92    #[doc = "Checks if the value of the field is `LOCKED`"]
93    #[inline(always)]
94    pub fn is_locked(&self) -> bool {
95        *self == LOCK_A::LOCKED
96    }
97}
98impl R {
99    #[doc = "Bit 0 - Ready Status"]
100    #[inline(always)]
101    pub fn rdy(&self) -> RDY_R {
102        RDY_R::new((self.bits & 1) != 0)
103    }
104    #[doc = "Bit 1 - Core Bias Optimization Ready"]
105    #[inline(always)]
106    pub fn corebiasoptrdy(&self) -> COREBIASOPTRDY_R {
107        COREBIASOPTRDY_R::new(((self.bits >> 1) & 1) != 0)
108    }
109    #[doc = "Bit 16 - Enabled Status"]
110    #[inline(always)]
111    pub fn ens(&self) -> ENS_R {
112        ENS_R::new(((self.bits >> 16) & 1) != 0)
113    }
114    #[doc = "Bit 17 - Oscillator Requested by Hardware"]
115    #[inline(always)]
116    pub fn hwreq(&self) -> HWREQ_R {
117        HWREQ_R::new(((self.bits >> 17) & 1) != 0)
118    }
119    #[doc = "Bit 19 - Oscillator Is Kept Warm"]
120    #[inline(always)]
121    pub fn iswarm(&self) -> ISWARM_R {
122        ISWARM_R::new(((self.bits >> 19) & 1) != 0)
123    }
124    #[doc = "Bit 30 - FSM Lock Status"]
125    #[inline(always)]
126    pub fn fsmlock(&self) -> FSMLOCK_R {
127        FSMLOCK_R::new(((self.bits >> 30) & 1) != 0)
128    }
129    #[doc = "Bit 31 - Configuration Lock Status"]
130    #[inline(always)]
131    pub fn lock(&self) -> LOCK_R {
132        LOCK_R::new(((self.bits >> 31) & 1) != 0)
133    }
134}
135#[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"]
136pub struct STATUS_SPEC;
137impl crate::RegisterSpec for STATUS_SPEC {
138    type Ux = u32;
139}
140#[doc = "`read()` method returns [status::R](R) reader structure"]
141impl crate::Readable for STATUS_SPEC {
142    type Reader = R;
143}
144#[doc = "`reset()` method sets STATUS to value 0"]
145impl crate::Resettable for STATUS_SPEC {
146    const RESET_VALUE: Self::Ux = 0;
147}