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