mimxrt595s/debugger_mailbox/
csw.rs1#[doc = "Register `CSW` reader"]
2pub struct R(crate::R<CSW_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CSW_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CSW_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CSW_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CSW` writer"]
17pub struct W(crate::W<CSW_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CSW_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<CSW_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CSW_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `RESYNCH_REQ` reader - Re-synchronization Request"]
38pub type RESYNCH_REQ_R = crate::BitReader<RESYNCH_REQ_A>;
39#[doc = "Re-synchronization Request\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum RESYNCH_REQ_A {
42 #[doc = "0: No Request"]
43 NO_REQUEST = 0,
44 #[doc = "1: Request for re-synchronization"]
45 REQUEST = 1,
46}
47impl From<RESYNCH_REQ_A> for bool {
48 #[inline(always)]
49 fn from(variant: RESYNCH_REQ_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl RESYNCH_REQ_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> RESYNCH_REQ_A {
57 match self.bits {
58 false => RESYNCH_REQ_A::NO_REQUEST,
59 true => RESYNCH_REQ_A::REQUEST,
60 }
61 }
62 #[doc = "Checks if the value of the field is `NO_REQUEST`"]
63 #[inline(always)]
64 pub fn is_no_request(&self) -> bool {
65 *self == RESYNCH_REQ_A::NO_REQUEST
66 }
67 #[doc = "Checks if the value of the field is `REQUEST`"]
68 #[inline(always)]
69 pub fn is_request(&self) -> bool {
70 *self == RESYNCH_REQ_A::REQUEST
71 }
72}
73#[doc = "Field `RESYNCH_REQ` writer - Re-synchronization Request"]
74pub type RESYNCH_REQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSW_SPEC, RESYNCH_REQ_A, O>;
75impl<'a, const O: u8> RESYNCH_REQ_W<'a, O> {
76 #[doc = "No Request"]
77 #[inline(always)]
78 pub fn no_request(self) -> &'a mut W {
79 self.variant(RESYNCH_REQ_A::NO_REQUEST)
80 }
81 #[doc = "Request for re-synchronization"]
82 #[inline(always)]
83 pub fn request(self) -> &'a mut W {
84 self.variant(RESYNCH_REQ_A::REQUEST)
85 }
86}
87#[doc = "Field `REQ_PENDING` reader - Request Pending"]
88pub type REQ_PENDING_R = crate::BitReader<REQ_PENDING_A>;
89#[doc = "Request Pending\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum REQ_PENDING_A {
92 #[doc = "0: No Request Pending"]
93 NO_REQUEST_PENDING = 0,
94 #[doc = "1: Request for Re-synchronization Pending"]
95 REQUEST_PENDING = 1,
96}
97impl From<REQ_PENDING_A> for bool {
98 #[inline(always)]
99 fn from(variant: REQ_PENDING_A) -> Self {
100 variant as u8 != 0
101 }
102}
103impl REQ_PENDING_R {
104 #[doc = "Get enumerated values variant"]
105 #[inline(always)]
106 pub fn variant(&self) -> REQ_PENDING_A {
107 match self.bits {
108 false => REQ_PENDING_A::NO_REQUEST_PENDING,
109 true => REQ_PENDING_A::REQUEST_PENDING,
110 }
111 }
112 #[doc = "Checks if the value of the field is `NO_REQUEST_PENDING`"]
113 #[inline(always)]
114 pub fn is_no_request_pending(&self) -> bool {
115 *self == REQ_PENDING_A::NO_REQUEST_PENDING
116 }
117 #[doc = "Checks if the value of the field is `REQUEST_PENDING`"]
118 #[inline(always)]
119 pub fn is_request_pending(&self) -> bool {
120 *self == REQ_PENDING_A::REQUEST_PENDING
121 }
122}
123#[doc = "Field `REQ_PENDING` writer - Request Pending"]
124pub type REQ_PENDING_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSW_SPEC, REQ_PENDING_A, O>;
125impl<'a, const O: u8> REQ_PENDING_W<'a, O> {
126 #[doc = "No Request Pending"]
127 #[inline(always)]
128 pub fn no_request_pending(self) -> &'a mut W {
129 self.variant(REQ_PENDING_A::NO_REQUEST_PENDING)
130 }
131 #[doc = "Request for Re-synchronization Pending"]
132 #[inline(always)]
133 pub fn request_pending(self) -> &'a mut W {
134 self.variant(REQ_PENDING_A::REQUEST_PENDING)
135 }
136}
137#[doc = "Field `DBG_OR_ERR` reader - Debug Overrun Error"]
138pub type DBG_OR_ERR_R = crate::BitReader<DBG_OR_ERR_A>;
139#[doc = "Debug Overrun Error\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq, Eq)]
141pub enum DBG_OR_ERR_A {
142 #[doc = "0: No Debug Overrun error"]
143 NO_OVERRUN_ERR = 0,
144 #[doc = "1: Debug Overrun Error. A debug overrun occurred."]
145 OVERRUN_ERR = 1,
146}
147impl From<DBG_OR_ERR_A> for bool {
148 #[inline(always)]
149 fn from(variant: DBG_OR_ERR_A) -> Self {
150 variant as u8 != 0
151 }
152}
153impl DBG_OR_ERR_R {
154 #[doc = "Get enumerated values variant"]
155 #[inline(always)]
156 pub fn variant(&self) -> DBG_OR_ERR_A {
157 match self.bits {
158 false => DBG_OR_ERR_A::NO_OVERRUN_ERR,
159 true => DBG_OR_ERR_A::OVERRUN_ERR,
160 }
161 }
162 #[doc = "Checks if the value of the field is `NO_OVERRUN_ERR`"]
163 #[inline(always)]
164 pub fn is_no_overrun_err(&self) -> bool {
165 *self == DBG_OR_ERR_A::NO_OVERRUN_ERR
166 }
167 #[doc = "Checks if the value of the field is `OVERRUN_ERR`"]
168 #[inline(always)]
169 pub fn is_overrun_err(&self) -> bool {
170 *self == DBG_OR_ERR_A::OVERRUN_ERR
171 }
172}
173#[doc = "Field `DBG_OR_ERR` writer - Debug Overrun Error"]
174pub type DBG_OR_ERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSW_SPEC, DBG_OR_ERR_A, O>;
175impl<'a, const O: u8> DBG_OR_ERR_W<'a, O> {
176 #[doc = "No Debug Overrun error"]
177 #[inline(always)]
178 pub fn no_overrun_err(self) -> &'a mut W {
179 self.variant(DBG_OR_ERR_A::NO_OVERRUN_ERR)
180 }
181 #[doc = "Debug Overrun Error. A debug overrun occurred."]
182 #[inline(always)]
183 pub fn overrun_err(self) -> &'a mut W {
184 self.variant(DBG_OR_ERR_A::OVERRUN_ERR)
185 }
186}
187#[doc = "Field `AHB_OR_ERR` reader - AHB Overrun Error"]
188pub type AHB_OR_ERR_R = crate::BitReader<AHB_OR_ERR_A>;
189#[doc = "AHB Overrun Error\n\nValue on reset: 0"]
190#[derive(Clone, Copy, Debug, PartialEq, Eq)]
191pub enum AHB_OR_ERR_A {
192 #[doc = "0: No AHB Overrun Error"]
193 NO_AHB_OVERRUN_ERR = 0,
194 #[doc = "1: AHB Overrun Error. An AHB overrun occurred."]
195 AHB_OVERRUN_ERR = 1,
196}
197impl From<AHB_OR_ERR_A> for bool {
198 #[inline(always)]
199 fn from(variant: AHB_OR_ERR_A) -> Self {
200 variant as u8 != 0
201 }
202}
203impl AHB_OR_ERR_R {
204 #[doc = "Get enumerated values variant"]
205 #[inline(always)]
206 pub fn variant(&self) -> AHB_OR_ERR_A {
207 match self.bits {
208 false => AHB_OR_ERR_A::NO_AHB_OVERRUN_ERR,
209 true => AHB_OR_ERR_A::AHB_OVERRUN_ERR,
210 }
211 }
212 #[doc = "Checks if the value of the field is `NO_AHB_OVERRUN_ERR`"]
213 #[inline(always)]
214 pub fn is_no_ahb_overrun_err(&self) -> bool {
215 *self == AHB_OR_ERR_A::NO_AHB_OVERRUN_ERR
216 }
217 #[doc = "Checks if the value of the field is `AHB_OVERRUN_ERR`"]
218 #[inline(always)]
219 pub fn is_ahb_overrun_err(&self) -> bool {
220 *self == AHB_OR_ERR_A::AHB_OVERRUN_ERR
221 }
222}
223#[doc = "Field `AHB_OR_ERR` writer - AHB Overrun Error"]
224pub type AHB_OR_ERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSW_SPEC, AHB_OR_ERR_A, O>;
225impl<'a, const O: u8> AHB_OR_ERR_W<'a, O> {
226 #[doc = "No AHB Overrun Error"]
227 #[inline(always)]
228 pub fn no_ahb_overrun_err(self) -> &'a mut W {
229 self.variant(AHB_OR_ERR_A::NO_AHB_OVERRUN_ERR)
230 }
231 #[doc = "AHB Overrun Error. An AHB overrun occurred."]
232 #[inline(always)]
233 pub fn ahb_overrun_err(self) -> &'a mut W {
234 self.variant(AHB_OR_ERR_A::AHB_OVERRUN_ERR)
235 }
236}
237#[doc = "Field `SOFT_RESET` reader - Soft Reset"]
238pub type SOFT_RESET_R = crate::BitReader<bool>;
239#[doc = "Field `SOFT_RESET` writer - Soft Reset"]
240pub type SOFT_RESET_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSW_SPEC, bool, O>;
241#[doc = "Field `CHIP_RESET_REQ` reader - Chip Reset Request"]
242pub type CHIP_RESET_REQ_R = crate::BitReader<bool>;
243#[doc = "Field `CHIP_RESET_REQ` writer - Chip Reset Request"]
244pub type CHIP_RESET_REQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSW_SPEC, bool, O>;
245impl R {
246 #[doc = "Bit 0 - Re-synchronization Request"]
247 #[inline(always)]
248 pub fn resynch_req(&self) -> RESYNCH_REQ_R {
249 RESYNCH_REQ_R::new((self.bits & 1) != 0)
250 }
251 #[doc = "Bit 1 - Request Pending"]
252 #[inline(always)]
253 pub fn req_pending(&self) -> REQ_PENDING_R {
254 REQ_PENDING_R::new(((self.bits >> 1) & 1) != 0)
255 }
256 #[doc = "Bit 2 - Debug Overrun Error"]
257 #[inline(always)]
258 pub fn dbg_or_err(&self) -> DBG_OR_ERR_R {
259 DBG_OR_ERR_R::new(((self.bits >> 2) & 1) != 0)
260 }
261 #[doc = "Bit 3 - AHB Overrun Error"]
262 #[inline(always)]
263 pub fn ahb_or_err(&self) -> AHB_OR_ERR_R {
264 AHB_OR_ERR_R::new(((self.bits >> 3) & 1) != 0)
265 }
266 #[doc = "Bit 4 - Soft Reset"]
267 #[inline(always)]
268 pub fn soft_reset(&self) -> SOFT_RESET_R {
269 SOFT_RESET_R::new(((self.bits >> 4) & 1) != 0)
270 }
271 #[doc = "Bit 5 - Chip Reset Request"]
272 #[inline(always)]
273 pub fn chip_reset_req(&self) -> CHIP_RESET_REQ_R {
274 CHIP_RESET_REQ_R::new(((self.bits >> 5) & 1) != 0)
275 }
276}
277impl W {
278 #[doc = "Bit 0 - Re-synchronization Request"]
279 #[inline(always)]
280 #[must_use]
281 pub fn resynch_req(&mut self) -> RESYNCH_REQ_W<0> {
282 RESYNCH_REQ_W::new(self)
283 }
284 #[doc = "Bit 1 - Request Pending"]
285 #[inline(always)]
286 #[must_use]
287 pub fn req_pending(&mut self) -> REQ_PENDING_W<1> {
288 REQ_PENDING_W::new(self)
289 }
290 #[doc = "Bit 2 - Debug Overrun Error"]
291 #[inline(always)]
292 #[must_use]
293 pub fn dbg_or_err(&mut self) -> DBG_OR_ERR_W<2> {
294 DBG_OR_ERR_W::new(self)
295 }
296 #[doc = "Bit 3 - AHB Overrun Error"]
297 #[inline(always)]
298 #[must_use]
299 pub fn ahb_or_err(&mut self) -> AHB_OR_ERR_W<3> {
300 AHB_OR_ERR_W::new(self)
301 }
302 #[doc = "Bit 4 - Soft Reset"]
303 #[inline(always)]
304 #[must_use]
305 pub fn soft_reset(&mut self) -> SOFT_RESET_W<4> {
306 SOFT_RESET_W::new(self)
307 }
308 #[doc = "Bit 5 - Chip Reset Request"]
309 #[inline(always)]
310 #[must_use]
311 pub fn chip_reset_req(&mut self) -> CHIP_RESET_REQ_W<5> {
312 CHIP_RESET_REQ_W::new(self)
313 }
314 #[doc = "Writes raw bits to the register."]
315 #[inline(always)]
316 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
317 self.0.bits(bits);
318 self
319 }
320}
321#[doc = "Command and status word\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csw](index.html) module"]
322pub struct CSW_SPEC;
323impl crate::RegisterSpec for CSW_SPEC {
324 type Ux = u32;
325}
326#[doc = "`read()` method returns [csw::R](R) reader structure"]
327impl crate::Readable for CSW_SPEC {
328 type Reader = R;
329}
330#[doc = "`write(|w| ..)` method takes [csw::W](W) writer structure"]
331impl crate::Writable for CSW_SPEC {
332 type Writer = W;
333 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
334 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
335}
336#[doc = "`reset()` method sets CSW to value 0"]
337impl crate::Resettable for CSW_SPEC {
338 const RESET_VALUE: Self::Ux = 0;
339}