atsaml21e17b/dmac/
swtrigctrl.rs

1#[doc = "Register `SWTRIGCTRL` reader"]
2pub struct R(crate::R<SWTRIGCTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SWTRIGCTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SWTRIGCTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SWTRIGCTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `SWTRIGCTRL` writer"]
17pub struct W(crate::W<SWTRIGCTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SWTRIGCTRL_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<SWTRIGCTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SWTRIGCTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `SWTRIG0` reader - Channel 0 Software Trigger"]
38pub type SWTRIG0_R = crate::BitReader<bool>;
39#[doc = "Field `SWTRIG0` writer - Channel 0 Software Trigger"]
40pub type SWTRIG0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
41#[doc = "Field `SWTRIG1` reader - Channel 1 Software Trigger"]
42pub type SWTRIG1_R = crate::BitReader<bool>;
43#[doc = "Field `SWTRIG1` writer - Channel 1 Software Trigger"]
44pub type SWTRIG1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
45#[doc = "Field `SWTRIG2` reader - Channel 2 Software Trigger"]
46pub type SWTRIG2_R = crate::BitReader<bool>;
47#[doc = "Field `SWTRIG2` writer - Channel 2 Software Trigger"]
48pub type SWTRIG2_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
49#[doc = "Field `SWTRIG3` reader - Channel 3 Software Trigger"]
50pub type SWTRIG3_R = crate::BitReader<bool>;
51#[doc = "Field `SWTRIG3` writer - Channel 3 Software Trigger"]
52pub type SWTRIG3_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
53#[doc = "Field `SWTRIG4` reader - Channel 4 Software Trigger"]
54pub type SWTRIG4_R = crate::BitReader<bool>;
55#[doc = "Field `SWTRIG4` writer - Channel 4 Software Trigger"]
56pub type SWTRIG4_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
57#[doc = "Field `SWTRIG5` reader - Channel 5 Software Trigger"]
58pub type SWTRIG5_R = crate::BitReader<bool>;
59#[doc = "Field `SWTRIG5` writer - Channel 5 Software Trigger"]
60pub type SWTRIG5_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
61#[doc = "Field `SWTRIG6` reader - Channel 6 Software Trigger"]
62pub type SWTRIG6_R = crate::BitReader<bool>;
63#[doc = "Field `SWTRIG6` writer - Channel 6 Software Trigger"]
64pub type SWTRIG6_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
65#[doc = "Field `SWTRIG7` reader - Channel 7 Software Trigger"]
66pub type SWTRIG7_R = crate::BitReader<bool>;
67#[doc = "Field `SWTRIG7` writer - Channel 7 Software Trigger"]
68pub type SWTRIG7_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
69#[doc = "Field `SWTRIG8` reader - Channel 8 Software Trigger"]
70pub type SWTRIG8_R = crate::BitReader<bool>;
71#[doc = "Field `SWTRIG8` writer - Channel 8 Software Trigger"]
72pub type SWTRIG8_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
73#[doc = "Field `SWTRIG9` reader - Channel 9 Software Trigger"]
74pub type SWTRIG9_R = crate::BitReader<bool>;
75#[doc = "Field `SWTRIG9` writer - Channel 9 Software Trigger"]
76pub type SWTRIG9_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
77#[doc = "Field `SWTRIG10` reader - Channel 10 Software Trigger"]
78pub type SWTRIG10_R = crate::BitReader<bool>;
79#[doc = "Field `SWTRIG10` writer - Channel 10 Software Trigger"]
80pub type SWTRIG10_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
81#[doc = "Field `SWTRIG11` reader - Channel 11 Software Trigger"]
82pub type SWTRIG11_R = crate::BitReader<bool>;
83#[doc = "Field `SWTRIG11` writer - Channel 11 Software Trigger"]
84pub type SWTRIG11_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
85#[doc = "Field `SWTRIG12` reader - Channel 12 Software Trigger"]
86pub type SWTRIG12_R = crate::BitReader<bool>;
87#[doc = "Field `SWTRIG12` writer - Channel 12 Software Trigger"]
88pub type SWTRIG12_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
89#[doc = "Field `SWTRIG13` reader - Channel 13 Software Trigger"]
90pub type SWTRIG13_R = crate::BitReader<bool>;
91#[doc = "Field `SWTRIG13` writer - Channel 13 Software Trigger"]
92pub type SWTRIG13_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
93#[doc = "Field `SWTRIG14` reader - Channel 14 Software Trigger"]
94pub type SWTRIG14_R = crate::BitReader<bool>;
95#[doc = "Field `SWTRIG14` writer - Channel 14 Software Trigger"]
96pub type SWTRIG14_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
97#[doc = "Field `SWTRIG15` reader - Channel 15 Software Trigger"]
98pub type SWTRIG15_R = crate::BitReader<bool>;
99#[doc = "Field `SWTRIG15` writer - Channel 15 Software Trigger"]
100pub type SWTRIG15_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWTRIGCTRL_SPEC, bool, O>;
101impl R {
102    #[doc = "Bit 0 - Channel 0 Software Trigger"]
103    #[inline(always)]
104    pub fn swtrig0(&self) -> SWTRIG0_R {
105        SWTRIG0_R::new((self.bits & 1) != 0)
106    }
107    #[doc = "Bit 1 - Channel 1 Software Trigger"]
108    #[inline(always)]
109    pub fn swtrig1(&self) -> SWTRIG1_R {
110        SWTRIG1_R::new(((self.bits >> 1) & 1) != 0)
111    }
112    #[doc = "Bit 2 - Channel 2 Software Trigger"]
113    #[inline(always)]
114    pub fn swtrig2(&self) -> SWTRIG2_R {
115        SWTRIG2_R::new(((self.bits >> 2) & 1) != 0)
116    }
117    #[doc = "Bit 3 - Channel 3 Software Trigger"]
118    #[inline(always)]
119    pub fn swtrig3(&self) -> SWTRIG3_R {
120        SWTRIG3_R::new(((self.bits >> 3) & 1) != 0)
121    }
122    #[doc = "Bit 4 - Channel 4 Software Trigger"]
123    #[inline(always)]
124    pub fn swtrig4(&self) -> SWTRIG4_R {
125        SWTRIG4_R::new(((self.bits >> 4) & 1) != 0)
126    }
127    #[doc = "Bit 5 - Channel 5 Software Trigger"]
128    #[inline(always)]
129    pub fn swtrig5(&self) -> SWTRIG5_R {
130        SWTRIG5_R::new(((self.bits >> 5) & 1) != 0)
131    }
132    #[doc = "Bit 6 - Channel 6 Software Trigger"]
133    #[inline(always)]
134    pub fn swtrig6(&self) -> SWTRIG6_R {
135        SWTRIG6_R::new(((self.bits >> 6) & 1) != 0)
136    }
137    #[doc = "Bit 7 - Channel 7 Software Trigger"]
138    #[inline(always)]
139    pub fn swtrig7(&self) -> SWTRIG7_R {
140        SWTRIG7_R::new(((self.bits >> 7) & 1) != 0)
141    }
142    #[doc = "Bit 8 - Channel 8 Software Trigger"]
143    #[inline(always)]
144    pub fn swtrig8(&self) -> SWTRIG8_R {
145        SWTRIG8_R::new(((self.bits >> 8) & 1) != 0)
146    }
147    #[doc = "Bit 9 - Channel 9 Software Trigger"]
148    #[inline(always)]
149    pub fn swtrig9(&self) -> SWTRIG9_R {
150        SWTRIG9_R::new(((self.bits >> 9) & 1) != 0)
151    }
152    #[doc = "Bit 10 - Channel 10 Software Trigger"]
153    #[inline(always)]
154    pub fn swtrig10(&self) -> SWTRIG10_R {
155        SWTRIG10_R::new(((self.bits >> 10) & 1) != 0)
156    }
157    #[doc = "Bit 11 - Channel 11 Software Trigger"]
158    #[inline(always)]
159    pub fn swtrig11(&self) -> SWTRIG11_R {
160        SWTRIG11_R::new(((self.bits >> 11) & 1) != 0)
161    }
162    #[doc = "Bit 12 - Channel 12 Software Trigger"]
163    #[inline(always)]
164    pub fn swtrig12(&self) -> SWTRIG12_R {
165        SWTRIG12_R::new(((self.bits >> 12) & 1) != 0)
166    }
167    #[doc = "Bit 13 - Channel 13 Software Trigger"]
168    #[inline(always)]
169    pub fn swtrig13(&self) -> SWTRIG13_R {
170        SWTRIG13_R::new(((self.bits >> 13) & 1) != 0)
171    }
172    #[doc = "Bit 14 - Channel 14 Software Trigger"]
173    #[inline(always)]
174    pub fn swtrig14(&self) -> SWTRIG14_R {
175        SWTRIG14_R::new(((self.bits >> 14) & 1) != 0)
176    }
177    #[doc = "Bit 15 - Channel 15 Software Trigger"]
178    #[inline(always)]
179    pub fn swtrig15(&self) -> SWTRIG15_R {
180        SWTRIG15_R::new(((self.bits >> 15) & 1) != 0)
181    }
182}
183impl W {
184    #[doc = "Bit 0 - Channel 0 Software Trigger"]
185    #[inline(always)]
186    #[must_use]
187    pub fn swtrig0(&mut self) -> SWTRIG0_W<0> {
188        SWTRIG0_W::new(self)
189    }
190    #[doc = "Bit 1 - Channel 1 Software Trigger"]
191    #[inline(always)]
192    #[must_use]
193    pub fn swtrig1(&mut self) -> SWTRIG1_W<1> {
194        SWTRIG1_W::new(self)
195    }
196    #[doc = "Bit 2 - Channel 2 Software Trigger"]
197    #[inline(always)]
198    #[must_use]
199    pub fn swtrig2(&mut self) -> SWTRIG2_W<2> {
200        SWTRIG2_W::new(self)
201    }
202    #[doc = "Bit 3 - Channel 3 Software Trigger"]
203    #[inline(always)]
204    #[must_use]
205    pub fn swtrig3(&mut self) -> SWTRIG3_W<3> {
206        SWTRIG3_W::new(self)
207    }
208    #[doc = "Bit 4 - Channel 4 Software Trigger"]
209    #[inline(always)]
210    #[must_use]
211    pub fn swtrig4(&mut self) -> SWTRIG4_W<4> {
212        SWTRIG4_W::new(self)
213    }
214    #[doc = "Bit 5 - Channel 5 Software Trigger"]
215    #[inline(always)]
216    #[must_use]
217    pub fn swtrig5(&mut self) -> SWTRIG5_W<5> {
218        SWTRIG5_W::new(self)
219    }
220    #[doc = "Bit 6 - Channel 6 Software Trigger"]
221    #[inline(always)]
222    #[must_use]
223    pub fn swtrig6(&mut self) -> SWTRIG6_W<6> {
224        SWTRIG6_W::new(self)
225    }
226    #[doc = "Bit 7 - Channel 7 Software Trigger"]
227    #[inline(always)]
228    #[must_use]
229    pub fn swtrig7(&mut self) -> SWTRIG7_W<7> {
230        SWTRIG7_W::new(self)
231    }
232    #[doc = "Bit 8 - Channel 8 Software Trigger"]
233    #[inline(always)]
234    #[must_use]
235    pub fn swtrig8(&mut self) -> SWTRIG8_W<8> {
236        SWTRIG8_W::new(self)
237    }
238    #[doc = "Bit 9 - Channel 9 Software Trigger"]
239    #[inline(always)]
240    #[must_use]
241    pub fn swtrig9(&mut self) -> SWTRIG9_W<9> {
242        SWTRIG9_W::new(self)
243    }
244    #[doc = "Bit 10 - Channel 10 Software Trigger"]
245    #[inline(always)]
246    #[must_use]
247    pub fn swtrig10(&mut self) -> SWTRIG10_W<10> {
248        SWTRIG10_W::new(self)
249    }
250    #[doc = "Bit 11 - Channel 11 Software Trigger"]
251    #[inline(always)]
252    #[must_use]
253    pub fn swtrig11(&mut self) -> SWTRIG11_W<11> {
254        SWTRIG11_W::new(self)
255    }
256    #[doc = "Bit 12 - Channel 12 Software Trigger"]
257    #[inline(always)]
258    #[must_use]
259    pub fn swtrig12(&mut self) -> SWTRIG12_W<12> {
260        SWTRIG12_W::new(self)
261    }
262    #[doc = "Bit 13 - Channel 13 Software Trigger"]
263    #[inline(always)]
264    #[must_use]
265    pub fn swtrig13(&mut self) -> SWTRIG13_W<13> {
266        SWTRIG13_W::new(self)
267    }
268    #[doc = "Bit 14 - Channel 14 Software Trigger"]
269    #[inline(always)]
270    #[must_use]
271    pub fn swtrig14(&mut self) -> SWTRIG14_W<14> {
272        SWTRIG14_W::new(self)
273    }
274    #[doc = "Bit 15 - Channel 15 Software Trigger"]
275    #[inline(always)]
276    #[must_use]
277    pub fn swtrig15(&mut self) -> SWTRIG15_W<15> {
278        SWTRIG15_W::new(self)
279    }
280    #[doc = "Writes raw bits to the register."]
281    #[inline(always)]
282    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
283        self.0.bits(bits);
284        self
285    }
286}
287#[doc = "Software Trigger 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 [swtrigctrl](index.html) module"]
288pub struct SWTRIGCTRL_SPEC;
289impl crate::RegisterSpec for SWTRIGCTRL_SPEC {
290    type Ux = u32;
291}
292#[doc = "`read()` method returns [swtrigctrl::R](R) reader structure"]
293impl crate::Readable for SWTRIGCTRL_SPEC {
294    type Reader = R;
295}
296#[doc = "`write(|w| ..)` method takes [swtrigctrl::W](W) writer structure"]
297impl crate::Writable for SWTRIGCTRL_SPEC {
298    type Writer = W;
299    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
300    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
301}
302#[doc = "`reset()` method sets SWTRIGCTRL to value 0"]
303impl crate::Resettable for SWTRIGCTRL_SPEC {
304    const RESET_VALUE: Self::Ux = 0;
305}