mcxa_pac/scg0/
param.rs

1#[doc = "Register `PARAM` reader"]
2pub type R = crate::R<ParamSpec>;
3#[doc = "SOSC Clock Present\n\nValue on reset: 1"]
4#[cfg_attr(feature = "defmt", derive(defmt::Format))]
5#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6pub enum Soscclkpres {
7    #[doc = "0: SOSC clock source is not present"]
8    Nopres = 0,
9    #[doc = "1: SOSC clock source is present"]
10    Pres = 1,
11}
12impl From<Soscclkpres> for bool {
13    #[inline(always)]
14    fn from(variant: Soscclkpres) -> Self {
15        variant as u8 != 0
16    }
17}
18#[doc = "Field `SOSCCLKPRES` reader - SOSC Clock Present"]
19pub type SoscclkpresR = crate::BitReader<Soscclkpres>;
20impl SoscclkpresR {
21    #[doc = "Get enumerated values variant"]
22    #[inline(always)]
23    pub const fn variant(&self) -> Soscclkpres {
24        match self.bits {
25            false => Soscclkpres::Nopres,
26            true => Soscclkpres::Pres,
27        }
28    }
29    #[doc = "SOSC clock source is not present"]
30    #[inline(always)]
31    pub fn is_nopres(&self) -> bool {
32        *self == Soscclkpres::Nopres
33    }
34    #[doc = "SOSC clock source is present"]
35    #[inline(always)]
36    pub fn is_pres(&self) -> bool {
37        *self == Soscclkpres::Pres
38    }
39}
40#[doc = "SIRC Clock Present\n\nValue on reset: 1"]
41#[cfg_attr(feature = "defmt", derive(defmt::Format))]
42#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum Sircclkpres {
44    #[doc = "0: SIRC clock source is not present"]
45    Nopres = 0,
46    #[doc = "1: SIRC clock source is present"]
47    Pres = 1,
48}
49impl From<Sircclkpres> for bool {
50    #[inline(always)]
51    fn from(variant: Sircclkpres) -> Self {
52        variant as u8 != 0
53    }
54}
55#[doc = "Field `SIRCCLKPRES` reader - SIRC Clock Present"]
56pub type SircclkpresR = crate::BitReader<Sircclkpres>;
57impl SircclkpresR {
58    #[doc = "Get enumerated values variant"]
59    #[inline(always)]
60    pub const fn variant(&self) -> Sircclkpres {
61        match self.bits {
62            false => Sircclkpres::Nopres,
63            true => Sircclkpres::Pres,
64        }
65    }
66    #[doc = "SIRC clock source is not present"]
67    #[inline(always)]
68    pub fn is_nopres(&self) -> bool {
69        *self == Sircclkpres::Nopres
70    }
71    #[doc = "SIRC clock source is present"]
72    #[inline(always)]
73    pub fn is_pres(&self) -> bool {
74        *self == Sircclkpres::Pres
75    }
76}
77#[doc = "FIRC Clock Present\n\nValue on reset: 1"]
78#[cfg_attr(feature = "defmt", derive(defmt::Format))]
79#[derive(Clone, Copy, Debug, PartialEq, Eq)]
80pub enum Fircclkpres {
81    #[doc = "0: FIRC clock source is not present"]
82    Nopres = 0,
83    #[doc = "1: FIRC clock source is present"]
84    Pres = 1,
85}
86impl From<Fircclkpres> for bool {
87    #[inline(always)]
88    fn from(variant: Fircclkpres) -> Self {
89        variant as u8 != 0
90    }
91}
92#[doc = "Field `FIRCCLKPRES` reader - FIRC Clock Present"]
93pub type FircclkpresR = crate::BitReader<Fircclkpres>;
94impl FircclkpresR {
95    #[doc = "Get enumerated values variant"]
96    #[inline(always)]
97    pub const fn variant(&self) -> Fircclkpres {
98        match self.bits {
99            false => Fircclkpres::Nopres,
100            true => Fircclkpres::Pres,
101        }
102    }
103    #[doc = "FIRC clock source is not present"]
104    #[inline(always)]
105    pub fn is_nopres(&self) -> bool {
106        *self == Fircclkpres::Nopres
107    }
108    #[doc = "FIRC clock source is present"]
109    #[inline(always)]
110    pub fn is_pres(&self) -> bool {
111        *self == Fircclkpres::Pres
112    }
113}
114#[doc = "ROSC Clock Present\n\nValue on reset: 1"]
115#[cfg_attr(feature = "defmt", derive(defmt::Format))]
116#[derive(Clone, Copy, Debug, PartialEq, Eq)]
117pub enum Roscclkpres {
118    #[doc = "0: ROSC clock source is not present"]
119    Nopres = 0,
120    #[doc = "1: ROSC clock source is present"]
121    Pres = 1,
122}
123impl From<Roscclkpres> for bool {
124    #[inline(always)]
125    fn from(variant: Roscclkpres) -> Self {
126        variant as u8 != 0
127    }
128}
129#[doc = "Field `ROSCCLKPRES` reader - ROSC Clock Present"]
130pub type RoscclkpresR = crate::BitReader<Roscclkpres>;
131impl RoscclkpresR {
132    #[doc = "Get enumerated values variant"]
133    #[inline(always)]
134    pub const fn variant(&self) -> Roscclkpres {
135        match self.bits {
136            false => Roscclkpres::Nopres,
137            true => Roscclkpres::Pres,
138        }
139    }
140    #[doc = "ROSC clock source is not present"]
141    #[inline(always)]
142    pub fn is_nopres(&self) -> bool {
143        *self == Roscclkpres::Nopres
144    }
145    #[doc = "ROSC clock source is present"]
146    #[inline(always)]
147    pub fn is_pres(&self) -> bool {
148        *self == Roscclkpres::Pres
149    }
150}
151#[doc = "SPLL Clock Present\n\nValue on reset: 1"]
152#[cfg_attr(feature = "defmt", derive(defmt::Format))]
153#[derive(Clone, Copy, Debug, PartialEq, Eq)]
154pub enum Spllclkpres {
155    #[doc = "0: SPLL clock source is not present"]
156    Nopres = 0,
157    #[doc = "1: SPLL clock source is present"]
158    Pres = 1,
159}
160impl From<Spllclkpres> for bool {
161    #[inline(always)]
162    fn from(variant: Spllclkpres) -> Self {
163        variant as u8 != 0
164    }
165}
166#[doc = "Field `SPLLCLKPRES` reader - SPLL Clock Present"]
167pub type SpllclkpresR = crate::BitReader<Spllclkpres>;
168impl SpllclkpresR {
169    #[doc = "Get enumerated values variant"]
170    #[inline(always)]
171    pub const fn variant(&self) -> Spllclkpres {
172        match self.bits {
173            false => Spllclkpres::Nopres,
174            true => Spllclkpres::Pres,
175        }
176    }
177    #[doc = "SPLL clock source is not present"]
178    #[inline(always)]
179    pub fn is_nopres(&self) -> bool {
180        *self == Spllclkpres::Nopres
181    }
182    #[doc = "SPLL clock source is present"]
183    #[inline(always)]
184    pub fn is_pres(&self) -> bool {
185        *self == Spllclkpres::Pres
186    }
187}
188impl R {
189    #[doc = "Bit 1 - SOSC Clock Present"]
190    #[inline(always)]
191    pub fn soscclkpres(&self) -> SoscclkpresR {
192        SoscclkpresR::new(((self.bits >> 1) & 1) != 0)
193    }
194    #[doc = "Bit 2 - SIRC Clock Present"]
195    #[inline(always)]
196    pub fn sircclkpres(&self) -> SircclkpresR {
197        SircclkpresR::new(((self.bits >> 2) & 1) != 0)
198    }
199    #[doc = "Bit 3 - FIRC Clock Present"]
200    #[inline(always)]
201    pub fn fircclkpres(&self) -> FircclkpresR {
202        FircclkpresR::new(((self.bits >> 3) & 1) != 0)
203    }
204    #[doc = "Bit 4 - ROSC Clock Present"]
205    #[inline(always)]
206    pub fn roscclkpres(&self) -> RoscclkpresR {
207        RoscclkpresR::new(((self.bits >> 4) & 1) != 0)
208    }
209    #[doc = "Bit 6 - SPLL Clock Present"]
210    #[inline(always)]
211    pub fn spllclkpres(&self) -> SpllclkpresR {
212        SpllclkpresR::new(((self.bits >> 6) & 1) != 0)
213    }
214}
215#[cfg(feature = "debug")]
216impl core::fmt::Debug for R {
217    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
218        f.debug_struct("PARAM")
219            .field("soscclkpres", &self.soscclkpres())
220            .field("sircclkpres", &self.sircclkpres())
221            .field("fircclkpres", &self.fircclkpres())
222            .field("roscclkpres", &self.roscclkpres())
223            .field("spllclkpres", &self.spllclkpres())
224            .finish()
225    }
226}
227#[doc = "Parameter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`param::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
228pub struct ParamSpec;
229impl crate::RegisterSpec for ParamSpec {
230    type Ux = u32;
231}
232#[doc = "`read()` method returns [`param::R`](R) reader structure"]
233impl crate::Readable for ParamSpec {}
234#[doc = "`reset()` method sets PARAM to value 0x5e"]
235impl crate::Resettable for ParamSpec {
236    const RESET_VALUE: u32 = 0x5e;
237}