mimxrt595s/usdhc0/
adma_err_status.rs

1#[doc = "Register `ADMA_ERR_STATUS` reader"]
2pub struct R(crate::R<ADMA_ERR_STATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<ADMA_ERR_STATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<ADMA_ERR_STATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<ADMA_ERR_STATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `ADMAES` reader - ADMA error state (when ADMA error is occurred)"]
17pub type ADMAES_R = crate::FieldReader<u8, u8>;
18#[doc = "Field `ADMALME` reader - ADMA length mismatch error"]
19pub type ADMALME_R = crate::BitReader<ADMALME_A>;
20#[doc = "ADMA length mismatch error\n\nValue on reset: 0"]
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22pub enum ADMALME_A {
23    #[doc = "0: No error"]
24    ADMALME_0 = 0,
25    #[doc = "1: Error"]
26    ADMALME_1 = 1,
27}
28impl From<ADMALME_A> for bool {
29    #[inline(always)]
30    fn from(variant: ADMALME_A) -> Self {
31        variant as u8 != 0
32    }
33}
34impl ADMALME_R {
35    #[doc = "Get enumerated values variant"]
36    #[inline(always)]
37    pub fn variant(&self) -> ADMALME_A {
38        match self.bits {
39            false => ADMALME_A::ADMALME_0,
40            true => ADMALME_A::ADMALME_1,
41        }
42    }
43    #[doc = "Checks if the value of the field is `ADMALME_0`"]
44    #[inline(always)]
45    pub fn is_admalme_0(&self) -> bool {
46        *self == ADMALME_A::ADMALME_0
47    }
48    #[doc = "Checks if the value of the field is `ADMALME_1`"]
49    #[inline(always)]
50    pub fn is_admalme_1(&self) -> bool {
51        *self == ADMALME_A::ADMALME_1
52    }
53}
54#[doc = "Field `ADMADCE` reader - ADMA descriptor error"]
55pub type ADMADCE_R = crate::BitReader<ADMADCE_A>;
56#[doc = "ADMA descriptor error\n\nValue on reset: 0"]
57#[derive(Clone, Copy, Debug, PartialEq, Eq)]
58pub enum ADMADCE_A {
59    #[doc = "0: No error"]
60    ADMADCE_0 = 0,
61    #[doc = "1: Error"]
62    ADMADCE_1 = 1,
63}
64impl From<ADMADCE_A> for bool {
65    #[inline(always)]
66    fn from(variant: ADMADCE_A) -> Self {
67        variant as u8 != 0
68    }
69}
70impl ADMADCE_R {
71    #[doc = "Get enumerated values variant"]
72    #[inline(always)]
73    pub fn variant(&self) -> ADMADCE_A {
74        match self.bits {
75            false => ADMADCE_A::ADMADCE_0,
76            true => ADMADCE_A::ADMADCE_1,
77        }
78    }
79    #[doc = "Checks if the value of the field is `ADMADCE_0`"]
80    #[inline(always)]
81    pub fn is_admadce_0(&self) -> bool {
82        *self == ADMADCE_A::ADMADCE_0
83    }
84    #[doc = "Checks if the value of the field is `ADMADCE_1`"]
85    #[inline(always)]
86    pub fn is_admadce_1(&self) -> bool {
87        *self == ADMADCE_A::ADMADCE_1
88    }
89}
90impl R {
91    #[doc = "Bits 0:1 - ADMA error state (when ADMA error is occurred)"]
92    #[inline(always)]
93    pub fn admaes(&self) -> ADMAES_R {
94        ADMAES_R::new((self.bits & 3) as u8)
95    }
96    #[doc = "Bit 2 - ADMA length mismatch error"]
97    #[inline(always)]
98    pub fn admalme(&self) -> ADMALME_R {
99        ADMALME_R::new(((self.bits >> 2) & 1) != 0)
100    }
101    #[doc = "Bit 3 - ADMA descriptor error"]
102    #[inline(always)]
103    pub fn admadce(&self) -> ADMADCE_R {
104        ADMADCE_R::new(((self.bits >> 3) & 1) != 0)
105    }
106}
107#[doc = "ADMA Error Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [adma_err_status](index.html) module"]
108pub struct ADMA_ERR_STATUS_SPEC;
109impl crate::RegisterSpec for ADMA_ERR_STATUS_SPEC {
110    type Ux = u32;
111}
112#[doc = "`read()` method returns [adma_err_status::R](R) reader structure"]
113impl crate::Readable for ADMA_ERR_STATUS_SPEC {
114    type Reader = R;
115}
116#[doc = "`reset()` method sets ADMA_ERR_STATUS to value 0"]
117impl crate::Resettable for ADMA_ERR_STATUS_SPEC {
118    const RESET_VALUE: Self::Ux = 0;
119}