atsamd51g/dmac/
ctrl.rs
1#[doc = "Register `CTRL` reader"]
2pub type R = crate::R<CtrlSpec>;
3#[doc = "Register `CTRL` writer"]
4pub type W = crate::W<CtrlSpec>;
5#[doc = "Field `SWRST` reader - Software Reset"]
6pub type SwrstR = crate::BitReader;
7#[doc = "Field `SWRST` writer - Software Reset"]
8pub type SwrstW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `DMAENABLE` reader - DMA Enable"]
10pub type DmaenableR = crate::BitReader;
11#[doc = "Field `DMAENABLE` writer - DMA Enable"]
12pub type DmaenableW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `LVLEN0` reader - Priority Level 0 Enable"]
14pub type Lvlen0R = crate::BitReader;
15#[doc = "Field `LVLEN0` writer - Priority Level 0 Enable"]
16pub type Lvlen0W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `LVLEN1` reader - Priority Level 1 Enable"]
18pub type Lvlen1R = crate::BitReader;
19#[doc = "Field `LVLEN1` writer - Priority Level 1 Enable"]
20pub type Lvlen1W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `LVLEN2` reader - Priority Level 2 Enable"]
22pub type Lvlen2R = crate::BitReader;
23#[doc = "Field `LVLEN2` writer - Priority Level 2 Enable"]
24pub type Lvlen2W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `LVLEN3` reader - Priority Level 3 Enable"]
26pub type Lvlen3R = crate::BitReader;
27#[doc = "Field `LVLEN3` writer - Priority Level 3 Enable"]
28pub type Lvlen3W<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30 #[doc = "Bit 0 - Software Reset"]
31 #[inline(always)]
32 pub fn swrst(&self) -> SwrstR {
33 SwrstR::new((self.bits & 1) != 0)
34 }
35 #[doc = "Bit 1 - DMA Enable"]
36 #[inline(always)]
37 pub fn dmaenable(&self) -> DmaenableR {
38 DmaenableR::new(((self.bits >> 1) & 1) != 0)
39 }
40 #[doc = "Bit 8 - Priority Level 0 Enable"]
41 #[inline(always)]
42 pub fn lvlen0(&self) -> Lvlen0R {
43 Lvlen0R::new(((self.bits >> 8) & 1) != 0)
44 }
45 #[doc = "Bit 9 - Priority Level 1 Enable"]
46 #[inline(always)]
47 pub fn lvlen1(&self) -> Lvlen1R {
48 Lvlen1R::new(((self.bits >> 9) & 1) != 0)
49 }
50 #[doc = "Bit 10 - Priority Level 2 Enable"]
51 #[inline(always)]
52 pub fn lvlen2(&self) -> Lvlen2R {
53 Lvlen2R::new(((self.bits >> 10) & 1) != 0)
54 }
55 #[doc = "Bit 11 - Priority Level 3 Enable"]
56 #[inline(always)]
57 pub fn lvlen3(&self) -> Lvlen3R {
58 Lvlen3R::new(((self.bits >> 11) & 1) != 0)
59 }
60}
61impl W {
62 #[doc = "Bit 0 - Software Reset"]
63 #[inline(always)]
64 #[must_use]
65 pub fn swrst(&mut self) -> SwrstW<CtrlSpec> {
66 SwrstW::new(self, 0)
67 }
68 #[doc = "Bit 1 - DMA Enable"]
69 #[inline(always)]
70 #[must_use]
71 pub fn dmaenable(&mut self) -> DmaenableW<CtrlSpec> {
72 DmaenableW::new(self, 1)
73 }
74 #[doc = "Bit 8 - Priority Level 0 Enable"]
75 #[inline(always)]
76 #[must_use]
77 pub fn lvlen0(&mut self) -> Lvlen0W<CtrlSpec> {
78 Lvlen0W::new(self, 8)
79 }
80 #[doc = "Bit 9 - Priority Level 1 Enable"]
81 #[inline(always)]
82 #[must_use]
83 pub fn lvlen1(&mut self) -> Lvlen1W<CtrlSpec> {
84 Lvlen1W::new(self, 9)
85 }
86 #[doc = "Bit 10 - Priority Level 2 Enable"]
87 #[inline(always)]
88 #[must_use]
89 pub fn lvlen2(&mut self) -> Lvlen2W<CtrlSpec> {
90 Lvlen2W::new(self, 10)
91 }
92 #[doc = "Bit 11 - Priority Level 3 Enable"]
93 #[inline(always)]
94 #[must_use]
95 pub fn lvlen3(&mut self) -> Lvlen3W<CtrlSpec> {
96 Lvlen3W::new(self, 11)
97 }
98}
99#[doc = "Control\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
100pub struct CtrlSpec;
101impl crate::RegisterSpec for CtrlSpec {
102 type Ux = u16;
103}
104#[doc = "`read()` method returns [`ctrl::R`](R) reader structure"]
105impl crate::Readable for CtrlSpec {}
106#[doc = "`write(|w| ..)` method takes [`ctrl::W`](W) writer structure"]
107impl crate::Writable for CtrlSpec {
108 type Safety = crate::Unsafe;
109 const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
110 const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
111}
112#[doc = "`reset()` method sets CTRL to value 0"]
113impl crate::Resettable for CtrlSpec {
114 const RESET_VALUE: u16 = 0;
115}