atsamd51n/dmac/
active.rs
1#[doc = "Register `ACTIVE` reader"]
2pub type R = crate::R<ActiveSpec>;
3#[doc = "Field `LVLEX0` reader - Level 0 Channel Trigger Request Executing"]
4pub type Lvlex0R = crate::BitReader;
5#[doc = "Field `LVLEX1` reader - Level 1 Channel Trigger Request Executing"]
6pub type Lvlex1R = crate::BitReader;
7#[doc = "Field `LVLEX2` reader - Level 2 Channel Trigger Request Executing"]
8pub type Lvlex2R = crate::BitReader;
9#[doc = "Field `LVLEX3` reader - Level 3 Channel Trigger Request Executing"]
10pub type Lvlex3R = crate::BitReader;
11#[doc = "Field `ID` reader - Active Channel ID"]
12pub type IdR = crate::FieldReader;
13#[doc = "Field `ABUSY` reader - Active Channel Busy"]
14pub type AbusyR = crate::BitReader;
15#[doc = "Field `BTCNT` reader - Active Channel Block Transfer Count"]
16pub type BtcntR = crate::FieldReader<u16>;
17impl R {
18 #[doc = "Bit 0 - Level 0 Channel Trigger Request Executing"]
19 #[inline(always)]
20 pub fn lvlex0(&self) -> Lvlex0R {
21 Lvlex0R::new((self.bits & 1) != 0)
22 }
23 #[doc = "Bit 1 - Level 1 Channel Trigger Request Executing"]
24 #[inline(always)]
25 pub fn lvlex1(&self) -> Lvlex1R {
26 Lvlex1R::new(((self.bits >> 1) & 1) != 0)
27 }
28 #[doc = "Bit 2 - Level 2 Channel Trigger Request Executing"]
29 #[inline(always)]
30 pub fn lvlex2(&self) -> Lvlex2R {
31 Lvlex2R::new(((self.bits >> 2) & 1) != 0)
32 }
33 #[doc = "Bit 3 - Level 3 Channel Trigger Request Executing"]
34 #[inline(always)]
35 pub fn lvlex3(&self) -> Lvlex3R {
36 Lvlex3R::new(((self.bits >> 3) & 1) != 0)
37 }
38 #[doc = "Bits 8:12 - Active Channel ID"]
39 #[inline(always)]
40 pub fn id(&self) -> IdR {
41 IdR::new(((self.bits >> 8) & 0x1f) as u8)
42 }
43 #[doc = "Bit 15 - Active Channel Busy"]
44 #[inline(always)]
45 pub fn abusy(&self) -> AbusyR {
46 AbusyR::new(((self.bits >> 15) & 1) != 0)
47 }
48 #[doc = "Bits 16:31 - Active Channel Block Transfer Count"]
49 #[inline(always)]
50 pub fn btcnt(&self) -> BtcntR {
51 BtcntR::new(((self.bits >> 16) & 0xffff) as u16)
52 }
53}
54#[doc = "Active Channel and Levels\n\nYou can [`read`](crate::Reg::read) this register and get [`active::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct ActiveSpec;
56impl crate::RegisterSpec for ActiveSpec {
57 type Ux = u32;
58}
59#[doc = "`read()` method returns [`active::R`](R) reader structure"]
60impl crate::Readable for ActiveSpec {}
61#[doc = "`reset()` method sets ACTIVE to value 0"]
62impl crate::Resettable for ActiveSpec {
63 const RESET_VALUE: u32 = 0;
64}