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
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
#[doc = "Register `MP_ES` reader"]
pub type R = crate::R<MpEsSpec>;
#[doc = "Destination Bus Error\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dbe {
    #[doc = "0: No destination bus error"]
    NoError = 0,
    #[doc = "1: Last recorded error was a bus error on a destination write"]
    BusError = 1,
}
impl From<Dbe> for bool {
    #[inline(always)]
    fn from(variant: Dbe) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DBE` reader - Destination Bus Error"]
pub type DbeR = crate::BitReader<Dbe>;
impl DbeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dbe {
        match self.bits {
            false => Dbe::NoError,
            true => Dbe::BusError,
        }
    }
    #[doc = "No destination bus error"]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Dbe::NoError
    }
    #[doc = "Last recorded error was a bus error on a destination write"]
    #[inline(always)]
    pub fn is_bus_error(&self) -> bool {
        *self == Dbe::BusError
    }
}
#[doc = "Source Bus Error\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sbe {
    #[doc = "0: No source bus error"]
    NoError = 0,
    #[doc = "1: Last recorded error was a bus error on a source read"]
    BusError = 1,
}
impl From<Sbe> for bool {
    #[inline(always)]
    fn from(variant: Sbe) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SBE` reader - Source Bus Error"]
pub type SbeR = crate::BitReader<Sbe>;
impl SbeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sbe {
        match self.bits {
            false => Sbe::NoError,
            true => Sbe::BusError,
        }
    }
    #[doc = "No source bus error"]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Sbe::NoError
    }
    #[doc = "Last recorded error was a bus error on a source read"]
    #[inline(always)]
    pub fn is_bus_error(&self) -> bool {
        *self == Sbe::BusError
    }
}
#[doc = "Scatter/Gather Configuration Error\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sge {
    #[doc = "0: No scatter/gather configuration error"]
    NoError = 0,
    #[doc = "1: Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field"]
    ConfigurationError = 1,
}
impl From<Sge> for bool {
    #[inline(always)]
    fn from(variant: Sge) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SGE` reader - Scatter/Gather Configuration Error"]
pub type SgeR = crate::BitReader<Sge>;
impl SgeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sge {
        match self.bits {
            false => Sge::NoError,
            true => Sge::ConfigurationError,
        }
    }
    #[doc = "No scatter/gather configuration error"]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Sge::NoError
    }
    #[doc = "Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field"]
    #[inline(always)]
    pub fn is_configuration_error(&self) -> bool {
        *self == Sge::ConfigurationError
    }
}
#[doc = "NBYTES/CITER Configuration Error\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Nce {
    #[doc = "0: No NBYTES/CITER configuration error"]
    NoError = 0,
    #[doc = "1: The last recorded error was NBYTES equal to zero or a CITER not equal to BITER error"]
    ConfigurationError = 1,
}
impl From<Nce> for bool {
    #[inline(always)]
    fn from(variant: Nce) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `NCE` reader - NBYTES/CITER Configuration Error"]
pub type NceR = crate::BitReader<Nce>;
impl NceR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Nce {
        match self.bits {
            false => Nce::NoError,
            true => Nce::ConfigurationError,
        }
    }
    #[doc = "No NBYTES/CITER configuration error"]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Nce::NoError
    }
    #[doc = "The last recorded error was NBYTES equal to zero or a CITER not equal to BITER error"]
    #[inline(always)]
    pub fn is_configuration_error(&self) -> bool {
        *self == Nce::ConfigurationError
    }
}
#[doc = "Destination Offset Error\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Doe {
    #[doc = "0: No destination offset configuration error"]
    NoError = 0,
    #[doc = "1: Last recorded error was a configuration error detected in the TCDn_DOFF field"]
    ConfigurationError = 1,
}
impl From<Doe> for bool {
    #[inline(always)]
    fn from(variant: Doe) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DOE` reader - Destination Offset Error"]
pub type DoeR = crate::BitReader<Doe>;
impl DoeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Doe {
        match self.bits {
            false => Doe::NoError,
            true => Doe::ConfigurationError,
        }
    }
    #[doc = "No destination offset configuration error"]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Doe::NoError
    }
    #[doc = "Last recorded error was a configuration error detected in the TCDn_DOFF field"]
    #[inline(always)]
    pub fn is_configuration_error(&self) -> bool {
        *self == Doe::ConfigurationError
    }
}
#[doc = "Destination Address Error\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dae {
    #[doc = "0: No destination address configuration error"]
    NoError = 0,
    #[doc = "1: Last recorded error was a configuration error detected in the TCDn_DADDR field"]
    ConfigurationError = 1,
}
impl From<Dae> for bool {
    #[inline(always)]
    fn from(variant: Dae) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DAE` reader - Destination Address Error"]
pub type DaeR = crate::BitReader<Dae>;
impl DaeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dae {
        match self.bits {
            false => Dae::NoError,
            true => Dae::ConfigurationError,
        }
    }
    #[doc = "No destination address configuration error"]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Dae::NoError
    }
    #[doc = "Last recorded error was a configuration error detected in the TCDn_DADDR field"]
    #[inline(always)]
    pub fn is_configuration_error(&self) -> bool {
        *self == Dae::ConfigurationError
    }
}
#[doc = "Source Offset Error\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Soe {
    #[doc = "0: No source offset configuration error"]
    NoError = 0,
    #[doc = "1: Last recorded error was a configuration error detected in the TCDn_SOFF field"]
    ConfigurationError = 1,
}
impl From<Soe> for bool {
    #[inline(always)]
    fn from(variant: Soe) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SOE` reader - Source Offset Error"]
pub type SoeR = crate::BitReader<Soe>;
impl SoeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Soe {
        match self.bits {
            false => Soe::NoError,
            true => Soe::ConfigurationError,
        }
    }
    #[doc = "No source offset configuration error"]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Soe::NoError
    }
    #[doc = "Last recorded error was a configuration error detected in the TCDn_SOFF field"]
    #[inline(always)]
    pub fn is_configuration_error(&self) -> bool {
        *self == Soe::ConfigurationError
    }
}
#[doc = "Source Address Error\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sae {
    #[doc = "0: No source address configuration error"]
    NoError = 0,
    #[doc = "1: Last recorded error was a configuration error detected in the TCDn_SADDR field"]
    ConfigurationError = 1,
}
impl From<Sae> for bool {
    #[inline(always)]
    fn from(variant: Sae) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SAE` reader - Source Address Error"]
pub type SaeR = crate::BitReader<Sae>;
impl SaeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sae {
        match self.bits {
            false => Sae::NoError,
            true => Sae::ConfigurationError,
        }
    }
    #[doc = "No source address configuration error"]
    #[inline(always)]
    pub fn is_no_error(&self) -> bool {
        *self == Sae::NoError
    }
    #[doc = "Last recorded error was a configuration error detected in the TCDn_SADDR field"]
    #[inline(always)]
    pub fn is_configuration_error(&self) -> bool {
        *self == Sae::ConfigurationError
    }
}
#[doc = "Transfer Canceled\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ecx {
    #[doc = "0: No canceled transfers"]
    NoCanceledTransfers = 0,
    #[doc = "1: Last recorded entry was a canceled transfer by the error cancel transfer input"]
    CanceledTransfer = 1,
}
impl From<Ecx> for bool {
    #[inline(always)]
    fn from(variant: Ecx) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ECX` reader - Transfer Canceled"]
pub type EcxR = crate::BitReader<Ecx>;
impl EcxR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ecx {
        match self.bits {
            false => Ecx::NoCanceledTransfers,
            true => Ecx::CanceledTransfer,
        }
    }
    #[doc = "No canceled transfers"]
    #[inline(always)]
    pub fn is_no_canceled_transfers(&self) -> bool {
        *self == Ecx::NoCanceledTransfers
    }
    #[doc = "Last recorded entry was a canceled transfer by the error cancel transfer input"]
    #[inline(always)]
    pub fn is_canceled_transfer(&self) -> bool {
        *self == Ecx::CanceledTransfer
    }
}
#[doc = "Field `ERRCHN` reader - Error Channel Number or Canceled Channel Number"]
pub type ErrchnR = crate::FieldReader;
#[doc = "Valid\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Vld {
    #[doc = "0: No CHn_ES\\[ERR\\] fields are set to 1"]
    NoFieldSetOne = 0,
    #[doc = "1: At least one CHn_ES\\[ERR\\] field is set to 1, indicating a valid error exists that software has not cleared"]
    AtleastOneField = 1,
}
impl From<Vld> for bool {
    #[inline(always)]
    fn from(variant: Vld) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `VLD` reader - Valid"]
pub type VldR = crate::BitReader<Vld>;
impl VldR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Vld {
        match self.bits {
            false => Vld::NoFieldSetOne,
            true => Vld::AtleastOneField,
        }
    }
    #[doc = "No CHn_ES\\[ERR\\] fields are set to 1"]
    #[inline(always)]
    pub fn is_no_field_set_one(&self) -> bool {
        *self == Vld::NoFieldSetOne
    }
    #[doc = "At least one CHn_ES\\[ERR\\] field is set to 1, indicating a valid error exists that software has not cleared"]
    #[inline(always)]
    pub fn is_atleast_one_field(&self) -> bool {
        *self == Vld::AtleastOneField
    }
}
impl R {
    #[doc = "Bit 0 - Destination Bus Error"]
    #[inline(always)]
    pub fn dbe(&self) -> DbeR {
        DbeR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Source Bus Error"]
    #[inline(always)]
    pub fn sbe(&self) -> SbeR {
        SbeR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Scatter/Gather Configuration Error"]
    #[inline(always)]
    pub fn sge(&self) -> SgeR {
        SgeR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - NBYTES/CITER Configuration Error"]
    #[inline(always)]
    pub fn nce(&self) -> NceR {
        NceR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Destination Offset Error"]
    #[inline(always)]
    pub fn doe(&self) -> DoeR {
        DoeR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Destination Address Error"]
    #[inline(always)]
    pub fn dae(&self) -> DaeR {
        DaeR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - Source Offset Error"]
    #[inline(always)]
    pub fn soe(&self) -> SoeR {
        SoeR::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Source Address Error"]
    #[inline(always)]
    pub fn sae(&self) -> SaeR {
        SaeR::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - Transfer Canceled"]
    #[inline(always)]
    pub fn ecx(&self) -> EcxR {
        EcxR::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bits 24:26 - Error Channel Number or Canceled Channel Number"]
    #[inline(always)]
    pub fn errchn(&self) -> ErrchnR {
        ErrchnR::new(((self.bits >> 24) & 7) as u8)
    }
    #[doc = "Bit 31 - Valid"]
    #[inline(always)]
    pub fn vld(&self) -> VldR {
        VldR::new(((self.bits >> 31) & 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("MP_ES")
            .field("dbe", &self.dbe())
            .field("sbe", &self.sbe())
            .field("sge", &self.sge())
            .field("nce", &self.nce())
            .field("doe", &self.doe())
            .field("dae", &self.dae())
            .field("soe", &self.soe())
            .field("sae", &self.sae())
            .field("ecx", &self.ecx())
            .field("errchn", &self.errchn())
            .field("vld", &self.vld())
            .finish()
    }
}
#[doc = "Management Page Error Status\n\nYou can [`read`](crate::Reg::read) this register and get [`mp_es::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct MpEsSpec;
impl crate::RegisterSpec for MpEsSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`mp_es::R`](R) reader structure"]
impl crate::Readable for MpEsSpec {}
#[doc = "`reset()` method sets MP_ES to value 0"]
impl crate::Resettable for MpEsSpec {}