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
#[doc = "Register `AESR` reader"]
pub type R = crate::R<AESR_SPEC>;
#[doc = "Field `ERRST` reader - ADMA Error State"]
pub type ERRST_R = crate::FieldReader<ERRSTSELECT_A>;
#[doc = "ADMA Error State\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ERRSTSELECT_A {
    #[doc = "0: ST_STOP (Stop DMA)"]
    STOP = 0,
    #[doc = "1: ST_FDS (Fetch Descriptor)"]
    FDS = 1,
    #[doc = "3: ST_TFR (Transfer Data)"]
    TFR = 3,
}
impl From<ERRSTSELECT_A> for u8 {
    #[inline(always)]
    fn from(variant: ERRSTSELECT_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for ERRSTSELECT_A {
    type Ux = u8;
}
impl ERRST_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<ERRSTSELECT_A> {
        match self.bits {
            0 => Some(ERRSTSELECT_A::STOP),
            1 => Some(ERRSTSELECT_A::FDS),
            3 => Some(ERRSTSELECT_A::TFR),
            _ => None,
        }
    }
    #[doc = "ST_STOP (Stop DMA)"]
    #[inline(always)]
    pub fn is_stop(&self) -> bool {
        *self == ERRSTSELECT_A::STOP
    }
    #[doc = "ST_FDS (Fetch Descriptor)"]
    #[inline(always)]
    pub fn is_fds(&self) -> bool {
        *self == ERRSTSELECT_A::FDS
    }
    #[doc = "ST_TFR (Transfer Data)"]
    #[inline(always)]
    pub fn is_tfr(&self) -> bool {
        *self == ERRSTSELECT_A::TFR
    }
}
#[doc = "Field `LMIS` reader - ADMA Length Mismatch Error"]
pub type LMIS_R = crate::BitReader<LMISSELECT_A>;
#[doc = "ADMA Length Mismatch Error\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LMISSELECT_A {
    #[doc = "0: No Error"]
    NO = 0,
    #[doc = "1: Error"]
    YES = 1,
}
impl From<LMISSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: LMISSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl LMIS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> LMISSELECT_A {
        match self.bits {
            false => LMISSELECT_A::NO,
            true => LMISSELECT_A::YES,
        }
    }
    #[doc = "No Error"]
    #[inline(always)]
    pub fn is_no(&self) -> bool {
        *self == LMISSELECT_A::NO
    }
    #[doc = "Error"]
    #[inline(always)]
    pub fn is_yes(&self) -> bool {
        *self == LMISSELECT_A::YES
    }
}
impl R {
    #[doc = "Bits 0:1 - ADMA Error State"]
    #[inline(always)]
    pub fn errst(&self) -> ERRST_R {
        ERRST_R::new(self.bits & 3)
    }
    #[doc = "Bit 2 - ADMA Length Mismatch Error"]
    #[inline(always)]
    pub fn lmis(&self) -> LMIS_R {
        LMIS_R::new(((self.bits >> 2) & 1) != 0)
    }
}
#[doc = "ADMA Error Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`aesr::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct AESR_SPEC;
impl crate::RegisterSpec for AESR_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [`aesr::R`](R) reader structure"]
impl crate::Readable for AESR_SPEC {}
#[doc = "`reset()` method sets AESR to value 0"]
impl crate::Resettable for AESR_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}