atsaml21e18b/dmac/
ctrl.rs1#[doc = "Register `CTRL` reader"]
2pub struct R(crate::R<CTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CTRL` writer"]
17pub struct W(crate::W<CTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CTRL_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<CTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `SWRST` reader - Software Reset"]
38pub type SWRST_R = crate::BitReader<bool>;
39#[doc = "Field `SWRST` writer - Software Reset"]
40pub type SWRST_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRL_SPEC, bool, O>;
41#[doc = "Field `DMAENABLE` reader - DMA Enable"]
42pub type DMAENABLE_R = crate::BitReader<bool>;
43#[doc = "Field `DMAENABLE` writer - DMA Enable"]
44pub type DMAENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRL_SPEC, bool, O>;
45#[doc = "Field `CRCENABLE` reader - CRC Enable"]
46pub type CRCENABLE_R = crate::BitReader<bool>;
47#[doc = "Field `CRCENABLE` writer - CRC Enable"]
48pub type CRCENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRL_SPEC, bool, O>;
49#[doc = "Field `LVLEN0` reader - Priority Level 0 Enable"]
50pub type LVLEN0_R = crate::BitReader<bool>;
51#[doc = "Field `LVLEN0` writer - Priority Level 0 Enable"]
52pub type LVLEN0_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRL_SPEC, bool, O>;
53#[doc = "Field `LVLEN1` reader - Priority Level 1 Enable"]
54pub type LVLEN1_R = crate::BitReader<bool>;
55#[doc = "Field `LVLEN1` writer - Priority Level 1 Enable"]
56pub type LVLEN1_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRL_SPEC, bool, O>;
57#[doc = "Field `LVLEN2` reader - Priority Level 2 Enable"]
58pub type LVLEN2_R = crate::BitReader<bool>;
59#[doc = "Field `LVLEN2` writer - Priority Level 2 Enable"]
60pub type LVLEN2_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRL_SPEC, bool, O>;
61#[doc = "Field `LVLEN3` reader - Priority Level 3 Enable"]
62pub type LVLEN3_R = crate::BitReader<bool>;
63#[doc = "Field `LVLEN3` writer - Priority Level 3 Enable"]
64pub type LVLEN3_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRL_SPEC, bool, O>;
65impl R {
66 #[doc = "Bit 0 - Software Reset"]
67 #[inline(always)]
68 pub fn swrst(&self) -> SWRST_R {
69 SWRST_R::new((self.bits & 1) != 0)
70 }
71 #[doc = "Bit 1 - DMA Enable"]
72 #[inline(always)]
73 pub fn dmaenable(&self) -> DMAENABLE_R {
74 DMAENABLE_R::new(((self.bits >> 1) & 1) != 0)
75 }
76 #[doc = "Bit 2 - CRC Enable"]
77 #[inline(always)]
78 pub fn crcenable(&self) -> CRCENABLE_R {
79 CRCENABLE_R::new(((self.bits >> 2) & 1) != 0)
80 }
81 #[doc = "Bit 8 - Priority Level 0 Enable"]
82 #[inline(always)]
83 pub fn lvlen0(&self) -> LVLEN0_R {
84 LVLEN0_R::new(((self.bits >> 8) & 1) != 0)
85 }
86 #[doc = "Bit 9 - Priority Level 1 Enable"]
87 #[inline(always)]
88 pub fn lvlen1(&self) -> LVLEN1_R {
89 LVLEN1_R::new(((self.bits >> 9) & 1) != 0)
90 }
91 #[doc = "Bit 10 - Priority Level 2 Enable"]
92 #[inline(always)]
93 pub fn lvlen2(&self) -> LVLEN2_R {
94 LVLEN2_R::new(((self.bits >> 10) & 1) != 0)
95 }
96 #[doc = "Bit 11 - Priority Level 3 Enable"]
97 #[inline(always)]
98 pub fn lvlen3(&self) -> LVLEN3_R {
99 LVLEN3_R::new(((self.bits >> 11) & 1) != 0)
100 }
101}
102impl W {
103 #[doc = "Bit 0 - Software Reset"]
104 #[inline(always)]
105 #[must_use]
106 pub fn swrst(&mut self) -> SWRST_W<0> {
107 SWRST_W::new(self)
108 }
109 #[doc = "Bit 1 - DMA Enable"]
110 #[inline(always)]
111 #[must_use]
112 pub fn dmaenable(&mut self) -> DMAENABLE_W<1> {
113 DMAENABLE_W::new(self)
114 }
115 #[doc = "Bit 2 - CRC Enable"]
116 #[inline(always)]
117 #[must_use]
118 pub fn crcenable(&mut self) -> CRCENABLE_W<2> {
119 CRCENABLE_W::new(self)
120 }
121 #[doc = "Bit 8 - Priority Level 0 Enable"]
122 #[inline(always)]
123 #[must_use]
124 pub fn lvlen0(&mut self) -> LVLEN0_W<8> {
125 LVLEN0_W::new(self)
126 }
127 #[doc = "Bit 9 - Priority Level 1 Enable"]
128 #[inline(always)]
129 #[must_use]
130 pub fn lvlen1(&mut self) -> LVLEN1_W<9> {
131 LVLEN1_W::new(self)
132 }
133 #[doc = "Bit 10 - Priority Level 2 Enable"]
134 #[inline(always)]
135 #[must_use]
136 pub fn lvlen2(&mut self) -> LVLEN2_W<10> {
137 LVLEN2_W::new(self)
138 }
139 #[doc = "Bit 11 - Priority Level 3 Enable"]
140 #[inline(always)]
141 #[must_use]
142 pub fn lvlen3(&mut self) -> LVLEN3_W<11> {
143 LVLEN3_W::new(self)
144 }
145 #[doc = "Writes raw bits to the register."]
146 #[inline(always)]
147 pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
148 self.0.bits(bits);
149 self
150 }
151}
152#[doc = "Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ctrl](index.html) module"]
153pub struct CTRL_SPEC;
154impl crate::RegisterSpec for CTRL_SPEC {
155 type Ux = u16;
156}
157#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
158impl crate::Readable for CTRL_SPEC {
159 type Reader = R;
160}
161#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
162impl crate::Writable for CTRL_SPEC {
163 type Writer = W;
164 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
165 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
166}
167#[doc = "`reset()` method sets CTRL to value 0"]
168impl crate::Resettable for CTRL_SPEC {
169 const RESET_VALUE: Self::Ux = 0;
170}