eos_s3/extm4regs/
config1.rs1#[doc = "Register `CONFIG1` reader"]
2pub struct R(crate::R<CONFIG1_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CONFIG1_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CONFIG1_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CONFIG1_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `CURRPRI` reader - Indicates what priority interrupt, or base boost, is being used now. CURRPRI represents the preemption priority, and does not indicate secondary priority."]
17pub struct CURRPRI_R(crate::FieldReader<u8, u8>);
18impl CURRPRI_R {
19 #[inline(always)]
20 pub(crate) fn new(bits: u8) -> Self {
21 CURRPRI_R(crate::FieldReader::new(bits))
22 }
23}
24impl core::ops::Deref for CURRPRI_R {
25 type Target = crate::FieldReader<u8, u8>;
26 #[inline(always)]
27 fn deref(&self) -> &Self::Target {
28 &self.0
29 }
30}
31#[doc = "Branch status\n\nValue on reset: 0"]
32#[derive(Clone, Copy, Debug, PartialEq)]
33#[repr(u8)]
34pub enum BRCHSTAT_A {
35 #[doc = "0: No hint."]
36 NO_HINT = 0,
37 #[doc = "1: Conditional branch backwards in decode"]
38 COND_BACKWARDS_DECODE = 1,
39 #[doc = "2: Conditional branch in decode"]
40 COND_DECODE = 2,
41 #[doc = "3: Conditional branch in execute"]
42 COND_EXECUTE = 3,
43 #[doc = "4: Unconditional branch in decode"]
44 UNCOND_DECODE = 4,
45 #[doc = "5: Unconditional branch in execute"]
46 UNCOND_EXECUTE = 5,
47 #[doc = "8: Conditional branch in decode taken (cycle after IHTRANS)"]
48 COND_DECODE_TAKEN = 8,
49}
50impl From<BRCHSTAT_A> for u8 {
51 #[inline(always)]
52 fn from(variant: BRCHSTAT_A) -> Self {
53 variant as _
54 }
55}
56#[doc = "Field `BRCHSTAT` reader - Branch status"]
57pub struct BRCHSTAT_R(crate::FieldReader<u8, BRCHSTAT_A>);
58impl BRCHSTAT_R {
59 #[inline(always)]
60 pub(crate) fn new(bits: u8) -> Self {
61 BRCHSTAT_R(crate::FieldReader::new(bits))
62 }
63 #[doc = r"Get enumerated values variant"]
64 #[inline(always)]
65 pub fn variant(&self) -> Option<BRCHSTAT_A> {
66 match self.bits {
67 0 => Some(BRCHSTAT_A::NO_HINT),
68 1 => Some(BRCHSTAT_A::COND_BACKWARDS_DECODE),
69 2 => Some(BRCHSTAT_A::COND_DECODE),
70 3 => Some(BRCHSTAT_A::COND_EXECUTE),
71 4 => Some(BRCHSTAT_A::UNCOND_DECODE),
72 5 => Some(BRCHSTAT_A::UNCOND_EXECUTE),
73 8 => Some(BRCHSTAT_A::COND_DECODE_TAKEN),
74 _ => None,
75 }
76 }
77 #[doc = "Checks if the value of the field is `NO_HINT`"]
78 #[inline(always)]
79 pub fn is_no_hint(&self) -> bool {
80 **self == BRCHSTAT_A::NO_HINT
81 }
82 #[doc = "Checks if the value of the field is `COND_BACKWARDS_DECODE`"]
83 #[inline(always)]
84 pub fn is_cond_backwards_decode(&self) -> bool {
85 **self == BRCHSTAT_A::COND_BACKWARDS_DECODE
86 }
87 #[doc = "Checks if the value of the field is `COND_DECODE`"]
88 #[inline(always)]
89 pub fn is_cond_decode(&self) -> bool {
90 **self == BRCHSTAT_A::COND_DECODE
91 }
92 #[doc = "Checks if the value of the field is `COND_EXECUTE`"]
93 #[inline(always)]
94 pub fn is_cond_execute(&self) -> bool {
95 **self == BRCHSTAT_A::COND_EXECUTE
96 }
97 #[doc = "Checks if the value of the field is `UNCOND_DECODE`"]
98 #[inline(always)]
99 pub fn is_uncond_decode(&self) -> bool {
100 **self == BRCHSTAT_A::UNCOND_DECODE
101 }
102 #[doc = "Checks if the value of the field is `UNCOND_EXECUTE`"]
103 #[inline(always)]
104 pub fn is_uncond_execute(&self) -> bool {
105 **self == BRCHSTAT_A::UNCOND_EXECUTE
106 }
107 #[doc = "Checks if the value of the field is `COND_DECODE_TAKEN`"]
108 #[inline(always)]
109 pub fn is_cond_decode_taken(&self) -> bool {
110 **self == BRCHSTAT_A::COND_DECODE_TAKEN
111 }
112}
113impl core::ops::Deref for BRCHSTAT_R {
114 type Target = crate::FieldReader<u8, BRCHSTAT_A>;
115 #[inline(always)]
116 fn deref(&self) -> &Self::Target {
117 &self.0
118 }
119}
120#[doc = "Field `HALTED` reader - In halting mode debug. HALTED remains asserted while the core is in debug."]
121pub struct HALTED_R(crate::FieldReader<bool, bool>);
122impl HALTED_R {
123 #[inline(always)]
124 pub(crate) fn new(bits: bool) -> Self {
125 HALTED_R(crate::FieldReader::new(bits))
126 }
127}
128impl core::ops::Deref for HALTED_R {
129 type Target = crate::FieldReader<bool, bool>;
130 #[inline(always)]
131 fn deref(&self) -> &Self::Target {
132 &self.0
133 }
134}
135#[doc = "Field `MEMATTRS` reader - Memory Attributes. \n \n Bit 0 = Allocate \n \n Bit 1 = Shareable."]
136pub struct MEMATTRS_R(crate::FieldReader<u8, u8>);
137impl MEMATTRS_R {
138 #[inline(always)]
139 pub(crate) fn new(bits: u8) -> Self {
140 MEMATTRS_R(crate::FieldReader::new(bits))
141 }
142}
143impl core::ops::Deref for MEMATTRS_R {
144 type Target = crate::FieldReader<u8, u8>;
145 #[inline(always)]
146 fn deref(&self) -> &Self::Target {
147 &self.0
148 }
149}
150#[doc = "Field `MEMATTRD` reader - Memory attributes. Always 0b01 for this bus. They are always Non-shareable, Non-allocate."]
151pub struct MEMATTRD_R(crate::FieldReader<u8, u8>);
152impl MEMATTRD_R {
153 #[inline(always)]
154 pub(crate) fn new(bits: u8) -> Self {
155 MEMATTRD_R(crate::FieldReader::new(bits))
156 }
157}
158impl core::ops::Deref for MEMATTRD_R {
159 type Target = crate::FieldReader<u8, u8>;
160 #[inline(always)]
161 fn deref(&self) -> &Self::Target {
162 &self.0
163 }
164}
165#[doc = "Field `MEMATTRI` reader - Memory attributes. Always 0b01 for this bus. They are always Non-shareable, Non-allocate."]
166pub struct MEMATTRI_R(crate::FieldReader<u8, u8>);
167impl MEMATTRI_R {
168 #[inline(always)]
169 pub(crate) fn new(bits: u8) -> Self {
170 MEMATTRI_R(crate::FieldReader::new(bits))
171 }
172}
173impl core::ops::Deref for MEMATTRI_R {
174 type Target = crate::FieldReader<u8, u8>;
175 #[inline(always)]
176 fn deref(&self) -> &Self::Target {
177 &self.0
178 }
179}
180#[doc = "Field `EXREQS` reader - Exclusive Request. EXREQS is an address phase control signal that indicates if the access is because of a LDREX or STREX:\n \n 0 = No request \n \n 1 = Exclusive request \n \n You can use EXREQS and EXRESPS to synchronize primitives and semaphores."]
181pub struct EXREQS_R(crate::FieldReader<bool, bool>);
182impl EXREQS_R {
183 #[inline(always)]
184 pub(crate) fn new(bits: bool) -> Self {
185 EXREQS_R(crate::FieldReader::new(bits))
186 }
187}
188impl core::ops::Deref for EXREQS_R {
189 type Target = crate::FieldReader<bool, bool>;
190 #[inline(always)]
191 fn deref(&self) -> &Self::Target {
192 &self.0
193 }
194}
195#[doc = "Field `EXREQD` reader - Exclusive Request. EXREQD is an address phase control signal that indicates if the access is because of a LDREX or STREX: \n \n 0 = No request \n \n 1 = Exclusive request. \n \n You can use EXREQD and EXRESPD to synchronize primitives and semaphores."]
196pub struct EXREQD_R(crate::FieldReader<bool, bool>);
197impl EXREQD_R {
198 #[inline(always)]
199 pub(crate) fn new(bits: bool) -> Self {
200 EXREQD_R(crate::FieldReader::new(bits))
201 }
202}
203impl core::ops::Deref for EXREQD_R {
204 type Target = crate::FieldReader<bool, bool>;
205 #[inline(always)]
206 fn deref(&self) -> &Self::Target {
207 &self.0
208 }
209}
210impl R {
211 #[doc = "Bits 0:7 - Indicates what priority interrupt, or base boost, is being used now. CURRPRI represents the preemption priority, and does not indicate secondary priority."]
212 #[inline(always)]
213 pub fn currpri(&self) -> CURRPRI_R {
214 CURRPRI_R::new((self.bits & 0xff) as u8)
215 }
216 #[doc = "Bits 8:11 - Branch status"]
217 #[inline(always)]
218 pub fn brchstat(&self) -> BRCHSTAT_R {
219 BRCHSTAT_R::new(((self.bits >> 8) & 0x0f) as u8)
220 }
221 #[doc = "Bit 15 - In halting mode debug. HALTED remains asserted while the core is in debug."]
222 #[inline(always)]
223 pub fn halted(&self) -> HALTED_R {
224 HALTED_R::new(((self.bits >> 15) & 0x01) != 0)
225 }
226 #[doc = "Bits 22:23 - Memory Attributes. \n \n Bit 0 = Allocate \n \n Bit 1 = Shareable."]
227 #[inline(always)]
228 pub fn memattrs(&self) -> MEMATTRS_R {
229 MEMATTRS_R::new(((self.bits >> 22) & 0x03) as u8)
230 }
231 #[doc = "Bits 24:25 - Memory attributes. Always 0b01 for this bus. They are always Non-shareable, Non-allocate."]
232 #[inline(always)]
233 pub fn memattrd(&self) -> MEMATTRD_R {
234 MEMATTRD_R::new(((self.bits >> 24) & 0x03) as u8)
235 }
236 #[doc = "Bits 26:27 - Memory attributes. Always 0b01 for this bus. They are always Non-shareable, Non-allocate."]
237 #[inline(always)]
238 pub fn memattri(&self) -> MEMATTRI_R {
239 MEMATTRI_R::new(((self.bits >> 26) & 0x03) as u8)
240 }
241 #[doc = "Bit 30 - Exclusive Request. EXREQS is an address phase control signal that indicates if the access is because of a LDREX or STREX:\n \n 0 = No request \n \n 1 = Exclusive request \n \n You can use EXREQS and EXRESPS to synchronize primitives and semaphores."]
242 #[inline(always)]
243 pub fn exreqs(&self) -> EXREQS_R {
244 EXREQS_R::new(((self.bits >> 30) & 0x01) != 0)
245 }
246 #[doc = "Bit 31 - Exclusive Request. EXREQD is an address phase control signal that indicates if the access is because of a LDREX or STREX: \n \n 0 = No request \n \n 1 = Exclusive request. \n \n You can use EXREQD and EXRESPD to synchronize primitives and semaphores."]
247 #[inline(always)]
248 pub fn exreqd(&self) -> EXREQD_R {
249 EXREQD_R::new(((self.bits >> 31) & 0x01) != 0)
250 }
251}
252#[doc = "Configuration register 1\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 [config1](index.html) module"]
253pub struct CONFIG1_SPEC;
254impl crate::RegisterSpec for CONFIG1_SPEC {
255 type Ux = u32;
256}
257#[doc = "`read()` method returns [config1::R](R) reader structure"]
258impl crate::Readable for CONFIG1_SPEC {
259 type Reader = R;
260}
261#[doc = "`reset()` method sets CONFIG1 to value 0"]
262impl crate::Resettable for CONFIG1_SPEC {
263 #[inline(always)]
264 fn reset_value() -> Self::Ux {
265 0
266 }
267}