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
#[doc = "Register `dmac_sta` reader"]
pub struct R(crate::R<DMAC_STA_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<DMAC_STA_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<DMAC_STA_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<DMAC_STA_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Field `dma_status[0-15]` reader - DMA Channel\\[15:0\\] Status"]
pub type DMA_STATUS_R = crate::BitReader<DMA_STATUS_A>;
#[doc = "DMA Channel\\[15:0\\] Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DMA_STATUS_A {
    #[doc = "0: `0`"]
    IDLE = 0,
    #[doc = "1: `1`"]
    BUSY = 1,
}
impl From<DMA_STATUS_A> for bool {
    #[inline(always)]
    fn from(variant: DMA_STATUS_A) -> Self {
        variant as u8 != 0
    }
}
impl DMA_STATUS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DMA_STATUS_A {
        match self.bits {
            false => DMA_STATUS_A::IDLE,
            true => DMA_STATUS_A::BUSY,
        }
    }
    #[doc = "Checks if the value of the field is `IDLE`"]
    #[inline(always)]
    pub fn is_idle(&self) -> bool {
        *self == DMA_STATUS_A::IDLE
    }
    #[doc = "Checks if the value of the field is `BUSY`"]
    #[inline(always)]
    pub fn is_busy(&self) -> bool {
        *self == DMA_STATUS_A::BUSY
    }
}
#[doc = "Field `mbus_fifo_status` reader - MBUS FIFO Status"]
pub type MBUS_FIFO_STATUS_R = crate::BitReader<MBUS_FIFO_STATUS_A>;
#[doc = "MBUS FIFO Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MBUS_FIFO_STATUS_A {
    #[doc = "0: `0`"]
    EMPTY = 0,
    #[doc = "1: `1`"]
    NOT_EMPTY = 1,
}
impl From<MBUS_FIFO_STATUS_A> for bool {
    #[inline(always)]
    fn from(variant: MBUS_FIFO_STATUS_A) -> Self {
        variant as u8 != 0
    }
}
impl MBUS_FIFO_STATUS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> MBUS_FIFO_STATUS_A {
        match self.bits {
            false => MBUS_FIFO_STATUS_A::EMPTY,
            true => MBUS_FIFO_STATUS_A::NOT_EMPTY,
        }
    }
    #[doc = "Checks if the value of the field is `EMPTY`"]
    #[inline(always)]
    pub fn is_empty(&self) -> bool {
        *self == MBUS_FIFO_STATUS_A::EMPTY
    }
    #[doc = "Checks if the value of the field is `NOT_EMPTY`"]
    #[inline(always)]
    pub fn is_not_empty(&self) -> bool {
        *self == MBUS_FIFO_STATUS_A::NOT_EMPTY
    }
}
impl R {
    #[doc = "DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub unsafe fn dma_status(&self, n: u8) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> n) & 1) != 0)
    }
    #[doc = "Bit 0 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status0(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status1(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status2(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status3(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status4(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status5(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status6(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status7(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status8(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status9(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status10(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status11(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 12 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status12(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status13(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status14(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 15 - DMA Channel\\[15:0\\] Status"]
    #[inline(always)]
    pub fn dma_status15(&self) -> DMA_STATUS_R {
        DMA_STATUS_R::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bit 31 - MBUS FIFO Status"]
    #[inline(always)]
    pub fn mbus_fifo_status(&self) -> MBUS_FIFO_STATUS_R {
        MBUS_FIFO_STATUS_R::new(((self.bits >> 31) & 1) != 0)
    }
}
#[doc = "DMAC Status Register\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 [dmac_sta](index.html) module"]
pub struct DMAC_STA_SPEC;
impl crate::RegisterSpec for DMAC_STA_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [dmac_sta::R](R) reader structure"]
impl crate::Readable for DMAC_STA_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets dmac_sta to value 0"]
impl crate::Resettable for DMAC_STA_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}