Skip to main content

mcxa_pac/dma0/
mp_es.rs

1#[doc = "Register `MP_ES` reader"]
2pub type R = crate::R<MpEsSpec>;
3#[doc = "Destination Bus Error\n\nValue on reset: 0"]
4#[cfg_attr(feature = "defmt", derive(defmt::Format))]
5#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6pub enum Dbe {
7    #[doc = "0: No destination bus error"]
8    NoError = 0,
9    #[doc = "1: Last recorded error was a bus error on a destination write"]
10    BusError = 1,
11}
12impl From<Dbe> for bool {
13    #[inline(always)]
14    fn from(variant: Dbe) -> Self {
15        variant as u8 != 0
16    }
17}
18#[doc = "Field `DBE` reader - Destination Bus Error"]
19pub type DbeR = crate::BitReader<Dbe>;
20impl DbeR {
21    #[doc = "Get enumerated values variant"]
22    #[inline(always)]
23    pub const fn variant(&self) -> Dbe {
24        match self.bits {
25            false => Dbe::NoError,
26            true => Dbe::BusError,
27        }
28    }
29    #[doc = "No destination bus error"]
30    #[inline(always)]
31    pub fn is_no_error(&self) -> bool {
32        *self == Dbe::NoError
33    }
34    #[doc = "Last recorded error was a bus error on a destination write"]
35    #[inline(always)]
36    pub fn is_bus_error(&self) -> bool {
37        *self == Dbe::BusError
38    }
39}
40#[doc = "Source Bus Error\n\nValue on reset: 0"]
41#[cfg_attr(feature = "defmt", derive(defmt::Format))]
42#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum Sbe {
44    #[doc = "0: No source bus error"]
45    NoError = 0,
46    #[doc = "1: Last recorded error was a bus error on a source read"]
47    BusError = 1,
48}
49impl From<Sbe> for bool {
50    #[inline(always)]
51    fn from(variant: Sbe) -> Self {
52        variant as u8 != 0
53    }
54}
55#[doc = "Field `SBE` reader - Source Bus Error"]
56pub type SbeR = crate::BitReader<Sbe>;
57impl SbeR {
58    #[doc = "Get enumerated values variant"]
59    #[inline(always)]
60    pub const fn variant(&self) -> Sbe {
61        match self.bits {
62            false => Sbe::NoError,
63            true => Sbe::BusError,
64        }
65    }
66    #[doc = "No source bus error"]
67    #[inline(always)]
68    pub fn is_no_error(&self) -> bool {
69        *self == Sbe::NoError
70    }
71    #[doc = "Last recorded error was a bus error on a source read"]
72    #[inline(always)]
73    pub fn is_bus_error(&self) -> bool {
74        *self == Sbe::BusError
75    }
76}
77#[doc = "Scatter/Gather Configuration Error\n\nValue on reset: 0"]
78#[cfg_attr(feature = "defmt", derive(defmt::Format))]
79#[derive(Clone, Copy, Debug, PartialEq, Eq)]
80pub enum Sge {
81    #[doc = "0: No scatter/gather configuration error"]
82    NoError = 0,
83    #[doc = "1: Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field"]
84    ConfigurationError = 1,
85}
86impl From<Sge> for bool {
87    #[inline(always)]
88    fn from(variant: Sge) -> Self {
89        variant as u8 != 0
90    }
91}
92#[doc = "Field `SGE` reader - Scatter/Gather Configuration Error"]
93pub type SgeR = crate::BitReader<Sge>;
94impl SgeR {
95    #[doc = "Get enumerated values variant"]
96    #[inline(always)]
97    pub const fn variant(&self) -> Sge {
98        match self.bits {
99            false => Sge::NoError,
100            true => Sge::ConfigurationError,
101        }
102    }
103    #[doc = "No scatter/gather configuration error"]
104    #[inline(always)]
105    pub fn is_no_error(&self) -> bool {
106        *self == Sge::NoError
107    }
108    #[doc = "Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field"]
109    #[inline(always)]
110    pub fn is_configuration_error(&self) -> bool {
111        *self == Sge::ConfigurationError
112    }
113}
114#[doc = "NBYTES/CITER Configuration Error\n\nValue on reset: 0"]
115#[cfg_attr(feature = "defmt", derive(defmt::Format))]
116#[derive(Clone, Copy, Debug, PartialEq, Eq)]
117pub enum Nce {
118    #[doc = "0: No NBYTES/CITER configuration error"]
119    NoError = 0,
120    #[doc = "1: The last recorded error was NBYTES equal to zero or a CITER not equal to BITER error"]
121    ConfigurationError = 1,
122}
123impl From<Nce> for bool {
124    #[inline(always)]
125    fn from(variant: Nce) -> Self {
126        variant as u8 != 0
127    }
128}
129#[doc = "Field `NCE` reader - NBYTES/CITER Configuration Error"]
130pub type NceR = crate::BitReader<Nce>;
131impl NceR {
132    #[doc = "Get enumerated values variant"]
133    #[inline(always)]
134    pub const fn variant(&self) -> Nce {
135        match self.bits {
136            false => Nce::NoError,
137            true => Nce::ConfigurationError,
138        }
139    }
140    #[doc = "No NBYTES/CITER configuration error"]
141    #[inline(always)]
142    pub fn is_no_error(&self) -> bool {
143        *self == Nce::NoError
144    }
145    #[doc = "The last recorded error was NBYTES equal to zero or a CITER not equal to BITER error"]
146    #[inline(always)]
147    pub fn is_configuration_error(&self) -> bool {
148        *self == Nce::ConfigurationError
149    }
150}
151#[doc = "Destination Offset Error\n\nValue on reset: 0"]
152#[cfg_attr(feature = "defmt", derive(defmt::Format))]
153#[derive(Clone, Copy, Debug, PartialEq, Eq)]
154pub enum Doe {
155    #[doc = "0: No destination offset configuration error"]
156    NoError = 0,
157    #[doc = "1: Last recorded error was a configuration error detected in the TCDn_DOFF field"]
158    ConfigurationError = 1,
159}
160impl From<Doe> for bool {
161    #[inline(always)]
162    fn from(variant: Doe) -> Self {
163        variant as u8 != 0
164    }
165}
166#[doc = "Field `DOE` reader - Destination Offset Error"]
167pub type DoeR = crate::BitReader<Doe>;
168impl DoeR {
169    #[doc = "Get enumerated values variant"]
170    #[inline(always)]
171    pub const fn variant(&self) -> Doe {
172        match self.bits {
173            false => Doe::NoError,
174            true => Doe::ConfigurationError,
175        }
176    }
177    #[doc = "No destination offset configuration error"]
178    #[inline(always)]
179    pub fn is_no_error(&self) -> bool {
180        *self == Doe::NoError
181    }
182    #[doc = "Last recorded error was a configuration error detected in the TCDn_DOFF field"]
183    #[inline(always)]
184    pub fn is_configuration_error(&self) -> bool {
185        *self == Doe::ConfigurationError
186    }
187}
188#[doc = "Destination Address Error\n\nValue on reset: 0"]
189#[cfg_attr(feature = "defmt", derive(defmt::Format))]
190#[derive(Clone, Copy, Debug, PartialEq, Eq)]
191pub enum Dae {
192    #[doc = "0: No destination address configuration error"]
193    NoError = 0,
194    #[doc = "1: Last recorded error was a configuration error detected in the TCDn_DADDR field"]
195    ConfigurationError = 1,
196}
197impl From<Dae> for bool {
198    #[inline(always)]
199    fn from(variant: Dae) -> Self {
200        variant as u8 != 0
201    }
202}
203#[doc = "Field `DAE` reader - Destination Address Error"]
204pub type DaeR = crate::BitReader<Dae>;
205impl DaeR {
206    #[doc = "Get enumerated values variant"]
207    #[inline(always)]
208    pub const fn variant(&self) -> Dae {
209        match self.bits {
210            false => Dae::NoError,
211            true => Dae::ConfigurationError,
212        }
213    }
214    #[doc = "No destination address configuration error"]
215    #[inline(always)]
216    pub fn is_no_error(&self) -> bool {
217        *self == Dae::NoError
218    }
219    #[doc = "Last recorded error was a configuration error detected in the TCDn_DADDR field"]
220    #[inline(always)]
221    pub fn is_configuration_error(&self) -> bool {
222        *self == Dae::ConfigurationError
223    }
224}
225#[doc = "Source Offset Error\n\nValue on reset: 0"]
226#[cfg_attr(feature = "defmt", derive(defmt::Format))]
227#[derive(Clone, Copy, Debug, PartialEq, Eq)]
228pub enum Soe {
229    #[doc = "0: No source offset configuration error"]
230    NoError = 0,
231    #[doc = "1: Last recorded error was a configuration error detected in the TCDn_SOFF field"]
232    ConfigurationError = 1,
233}
234impl From<Soe> for bool {
235    #[inline(always)]
236    fn from(variant: Soe) -> Self {
237        variant as u8 != 0
238    }
239}
240#[doc = "Field `SOE` reader - Source Offset Error"]
241pub type SoeR = crate::BitReader<Soe>;
242impl SoeR {
243    #[doc = "Get enumerated values variant"]
244    #[inline(always)]
245    pub const fn variant(&self) -> Soe {
246        match self.bits {
247            false => Soe::NoError,
248            true => Soe::ConfigurationError,
249        }
250    }
251    #[doc = "No source offset configuration error"]
252    #[inline(always)]
253    pub fn is_no_error(&self) -> bool {
254        *self == Soe::NoError
255    }
256    #[doc = "Last recorded error was a configuration error detected in the TCDn_SOFF field"]
257    #[inline(always)]
258    pub fn is_configuration_error(&self) -> bool {
259        *self == Soe::ConfigurationError
260    }
261}
262#[doc = "Source Address Error\n\nValue on reset: 0"]
263#[cfg_attr(feature = "defmt", derive(defmt::Format))]
264#[derive(Clone, Copy, Debug, PartialEq, Eq)]
265pub enum Sae {
266    #[doc = "0: No source address configuration error"]
267    NoError = 0,
268    #[doc = "1: Last recorded error was a configuration error detected in the TCDn_SADDR field"]
269    ConfigurationError = 1,
270}
271impl From<Sae> for bool {
272    #[inline(always)]
273    fn from(variant: Sae) -> Self {
274        variant as u8 != 0
275    }
276}
277#[doc = "Field `SAE` reader - Source Address Error"]
278pub type SaeR = crate::BitReader<Sae>;
279impl SaeR {
280    #[doc = "Get enumerated values variant"]
281    #[inline(always)]
282    pub const fn variant(&self) -> Sae {
283        match self.bits {
284            false => Sae::NoError,
285            true => Sae::ConfigurationError,
286        }
287    }
288    #[doc = "No source address configuration error"]
289    #[inline(always)]
290    pub fn is_no_error(&self) -> bool {
291        *self == Sae::NoError
292    }
293    #[doc = "Last recorded error was a configuration error detected in the TCDn_SADDR field"]
294    #[inline(always)]
295    pub fn is_configuration_error(&self) -> bool {
296        *self == Sae::ConfigurationError
297    }
298}
299#[doc = "Transfer Canceled\n\nValue on reset: 0"]
300#[cfg_attr(feature = "defmt", derive(defmt::Format))]
301#[derive(Clone, Copy, Debug, PartialEq, Eq)]
302pub enum Ecx {
303    #[doc = "0: No canceled transfers"]
304    NoCanceledTransfers = 0,
305    #[doc = "1: Last recorded entry was a canceled transfer by the error cancel transfer input"]
306    CanceledTransfer = 1,
307}
308impl From<Ecx> for bool {
309    #[inline(always)]
310    fn from(variant: Ecx) -> Self {
311        variant as u8 != 0
312    }
313}
314#[doc = "Field `ECX` reader - Transfer Canceled"]
315pub type EcxR = crate::BitReader<Ecx>;
316impl EcxR {
317    #[doc = "Get enumerated values variant"]
318    #[inline(always)]
319    pub const fn variant(&self) -> Ecx {
320        match self.bits {
321            false => Ecx::NoCanceledTransfers,
322            true => Ecx::CanceledTransfer,
323        }
324    }
325    #[doc = "No canceled transfers"]
326    #[inline(always)]
327    pub fn is_no_canceled_transfers(&self) -> bool {
328        *self == Ecx::NoCanceledTransfers
329    }
330    #[doc = "Last recorded entry was a canceled transfer by the error cancel transfer input"]
331    #[inline(always)]
332    pub fn is_canceled_transfer(&self) -> bool {
333        *self == Ecx::CanceledTransfer
334    }
335}
336#[doc = "Field `ERRCHN` reader - Error Channel Number or Canceled Channel Number"]
337pub type ErrchnR = crate::FieldReader;
338#[doc = "Valid\n\nValue on reset: 0"]
339#[cfg_attr(feature = "defmt", derive(defmt::Format))]
340#[derive(Clone, Copy, Debug, PartialEq, Eq)]
341pub enum Vld {
342    #[doc = "0: No CHn_ES\\[ERR\\] fields are set to 1"]
343    NoFieldSetOne = 0,
344    #[doc = "1: At least one CHn_ES\\[ERR\\] field is set to 1, indicating a valid error exists that software has not cleared"]
345    AtleastOneField = 1,
346}
347impl From<Vld> for bool {
348    #[inline(always)]
349    fn from(variant: Vld) -> Self {
350        variant as u8 != 0
351    }
352}
353#[doc = "Field `VLD` reader - Valid"]
354pub type VldR = crate::BitReader<Vld>;
355impl VldR {
356    #[doc = "Get enumerated values variant"]
357    #[inline(always)]
358    pub const fn variant(&self) -> Vld {
359        match self.bits {
360            false => Vld::NoFieldSetOne,
361            true => Vld::AtleastOneField,
362        }
363    }
364    #[doc = "No CHn_ES\\[ERR\\] fields are set to 1"]
365    #[inline(always)]
366    pub fn is_no_field_set_one(&self) -> bool {
367        *self == Vld::NoFieldSetOne
368    }
369    #[doc = "At least one CHn_ES\\[ERR\\] field is set to 1, indicating a valid error exists that software has not cleared"]
370    #[inline(always)]
371    pub fn is_atleast_one_field(&self) -> bool {
372        *self == Vld::AtleastOneField
373    }
374}
375impl R {
376    #[doc = "Bit 0 - Destination Bus Error"]
377    #[inline(always)]
378    pub fn dbe(&self) -> DbeR {
379        DbeR::new((self.bits & 1) != 0)
380    }
381    #[doc = "Bit 1 - Source Bus Error"]
382    #[inline(always)]
383    pub fn sbe(&self) -> SbeR {
384        SbeR::new(((self.bits >> 1) & 1) != 0)
385    }
386    #[doc = "Bit 2 - Scatter/Gather Configuration Error"]
387    #[inline(always)]
388    pub fn sge(&self) -> SgeR {
389        SgeR::new(((self.bits >> 2) & 1) != 0)
390    }
391    #[doc = "Bit 3 - NBYTES/CITER Configuration Error"]
392    #[inline(always)]
393    pub fn nce(&self) -> NceR {
394        NceR::new(((self.bits >> 3) & 1) != 0)
395    }
396    #[doc = "Bit 4 - Destination Offset Error"]
397    #[inline(always)]
398    pub fn doe(&self) -> DoeR {
399        DoeR::new(((self.bits >> 4) & 1) != 0)
400    }
401    #[doc = "Bit 5 - Destination Address Error"]
402    #[inline(always)]
403    pub fn dae(&self) -> DaeR {
404        DaeR::new(((self.bits >> 5) & 1) != 0)
405    }
406    #[doc = "Bit 6 - Source Offset Error"]
407    #[inline(always)]
408    pub fn soe(&self) -> SoeR {
409        SoeR::new(((self.bits >> 6) & 1) != 0)
410    }
411    #[doc = "Bit 7 - Source Address Error"]
412    #[inline(always)]
413    pub fn sae(&self) -> SaeR {
414        SaeR::new(((self.bits >> 7) & 1) != 0)
415    }
416    #[doc = "Bit 8 - Transfer Canceled"]
417    #[inline(always)]
418    pub fn ecx(&self) -> EcxR {
419        EcxR::new(((self.bits >> 8) & 1) != 0)
420    }
421    #[doc = "Bits 24:26 - Error Channel Number or Canceled Channel Number"]
422    #[inline(always)]
423    pub fn errchn(&self) -> ErrchnR {
424        ErrchnR::new(((self.bits >> 24) & 7) as u8)
425    }
426    #[doc = "Bit 31 - Valid"]
427    #[inline(always)]
428    pub fn vld(&self) -> VldR {
429        VldR::new(((self.bits >> 31) & 1) != 0)
430    }
431}
432#[cfg(feature = "debug")]
433impl core::fmt::Debug for R {
434    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
435        f.debug_struct("MP_ES")
436            .field("dbe", &self.dbe())
437            .field("sbe", &self.sbe())
438            .field("sge", &self.sge())
439            .field("nce", &self.nce())
440            .field("doe", &self.doe())
441            .field("dae", &self.dae())
442            .field("soe", &self.soe())
443            .field("sae", &self.sae())
444            .field("ecx", &self.ecx())
445            .field("errchn", &self.errchn())
446            .field("vld", &self.vld())
447            .finish()
448    }
449}
450#[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)."]
451pub struct MpEsSpec;
452impl crate::RegisterSpec for MpEsSpec {
453    type Ux = u32;
454}
455#[doc = "`read()` method returns [`mp_es::R`](R) reader structure"]
456impl crate::Readable for MpEsSpec {}
457#[doc = "`reset()` method sets MP_ES to value 0"]
458impl crate::Resettable for MpEsSpec {}