eos_s3/spi_tlc/
tamarstatus.rs1#[doc = "Register `TAMARSTATUS` reader"]
2pub struct R(crate::R<TAMARSTATUS_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<TAMARSTATUS_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<TAMARSTATUS_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<TAMARSTATUS_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Indicate the M4 Power Status\n\nValue on reset: 0"]
17#[derive(Clone, Copy, Debug, PartialEq)]
18#[repr(u8)]
19pub enum M4POWERSTATUS_A {
20 #[doc = "0: Active mode."]
21 ACTIVE = 0,
22 #[doc = "1: Deep Sleep mode."]
23 DEEP_SLEEP = 1,
24 #[doc = "2: Shut down mode."]
25 SHUT_DOWN = 2,
26 #[doc = "3: Clock off mode."]
27 CLOCK_OFF = 3,
28}
29impl From<M4POWERSTATUS_A> for u8 {
30 #[inline(always)]
31 fn from(variant: M4POWERSTATUS_A) -> Self {
32 variant as _
33 }
34}
35#[doc = "Field `M4PowerStatus` reader - Indicate the M4 Power Status"]
36pub struct M4POWERSTATUS_R(crate::FieldReader<u8, M4POWERSTATUS_A>);
37impl M4POWERSTATUS_R {
38 #[inline(always)]
39 pub(crate) fn new(bits: u8) -> Self {
40 M4POWERSTATUS_R(crate::FieldReader::new(bits))
41 }
42 #[doc = r"Get enumerated values variant"]
43 #[inline(always)]
44 pub fn variant(&self) -> M4POWERSTATUS_A {
45 match self.bits {
46 0 => M4POWERSTATUS_A::ACTIVE,
47 1 => M4POWERSTATUS_A::DEEP_SLEEP,
48 2 => M4POWERSTATUS_A::SHUT_DOWN,
49 3 => M4POWERSTATUS_A::CLOCK_OFF,
50 _ => unreachable!(),
51 }
52 }
53 #[doc = "Checks if the value of the field is `ACTIVE`"]
54 #[inline(always)]
55 pub fn is_active(&self) -> bool {
56 **self == M4POWERSTATUS_A::ACTIVE
57 }
58 #[doc = "Checks if the value of the field is `DEEP_SLEEP`"]
59 #[inline(always)]
60 pub fn is_deep_sleep(&self) -> bool {
61 **self == M4POWERSTATUS_A::DEEP_SLEEP
62 }
63 #[doc = "Checks if the value of the field is `SHUT_DOWN`"]
64 #[inline(always)]
65 pub fn is_shut_down(&self) -> bool {
66 **self == M4POWERSTATUS_A::SHUT_DOWN
67 }
68 #[doc = "Checks if the value of the field is `CLOCK_OFF`"]
69 #[inline(always)]
70 pub fn is_clock_off(&self) -> bool {
71 **self == M4POWERSTATUS_A::CLOCK_OFF
72 }
73}
74impl core::ops::Deref for M4POWERSTATUS_R {
75 type Target = crate::FieldReader<u8, M4POWERSTATUS_A>;
76 #[inline(always)]
77 fn deref(&self) -> &Self::Target {
78 &self.0
79 }
80}
81#[doc = "Indicates if the M4 Subsystem reset is released (not core reset)\n\nValue on reset: 0"]
82#[derive(Clone, Copy, Debug, PartialEq)]
83pub enum M4RESETSTATUS_A {
84 #[doc = "0: M4 Subsystem reset is released."]
85 RESET_RELEASED = 0,
86 #[doc = "1: M4 Subsystem reset is NOT released."]
87 RESET_NOT_RELEASE = 1,
88}
89impl From<M4RESETSTATUS_A> for bool {
90 #[inline(always)]
91 fn from(variant: M4RESETSTATUS_A) -> Self {
92 variant as u8 != 0
93 }
94}
95#[doc = "Field `M4ResetStatus` reader - Indicates if the M4 Subsystem reset is released (not core reset)"]
96pub struct M4RESETSTATUS_R(crate::FieldReader<bool, M4RESETSTATUS_A>);
97impl M4RESETSTATUS_R {
98 #[inline(always)]
99 pub(crate) fn new(bits: bool) -> Self {
100 M4RESETSTATUS_R(crate::FieldReader::new(bits))
101 }
102 #[doc = r"Get enumerated values variant"]
103 #[inline(always)]
104 pub fn variant(&self) -> M4RESETSTATUS_A {
105 match self.bits {
106 false => M4RESETSTATUS_A::RESET_RELEASED,
107 true => M4RESETSTATUS_A::RESET_NOT_RELEASE,
108 }
109 }
110 #[doc = "Checks if the value of the field is `RESET_RELEASED`"]
111 #[inline(always)]
112 pub fn is_reset_released(&self) -> bool {
113 **self == M4RESETSTATUS_A::RESET_RELEASED
114 }
115 #[doc = "Checks if the value of the field is `RESET_NOT_RELEASE`"]
116 #[inline(always)]
117 pub fn is_reset_not_release(&self) -> bool {
118 **self == M4RESETSTATUS_A::RESET_NOT_RELEASE
119 }
120}
121impl core::ops::Deref for M4RESETSTATUS_R {
122 type Target = crate::FieldReader<bool, M4RESETSTATUS_A>;
123 #[inline(always)]
124 fn deref(&self) -> &Self::Target {
125 &self.0
126 }
127}
128#[doc = "This bit is reflect the value on RFUPMU offset 3EC. It will not set for cold start.\n\nValue on reset: 0"]
129#[derive(Clone, Copy, Debug, PartialEq)]
130pub enum M4REBOOTREQ_A {
131 #[doc = "0: No Code reload is neccesary"]
132 NO_RELOAD_NEED = 0,
133 #[doc = "1: Need to Re-Load the Code in AP mode"]
134 RELOAD_NEEDED = 1,
135}
136impl From<M4REBOOTREQ_A> for bool {
137 #[inline(always)]
138 fn from(variant: M4REBOOTREQ_A) -> Self {
139 variant as u8 != 0
140 }
141}
142#[doc = "Field `M4RebootReq` reader - This bit is reflect the value on RFUPMU offset 3EC. It will not set for cold start."]
143pub struct M4REBOOTREQ_R(crate::FieldReader<bool, M4REBOOTREQ_A>);
144impl M4REBOOTREQ_R {
145 #[inline(always)]
146 pub(crate) fn new(bits: bool) -> Self {
147 M4REBOOTREQ_R(crate::FieldReader::new(bits))
148 }
149 #[doc = r"Get enumerated values variant"]
150 #[inline(always)]
151 pub fn variant(&self) -> M4REBOOTREQ_A {
152 match self.bits {
153 false => M4REBOOTREQ_A::NO_RELOAD_NEED,
154 true => M4REBOOTREQ_A::RELOAD_NEEDED,
155 }
156 }
157 #[doc = "Checks if the value of the field is `NO_RELOAD_NEED`"]
158 #[inline(always)]
159 pub fn is_no_reload_need(&self) -> bool {
160 **self == M4REBOOTREQ_A::NO_RELOAD_NEED
161 }
162 #[doc = "Checks if the value of the field is `RELOAD_NEEDED`"]
163 #[inline(always)]
164 pub fn is_reload_needed(&self) -> bool {
165 **self == M4REBOOTREQ_A::RELOAD_NEEDED
166 }
167}
168impl core::ops::Deref for M4REBOOTREQ_R {
169 type Target = crate::FieldReader<bool, M4REBOOTREQ_A>;
170 #[inline(always)]
171 fn deref(&self) -> &Self::Target {
172 &self.0
173 }
174}
175#[doc = "Field `PORiniCond` reader - 0xE value if POR trigger, It reflect the value of rfupmu offset 00C"]
176pub struct PORINICOND_R(crate::FieldReader<u8, u8>);
177impl PORINICOND_R {
178 #[inline(always)]
179 pub(crate) fn new(bits: u8) -> Self {
180 PORINICOND_R(crate::FieldReader::new(bits))
181 }
182}
183impl core::ops::Deref for PORINICOND_R {
184 type Target = crate::FieldReader<u8, u8>;
185 #[inline(always)]
186 fn deref(&self) -> &Self::Target {
187 &self.0
188 }
189}
190impl R {
191 #[doc = "Bits 0:1 - Indicate the M4 Power Status"]
192 #[inline(always)]
193 pub fn m4power_status(&self) -> M4POWERSTATUS_R {
194 M4POWERSTATUS_R::new((self.bits & 0x03) as u8)
195 }
196 #[doc = "Bit 2 - Indicates if the M4 Subsystem reset is released (not core reset)"]
197 #[inline(always)]
198 pub fn m4reset_status(&self) -> M4RESETSTATUS_R {
199 M4RESETSTATUS_R::new(((self.bits >> 2) & 0x01) != 0)
200 }
201 #[doc = "Bit 3 - This bit is reflect the value on RFUPMU offset 3EC. It will not set for cold start."]
202 #[inline(always)]
203 pub fn m4reboot_req(&self) -> M4REBOOTREQ_R {
204 M4REBOOTREQ_R::new(((self.bits >> 3) & 0x01) != 0)
205 }
206 #[doc = "Bits 4:7 - 0xE value if POR trigger, It reflect the value of rfupmu offset 00C"]
207 #[inline(always)]
208 pub fn porini_cond(&self) -> PORINICOND_R {
209 PORINICOND_R::new(((self.bits >> 4) & 0x0f) as u8)
210 }
211}
212#[doc = "???\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 [tamarstatus](index.html) module"]
213pub struct TAMARSTATUS_SPEC;
214impl crate::RegisterSpec for TAMARSTATUS_SPEC {
215 type Ux = u8;
216}
217#[doc = "`read()` method returns [tamarstatus::R](R) reader structure"]
218impl crate::Readable for TAMARSTATUS_SPEC {
219 type Reader = R;
220}
221#[doc = "`reset()` method sets TAMARSTATUS to value 0xe0"]
222impl crate::Resettable for TAMARSTATUS_SPEC {
223 #[inline(always)]
224 fn reset_value() -> Self::Ux {
225 0xe0
226 }
227}