efm32hg309_pac/dma/
if_.rs

1#[doc = "Register `IF` reader"]
2pub struct R(crate::R<IF_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<IF_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<IF_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<IF_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `CH0DONE` reader - DMA Channel 0 Complete Interrupt Flag"]
17pub type CH0DONE_R = crate::BitReader<bool>;
18#[doc = "Field `CH1DONE` reader - DMA Channel 1 Complete Interrupt Flag"]
19pub type CH1DONE_R = crate::BitReader<bool>;
20#[doc = "Field `CH2DONE` reader - DMA Channel 2 Complete Interrupt Flag"]
21pub type CH2DONE_R = crate::BitReader<bool>;
22#[doc = "Field `CH3DONE` reader - DMA Channel 3 Complete Interrupt Flag"]
23pub type CH3DONE_R = crate::BitReader<bool>;
24#[doc = "Field `CH4DONE` reader - DMA Channel 4 Complete Interrupt Flag"]
25pub type CH4DONE_R = crate::BitReader<bool>;
26#[doc = "Field `CH5DONE` reader - DMA Channel 5 Complete Interrupt Flag"]
27pub type CH5DONE_R = crate::BitReader<bool>;
28#[doc = "Field `ERR` reader - DMA Error Interrupt Flag"]
29pub type ERR_R = crate::BitReader<bool>;
30impl R {
31    #[doc = "Bit 0 - DMA Channel 0 Complete Interrupt Flag"]
32    #[inline(always)]
33    pub fn ch0done(&self) -> CH0DONE_R {
34        CH0DONE_R::new((self.bits & 1) != 0)
35    }
36    #[doc = "Bit 1 - DMA Channel 1 Complete Interrupt Flag"]
37    #[inline(always)]
38    pub fn ch1done(&self) -> CH1DONE_R {
39        CH1DONE_R::new(((self.bits >> 1) & 1) != 0)
40    }
41    #[doc = "Bit 2 - DMA Channel 2 Complete Interrupt Flag"]
42    #[inline(always)]
43    pub fn ch2done(&self) -> CH2DONE_R {
44        CH2DONE_R::new(((self.bits >> 2) & 1) != 0)
45    }
46    #[doc = "Bit 3 - DMA Channel 3 Complete Interrupt Flag"]
47    #[inline(always)]
48    pub fn ch3done(&self) -> CH3DONE_R {
49        CH3DONE_R::new(((self.bits >> 3) & 1) != 0)
50    }
51    #[doc = "Bit 4 - DMA Channel 4 Complete Interrupt Flag"]
52    #[inline(always)]
53    pub fn ch4done(&self) -> CH4DONE_R {
54        CH4DONE_R::new(((self.bits >> 4) & 1) != 0)
55    }
56    #[doc = "Bit 5 - DMA Channel 5 Complete Interrupt Flag"]
57    #[inline(always)]
58    pub fn ch5done(&self) -> CH5DONE_R {
59        CH5DONE_R::new(((self.bits >> 5) & 1) != 0)
60    }
61    #[doc = "Bit 31 - DMA Error Interrupt Flag"]
62    #[inline(always)]
63    pub fn err(&self) -> ERR_R {
64        ERR_R::new(((self.bits >> 31) & 1) != 0)
65    }
66}
67#[doc = "Interrupt Flag 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 [if_](index.html) module"]
68pub struct IF_SPEC;
69impl crate::RegisterSpec for IF_SPEC {
70    type Ux = u32;
71}
72#[doc = "`read()` method returns [if_::R](R) reader structure"]
73impl crate::Readable for IF_SPEC {
74    type Reader = R;
75}
76#[doc = "`reset()` method sets IF to value 0"]
77impl crate::Resettable for IF_SPEC {
78    #[inline(always)]
79    fn reset_value() -> Self::Ux {
80        0
81    }
82}