xmc4800/gpdma1/
maskerr.rs

1#[doc = "Register `MASKERR` reader"]
2pub type R = crate::R<MASKERR_SPEC>;
3#[doc = "Register `MASKERR` writer"]
4pub type W = crate::W<MASKERR_SPEC>;
5#[doc = "Mask bit for channel 0\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum CH0_A {
8    #[doc = "0: masked"]
9    VALUE1 = 0,
10    #[doc = "1: unmasked"]
11    VALUE2 = 1,
12}
13impl From<CH0_A> for bool {
14    #[inline(always)]
15    fn from(variant: CH0_A) -> Self {
16        variant as u8 != 0
17    }
18}
19#[doc = "Field `CH0` reader - Mask bit for channel 0"]
20pub type CH0_R = crate::BitReader<CH0_A>;
21impl CH0_R {
22    #[doc = "Get enumerated values variant"]
23    #[inline(always)]
24    pub const fn variant(&self) -> CH0_A {
25        match self.bits {
26            false => CH0_A::VALUE1,
27            true => CH0_A::VALUE2,
28        }
29    }
30    #[doc = "masked"]
31    #[inline(always)]
32    pub fn is_value1(&self) -> bool {
33        *self == CH0_A::VALUE1
34    }
35    #[doc = "unmasked"]
36    #[inline(always)]
37    pub fn is_value2(&self) -> bool {
38        *self == CH0_A::VALUE2
39    }
40}
41#[doc = "Field `CH0` writer - Mask bit for channel 0"]
42pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_A>;
43impl<'a, REG> CH0_W<'a, REG>
44where
45    REG: crate::Writable + crate::RegisterSpec,
46{
47    #[doc = "masked"]
48    #[inline(always)]
49    pub fn value1(self) -> &'a mut crate::W<REG> {
50        self.variant(CH0_A::VALUE1)
51    }
52    #[doc = "unmasked"]
53    #[inline(always)]
54    pub fn value2(self) -> &'a mut crate::W<REG> {
55        self.variant(CH0_A::VALUE2)
56    }
57}
58#[doc = "Mask bit for channel 1\n\nValue on reset: 0"]
59#[derive(Clone, Copy, Debug, PartialEq, Eq)]
60pub enum CH1_A {
61    #[doc = "0: masked"]
62    VALUE1 = 0,
63    #[doc = "1: unmasked"]
64    VALUE2 = 1,
65}
66impl From<CH1_A> for bool {
67    #[inline(always)]
68    fn from(variant: CH1_A) -> Self {
69        variant as u8 != 0
70    }
71}
72#[doc = "Field `CH1` reader - Mask bit for channel 1"]
73pub type CH1_R = crate::BitReader<CH1_A>;
74impl CH1_R {
75    #[doc = "Get enumerated values variant"]
76    #[inline(always)]
77    pub const fn variant(&self) -> CH1_A {
78        match self.bits {
79            false => CH1_A::VALUE1,
80            true => CH1_A::VALUE2,
81        }
82    }
83    #[doc = "masked"]
84    #[inline(always)]
85    pub fn is_value1(&self) -> bool {
86        *self == CH1_A::VALUE1
87    }
88    #[doc = "unmasked"]
89    #[inline(always)]
90    pub fn is_value2(&self) -> bool {
91        *self == CH1_A::VALUE2
92    }
93}
94#[doc = "Field `CH1` writer - Mask bit for channel 1"]
95pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_A>;
96impl<'a, REG> CH1_W<'a, REG>
97where
98    REG: crate::Writable + crate::RegisterSpec,
99{
100    #[doc = "masked"]
101    #[inline(always)]
102    pub fn value1(self) -> &'a mut crate::W<REG> {
103        self.variant(CH1_A::VALUE1)
104    }
105    #[doc = "unmasked"]
106    #[inline(always)]
107    pub fn value2(self) -> &'a mut crate::W<REG> {
108        self.variant(CH1_A::VALUE2)
109    }
110}
111#[doc = "Mask bit for channel 2\n\nValue on reset: 0"]
112#[derive(Clone, Copy, Debug, PartialEq, Eq)]
113pub enum CH2_A {
114    #[doc = "0: masked"]
115    VALUE1 = 0,
116    #[doc = "1: unmasked"]
117    VALUE2 = 1,
118}
119impl From<CH2_A> for bool {
120    #[inline(always)]
121    fn from(variant: CH2_A) -> Self {
122        variant as u8 != 0
123    }
124}
125#[doc = "Field `CH2` reader - Mask bit for channel 2"]
126pub type CH2_R = crate::BitReader<CH2_A>;
127impl CH2_R {
128    #[doc = "Get enumerated values variant"]
129    #[inline(always)]
130    pub const fn variant(&self) -> CH2_A {
131        match self.bits {
132            false => CH2_A::VALUE1,
133            true => CH2_A::VALUE2,
134        }
135    }
136    #[doc = "masked"]
137    #[inline(always)]
138    pub fn is_value1(&self) -> bool {
139        *self == CH2_A::VALUE1
140    }
141    #[doc = "unmasked"]
142    #[inline(always)]
143    pub fn is_value2(&self) -> bool {
144        *self == CH2_A::VALUE2
145    }
146}
147#[doc = "Field `CH2` writer - Mask bit for channel 2"]
148pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_A>;
149impl<'a, REG> CH2_W<'a, REG>
150where
151    REG: crate::Writable + crate::RegisterSpec,
152{
153    #[doc = "masked"]
154    #[inline(always)]
155    pub fn value1(self) -> &'a mut crate::W<REG> {
156        self.variant(CH2_A::VALUE1)
157    }
158    #[doc = "unmasked"]
159    #[inline(always)]
160    pub fn value2(self) -> &'a mut crate::W<REG> {
161        self.variant(CH2_A::VALUE2)
162    }
163}
164#[doc = "Mask bit for channel 3\n\nValue on reset: 0"]
165#[derive(Clone, Copy, Debug, PartialEq, Eq)]
166pub enum CH3_A {
167    #[doc = "0: masked"]
168    VALUE1 = 0,
169    #[doc = "1: unmasked"]
170    VALUE2 = 1,
171}
172impl From<CH3_A> for bool {
173    #[inline(always)]
174    fn from(variant: CH3_A) -> Self {
175        variant as u8 != 0
176    }
177}
178#[doc = "Field `CH3` reader - Mask bit for channel 3"]
179pub type CH3_R = crate::BitReader<CH3_A>;
180impl CH3_R {
181    #[doc = "Get enumerated values variant"]
182    #[inline(always)]
183    pub const fn variant(&self) -> CH3_A {
184        match self.bits {
185            false => CH3_A::VALUE1,
186            true => CH3_A::VALUE2,
187        }
188    }
189    #[doc = "masked"]
190    #[inline(always)]
191    pub fn is_value1(&self) -> bool {
192        *self == CH3_A::VALUE1
193    }
194    #[doc = "unmasked"]
195    #[inline(always)]
196    pub fn is_value2(&self) -> bool {
197        *self == CH3_A::VALUE2
198    }
199}
200#[doc = "Field `CH3` writer - Mask bit for channel 3"]
201pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_A>;
202impl<'a, REG> CH3_W<'a, REG>
203where
204    REG: crate::Writable + crate::RegisterSpec,
205{
206    #[doc = "masked"]
207    #[inline(always)]
208    pub fn value1(self) -> &'a mut crate::W<REG> {
209        self.variant(CH3_A::VALUE1)
210    }
211    #[doc = "unmasked"]
212    #[inline(always)]
213    pub fn value2(self) -> &'a mut crate::W<REG> {
214        self.variant(CH3_A::VALUE2)
215    }
216}
217#[doc = "Write enable for mask bit of channel 0\n\nValue on reset: 0"]
218#[derive(Clone, Copy, Debug, PartialEq, Eq)]
219pub enum WE_CH0_A {
220    #[doc = "0: write disabled"]
221    VALUE1 = 0,
222    #[doc = "1: write enabled"]
223    VALUE2 = 1,
224}
225impl From<WE_CH0_A> for bool {
226    #[inline(always)]
227    fn from(variant: WE_CH0_A) -> Self {
228        variant as u8 != 0
229    }
230}
231#[doc = "Field `WE_CH0` writer - Write enable for mask bit of channel 0"]
232pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_A>;
233impl<'a, REG> WE_CH0_W<'a, REG>
234where
235    REG: crate::Writable + crate::RegisterSpec,
236{
237    #[doc = "write disabled"]
238    #[inline(always)]
239    pub fn value1(self) -> &'a mut crate::W<REG> {
240        self.variant(WE_CH0_A::VALUE1)
241    }
242    #[doc = "write enabled"]
243    #[inline(always)]
244    pub fn value2(self) -> &'a mut crate::W<REG> {
245        self.variant(WE_CH0_A::VALUE2)
246    }
247}
248#[doc = "Write enable for mask bit of channel 1\n\nValue on reset: 0"]
249#[derive(Clone, Copy, Debug, PartialEq, Eq)]
250pub enum WE_CH1_A {
251    #[doc = "0: write disabled"]
252    VALUE1 = 0,
253    #[doc = "1: write enabled"]
254    VALUE2 = 1,
255}
256impl From<WE_CH1_A> for bool {
257    #[inline(always)]
258    fn from(variant: WE_CH1_A) -> Self {
259        variant as u8 != 0
260    }
261}
262#[doc = "Field `WE_CH1` writer - Write enable for mask bit of channel 1"]
263pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_A>;
264impl<'a, REG> WE_CH1_W<'a, REG>
265where
266    REG: crate::Writable + crate::RegisterSpec,
267{
268    #[doc = "write disabled"]
269    #[inline(always)]
270    pub fn value1(self) -> &'a mut crate::W<REG> {
271        self.variant(WE_CH1_A::VALUE1)
272    }
273    #[doc = "write enabled"]
274    #[inline(always)]
275    pub fn value2(self) -> &'a mut crate::W<REG> {
276        self.variant(WE_CH1_A::VALUE2)
277    }
278}
279#[doc = "Write enable for mask bit of channel 2\n\nValue on reset: 0"]
280#[derive(Clone, Copy, Debug, PartialEq, Eq)]
281pub enum WE_CH2_A {
282    #[doc = "0: write disabled"]
283    VALUE1 = 0,
284    #[doc = "1: write enabled"]
285    VALUE2 = 1,
286}
287impl From<WE_CH2_A> for bool {
288    #[inline(always)]
289    fn from(variant: WE_CH2_A) -> Self {
290        variant as u8 != 0
291    }
292}
293#[doc = "Field `WE_CH2` writer - Write enable for mask bit of channel 2"]
294pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_A>;
295impl<'a, REG> WE_CH2_W<'a, REG>
296where
297    REG: crate::Writable + crate::RegisterSpec,
298{
299    #[doc = "write disabled"]
300    #[inline(always)]
301    pub fn value1(self) -> &'a mut crate::W<REG> {
302        self.variant(WE_CH2_A::VALUE1)
303    }
304    #[doc = "write enabled"]
305    #[inline(always)]
306    pub fn value2(self) -> &'a mut crate::W<REG> {
307        self.variant(WE_CH2_A::VALUE2)
308    }
309}
310#[doc = "Write enable for mask bit of channel 3\n\nValue on reset: 0"]
311#[derive(Clone, Copy, Debug, PartialEq, Eq)]
312pub enum WE_CH3_A {
313    #[doc = "0: write disabled"]
314    VALUE1 = 0,
315    #[doc = "1: write enabled"]
316    VALUE2 = 1,
317}
318impl From<WE_CH3_A> for bool {
319    #[inline(always)]
320    fn from(variant: WE_CH3_A) -> Self {
321        variant as u8 != 0
322    }
323}
324#[doc = "Field `WE_CH3` writer - Write enable for mask bit of channel 3"]
325pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_A>;
326impl<'a, REG> WE_CH3_W<'a, REG>
327where
328    REG: crate::Writable + crate::RegisterSpec,
329{
330    #[doc = "write disabled"]
331    #[inline(always)]
332    pub fn value1(self) -> &'a mut crate::W<REG> {
333        self.variant(WE_CH3_A::VALUE1)
334    }
335    #[doc = "write enabled"]
336    #[inline(always)]
337    pub fn value2(self) -> &'a mut crate::W<REG> {
338        self.variant(WE_CH3_A::VALUE2)
339    }
340}
341impl R {
342    #[doc = "Bit 0 - Mask bit for channel 0"]
343    #[inline(always)]
344    pub fn ch0(&self) -> CH0_R {
345        CH0_R::new((self.bits & 1) != 0)
346    }
347    #[doc = "Bit 1 - Mask bit for channel 1"]
348    #[inline(always)]
349    pub fn ch1(&self) -> CH1_R {
350        CH1_R::new(((self.bits >> 1) & 1) != 0)
351    }
352    #[doc = "Bit 2 - Mask bit for channel 2"]
353    #[inline(always)]
354    pub fn ch2(&self) -> CH2_R {
355        CH2_R::new(((self.bits >> 2) & 1) != 0)
356    }
357    #[doc = "Bit 3 - Mask bit for channel 3"]
358    #[inline(always)]
359    pub fn ch3(&self) -> CH3_R {
360        CH3_R::new(((self.bits >> 3) & 1) != 0)
361    }
362}
363impl W {
364    #[doc = "Bit 0 - Mask bit for channel 0"]
365    #[inline(always)]
366    pub fn ch0(&mut self) -> CH0_W<MASKERR_SPEC> {
367        CH0_W::new(self, 0)
368    }
369    #[doc = "Bit 1 - Mask bit for channel 1"]
370    #[inline(always)]
371    pub fn ch1(&mut self) -> CH1_W<MASKERR_SPEC> {
372        CH1_W::new(self, 1)
373    }
374    #[doc = "Bit 2 - Mask bit for channel 2"]
375    #[inline(always)]
376    pub fn ch2(&mut self) -> CH2_W<MASKERR_SPEC> {
377        CH2_W::new(self, 2)
378    }
379    #[doc = "Bit 3 - Mask bit for channel 3"]
380    #[inline(always)]
381    pub fn ch3(&mut self) -> CH3_W<MASKERR_SPEC> {
382        CH3_W::new(self, 3)
383    }
384    #[doc = "Bit 8 - Write enable for mask bit of channel 0"]
385    #[inline(always)]
386    pub fn we_ch0(&mut self) -> WE_CH0_W<MASKERR_SPEC> {
387        WE_CH0_W::new(self, 8)
388    }
389    #[doc = "Bit 9 - Write enable for mask bit of channel 1"]
390    #[inline(always)]
391    pub fn we_ch1(&mut self) -> WE_CH1_W<MASKERR_SPEC> {
392        WE_CH1_W::new(self, 9)
393    }
394    #[doc = "Bit 10 - Write enable for mask bit of channel 2"]
395    #[inline(always)]
396    pub fn we_ch2(&mut self) -> WE_CH2_W<MASKERR_SPEC> {
397        WE_CH2_W::new(self, 10)
398    }
399    #[doc = "Bit 11 - Write enable for mask bit of channel 3"]
400    #[inline(always)]
401    pub fn we_ch3(&mut self) -> WE_CH3_W<MASKERR_SPEC> {
402        WE_CH3_W::new(self, 11)
403    }
404}
405#[doc = "Mask for Raw IntErr Status\n\nYou can [`read`](crate::Reg::read) this register and get [`maskerr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`maskerr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
406pub struct MASKERR_SPEC;
407impl crate::RegisterSpec for MASKERR_SPEC {
408    type Ux = u32;
409}
410#[doc = "`read()` method returns [`maskerr::R`](R) reader structure"]
411impl crate::Readable for MASKERR_SPEC {}
412#[doc = "`write(|w| ..)` method takes [`maskerr::W`](W) writer structure"]
413impl crate::Writable for MASKERR_SPEC {
414    type Safety = crate::Unsafe;
415    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
416    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
417}
418#[doc = "`reset()` method sets MASKERR to value 0"]
419impl crate::Resettable for MASKERR_SPEC {
420    const RESET_VALUE: u32 = 0;
421}