atsamd11c/dmac/
chctrlb.rs

1#[doc = "Register `CHCTRLB` reader"]
2pub type R = crate::R<ChctrlbSpec>;
3#[doc = "Register `CHCTRLB` writer"]
4pub type W = crate::W<ChctrlbSpec>;
5#[doc = "Event Input Action\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7#[repr(u8)]
8pub enum Evactselect {
9    #[doc = "0: No action"]
10    Noact = 0,
11    #[doc = "1: Transfer and periodic transfer trigger"]
12    Trig = 1,
13    #[doc = "2: Conditional transfer trigger"]
14    Ctrig = 2,
15    #[doc = "3: Conditional block transfer"]
16    Cblock = 3,
17    #[doc = "4: Channel suspend operation"]
18    Suspend = 4,
19    #[doc = "5: Channel resume operation"]
20    Resume = 5,
21    #[doc = "6: Skip next block suspend action"]
22    Sskip = 6,
23}
24impl From<Evactselect> for u8 {
25    #[inline(always)]
26    fn from(variant: Evactselect) -> Self {
27        variant as _
28    }
29}
30impl crate::FieldSpec for Evactselect {
31    type Ux = u8;
32}
33impl crate::IsEnum for Evactselect {}
34#[doc = "Field `EVACT` reader - Event Input Action"]
35pub type EvactR = crate::FieldReader<Evactselect>;
36impl EvactR {
37    #[doc = "Get enumerated values variant"]
38    #[inline(always)]
39    pub const fn variant(&self) -> Option<Evactselect> {
40        match self.bits {
41            0 => Some(Evactselect::Noact),
42            1 => Some(Evactselect::Trig),
43            2 => Some(Evactselect::Ctrig),
44            3 => Some(Evactselect::Cblock),
45            4 => Some(Evactselect::Suspend),
46            5 => Some(Evactselect::Resume),
47            6 => Some(Evactselect::Sskip),
48            _ => None,
49        }
50    }
51    #[doc = "No action"]
52    #[inline(always)]
53    pub fn is_noact(&self) -> bool {
54        *self == Evactselect::Noact
55    }
56    #[doc = "Transfer and periodic transfer trigger"]
57    #[inline(always)]
58    pub fn is_trig(&self) -> bool {
59        *self == Evactselect::Trig
60    }
61    #[doc = "Conditional transfer trigger"]
62    #[inline(always)]
63    pub fn is_ctrig(&self) -> bool {
64        *self == Evactselect::Ctrig
65    }
66    #[doc = "Conditional block transfer"]
67    #[inline(always)]
68    pub fn is_cblock(&self) -> bool {
69        *self == Evactselect::Cblock
70    }
71    #[doc = "Channel suspend operation"]
72    #[inline(always)]
73    pub fn is_suspend(&self) -> bool {
74        *self == Evactselect::Suspend
75    }
76    #[doc = "Channel resume operation"]
77    #[inline(always)]
78    pub fn is_resume(&self) -> bool {
79        *self == Evactselect::Resume
80    }
81    #[doc = "Skip next block suspend action"]
82    #[inline(always)]
83    pub fn is_sskip(&self) -> bool {
84        *self == Evactselect::Sskip
85    }
86}
87#[doc = "Field `EVACT` writer - Event Input Action"]
88pub type EvactW<'a, REG> = crate::FieldWriter<'a, REG, 3, Evactselect>;
89impl<'a, REG> EvactW<'a, REG>
90where
91    REG: crate::Writable + crate::RegisterSpec,
92    REG::Ux: From<u8>,
93{
94    #[doc = "No action"]
95    #[inline(always)]
96    pub fn noact(self) -> &'a mut crate::W<REG> {
97        self.variant(Evactselect::Noact)
98    }
99    #[doc = "Transfer and periodic transfer trigger"]
100    #[inline(always)]
101    pub fn trig(self) -> &'a mut crate::W<REG> {
102        self.variant(Evactselect::Trig)
103    }
104    #[doc = "Conditional transfer trigger"]
105    #[inline(always)]
106    pub fn ctrig(self) -> &'a mut crate::W<REG> {
107        self.variant(Evactselect::Ctrig)
108    }
109    #[doc = "Conditional block transfer"]
110    #[inline(always)]
111    pub fn cblock(self) -> &'a mut crate::W<REG> {
112        self.variant(Evactselect::Cblock)
113    }
114    #[doc = "Channel suspend operation"]
115    #[inline(always)]
116    pub fn suspend(self) -> &'a mut crate::W<REG> {
117        self.variant(Evactselect::Suspend)
118    }
119    #[doc = "Channel resume operation"]
120    #[inline(always)]
121    pub fn resume(self) -> &'a mut crate::W<REG> {
122        self.variant(Evactselect::Resume)
123    }
124    #[doc = "Skip next block suspend action"]
125    #[inline(always)]
126    pub fn sskip(self) -> &'a mut crate::W<REG> {
127        self.variant(Evactselect::Sskip)
128    }
129}
130#[doc = "Field `EVIE` reader - Channel Event Input Enable"]
131pub type EvieR = crate::BitReader;
132#[doc = "Field `EVIE` writer - Channel Event Input Enable"]
133pub type EvieW<'a, REG> = crate::BitWriter<'a, REG>;
134#[doc = "Field `EVOE` reader - Channel Event Output Enable"]
135pub type EvoeR = crate::BitReader;
136#[doc = "Field `EVOE` writer - Channel Event Output Enable"]
137pub type EvoeW<'a, REG> = crate::BitWriter<'a, REG>;
138#[doc = "Channel Arbitration Level\n\nValue on reset: 0"]
139#[derive(Clone, Copy, Debug, PartialEq, Eq)]
140#[repr(u8)]
141pub enum Lvlselect {
142    #[doc = "0: Channel Priority Level 0"]
143    Lvl0 = 0,
144    #[doc = "1: Channel Priority Level 1"]
145    Lvl1 = 1,
146    #[doc = "2: Channel Priority Level 2"]
147    Lvl2 = 2,
148    #[doc = "3: Channel Priority Level 3"]
149    Lvl3 = 3,
150}
151impl From<Lvlselect> for u8 {
152    #[inline(always)]
153    fn from(variant: Lvlselect) -> Self {
154        variant as _
155    }
156}
157impl crate::FieldSpec for Lvlselect {
158    type Ux = u8;
159}
160impl crate::IsEnum for Lvlselect {}
161#[doc = "Field `LVL` reader - Channel Arbitration Level"]
162pub type LvlR = crate::FieldReader<Lvlselect>;
163impl LvlR {
164    #[doc = "Get enumerated values variant"]
165    #[inline(always)]
166    pub const fn variant(&self) -> Lvlselect {
167        match self.bits {
168            0 => Lvlselect::Lvl0,
169            1 => Lvlselect::Lvl1,
170            2 => Lvlselect::Lvl2,
171            3 => Lvlselect::Lvl3,
172            _ => unreachable!(),
173        }
174    }
175    #[doc = "Channel Priority Level 0"]
176    #[inline(always)]
177    pub fn is_lvl0(&self) -> bool {
178        *self == Lvlselect::Lvl0
179    }
180    #[doc = "Channel Priority Level 1"]
181    #[inline(always)]
182    pub fn is_lvl1(&self) -> bool {
183        *self == Lvlselect::Lvl1
184    }
185    #[doc = "Channel Priority Level 2"]
186    #[inline(always)]
187    pub fn is_lvl2(&self) -> bool {
188        *self == Lvlselect::Lvl2
189    }
190    #[doc = "Channel Priority Level 3"]
191    #[inline(always)]
192    pub fn is_lvl3(&self) -> bool {
193        *self == Lvlselect::Lvl3
194    }
195}
196#[doc = "Field `LVL` writer - Channel Arbitration Level"]
197pub type LvlW<'a, REG> = crate::FieldWriter<'a, REG, 2, Lvlselect, crate::Safe>;
198impl<'a, REG> LvlW<'a, REG>
199where
200    REG: crate::Writable + crate::RegisterSpec,
201    REG::Ux: From<u8>,
202{
203    #[doc = "Channel Priority Level 0"]
204    #[inline(always)]
205    pub fn lvl0(self) -> &'a mut crate::W<REG> {
206        self.variant(Lvlselect::Lvl0)
207    }
208    #[doc = "Channel Priority Level 1"]
209    #[inline(always)]
210    pub fn lvl1(self) -> &'a mut crate::W<REG> {
211        self.variant(Lvlselect::Lvl1)
212    }
213    #[doc = "Channel Priority Level 2"]
214    #[inline(always)]
215    pub fn lvl2(self) -> &'a mut crate::W<REG> {
216        self.variant(Lvlselect::Lvl2)
217    }
218    #[doc = "Channel Priority Level 3"]
219    #[inline(always)]
220    pub fn lvl3(self) -> &'a mut crate::W<REG> {
221        self.variant(Lvlselect::Lvl3)
222    }
223}
224#[doc = "Trigger Source\n\nValue on reset: 0"]
225#[derive(Clone, Copy, Debug, PartialEq, Eq)]
226#[repr(u8)]
227pub enum Trigsrcselect {
228    #[doc = "0: Only software/event triggers"]
229    Disable = 0,
230    #[doc = "1: SERCOM0 RX Trigger"]
231    Sercom0Rx = 1,
232    #[doc = "2: SERCOM0 TX Trigger"]
233    Sercom0Tx = 2,
234    #[doc = "3: SERCOM1 RX Trigger"]
235    Sercom1Rx = 3,
236    #[doc = "4: SERCOM1 TX Trigger"]
237    Sercom1Tx = 4,
238    #[doc = "5: SERCOM2 RX Trigger"]
239    Sercom2Rx = 5,
240    #[doc = "6: SERCOM2 TX Trigger"]
241    Sercom2Tx = 6,
242    #[doc = "7: TCC0 Overflow Trigger"]
243    Tcc0Ovf = 7,
244    #[doc = "8: TCC0 Match/Compare 0 Trigger"]
245    Tcc0Mc0 = 8,
246    #[doc = "9: TCC0 Match/Compare 1 Trigger"]
247    Tcc0Mc1 = 9,
248    #[doc = "10: TCC0 Match/Compare 2 Trigger"]
249    Tcc0Mc2 = 10,
250    #[doc = "11: TCC0 Match/Compare 3 Trigger"]
251    Tcc0Mc3 = 11,
252    #[doc = "12: TC1 Overflow Trigger"]
253    Tc1Ovf = 12,
254    #[doc = "13: TC1 Match/Compare 0 Trigger"]
255    Tc1Mc0 = 13,
256    #[doc = "14: TC1 Match/Compare 1 Trigger"]
257    Tc1Mc1 = 14,
258    #[doc = "15: TC2 Overflow Trigger"]
259    Tc2Ovf = 15,
260    #[doc = "16: TC2 Match/Compare 0 Trigger"]
261    Tc2Mc0 = 16,
262    #[doc = "17: TC2 Match/Compare 1 Trigger"]
263    Tc2Mc1 = 17,
264    #[doc = "18: ADC Result Ready Trigger"]
265    AdcResrdy = 18,
266    #[doc = "19: DAC Empty Trigger"]
267    DacEmpty = 19,
268}
269impl From<Trigsrcselect> for u8 {
270    #[inline(always)]
271    fn from(variant: Trigsrcselect) -> Self {
272        variant as _
273    }
274}
275impl crate::FieldSpec for Trigsrcselect {
276    type Ux = u8;
277}
278impl crate::IsEnum for Trigsrcselect {}
279#[doc = "Field `TRIGSRC` reader - Trigger Source"]
280pub type TrigsrcR = crate::FieldReader<Trigsrcselect>;
281impl TrigsrcR {
282    #[doc = "Get enumerated values variant"]
283    #[inline(always)]
284    pub const fn variant(&self) -> Option<Trigsrcselect> {
285        match self.bits {
286            0 => Some(Trigsrcselect::Disable),
287            1 => Some(Trigsrcselect::Sercom0Rx),
288            2 => Some(Trigsrcselect::Sercom0Tx),
289            3 => Some(Trigsrcselect::Sercom1Rx),
290            4 => Some(Trigsrcselect::Sercom1Tx),
291            5 => Some(Trigsrcselect::Sercom2Rx),
292            6 => Some(Trigsrcselect::Sercom2Tx),
293            7 => Some(Trigsrcselect::Tcc0Ovf),
294            8 => Some(Trigsrcselect::Tcc0Mc0),
295            9 => Some(Trigsrcselect::Tcc0Mc1),
296            10 => Some(Trigsrcselect::Tcc0Mc2),
297            11 => Some(Trigsrcselect::Tcc0Mc3),
298            12 => Some(Trigsrcselect::Tc1Ovf),
299            13 => Some(Trigsrcselect::Tc1Mc0),
300            14 => Some(Trigsrcselect::Tc1Mc1),
301            15 => Some(Trigsrcselect::Tc2Ovf),
302            16 => Some(Trigsrcselect::Tc2Mc0),
303            17 => Some(Trigsrcselect::Tc2Mc1),
304            18 => Some(Trigsrcselect::AdcResrdy),
305            19 => Some(Trigsrcselect::DacEmpty),
306            _ => None,
307        }
308    }
309    #[doc = "Only software/event triggers"]
310    #[inline(always)]
311    pub fn is_disable(&self) -> bool {
312        *self == Trigsrcselect::Disable
313    }
314    #[doc = "SERCOM0 RX Trigger"]
315    #[inline(always)]
316    pub fn is_sercom0_rx(&self) -> bool {
317        *self == Trigsrcselect::Sercom0Rx
318    }
319    #[doc = "SERCOM0 TX Trigger"]
320    #[inline(always)]
321    pub fn is_sercom0_tx(&self) -> bool {
322        *self == Trigsrcselect::Sercom0Tx
323    }
324    #[doc = "SERCOM1 RX Trigger"]
325    #[inline(always)]
326    pub fn is_sercom1_rx(&self) -> bool {
327        *self == Trigsrcselect::Sercom1Rx
328    }
329    #[doc = "SERCOM1 TX Trigger"]
330    #[inline(always)]
331    pub fn is_sercom1_tx(&self) -> bool {
332        *self == Trigsrcselect::Sercom1Tx
333    }
334    #[doc = "SERCOM2 RX Trigger"]
335    #[inline(always)]
336    pub fn is_sercom2_rx(&self) -> bool {
337        *self == Trigsrcselect::Sercom2Rx
338    }
339    #[doc = "SERCOM2 TX Trigger"]
340    #[inline(always)]
341    pub fn is_sercom2_tx(&self) -> bool {
342        *self == Trigsrcselect::Sercom2Tx
343    }
344    #[doc = "TCC0 Overflow Trigger"]
345    #[inline(always)]
346    pub fn is_tcc0_ovf(&self) -> bool {
347        *self == Trigsrcselect::Tcc0Ovf
348    }
349    #[doc = "TCC0 Match/Compare 0 Trigger"]
350    #[inline(always)]
351    pub fn is_tcc0_mc0(&self) -> bool {
352        *self == Trigsrcselect::Tcc0Mc0
353    }
354    #[doc = "TCC0 Match/Compare 1 Trigger"]
355    #[inline(always)]
356    pub fn is_tcc0_mc1(&self) -> bool {
357        *self == Trigsrcselect::Tcc0Mc1
358    }
359    #[doc = "TCC0 Match/Compare 2 Trigger"]
360    #[inline(always)]
361    pub fn is_tcc0_mc2(&self) -> bool {
362        *self == Trigsrcselect::Tcc0Mc2
363    }
364    #[doc = "TCC0 Match/Compare 3 Trigger"]
365    #[inline(always)]
366    pub fn is_tcc0_mc3(&self) -> bool {
367        *self == Trigsrcselect::Tcc0Mc3
368    }
369    #[doc = "TC1 Overflow Trigger"]
370    #[inline(always)]
371    pub fn is_tc1_ovf(&self) -> bool {
372        *self == Trigsrcselect::Tc1Ovf
373    }
374    #[doc = "TC1 Match/Compare 0 Trigger"]
375    #[inline(always)]
376    pub fn is_tc1_mc0(&self) -> bool {
377        *self == Trigsrcselect::Tc1Mc0
378    }
379    #[doc = "TC1 Match/Compare 1 Trigger"]
380    #[inline(always)]
381    pub fn is_tc1_mc1(&self) -> bool {
382        *self == Trigsrcselect::Tc1Mc1
383    }
384    #[doc = "TC2 Overflow Trigger"]
385    #[inline(always)]
386    pub fn is_tc2_ovf(&self) -> bool {
387        *self == Trigsrcselect::Tc2Ovf
388    }
389    #[doc = "TC2 Match/Compare 0 Trigger"]
390    #[inline(always)]
391    pub fn is_tc2_mc0(&self) -> bool {
392        *self == Trigsrcselect::Tc2Mc0
393    }
394    #[doc = "TC2 Match/Compare 1 Trigger"]
395    #[inline(always)]
396    pub fn is_tc2_mc1(&self) -> bool {
397        *self == Trigsrcselect::Tc2Mc1
398    }
399    #[doc = "ADC Result Ready Trigger"]
400    #[inline(always)]
401    pub fn is_adc_resrdy(&self) -> bool {
402        *self == Trigsrcselect::AdcResrdy
403    }
404    #[doc = "DAC Empty Trigger"]
405    #[inline(always)]
406    pub fn is_dac_empty(&self) -> bool {
407        *self == Trigsrcselect::DacEmpty
408    }
409}
410#[doc = "Field `TRIGSRC` writer - Trigger Source"]
411pub type TrigsrcW<'a, REG> = crate::FieldWriter<'a, REG, 5, Trigsrcselect>;
412impl<'a, REG> TrigsrcW<'a, REG>
413where
414    REG: crate::Writable + crate::RegisterSpec,
415    REG::Ux: From<u8>,
416{
417    #[doc = "Only software/event triggers"]
418    #[inline(always)]
419    pub fn disable(self) -> &'a mut crate::W<REG> {
420        self.variant(Trigsrcselect::Disable)
421    }
422    #[doc = "SERCOM0 RX Trigger"]
423    #[inline(always)]
424    pub fn sercom0_rx(self) -> &'a mut crate::W<REG> {
425        self.variant(Trigsrcselect::Sercom0Rx)
426    }
427    #[doc = "SERCOM0 TX Trigger"]
428    #[inline(always)]
429    pub fn sercom0_tx(self) -> &'a mut crate::W<REG> {
430        self.variant(Trigsrcselect::Sercom0Tx)
431    }
432    #[doc = "SERCOM1 RX Trigger"]
433    #[inline(always)]
434    pub fn sercom1_rx(self) -> &'a mut crate::W<REG> {
435        self.variant(Trigsrcselect::Sercom1Rx)
436    }
437    #[doc = "SERCOM1 TX Trigger"]
438    #[inline(always)]
439    pub fn sercom1_tx(self) -> &'a mut crate::W<REG> {
440        self.variant(Trigsrcselect::Sercom1Tx)
441    }
442    #[doc = "SERCOM2 RX Trigger"]
443    #[inline(always)]
444    pub fn sercom2_rx(self) -> &'a mut crate::W<REG> {
445        self.variant(Trigsrcselect::Sercom2Rx)
446    }
447    #[doc = "SERCOM2 TX Trigger"]
448    #[inline(always)]
449    pub fn sercom2_tx(self) -> &'a mut crate::W<REG> {
450        self.variant(Trigsrcselect::Sercom2Tx)
451    }
452    #[doc = "TCC0 Overflow Trigger"]
453    #[inline(always)]
454    pub fn tcc0_ovf(self) -> &'a mut crate::W<REG> {
455        self.variant(Trigsrcselect::Tcc0Ovf)
456    }
457    #[doc = "TCC0 Match/Compare 0 Trigger"]
458    #[inline(always)]
459    pub fn tcc0_mc0(self) -> &'a mut crate::W<REG> {
460        self.variant(Trigsrcselect::Tcc0Mc0)
461    }
462    #[doc = "TCC0 Match/Compare 1 Trigger"]
463    #[inline(always)]
464    pub fn tcc0_mc1(self) -> &'a mut crate::W<REG> {
465        self.variant(Trigsrcselect::Tcc0Mc1)
466    }
467    #[doc = "TCC0 Match/Compare 2 Trigger"]
468    #[inline(always)]
469    pub fn tcc0_mc2(self) -> &'a mut crate::W<REG> {
470        self.variant(Trigsrcselect::Tcc0Mc2)
471    }
472    #[doc = "TCC0 Match/Compare 3 Trigger"]
473    #[inline(always)]
474    pub fn tcc0_mc3(self) -> &'a mut crate::W<REG> {
475        self.variant(Trigsrcselect::Tcc0Mc3)
476    }
477    #[doc = "TC1 Overflow Trigger"]
478    #[inline(always)]
479    pub fn tc1_ovf(self) -> &'a mut crate::W<REG> {
480        self.variant(Trigsrcselect::Tc1Ovf)
481    }
482    #[doc = "TC1 Match/Compare 0 Trigger"]
483    #[inline(always)]
484    pub fn tc1_mc0(self) -> &'a mut crate::W<REG> {
485        self.variant(Trigsrcselect::Tc1Mc0)
486    }
487    #[doc = "TC1 Match/Compare 1 Trigger"]
488    #[inline(always)]
489    pub fn tc1_mc1(self) -> &'a mut crate::W<REG> {
490        self.variant(Trigsrcselect::Tc1Mc1)
491    }
492    #[doc = "TC2 Overflow Trigger"]
493    #[inline(always)]
494    pub fn tc2_ovf(self) -> &'a mut crate::W<REG> {
495        self.variant(Trigsrcselect::Tc2Ovf)
496    }
497    #[doc = "TC2 Match/Compare 0 Trigger"]
498    #[inline(always)]
499    pub fn tc2_mc0(self) -> &'a mut crate::W<REG> {
500        self.variant(Trigsrcselect::Tc2Mc0)
501    }
502    #[doc = "TC2 Match/Compare 1 Trigger"]
503    #[inline(always)]
504    pub fn tc2_mc1(self) -> &'a mut crate::W<REG> {
505        self.variant(Trigsrcselect::Tc2Mc1)
506    }
507    #[doc = "ADC Result Ready Trigger"]
508    #[inline(always)]
509    pub fn adc_resrdy(self) -> &'a mut crate::W<REG> {
510        self.variant(Trigsrcselect::AdcResrdy)
511    }
512    #[doc = "DAC Empty Trigger"]
513    #[inline(always)]
514    pub fn dac_empty(self) -> &'a mut crate::W<REG> {
515        self.variant(Trigsrcselect::DacEmpty)
516    }
517}
518#[doc = "Trigger Action\n\nValue on reset: 0"]
519#[derive(Clone, Copy, Debug, PartialEq, Eq)]
520#[repr(u8)]
521pub enum Trigactselect {
522    #[doc = "0: One trigger required for each block transfer"]
523    Block = 0,
524    #[doc = "2: One trigger required for each beat transfer"]
525    Beat = 2,
526    #[doc = "3: One trigger required for each transaction"]
527    Transaction = 3,
528}
529impl From<Trigactselect> for u8 {
530    #[inline(always)]
531    fn from(variant: Trigactselect) -> Self {
532        variant as _
533    }
534}
535impl crate::FieldSpec for Trigactselect {
536    type Ux = u8;
537}
538impl crate::IsEnum for Trigactselect {}
539#[doc = "Field `TRIGACT` reader - Trigger Action"]
540pub type TrigactR = crate::FieldReader<Trigactselect>;
541impl TrigactR {
542    #[doc = "Get enumerated values variant"]
543    #[inline(always)]
544    pub const fn variant(&self) -> Option<Trigactselect> {
545        match self.bits {
546            0 => Some(Trigactselect::Block),
547            2 => Some(Trigactselect::Beat),
548            3 => Some(Trigactselect::Transaction),
549            _ => None,
550        }
551    }
552    #[doc = "One trigger required for each block transfer"]
553    #[inline(always)]
554    pub fn is_block(&self) -> bool {
555        *self == Trigactselect::Block
556    }
557    #[doc = "One trigger required for each beat transfer"]
558    #[inline(always)]
559    pub fn is_beat(&self) -> bool {
560        *self == Trigactselect::Beat
561    }
562    #[doc = "One trigger required for each transaction"]
563    #[inline(always)]
564    pub fn is_transaction(&self) -> bool {
565        *self == Trigactselect::Transaction
566    }
567}
568#[doc = "Field `TRIGACT` writer - Trigger Action"]
569pub type TrigactW<'a, REG> = crate::FieldWriter<'a, REG, 2, Trigactselect>;
570impl<'a, REG> TrigactW<'a, REG>
571where
572    REG: crate::Writable + crate::RegisterSpec,
573    REG::Ux: From<u8>,
574{
575    #[doc = "One trigger required for each block transfer"]
576    #[inline(always)]
577    pub fn block(self) -> &'a mut crate::W<REG> {
578        self.variant(Trigactselect::Block)
579    }
580    #[doc = "One trigger required for each beat transfer"]
581    #[inline(always)]
582    pub fn beat(self) -> &'a mut crate::W<REG> {
583        self.variant(Trigactselect::Beat)
584    }
585    #[doc = "One trigger required for each transaction"]
586    #[inline(always)]
587    pub fn transaction(self) -> &'a mut crate::W<REG> {
588        self.variant(Trigactselect::Transaction)
589    }
590}
591#[doc = "Software Command\n\nValue on reset: 0"]
592#[derive(Clone, Copy, Debug, PartialEq, Eq)]
593#[repr(u8)]
594pub enum Cmdselect {
595    #[doc = "0: No action"]
596    Noact = 0,
597    #[doc = "1: Channel suspend operation"]
598    Suspend = 1,
599    #[doc = "2: Channel resume operation"]
600    Resume = 2,
601}
602impl From<Cmdselect> for u8 {
603    #[inline(always)]
604    fn from(variant: Cmdselect) -> Self {
605        variant as _
606    }
607}
608impl crate::FieldSpec for Cmdselect {
609    type Ux = u8;
610}
611impl crate::IsEnum for Cmdselect {}
612#[doc = "Field `CMD` reader - Software Command"]
613pub type CmdR = crate::FieldReader<Cmdselect>;
614impl CmdR {
615    #[doc = "Get enumerated values variant"]
616    #[inline(always)]
617    pub const fn variant(&self) -> Option<Cmdselect> {
618        match self.bits {
619            0 => Some(Cmdselect::Noact),
620            1 => Some(Cmdselect::Suspend),
621            2 => Some(Cmdselect::Resume),
622            _ => None,
623        }
624    }
625    #[doc = "No action"]
626    #[inline(always)]
627    pub fn is_noact(&self) -> bool {
628        *self == Cmdselect::Noact
629    }
630    #[doc = "Channel suspend operation"]
631    #[inline(always)]
632    pub fn is_suspend(&self) -> bool {
633        *self == Cmdselect::Suspend
634    }
635    #[doc = "Channel resume operation"]
636    #[inline(always)]
637    pub fn is_resume(&self) -> bool {
638        *self == Cmdselect::Resume
639    }
640}
641#[doc = "Field `CMD` writer - Software Command"]
642pub type CmdW<'a, REG> = crate::FieldWriter<'a, REG, 2, Cmdselect>;
643impl<'a, REG> CmdW<'a, REG>
644where
645    REG: crate::Writable + crate::RegisterSpec,
646    REG::Ux: From<u8>,
647{
648    #[doc = "No action"]
649    #[inline(always)]
650    pub fn noact(self) -> &'a mut crate::W<REG> {
651        self.variant(Cmdselect::Noact)
652    }
653    #[doc = "Channel suspend operation"]
654    #[inline(always)]
655    pub fn suspend(self) -> &'a mut crate::W<REG> {
656        self.variant(Cmdselect::Suspend)
657    }
658    #[doc = "Channel resume operation"]
659    #[inline(always)]
660    pub fn resume(self) -> &'a mut crate::W<REG> {
661        self.variant(Cmdselect::Resume)
662    }
663}
664impl R {
665    #[doc = "Bits 0:2 - Event Input Action"]
666    #[inline(always)]
667    pub fn evact(&self) -> EvactR {
668        EvactR::new((self.bits & 7) as u8)
669    }
670    #[doc = "Bit 3 - Channel Event Input Enable"]
671    #[inline(always)]
672    pub fn evie(&self) -> EvieR {
673        EvieR::new(((self.bits >> 3) & 1) != 0)
674    }
675    #[doc = "Bit 4 - Channel Event Output Enable"]
676    #[inline(always)]
677    pub fn evoe(&self) -> EvoeR {
678        EvoeR::new(((self.bits >> 4) & 1) != 0)
679    }
680    #[doc = "Bits 5:6 - Channel Arbitration Level"]
681    #[inline(always)]
682    pub fn lvl(&self) -> LvlR {
683        LvlR::new(((self.bits >> 5) & 3) as u8)
684    }
685    #[doc = "Bits 8:12 - Trigger Source"]
686    #[inline(always)]
687    pub fn trigsrc(&self) -> TrigsrcR {
688        TrigsrcR::new(((self.bits >> 8) & 0x1f) as u8)
689    }
690    #[doc = "Bits 22:23 - Trigger Action"]
691    #[inline(always)]
692    pub fn trigact(&self) -> TrigactR {
693        TrigactR::new(((self.bits >> 22) & 3) as u8)
694    }
695    #[doc = "Bits 24:25 - Software Command"]
696    #[inline(always)]
697    pub fn cmd(&self) -> CmdR {
698        CmdR::new(((self.bits >> 24) & 3) as u8)
699    }
700}
701impl W {
702    #[doc = "Bits 0:2 - Event Input Action"]
703    #[inline(always)]
704    #[must_use]
705    pub fn evact(&mut self) -> EvactW<ChctrlbSpec> {
706        EvactW::new(self, 0)
707    }
708    #[doc = "Bit 3 - Channel Event Input Enable"]
709    #[inline(always)]
710    #[must_use]
711    pub fn evie(&mut self) -> EvieW<ChctrlbSpec> {
712        EvieW::new(self, 3)
713    }
714    #[doc = "Bit 4 - Channel Event Output Enable"]
715    #[inline(always)]
716    #[must_use]
717    pub fn evoe(&mut self) -> EvoeW<ChctrlbSpec> {
718        EvoeW::new(self, 4)
719    }
720    #[doc = "Bits 5:6 - Channel Arbitration Level"]
721    #[inline(always)]
722    #[must_use]
723    pub fn lvl(&mut self) -> LvlW<ChctrlbSpec> {
724        LvlW::new(self, 5)
725    }
726    #[doc = "Bits 8:12 - Trigger Source"]
727    #[inline(always)]
728    #[must_use]
729    pub fn trigsrc(&mut self) -> TrigsrcW<ChctrlbSpec> {
730        TrigsrcW::new(self, 8)
731    }
732    #[doc = "Bits 22:23 - Trigger Action"]
733    #[inline(always)]
734    #[must_use]
735    pub fn trigact(&mut self) -> TrigactW<ChctrlbSpec> {
736        TrigactW::new(self, 22)
737    }
738    #[doc = "Bits 24:25 - Software Command"]
739    #[inline(always)]
740    #[must_use]
741    pub fn cmd(&mut self) -> CmdW<ChctrlbSpec> {
742        CmdW::new(self, 24)
743    }
744}
745#[doc = "Channel Control B\n\nYou can [`read`](crate::Reg::read) this register and get [`chctrlb::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`chctrlb::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
746pub struct ChctrlbSpec;
747impl crate::RegisterSpec for ChctrlbSpec {
748    type Ux = u32;
749}
750#[doc = "`read()` method returns [`chctrlb::R`](R) reader structure"]
751impl crate::Readable for ChctrlbSpec {}
752#[doc = "`write(|w| ..)` method takes [`chctrlb::W`](W) writer structure"]
753impl crate::Writable for ChctrlbSpec {
754    type Safety = crate::Unsafe;
755    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
756    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
757}
758#[doc = "`reset()` method sets CHCTRLB to value 0"]
759impl crate::Resettable for ChctrlbSpec {
760    const RESET_VALUE: u32 = 0;
761}