mcxa-pac 0.1.1

Peripheral Access Crate for MCXA256 devices
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
#[doc = "Register `CSW` reader"]
pub type R = crate::R<CswSpec>;
#[doc = "Register `CSW` writer"]
pub type W = crate::W<CswSpec>;
#[doc = "Resynchronization Request\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ResynchReq {
    #[doc = "0: No request"]
    NoRequest = 0,
    #[doc = "1: Request for resynchronization"]
    Request = 1,
}
impl From<ResynchReq> for bool {
    #[inline(always)]
    fn from(variant: ResynchReq) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RESYNCH_REQ` reader - Resynchronization Request"]
pub type ResynchReqR = crate::BitReader<ResynchReq>;
impl ResynchReqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> ResynchReq {
        match self.bits {
            false => ResynchReq::NoRequest,
            true => ResynchReq::Request,
        }
    }
    #[doc = "No request"]
    #[inline(always)]
    pub fn is_no_request(&self) -> bool {
        *self == ResynchReq::NoRequest
    }
    #[doc = "Request for resynchronization"]
    #[inline(always)]
    pub fn is_request(&self) -> bool {
        *self == ResynchReq::Request
    }
}
#[doc = "Field `RESYNCH_REQ` writer - Resynchronization Request"]
pub type ResynchReqW<'a, REG> = crate::BitWriter<'a, REG, ResynchReq>;
impl<'a, REG> ResynchReqW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No request"]
    #[inline(always)]
    pub fn no_request(self) -> &'a mut crate::W<REG> {
        self.variant(ResynchReq::NoRequest)
    }
    #[doc = "Request for resynchronization"]
    #[inline(always)]
    pub fn request(self) -> &'a mut crate::W<REG> {
        self.variant(ResynchReq::Request)
    }
}
#[doc = "Request Pending\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ReqPending {
    #[doc = "0: No request pending"]
    NoRequestPending = 0,
    #[doc = "1: Request for resynchronization pending"]
    RequestPending = 1,
}
impl From<ReqPending> for bool {
    #[inline(always)]
    fn from(variant: ReqPending) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `REQ_PENDING` reader - Request Pending"]
pub type ReqPendingR = crate::BitReader<ReqPending>;
impl ReqPendingR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> ReqPending {
        match self.bits {
            false => ReqPending::NoRequestPending,
            true => ReqPending::RequestPending,
        }
    }
    #[doc = "No request pending"]
    #[inline(always)]
    pub fn is_no_request_pending(&self) -> bool {
        *self == ReqPending::NoRequestPending
    }
    #[doc = "Request for resynchronization pending"]
    #[inline(always)]
    pub fn is_request_pending(&self) -> bool {
        *self == ReqPending::RequestPending
    }
}
#[doc = "Field `REQ_PENDING` writer - Request Pending"]
pub type ReqPendingW<'a, REG> = crate::BitWriter<'a, REG, ReqPending>;
impl<'a, REG> ReqPendingW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No request pending"]
    #[inline(always)]
    pub fn no_request_pending(self) -> &'a mut crate::W<REG> {
        self.variant(ReqPending::NoRequestPending)
    }
    #[doc = "Request for resynchronization pending"]
    #[inline(always)]
    pub fn request_pending(self) -> &'a mut crate::W<REG> {
        self.variant(ReqPending::RequestPending)
    }
}
#[doc = "DBGMB Overrun Error\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DbgOrErr {
    #[doc = "0: No overrun"]
    NoOverrunErr = 0,
    #[doc = "1: Overrun occurred"]
    OverrunErr = 1,
}
impl From<DbgOrErr> for bool {
    #[inline(always)]
    fn from(variant: DbgOrErr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DBG_OR_ERR` reader - DBGMB Overrun Error"]
pub type DbgOrErrR = crate::BitReader<DbgOrErr>;
impl DbgOrErrR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> DbgOrErr {
        match self.bits {
            false => DbgOrErr::NoOverrunErr,
            true => DbgOrErr::OverrunErr,
        }
    }
    #[doc = "No overrun"]
    #[inline(always)]
    pub fn is_no_overrun_err(&self) -> bool {
        *self == DbgOrErr::NoOverrunErr
    }
    #[doc = "Overrun occurred"]
    #[inline(always)]
    pub fn is_overrun_err(&self) -> bool {
        *self == DbgOrErr::OverrunErr
    }
}
#[doc = "Field `DBG_OR_ERR` writer - DBGMB Overrun Error"]
pub type DbgOrErrW<'a, REG> = crate::BitWriter<'a, REG, DbgOrErr>;
impl<'a, REG> DbgOrErrW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No overrun"]
    #[inline(always)]
    pub fn no_overrun_err(self) -> &'a mut crate::W<REG> {
        self.variant(DbgOrErr::NoOverrunErr)
    }
    #[doc = "Overrun occurred"]
    #[inline(always)]
    pub fn overrun_err(self) -> &'a mut crate::W<REG> {
        self.variant(DbgOrErr::OverrunErr)
    }
}
#[doc = "AHB Overrun Error\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AhbOrErr {
    #[doc = "0: No overrun"]
    NoAhbOverrunErr = 0,
    #[doc = "1: Overrun occurred"]
    AhbOverrunErr = 1,
}
impl From<AhbOrErr> for bool {
    #[inline(always)]
    fn from(variant: AhbOrErr) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `AHB_OR_ERR` reader - AHB Overrun Error"]
pub type AhbOrErrR = crate::BitReader<AhbOrErr>;
impl AhbOrErrR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> AhbOrErr {
        match self.bits {
            false => AhbOrErr::NoAhbOverrunErr,
            true => AhbOrErr::AhbOverrunErr,
        }
    }
    #[doc = "No overrun"]
    #[inline(always)]
    pub fn is_no_ahb_overrun_err(&self) -> bool {
        *self == AhbOrErr::NoAhbOverrunErr
    }
    #[doc = "Overrun occurred"]
    #[inline(always)]
    pub fn is_ahb_overrun_err(&self) -> bool {
        *self == AhbOrErr::AhbOverrunErr
    }
}
#[doc = "Field `AHB_OR_ERR` writer - AHB Overrun Error"]
pub type AhbOrErrW<'a, REG> = crate::BitWriter<'a, REG, AhbOrErr>;
impl<'a, REG> AhbOrErrW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No overrun"]
    #[inline(always)]
    pub fn no_ahb_overrun_err(self) -> &'a mut crate::W<REG> {
        self.variant(AhbOrErr::NoAhbOverrunErr)
    }
    #[doc = "Overrun occurred"]
    #[inline(always)]
    pub fn ahb_overrun_err(self) -> &'a mut crate::W<REG> {
        self.variant(AhbOrErr::AhbOverrunErr)
    }
}
#[doc = "Soft Reset\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SoftReset {
    #[doc = "0: No effect"]
    NoEff = 0,
    #[doc = "1: Reset"]
    Reset = 1,
}
impl From<SoftReset> for bool {
    #[inline(always)]
    fn from(variant: SoftReset) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SOFT_RESET` reader - Soft Reset"]
pub type SoftResetR = crate::BitReader<SoftReset>;
impl SoftResetR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SoftReset {
        match self.bits {
            false => SoftReset::NoEff,
            true => SoftReset::Reset,
        }
    }
    #[doc = "No effect"]
    #[inline(always)]
    pub fn is_no_eff(&self) -> bool {
        *self == SoftReset::NoEff
    }
    #[doc = "Reset"]
    #[inline(always)]
    pub fn is_reset(&self) -> bool {
        *self == SoftReset::Reset
    }
}
#[doc = "Field `SOFT_RESET` writer - Soft Reset"]
pub type SoftResetW<'a, REG> = crate::BitWriter<'a, REG, SoftReset>;
impl<'a, REG> SoftResetW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect"]
    #[inline(always)]
    pub fn no_eff(self) -> &'a mut crate::W<REG> {
        self.variant(SoftReset::NoEff)
    }
    #[doc = "Reset"]
    #[inline(always)]
    pub fn reset(self) -> &'a mut crate::W<REG> {
        self.variant(SoftReset::Reset)
    }
}
#[doc = "Chip Reset Request\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ChipResetReq {
    #[doc = "0: No effect"]
    NoEff = 0,
    #[doc = "1: Reset"]
    Reset = 1,
}
impl From<ChipResetReq> for bool {
    #[inline(always)]
    fn from(variant: ChipResetReq) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CHIP_RESET_REQ` reader - Chip Reset Request"]
pub type ChipResetReqR = crate::BitReader<ChipResetReq>;
impl ChipResetReqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> ChipResetReq {
        match self.bits {
            false => ChipResetReq::NoEff,
            true => ChipResetReq::Reset,
        }
    }
    #[doc = "No effect"]
    #[inline(always)]
    pub fn is_no_eff(&self) -> bool {
        *self == ChipResetReq::NoEff
    }
    #[doc = "Reset"]
    #[inline(always)]
    pub fn is_reset(&self) -> bool {
        *self == ChipResetReq::Reset
    }
}
#[doc = "Field `CHIP_RESET_REQ` writer - Chip Reset Request"]
pub type ChipResetReqW<'a, REG> = crate::BitWriter<'a, REG, ChipResetReq>;
impl<'a, REG> ChipResetReqW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect"]
    #[inline(always)]
    pub fn no_eff(self) -> &'a mut crate::W<REG> {
        self.variant(ChipResetReq::NoEff)
    }
    #[doc = "Reset"]
    #[inline(always)]
    pub fn reset(self) -> &'a mut crate::W<REG> {
        self.variant(ChipResetReq::Reset)
    }
}
impl R {
    #[doc = "Bit 0 - Resynchronization Request"]
    #[inline(always)]
    pub fn resynch_req(&self) -> ResynchReqR {
        ResynchReqR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Request Pending"]
    #[inline(always)]
    pub fn req_pending(&self) -> ReqPendingR {
        ReqPendingR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - DBGMB Overrun Error"]
    #[inline(always)]
    pub fn dbg_or_err(&self) -> DbgOrErrR {
        DbgOrErrR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - AHB Overrun Error"]
    #[inline(always)]
    pub fn ahb_or_err(&self) -> AhbOrErrR {
        AhbOrErrR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Soft Reset"]
    #[inline(always)]
    pub fn soft_reset(&self) -> SoftResetR {
        SoftResetR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Chip Reset Request"]
    #[inline(always)]
    pub fn chip_reset_req(&self) -> ChipResetReqR {
        ChipResetReqR::new(((self.bits >> 5) & 1) != 0)
    }
}
#[cfg(feature = "debug")]
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("CSW")
            .field("resynch_req", &self.resynch_req())
            .field("req_pending", &self.req_pending())
            .field("dbg_or_err", &self.dbg_or_err())
            .field("ahb_or_err", &self.ahb_or_err())
            .field("soft_reset", &self.soft_reset())
            .field("chip_reset_req", &self.chip_reset_req())
            .finish()
    }
}
impl W {
    #[doc = "Bit 0 - Resynchronization Request"]
    #[inline(always)]
    pub fn resynch_req(&mut self) -> ResynchReqW<'_, CswSpec> {
        ResynchReqW::new(self, 0)
    }
    #[doc = "Bit 1 - Request Pending"]
    #[inline(always)]
    pub fn req_pending(&mut self) -> ReqPendingW<'_, CswSpec> {
        ReqPendingW::new(self, 1)
    }
    #[doc = "Bit 2 - DBGMB Overrun Error"]
    #[inline(always)]
    pub fn dbg_or_err(&mut self) -> DbgOrErrW<'_, CswSpec> {
        DbgOrErrW::new(self, 2)
    }
    #[doc = "Bit 3 - AHB Overrun Error"]
    #[inline(always)]
    pub fn ahb_or_err(&mut self) -> AhbOrErrW<'_, CswSpec> {
        AhbOrErrW::new(self, 3)
    }
    #[doc = "Bit 4 - Soft Reset"]
    #[inline(always)]
    pub fn soft_reset(&mut self) -> SoftResetW<'_, CswSpec> {
        SoftResetW::new(self, 4)
    }
    #[doc = "Bit 5 - Chip Reset Request"]
    #[inline(always)]
    pub fn chip_reset_req(&mut self) -> ChipResetReqW<'_, CswSpec> {
        ChipResetReqW::new(self, 5)
    }
}
#[doc = "Command and Status Word\n\nYou can [`read`](crate::Reg::read) this register and get [`csw::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`csw::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CswSpec;
impl crate::RegisterSpec for CswSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`csw::R`](R) reader structure"]
impl crate::Readable for CswSpec {}
#[doc = "`write(|w| ..)` method takes [`csw::W`](W) writer structure"]
impl crate::Writable for CswSpec {
    type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets CSW to value 0"]
impl crate::Resettable for CswSpec {}