atsamd11c/dmac/
swtrigctrl.rs
1#[doc = "Register `SWTRIGCTRL` reader"]
2pub type R = crate::R<SwtrigctrlSpec>;
3#[doc = "Register `SWTRIGCTRL` writer"]
4pub type W = crate::W<SwtrigctrlSpec>;
5#[doc = "Field `SWTRIG0` reader - Channel 0 Software Trigger"]
6pub type Swtrig0R = crate::BitReader;
7#[doc = "Field `SWTRIG0` writer - Channel 0 Software Trigger"]
8pub type Swtrig0W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `SWTRIG1` reader - Channel 1 Software Trigger"]
10pub type Swtrig1R = crate::BitReader;
11#[doc = "Field `SWTRIG1` writer - Channel 1 Software Trigger"]
12pub type Swtrig1W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SWTRIG2` reader - Channel 2 Software Trigger"]
14pub type Swtrig2R = crate::BitReader;
15#[doc = "Field `SWTRIG2` writer - Channel 2 Software Trigger"]
16pub type Swtrig2W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `SWTRIG3` reader - Channel 3 Software Trigger"]
18pub type Swtrig3R = crate::BitReader;
19#[doc = "Field `SWTRIG3` writer - Channel 3 Software Trigger"]
20pub type Swtrig3W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `SWTRIG4` reader - Channel 4 Software Trigger"]
22pub type Swtrig4R = crate::BitReader;
23#[doc = "Field `SWTRIG4` writer - Channel 4 Software Trigger"]
24pub type Swtrig4W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `SWTRIG5` reader - Channel 5 Software Trigger"]
26pub type Swtrig5R = crate::BitReader;
27#[doc = "Field `SWTRIG5` writer - Channel 5 Software Trigger"]
28pub type Swtrig5W<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30 #[doc = "Bit 0 - Channel 0 Software Trigger"]
31 #[inline(always)]
32 pub fn swtrig0(&self) -> Swtrig0R {
33 Swtrig0R::new((self.bits & 1) != 0)
34 }
35 #[doc = "Bit 1 - Channel 1 Software Trigger"]
36 #[inline(always)]
37 pub fn swtrig1(&self) -> Swtrig1R {
38 Swtrig1R::new(((self.bits >> 1) & 1) != 0)
39 }
40 #[doc = "Bit 2 - Channel 2 Software Trigger"]
41 #[inline(always)]
42 pub fn swtrig2(&self) -> Swtrig2R {
43 Swtrig2R::new(((self.bits >> 2) & 1) != 0)
44 }
45 #[doc = "Bit 3 - Channel 3 Software Trigger"]
46 #[inline(always)]
47 pub fn swtrig3(&self) -> Swtrig3R {
48 Swtrig3R::new(((self.bits >> 3) & 1) != 0)
49 }
50 #[doc = "Bit 4 - Channel 4 Software Trigger"]
51 #[inline(always)]
52 pub fn swtrig4(&self) -> Swtrig4R {
53 Swtrig4R::new(((self.bits >> 4) & 1) != 0)
54 }
55 #[doc = "Bit 5 - Channel 5 Software Trigger"]
56 #[inline(always)]
57 pub fn swtrig5(&self) -> Swtrig5R {
58 Swtrig5R::new(((self.bits >> 5) & 1) != 0)
59 }
60}
61impl W {
62 #[doc = "Bit 0 - Channel 0 Software Trigger"]
63 #[inline(always)]
64 #[must_use]
65 pub fn swtrig0(&mut self) -> Swtrig0W<SwtrigctrlSpec> {
66 Swtrig0W::new(self, 0)
67 }
68 #[doc = "Bit 1 - Channel 1 Software Trigger"]
69 #[inline(always)]
70 #[must_use]
71 pub fn swtrig1(&mut self) -> Swtrig1W<SwtrigctrlSpec> {
72 Swtrig1W::new(self, 1)
73 }
74 #[doc = "Bit 2 - Channel 2 Software Trigger"]
75 #[inline(always)]
76 #[must_use]
77 pub fn swtrig2(&mut self) -> Swtrig2W<SwtrigctrlSpec> {
78 Swtrig2W::new(self, 2)
79 }
80 #[doc = "Bit 3 - Channel 3 Software Trigger"]
81 #[inline(always)]
82 #[must_use]
83 pub fn swtrig3(&mut self) -> Swtrig3W<SwtrigctrlSpec> {
84 Swtrig3W::new(self, 3)
85 }
86 #[doc = "Bit 4 - Channel 4 Software Trigger"]
87 #[inline(always)]
88 #[must_use]
89 pub fn swtrig4(&mut self) -> Swtrig4W<SwtrigctrlSpec> {
90 Swtrig4W::new(self, 4)
91 }
92 #[doc = "Bit 5 - Channel 5 Software Trigger"]
93 #[inline(always)]
94 #[must_use]
95 pub fn swtrig5(&mut self) -> Swtrig5W<SwtrigctrlSpec> {
96 Swtrig5W::new(self, 5)
97 }
98}
99#[doc = "Software Trigger Control\n\nYou can [`read`](crate::Reg::read) this register and get [`swtrigctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`swtrigctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
100pub struct SwtrigctrlSpec;
101impl crate::RegisterSpec for SwtrigctrlSpec {
102 type Ux = u32;
103}
104#[doc = "`read()` method returns [`swtrigctrl::R`](R) reader structure"]
105impl crate::Readable for SwtrigctrlSpec {}
106#[doc = "`write(|w| ..)` method takes [`swtrigctrl::W`](W) writer structure"]
107impl crate::Writable for SwtrigctrlSpec {
108 type Safety = crate::Unsafe;
109 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
110 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
111}
112#[doc = "`reset()` method sets SWTRIGCTRL to value 0"]
113impl crate::Resettable for SwtrigctrlSpec {
114 const RESET_VALUE: u32 = 0;
115}