eos_s3/pmu/
chip_sta_1.rs

1#[doc = "Register `CHIP_STA_1` reader"]
2pub struct R(crate::R<CHIP_STA_1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CHIP_STA_1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CHIP_STA_1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CHIP_STA_1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Indicates if FFE0 is busy\n\nValue on reset: 0"]
17#[derive(Clone, Copy, Debug, PartialEq)]
18pub enum FFE0_BUSY_A {
19    #[doc = "0: FFE0 is not busy"]
20    NOT_BUSY = 0,
21    #[doc = "1: FFE0 is busy"]
22    BUSY = 1,
23}
24impl From<FFE0_BUSY_A> for bool {
25    #[inline(always)]
26    fn from(variant: FFE0_BUSY_A) -> Self {
27        variant as u8 != 0
28    }
29}
30#[doc = "Field `FFE0_BUSY` reader - Indicates if FFE0 is busy"]
31pub struct FFE0_BUSY_R(crate::FieldReader<bool, FFE0_BUSY_A>);
32impl FFE0_BUSY_R {
33    #[inline(always)]
34    pub(crate) fn new(bits: bool) -> Self {
35        FFE0_BUSY_R(crate::FieldReader::new(bits))
36    }
37    #[doc = r"Get enumerated values variant"]
38    #[inline(always)]
39    pub fn variant(&self) -> FFE0_BUSY_A {
40        match self.bits {
41            false => FFE0_BUSY_A::NOT_BUSY,
42            true => FFE0_BUSY_A::BUSY,
43        }
44    }
45    #[doc = "Checks if the value of the field is `NOT_BUSY`"]
46    #[inline(always)]
47    pub fn is_not_busy(&self) -> bool {
48        **self == FFE0_BUSY_A::NOT_BUSY
49    }
50    #[doc = "Checks if the value of the field is `BUSY`"]
51    #[inline(always)]
52    pub fn is_busy(&self) -> bool {
53        **self == FFE0_BUSY_A::BUSY
54    }
55}
56impl core::ops::Deref for FFE0_BUSY_R {
57    type Target = crate::FieldReader<bool, FFE0_BUSY_A>;
58    #[inline(always)]
59    fn deref(&self) -> &Self::Target {
60        &self.0
61    }
62}
63#[doc = "This reflects the value of boot strap bit. Pad\\[19\\]\n\nValue on reset: 0"]
64#[derive(Clone, Copy, Debug, PartialEq)]
65pub enum CODE_SOURCE_CFG_A {
66    #[doc = "0: From SPI Flash, if SWD_Mode_Cfg is 1, CfgSM will not be kicked off."]
67    SPI_FLASH = 0,
68    #[doc = "1: From AP"]
69    AP = 1,
70}
71impl From<CODE_SOURCE_CFG_A> for bool {
72    #[inline(always)]
73    fn from(variant: CODE_SOURCE_CFG_A) -> Self {
74        variant as u8 != 0
75    }
76}
77#[doc = "Field `Code_Source_Cfg` reader - This reflects the value of boot strap bit. Pad\\[19\\]"]
78pub struct CODE_SOURCE_CFG_R(crate::FieldReader<bool, CODE_SOURCE_CFG_A>);
79impl CODE_SOURCE_CFG_R {
80    #[inline(always)]
81    pub(crate) fn new(bits: bool) -> Self {
82        CODE_SOURCE_CFG_R(crate::FieldReader::new(bits))
83    }
84    #[doc = r"Get enumerated values variant"]
85    #[inline(always)]
86    pub fn variant(&self) -> CODE_SOURCE_CFG_A {
87        match self.bits {
88            false => CODE_SOURCE_CFG_A::SPI_FLASH,
89            true => CODE_SOURCE_CFG_A::AP,
90        }
91    }
92    #[doc = "Checks if the value of the field is `SPI_FLASH`"]
93    #[inline(always)]
94    pub fn is_spi_flash(&self) -> bool {
95        **self == CODE_SOURCE_CFG_A::SPI_FLASH
96    }
97    #[doc = "Checks if the value of the field is `AP`"]
98    #[inline(always)]
99    pub fn is_ap(&self) -> bool {
100        **self == CODE_SOURCE_CFG_A::AP
101    }
102}
103impl core::ops::Deref for CODE_SOURCE_CFG_R {
104    type Target = crate::FieldReader<bool, CODE_SOURCE_CFG_A>;
105    #[inline(always)]
106    fn deref(&self) -> &Self::Target {
107        &self.0
108    }
109}
110#[doc = "This reflects the value of boot strap bit. Pad\\[8\\]\n\nValue on reset: 0"]
111#[derive(Clone, Copy, Debug, PartialEq)]
112pub enum DEBUG_PORT_CFG_A {
113    #[doc = "0: SW_CLK @pad\\[5\\], SW_IO @pad\\[6\\]"]
114    SWD_PADS_5_6 = 0,
115    #[doc = "1: SW_CLK @pad\\[27\\], SW_IO @pad\\[26\\]"]
116    SWD_PADS_27_26 = 1,
117}
118impl From<DEBUG_PORT_CFG_A> for bool {
119    #[inline(always)]
120    fn from(variant: DEBUG_PORT_CFG_A) -> Self {
121        variant as u8 != 0
122    }
123}
124#[doc = "Field `Debug_Port_Cfg` reader - This reflects the value of boot strap bit. Pad\\[8\\]"]
125pub struct DEBUG_PORT_CFG_R(crate::FieldReader<bool, DEBUG_PORT_CFG_A>);
126impl DEBUG_PORT_CFG_R {
127    #[inline(always)]
128    pub(crate) fn new(bits: bool) -> Self {
129        DEBUG_PORT_CFG_R(crate::FieldReader::new(bits))
130    }
131    #[doc = r"Get enumerated values variant"]
132    #[inline(always)]
133    pub fn variant(&self) -> DEBUG_PORT_CFG_A {
134        match self.bits {
135            false => DEBUG_PORT_CFG_A::SWD_PADS_5_6,
136            true => DEBUG_PORT_CFG_A::SWD_PADS_27_26,
137        }
138    }
139    #[doc = "Checks if the value of the field is `SWD_PADS_5_6`"]
140    #[inline(always)]
141    pub fn is_swd_pads_5_6(&self) -> bool {
142        **self == DEBUG_PORT_CFG_A::SWD_PADS_5_6
143    }
144    #[doc = "Checks if the value of the field is `SWD_PADS_27_26`"]
145    #[inline(always)]
146    pub fn is_swd_pads_27_26(&self) -> bool {
147        **self == DEBUG_PORT_CFG_A::SWD_PADS_27_26
148    }
149}
150impl core::ops::Deref for DEBUG_PORT_CFG_R {
151    type Target = crate::FieldReader<bool, DEBUG_PORT_CFG_A>;
152    #[inline(always)]
153    fn deref(&self) -> &Self::Target {
154        &self.0
155    }
156}
157#[doc = "Field `FB_0` reader - FB Stasus Siganl 0 (Its definition is depending on the implementation of FB)"]
158pub struct FB_0_R(crate::FieldReader<bool, bool>);
159impl FB_0_R {
160    #[inline(always)]
161    pub(crate) fn new(bits: bool) -> Self {
162        FB_0_R(crate::FieldReader::new(bits))
163    }
164}
165impl core::ops::Deref for FB_0_R {
166    type Target = crate::FieldReader<bool, bool>;
167    #[inline(always)]
168    fn deref(&self) -> &Self::Target {
169        &self.0
170    }
171}
172#[doc = "Field `FB_1` reader - FB Stasus Siganl 1 (Its definition is depending on the implementation of FB)"]
173pub struct FB_1_R(crate::FieldReader<bool, bool>);
174impl FB_1_R {
175    #[inline(always)]
176    pub(crate) fn new(bits: bool) -> Self {
177        FB_1_R(crate::FieldReader::new(bits))
178    }
179}
180impl core::ops::Deref for FB_1_R {
181    type Target = crate::FieldReader<bool, bool>;
182    #[inline(always)]
183    fn deref(&self) -> &Self::Target {
184        &self.0
185    }
186}
187#[doc = "Field `FB_2` reader - FB Stasus Siganl 2 (Its definition is depending on the implementation of FB)"]
188pub struct FB_2_R(crate::FieldReader<bool, bool>);
189impl FB_2_R {
190    #[inline(always)]
191    pub(crate) fn new(bits: bool) -> Self {
192        FB_2_R(crate::FieldReader::new(bits))
193    }
194}
195impl core::ops::Deref for FB_2_R {
196    type Target = crate::FieldReader<bool, bool>;
197    #[inline(always)]
198    fn deref(&self) -> &Self::Target {
199        &self.0
200    }
201}
202#[doc = "Field `FB_3` reader - FB Stasus Siganl 3 (Its definition is depending on the implementation of FB)"]
203pub struct FB_3_R(crate::FieldReader<bool, bool>);
204impl FB_3_R {
205    #[inline(always)]
206    pub(crate) fn new(bits: bool) -> Self {
207        FB_3_R(crate::FieldReader::new(bits))
208    }
209}
210impl core::ops::Deref for FB_3_R {
211    type Target = crate::FieldReader<bool, bool>;
212    #[inline(always)]
213    fn deref(&self) -> &Self::Target {
214        &self.0
215    }
216}
217#[doc = "This reflects the value of boot strap bit. Pad\\[20\\]\n\nValue on reset: 0"]
218#[derive(Clone, Copy, Debug, PartialEq)]
219pub enum SWD_MODE_CFG_A {
220    #[doc = "1: SWD debugger is attached. Release the M4 Core reset once System Reset released."]
221    IF_SWD_RELEASE_M4_ON_REST = 1,
222}
223impl From<SWD_MODE_CFG_A> for bool {
224    #[inline(always)]
225    fn from(variant: SWD_MODE_CFG_A) -> Self {
226        variant as u8 != 0
227    }
228}
229#[doc = "Field `SWD_Mode_Cfg` reader - This reflects the value of boot strap bit. Pad\\[20\\]"]
230pub struct SWD_MODE_CFG_R(crate::FieldReader<bool, SWD_MODE_CFG_A>);
231impl SWD_MODE_CFG_R {
232    #[inline(always)]
233    pub(crate) fn new(bits: bool) -> Self {
234        SWD_MODE_CFG_R(crate::FieldReader::new(bits))
235    }
236    #[doc = r"Get enumerated values variant"]
237    #[inline(always)]
238    pub fn variant(&self) -> Option<SWD_MODE_CFG_A> {
239        match self.bits {
240            true => Some(SWD_MODE_CFG_A::IF_SWD_RELEASE_M4_ON_REST),
241            _ => None,
242        }
243    }
244    #[doc = "Checks if the value of the field is `IF_SWD_RELEASE_M4_ON_REST`"]
245    #[inline(always)]
246    pub fn is_if_swd_release_m4_on_rest(&self) -> bool {
247        **self == SWD_MODE_CFG_A::IF_SWD_RELEASE_M4_ON_REST
248    }
249}
250impl core::ops::Deref for SWD_MODE_CFG_R {
251    type Target = crate::FieldReader<bool, SWD_MODE_CFG_A>;
252    #[inline(always)]
253    fn deref(&self) -> &Self::Target {
254        &self.0
255    }
256}
257#[doc = "This reflects the value of boot strap bit. Pad\\[9\\]\n\nValue on reset: 0"]
258#[derive(Clone, Copy, Debug, PartialEq)]
259pub enum CLOCK_BYPASS_CFG_A {
260    #[doc = "1: The System Clock Source is from the I/O PAD instead of OSC if Debug_port_cfg is 1 as well."]
261    EXTERNAL_CLOCK_CONFIGURED = 1,
262}
263impl From<CLOCK_BYPASS_CFG_A> for bool {
264    #[inline(always)]
265    fn from(variant: CLOCK_BYPASS_CFG_A) -> Self {
266        variant as u8 != 0
267    }
268}
269#[doc = "Field `CLOCK_BYPASS_Cfg` reader - This reflects the value of boot strap bit. Pad\\[9\\]"]
270pub struct CLOCK_BYPASS_CFG_R(crate::FieldReader<bool, CLOCK_BYPASS_CFG_A>);
271impl CLOCK_BYPASS_CFG_R {
272    #[inline(always)]
273    pub(crate) fn new(bits: bool) -> Self {
274        CLOCK_BYPASS_CFG_R(crate::FieldReader::new(bits))
275    }
276    #[doc = r"Get enumerated values variant"]
277    #[inline(always)]
278    pub fn variant(&self) -> Option<CLOCK_BYPASS_CFG_A> {
279        match self.bits {
280            true => Some(CLOCK_BYPASS_CFG_A::EXTERNAL_CLOCK_CONFIGURED),
281            _ => None,
282        }
283    }
284    #[doc = "Checks if the value of the field is `EXTERNAL_CLOCK_CONFIGURED`"]
285    #[inline(always)]
286    pub fn is_external_clock_configured(&self) -> bool {
287        **self == CLOCK_BYPASS_CFG_A::EXTERNAL_CLOCK_CONFIGURED
288    }
289}
290impl core::ops::Deref for CLOCK_BYPASS_CFG_R {
291    type Target = crate::FieldReader<bool, CLOCK_BYPASS_CFG_A>;
292    #[inline(always)]
293    fn deref(&self) -> &Self::Target {
294        &self.0
295    }
296}
297impl R {
298    #[doc = "Bit 0 - Indicates if FFE0 is busy"]
299    #[inline(always)]
300    pub fn ffe0_busy(&self) -> FFE0_BUSY_R {
301        FFE0_BUSY_R::new((self.bits & 0x01) != 0)
302    }
303    #[doc = "Bit 4 - This reflects the value of boot strap bit. Pad\\[19\\]"]
304    #[inline(always)]
305    pub fn code_source_cfg(&self) -> CODE_SOURCE_CFG_R {
306        CODE_SOURCE_CFG_R::new(((self.bits >> 4) & 0x01) != 0)
307    }
308    #[doc = "Bit 5 - This reflects the value of boot strap bit. Pad\\[8\\]"]
309    #[inline(always)]
310    pub fn debug_port_cfg(&self) -> DEBUG_PORT_CFG_R {
311        DEBUG_PORT_CFG_R::new(((self.bits >> 5) & 0x01) != 0)
312    }
313    #[doc = "Bit 6 - FB Stasus Siganl 0 (Its definition is depending on the implementation of FB)"]
314    #[inline(always)]
315    pub fn fb_0(&self) -> FB_0_R {
316        FB_0_R::new(((self.bits >> 6) & 0x01) != 0)
317    }
318    #[doc = "Bit 7 - FB Stasus Siganl 1 (Its definition is depending on the implementation of FB)"]
319    #[inline(always)]
320    pub fn fb_1(&self) -> FB_1_R {
321        FB_1_R::new(((self.bits >> 7) & 0x01) != 0)
322    }
323    #[doc = "Bit 8 - FB Stasus Siganl 2 (Its definition is depending on the implementation of FB)"]
324    #[inline(always)]
325    pub fn fb_2(&self) -> FB_2_R {
326        FB_2_R::new(((self.bits >> 8) & 0x01) != 0)
327    }
328    #[doc = "Bit 9 - FB Stasus Siganl 3 (Its definition is depending on the implementation of FB)"]
329    #[inline(always)]
330    pub fn fb_3(&self) -> FB_3_R {
331        FB_3_R::new(((self.bits >> 9) & 0x01) != 0)
332    }
333    #[doc = "Bit 10 - This reflects the value of boot strap bit. Pad\\[20\\]"]
334    #[inline(always)]
335    pub fn swd_mode_cfg(&self) -> SWD_MODE_CFG_R {
336        SWD_MODE_CFG_R::new(((self.bits >> 10) & 0x01) != 0)
337    }
338    #[doc = "Bit 11 - This reflects the value of boot strap bit. Pad\\[9\\]"]
339    #[inline(always)]
340    pub fn clock_bypass_cfg(&self) -> CLOCK_BYPASS_CFG_R {
341        CLOCK_BYPASS_CFG_R::new(((self.bits >> 11) & 0x01) != 0)
342    }
343}
344#[doc = "Chip Status 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 [chip_sta_1](index.html) module"]
345pub struct CHIP_STA_1_SPEC;
346impl crate::RegisterSpec for CHIP_STA_1_SPEC {
347    type Ux = u32;
348}
349#[doc = "`read()` method returns [chip_sta_1::R](R) reader structure"]
350impl crate::Readable for CHIP_STA_1_SPEC {
351    type Reader = R;
352}
353#[doc = "`reset()` method sets CHIP_STA_1 to value 0"]
354impl crate::Resettable for CHIP_STA_1_SPEC {
355    #[inline(always)]
356    fn reset_value() -> Self::Ux {
357        0
358    }
359}