xmc4800/ccu40/
gstat.rs

1#[doc = "Register `GSTAT` reader"]
2pub type R = crate::R<GSTAT_SPEC>;
3#[doc = "CC40 IDLE status\n\nValue on reset: 1"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum S0I_A {
6    #[doc = "0: Running"]
7    VALUE1 = 0,
8    #[doc = "1: Idle"]
9    VALUE2 = 1,
10}
11impl From<S0I_A> for bool {
12    #[inline(always)]
13    fn from(variant: S0I_A) -> Self {
14        variant as u8 != 0
15    }
16}
17#[doc = "Field `S0I` reader - CC40 IDLE status"]
18pub type S0I_R = crate::BitReader<S0I_A>;
19impl S0I_R {
20    #[doc = "Get enumerated values variant"]
21    #[inline(always)]
22    pub const fn variant(&self) -> S0I_A {
23        match self.bits {
24            false => S0I_A::VALUE1,
25            true => S0I_A::VALUE2,
26        }
27    }
28    #[doc = "Running"]
29    #[inline(always)]
30    pub fn is_value1(&self) -> bool {
31        *self == S0I_A::VALUE1
32    }
33    #[doc = "Idle"]
34    #[inline(always)]
35    pub fn is_value2(&self) -> bool {
36        *self == S0I_A::VALUE2
37    }
38}
39#[doc = "CC41 IDLE status\n\nValue on reset: 1"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum S1I_A {
42    #[doc = "0: Running"]
43    VALUE1 = 0,
44    #[doc = "1: Idle"]
45    VALUE2 = 1,
46}
47impl From<S1I_A> for bool {
48    #[inline(always)]
49    fn from(variant: S1I_A) -> Self {
50        variant as u8 != 0
51    }
52}
53#[doc = "Field `S1I` reader - CC41 IDLE status"]
54pub type S1I_R = crate::BitReader<S1I_A>;
55impl S1I_R {
56    #[doc = "Get enumerated values variant"]
57    #[inline(always)]
58    pub const fn variant(&self) -> S1I_A {
59        match self.bits {
60            false => S1I_A::VALUE1,
61            true => S1I_A::VALUE2,
62        }
63    }
64    #[doc = "Running"]
65    #[inline(always)]
66    pub fn is_value1(&self) -> bool {
67        *self == S1I_A::VALUE1
68    }
69    #[doc = "Idle"]
70    #[inline(always)]
71    pub fn is_value2(&self) -> bool {
72        *self == S1I_A::VALUE2
73    }
74}
75#[doc = "CC42 IDLE status\n\nValue on reset: 1"]
76#[derive(Clone, Copy, Debug, PartialEq, Eq)]
77pub enum S2I_A {
78    #[doc = "0: Running"]
79    VALUE1 = 0,
80    #[doc = "1: Idle"]
81    VALUE2 = 1,
82}
83impl From<S2I_A> for bool {
84    #[inline(always)]
85    fn from(variant: S2I_A) -> Self {
86        variant as u8 != 0
87    }
88}
89#[doc = "Field `S2I` reader - CC42 IDLE status"]
90pub type S2I_R = crate::BitReader<S2I_A>;
91impl S2I_R {
92    #[doc = "Get enumerated values variant"]
93    #[inline(always)]
94    pub const fn variant(&self) -> S2I_A {
95        match self.bits {
96            false => S2I_A::VALUE1,
97            true => S2I_A::VALUE2,
98        }
99    }
100    #[doc = "Running"]
101    #[inline(always)]
102    pub fn is_value1(&self) -> bool {
103        *self == S2I_A::VALUE1
104    }
105    #[doc = "Idle"]
106    #[inline(always)]
107    pub fn is_value2(&self) -> bool {
108        *self == S2I_A::VALUE2
109    }
110}
111#[doc = "CC43 IDLE status\n\nValue on reset: 1"]
112#[derive(Clone, Copy, Debug, PartialEq, Eq)]
113pub enum S3I_A {
114    #[doc = "0: Running"]
115    VALUE1 = 0,
116    #[doc = "1: Idle"]
117    VALUE2 = 1,
118}
119impl From<S3I_A> for bool {
120    #[inline(always)]
121    fn from(variant: S3I_A) -> Self {
122        variant as u8 != 0
123    }
124}
125#[doc = "Field `S3I` reader - CC43 IDLE status"]
126pub type S3I_R = crate::BitReader<S3I_A>;
127impl S3I_R {
128    #[doc = "Get enumerated values variant"]
129    #[inline(always)]
130    pub const fn variant(&self) -> S3I_A {
131        match self.bits {
132            false => S3I_A::VALUE1,
133            true => S3I_A::VALUE2,
134        }
135    }
136    #[doc = "Running"]
137    #[inline(always)]
138    pub fn is_value1(&self) -> bool {
139        *self == S3I_A::VALUE1
140    }
141    #[doc = "Idle"]
142    #[inline(always)]
143    pub fn is_value2(&self) -> bool {
144        *self == S3I_A::VALUE2
145    }
146}
147#[doc = "Prescaler Run Bit\n\nValue on reset: 0"]
148#[derive(Clone, Copy, Debug, PartialEq, Eq)]
149pub enum PRB_A {
150    #[doc = "0: Prescaler is stopped"]
151    VALUE1 = 0,
152    #[doc = "1: Prescaler is running"]
153    VALUE2 = 1,
154}
155impl From<PRB_A> for bool {
156    #[inline(always)]
157    fn from(variant: PRB_A) -> Self {
158        variant as u8 != 0
159    }
160}
161#[doc = "Field `PRB` reader - Prescaler Run Bit"]
162pub type PRB_R = crate::BitReader<PRB_A>;
163impl PRB_R {
164    #[doc = "Get enumerated values variant"]
165    #[inline(always)]
166    pub const fn variant(&self) -> PRB_A {
167        match self.bits {
168            false => PRB_A::VALUE1,
169            true => PRB_A::VALUE2,
170        }
171    }
172    #[doc = "Prescaler is stopped"]
173    #[inline(always)]
174    pub fn is_value1(&self) -> bool {
175        *self == PRB_A::VALUE1
176    }
177    #[doc = "Prescaler is running"]
178    #[inline(always)]
179    pub fn is_value2(&self) -> bool {
180        *self == PRB_A::VALUE2
181    }
182}
183impl R {
184    #[doc = "Bit 0 - CC40 IDLE status"]
185    #[inline(always)]
186    pub fn s0i(&self) -> S0I_R {
187        S0I_R::new((self.bits & 1) != 0)
188    }
189    #[doc = "Bit 1 - CC41 IDLE status"]
190    #[inline(always)]
191    pub fn s1i(&self) -> S1I_R {
192        S1I_R::new(((self.bits >> 1) & 1) != 0)
193    }
194    #[doc = "Bit 2 - CC42 IDLE status"]
195    #[inline(always)]
196    pub fn s2i(&self) -> S2I_R {
197        S2I_R::new(((self.bits >> 2) & 1) != 0)
198    }
199    #[doc = "Bit 3 - CC43 IDLE status"]
200    #[inline(always)]
201    pub fn s3i(&self) -> S3I_R {
202        S3I_R::new(((self.bits >> 3) & 1) != 0)
203    }
204    #[doc = "Bit 8 - Prescaler Run Bit"]
205    #[inline(always)]
206    pub fn prb(&self) -> PRB_R {
207        PRB_R::new(((self.bits >> 8) & 1) != 0)
208    }
209}
210#[doc = "Global Status Register\n\nYou can [`read`](crate::Reg::read) this register and get [`gstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
211pub struct GSTAT_SPEC;
212impl crate::RegisterSpec for GSTAT_SPEC {
213    type Ux = u32;
214}
215#[doc = "`read()` method returns [`gstat::R`](R) reader structure"]
216impl crate::Readable for GSTAT_SPEC {}
217#[doc = "`reset()` method sets GSTAT to value 0x0f"]
218impl crate::Resettable for GSTAT_SPEC {
219    const RESET_VALUE: u32 = 0x0f;
220}